feat: 新增 code-review skill #1

Merged
jiantw83 merged 3 commits from develop into master 2026-06-15 08:39:26 +00:00
Showing only changes of commit b9f87bac37 - Show all commits
+25 -23
View File
@@ -1,9 +1,9 @@
# jsc — 跨 AI 助理 Plugin 模板
# code-review — 跨 AI 助理 Plugin
一個可同時被 **Claude Code、Codex、Antigravity、OpenCode** 安裝的 plugin 模板
一個可同時被 **Claude Code、Codex、Antigravity、OpenCode** 安裝的 plugin,提供 **RPG 攻防對決式的 `git diff` 程式碼審查** skill
核心是以 [Agent Skills`SKILL.md`](https://agentskills.io) 標準撰寫的共用 skills(唯一真實來源放在 `skills/`),
搭配各助理各自的 plugin manifest,讓**同一個 repo** 可用各家**原生 plugin CLI** 安裝。
在 Claude Code 與 Antigravity 中skill 以 **`/jsc:` 前綴**呼叫(例如 `/jsc:hello`)。
plugin 名為 `jsc`在 Claude Code 與 Antigravity 中 skill 以 **`/jsc:` 前綴**呼叫(例如 `/jsc:code-review`)。
---
@@ -25,7 +25,7 @@
同一個 repo 同時帶四種 manifest,彼此以路徑隔離、互不干擾;四家都讀同一份 `skills/`
```
template/
code-review/
├── .claude-plugin/
│ ├── plugin.json # Claude 外掛定義(name: "jsc"
│ └── marketplace.json # Claude marketplacename: "jsc-plugins"source 指向本 repo
@@ -35,7 +35,9 @@ template/
│ └── marketplace.json # Codex marketplacename: "jsc-plugins"url source 指向本 repo
├── plugin.json # Antigravity 外掛定義(name: "jsc"skills: "./skills/"
├── skills/ # ★ 唯一真實來源:所有 skills
│ └── hello/SKILL.md
│ └── code-review/
│ ├── SKILL.md # 主 skill:取 diff → 選角 → 攻擊 → 裁決 → 總結
│ └── roles/ # 一角色一檔(bard/mage/rogue/assassin/paladin
├── AGENTS.md # 跨助理共用指引
└── README.md
```
@@ -44,7 +46,7 @@ template/
## 安裝 / 更新 / 移除(各家原生 plugin CLI
> 指令中的 repo 網址換成你的:`https://gitea.jsc.idv.tw/plugins/template.git`
> 指令中的 repo 網址換成你的:`https://gitea.jsc.idv.tw/plugins/code-review.git`
>
> **Claude / Codex 從 git URL 安裝(會 clone 遠端),請先把本 repo `push` 到 gitea。**
> **Antigravity 的 `agy plugin install <url>` 目前只支援 github.com**gitea 請改用「clone + 本地路徑」(見 Antigravity 節)。
@@ -54,7 +56,7 @@ template/
```bash
# 安裝
claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/template.git
claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/code-review.git
claude plugin install jsc@jsc-plugins
# 更新
@@ -67,14 +69,14 @@ claude plugin marketplace remove jsc-plugins
```
- 工作階段內 slash 版(等價):把 `claude plugin` 換成 `/plugin`
- 本機開發(免 push):`claude plugin marketplace add C:\Users\h3285\source\repos.plugins\template`(本地路徑)後再 install。
- **呼叫**`/jsc:<name>`(例 `/jsc:hello`)。
- 本機開發(免 push):`claude plugin marketplace add C:\Users\h3285\source\repos.plugins\code-review`(本地路徑)後再 install。
- **呼叫**`/jsc:<name>`(例 `/jsc:code-review`)。
### Codex
```bash
# 安裝
codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/template.git
codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/code-review.git
codex plugin add jsc@jsc-plugins
# 更新(重新抓取 marketplace 的 git 快照)
@@ -87,7 +89,7 @@ codex plugin marketplace remove jsc-plugins
- 安裝 token `jsc@jsc-plugins` = plugin 名(`.codex-plugin/plugin.json``name`@ marketplace 名(`.agents/plugins/marketplace.json``name`)。
- 本 repo 的 Codex marketplace 以 `url` 來源指向自己,故 Codex **一律從 gitea 安裝**(需先 push);安裝後重啟 Codex。
- **呼叫**`$<name>`(例 `$hello`),或用 `/skills` 選單。
- **呼叫**`$<name>`(例 `$code-review`),或用 `/skills` 選單。
### Antigravity`agy`
@@ -95,7 +97,7 @@ codex plugin marketplace remove jsc-plugins
```bash
# 安裝:clone 後用本地路徑
git clone https://gitea.jsc.idv.tw/plugins/template.git ~/jsc-plugin
git clone https://gitea.jsc.idv.tw/plugins/code-review.git ~/jsc-plugin
agy plugin install ~/jsc-plugin
# 更新(agy 無 update 子指令 → git pull 後重裝)
@@ -109,7 +111,7 @@ agy plugin uninstall jsc
- 若把 skills 放到 GitHub,則可直接 `agy plugin install https://github.com/<owner>/<repo>`
- 其他:`agy plugin list``agy plugin enable jsc` / `disable jsc``agy plugin validate <path>`。安裝後重啟工作階段。
- **呼叫**`/jsc:<name>`(例 `/jsc:hello`)或依描述自動觸發。
- **呼叫**`/jsc:<name>`(例 `/jsc:code-review`)或依描述自動觸發。
### OpenCode
@@ -118,7 +120,7 @@ OpenCode 會讀 `~/.config/opencode/skills/`(也會讀 `~/.claude/skills/`、`
```bash
# 安裝
git clone https://gitea.jsc.idv.tw/plugins/template.git ~/jsc-plugin
git clone https://gitea.jsc.idv.tw/plugins/code-review.git ~/jsc-plugin
mkdir -p ~/.config/opencode/skills
cp -r ~/jsc-plugin/skills/* ~/.config/opencode/skills/
@@ -127,7 +129,7 @@ git -C ~/jsc-plugin pull
cp -r ~/jsc-plugin/skills/* ~/.config/opencode/skills/
# 移除
rm -rf ~/.config/opencode/skills/hello
rm -rf ~/.config/opencode/skills/code-review
```
> **Windows PowerShell**`cp -r A B` → `Copy-Item A B -Recurse -Force`、`rm -rf X` → `Remove-Item X -Recurse -Force`、`~` → `$HOME`。
@@ -140,17 +142,17 @@ rm -rf ~/.config/opencode/skills/hello
安裝好之後,不必進互動介面,一行指令就能叫某個 skill 跑完並印出結果:
| 助理 | headless 指令 | 執行 `hello` skill |
| 助理 | headless 指令 | 執行 `code-review` skill |
| --- | --- | --- |
| Claude Code | `claude -p "<prompt>"` | `claude -p "/jsc:hello"` |
| Codex | `codex exec "<prompt>"` | `codex exec '$hello'` |
| Antigravity | `agy -p "<prompt>"` | `agy -p "/jsc:hello"` |
| OpenCode | `opencode run "<message>"` | `opencode run "用 hello skill 打個招呼"` |
| Claude Code | `claude -p "<prompt>"` | `claude -p "/jsc:code-review main feature/login all"` |
| Codex | `codex exec "<prompt>"` | `codex exec '$code-review main feature/login all'` |
| Antigravity | `agy -p "<prompt>"` | `agy -p "/jsc:code-review main feature/login all"` |
| OpenCode | `opencode run "<message>"` | `opencode run "用攻防角色 review main 與 feature/login 的差異"` |
- Claude / Antigravity 支援 `/jsc:` 前綴,直接 `-p "/jsc:<name>"` 即可。
- Codex 以 `$<name>` 觸發;在 shell 請用**單引號**避免 `$` 被展開:`codex exec '$hello'`
- Codex 以 `$<name>` 觸發;在 shell 請用**單引號**避免 `$` 被展開:`codex exec '$code-review …'`
- OpenCode 沒有前綴,用自然語言描述需求,模型會自動透過 skill 工具呼叫。
- 帶引數就接在後面,例如 `claude -p "/jsc:hello 參數"``codex exec '$hello 參數'`
- 帶引數就接在後面,例如 `claude -p "/jsc:code-review main feature/login mage"``codex exec '$code-review main feature/login mage'`
---
@@ -177,7 +179,7 @@ rm -rf ~/.config/opencode/skills/hello
## 新增一個 skill
1. 複製範本:`cp -r skills/hello skills/<your-skill-name>`
1. 複製既有 skill 作範本:`cp -r skills/code-review skills/<your-skill-name>`
2. 編輯 `skills/<your-skill-name>/SKILL.md` 的 frontmatter
- `name`:小寫、數字、連字號(`-`),最長 64 字元。**這就是 Claude Code / Antigravity 的 `/jsc:<name>`**。
- `description`:第三人稱,寫清楚「何時用、何時不用」與觸發關鍵字 — 這是各助理自動載入的唯一依據。