68893236+KINDNICK@users.noreply.github.com 1179d6832e ADD : 클로드 스킬 추가
2026-01-30 21:59:38 +09:00

246 lines
4.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 安装指南
Claude Code SEO Assistant 支持三种安装方式,选择最适合你工作流程的一种。
## 📋 前提条件
在开始安装之前,请确保:
-**Claude Code CLI 已安装** - [安装 Claude Code](https://claude.ai/claude-code)
-**Next.js 项目**(推荐)- 任何 Web 项目也可以使用
-**Git 已安装** - 用于克隆仓库
---
## 🎯 三种安装方式
### 方式 1: Plugin 模式(推荐)
将插件安装到 Claude Code 的全局插件目录,所有项目都可以使用。
#### HTTPS 方式克隆
```bash
# 克隆仓库到你的插件目录
git clone https://github.com/huifer/claude-code-seo.git \
~/.claude/plugins/claude-seo-assistant
```
#### SSH 方式克隆
```bash
# 使用 SSH需要配置 GitHub SSH 密钥)
git clone git@github.com:huifer/claude-code-seo.git \
~/.claude/plugins/claude-seo-assistant
```
#### 手动安装
```bash
# 1. 下载或克隆仓库到本地
git clone https://github.com/huifer/claude-code-seo.git
# 2. 复制到插件目录
cp -r claude-code-seo ~/.claude/plugins/
```
**插件目录位置:**
- **Linux/macOS**: `~/.claude/plugins/`
- **Windows**: `%USERPROFILE%\.claude\plugins\`
---
### 方式 2: 项目级配置
将插件复制到特定项目目录,仅在该项目中可用。
```bash
# 复制到你的项目根目录
cp -r claude-code-seo /path/to/your/project/.claude-seo/
# 或在项目内创建符号链接
ln -s /path/to/claude-code-seo /path/to/your/project/.claude-seo
```
**使用场景:**
- 团队协作项目,需要确保所有成员使用相同配置
- 项目特定的 SEO 需求和自定义
- 不希望插件全局可用
---
### 方式 3: 个人级配置
将插件安装到个人配置目录。
```bash
# 复制到用户配置目录
cp -r claude-code-seo ~/claude-code-seo/
```
**配置环境变量(如需要):**
```bash
# 添加到 ~/.bashrc 或 ~/.zshrc
export CLAUDE_CODE_PLUGINS_PATH=~/claude-code-seo
```
---
## ✅ 验证安装
安装完成后,验证插件是否正确加载:
### 1. 检查插件目录
```bash
# macOS/Linux
ls -la ~/.claude/plugins/claude-seo-assistant
# Windows
dir %USERPROFILE%\.claude\plugins\claude-seo-assistant
```
应该看到以下结构:
```
claude-seo-assistant/
├── .claude-plugin/
│ └── plugin.json
├── skills/
├── commands/
├── agents/
├── templates/
└── resources/
```
### 2. 在 Claude Code 中测试
启动 Claude Code 并尝试使用 SEO 命令:
```bash
# 测试基本命令
/seo-check
# 查看可用命令
/help seo
```
如果命令被识别并执行,说明安装成功!
---
## 🔧 配置选项
### 检查插件配置
查看 [`.claude-plugin/plugin.json`](../.claude-plugin/plugin.json) 了解插件配置:
```json
{
"name": "claude-code-seo",
"version": "1.0.0",
"description": "SEO Assistant for Claude Code",
"permissions": ["read", "write"]
}
```
### 自定义设置
可以在项目的 `.claude/settings.local.json` 中添加项目特定的配置:
```json
{
"seo": {
"defaultLanguage": "zh-CN",
"targetSearchEngines": ["google", "baidu"],
"enableAutoAudit": true
}
}
```
---
## 🔄 更新插件
### 使用 Git 更新
```bash
cd ~/.claude/plugins/claude-seo-assistant
git pull origin main
```
### 手动更新
```bash
# 删除旧版本
rm -rf ~/.claude/plugins/claude-seo-assistant
# 重新克隆
git clone https://github.com/huifer/claude-code-seo.git \
~/.claude/plugins/claude-seo-assistant
```
---
## 🗑️ 卸载插件
### Plugin 模式卸载
```bash
# 删除插件目录
rm -rf ~/.claude/plugins/claude-seo-assistant
```
### 项目级卸载
```bash
# 删除项目中的插件目录
rm -rf /path/to/your/project/.claude-seo
```
---
## ❓ 常见问题
### Q: 插件没有被识别?
**A:** 检查以下几点:
1. 确认目录结构正确,特别是 `.claude-plugin/plugin.json` 文件存在
2. 重启 Claude Code
3. 检查文件权限,确保 Claude Code 有读取权限
### Q: 命令无法执行?
**A:** 可能的原因:
1. 插件未正确加载 - 重新检查安装步骤
2. 命令语法错误 - 查看 [命令参考](commands.md)
3. 项目不是 Next.js 项目 - 某些功能需要 Next.js
### Q: 多个插件冲突?
**A:** 如果安装了多个 SEO 相关插件:
1. 检查命令名称是否冲突
2. 使用完整命令路径(如 `/seo-audit` 而不是 `/audit`
3. 禁用其他 SEO 插件进行测试
### Q: Windows 路径问题?
**A:** 在 Windows 上:
1. 使用 `\\``/` 作为路径分隔符
2. 避免路径中有空格,或使用引号
3. 使用 PowerShell 时可能需要转义特殊字符
---
## 📞 获取帮助
如果安装过程中遇到问题:
- 查看 [故障排除指南](../README.md#常见问题)
- 访问 [GitHub Issues](https://github.com/huifer/claude-code-seo/issues)
- 查看 [快速开始指南](getting-started.md)
---
**下一步:** [快速开始](getting-started.md) → 学习如何使用第一个 SEO 命令