跳转至

安装

PEtFiSh安装到你的AI编码助手的技能目录中,整个过程不到两分钟。

前置条件

  • 一个AI编码助手 — OpenCode、Claude Code、Cursor、Codex、Copilot、Windsurf或Antigravity
  • uv — Python包管理器(安装uv)— 安装器通过PEP 723自动引导

快速安装

安装两个核心包 — init(项目初始化器)和companion(Companion Gateway + 内置技能):

uv run https://raw.githubusercontent.com/kylecui/petfish.ai/master/install.py --pack init,companion --detect

--detect会自动检测你的AI平台。也可以用--platform opencode(或claudecursorcodexcopilotwindsurfantigravity)明确指定。

自动版本管理

安装器会自动下载最新稳定版本,无需手动指定版本号。

选择Profile

安装initcompanion后,在AI助手中运行/initproject选择一个profile。每个profile会自动安装对应的技能包:

Profile 自动安装的包
minimal petfish
code deploy, petfish, testdocs
course course, petfish
ops deploy, petfish
security deploy, petfish, testdocs, trust
research petfish, research
writing petfish, ppt
comprehensive course, deploy, petfish, ppt, testdocs, trust, context, research, reflect

也可以手动安装单个包:

uv run https://raw.githubusercontent.com/kylecui/petfish.ai/master/install.py --pack deploy --detect

可用技能包

用途 技能数
init 项目初始化器和/initproject向导 1
companion Companion Gateway、/petfish、内置生命周期技能 2
course 课程大纲、内容、实验、QA/QC工作流 15
deploy 部署、CI/CD、健康检查、回滚、运维 7
testdocs 测试用例和使用文档生成 2
petfish 工程写作风格 1
ppt 演示文稿设计 2
calibrate 评审反迎合校准 1
context 话题治理和上下文隔离 1
trust 技能信任治理引擎 1
research 研究工作台 — 覆盖8个领域的50个技能 50
reflect 结构化反思与纠正行动 1

平台支持

PEtFiSh支持8个AI编码平台:

平台 技能目录 指令文件
OpenCode .opencode/skills/ AGENTS.md
Claude Code .claude/skills/ CLAUDE.md
Codex .agents/skills/ AGENTS.md
Cursor .cursor/skills/ .cursor/rules/*.mdc
GitHub Copilot .github/skills/ .github/copilot-instructions.md
Windsurf .windsurf/skills/ .windsurfrules
Antigravity .agents/skills/ AGENTS.md + GEMINI.md
Universal .agents/skills/ AGENTS.md

重启生效

安装后需要重启AI助手

大多数AI编码平台在会话启动时加载技能。安装完成后,退出并重新启动AI助手才能生效。

平台 重启方式
OpenCode Ctrl+C,然后opencode(或opencode -s <session_id>恢复会话)
Claude Code /exitCtrl+C,然后claude --continue
Cursor / Copilot / Windsurf Ctrl+Shift+P → "Reload Window"
Codex Ctrl+C并重新启动(技能可能动态重载)

验证安装

重启后,在AI助手中运行/petfish。你应该能看到已安装的包和技能数量。

升级

使用--force参数重新运行安装命令即可升级:

uv run https://raw.githubusercontent.com/kylecui/petfish.ai/master/install.py --pack all --force

或运行/petfish upgrade查看升级命令。

常见问题

找不到uv

安装uv:https://docs.astral.sh/uv/getting-started/installation/

平台自动检测识别错误

使用--platform <name>明确指定:

uv run https://raw.githubusercontent.com/kylecui/petfish.ai/master/install.py --pack init,companion --platform opencode

网络问题(中国大陆/受限防火墙)

安装器内置镜像回退(ghfast.topghproxy.com),带重试。如果所有镜像都失败,可以克隆仓库后离线安装:

git clone https://github.com/kylecui/petfish.ai.git
uv run ./petfish.ai/install.py --pack <alias> --platform <PLATFORM> --target . --offline

私有仓库

对于私有或企业GitHub仓库:

GITHUB_TOKEN=xxx uv run https://raw.githubusercontent.com/kylecui/petfish.ai/master/install.py --pack init,companion