feat(review): 匯入 jsc-review 技能組並統一 marketplace 為 jsc #2

Merged
admin merged 10 commits from develop into master 2026-08-21 06:41:16 +00:00
Showing only changes of commit ccf83badbb - Show all commits
+24 -24
View File
@@ -3,39 +3,39 @@ name: code-review
description: Review changed code against the Refactoring smell catalog in six groups (bloaters, obscurity, couplers, dispensables, comment contract, shallow modules). Run when a file change is complete or an implementation is complete, e.g. from jsc-sdlc implement. Each group runs as a sub agent over the git diff; findings are reported with file:line, severity, and refactoring, and the caller decides whether to fix. Not a replacement for the CLI's built-in security or bug review.
---
# code-review — 壞味道分組審查
# code-review
依 `references/smells.md`(來自《Refactoring》)審查變更的程式碼。
Review changed code against `references/smells.md` (from the book *Refactoring*). The reference is written in Traditional Chinese; read it as-is.
## 審查時機
## When to run
1. **檔案變更完成時**:單檔或一組相關檔案改完。
2. **實作完成時**:一個工作包的所有待辦完成(`jsc-sdlc:implement` 步驟 6 呼叫)。
1. **When a file change is complete**: one file or one related group of files is done.
2. **When an implementation is complete**: all todos of a work package are done (called by `jsc-sdlc:implement` step 6).
## 分工
## Division of labor
- 本技能專注《Refactoring》壞味道與註解契約(第 5 組)與淺模組(第 6 組)。
- 安全性、邏輯 bug、測試涵蓋率交給 CLI 內建的 review 能力(例:claude 的 `/security-review`),不重複實作。
- This skill covers the *Refactoring* smells, the comment contract (group 5), and shallow modules (group 6).
- Security, logic bugs, and test coverage belong to the CLI's built-in review (e.g. claude's `/security-review`); do not duplicate them.
## 流程
## Steps
1. 取得審查範圍:`git diff`(未 commit 變更)或 `git diff {base}...HEAD`(實作完成時對基準分支);列出變更檔案清單。
2. 六組檢查分組進行,**每組必須以 sub agent 執行**,六組可平行:
1. Get the review scope: `git diff` (uncommitted changes) or `git diff {base}...HEAD` (against the base branch when an implementation is complete); list the changed files.
2. Review in six groups, and every group **MUST run as a sub agent**; the six groups may run in parallel:
| 組 | 範圍 |
| Group | Scope |
| --- | --- |
| 1 結構與體積(Bloaters) | smells.md 第 1 組 |
| 2 可讀性與命名(Obscurity) | smells.md 第 2 組 |
| 3 耦合與設計(Couplers) | smells.md 第 3 組 |
| 4 邏輯與壞習慣(Dispensables & Others) | smells.md 第 4 組 |
| 5 註解問題(介面契約) | smells.md 第 5 組 |
| 6 淺模組(Shallow Module) | smells.md 第 6 組 |
| 1 Bloaters | smells.md group 1 |
| 2 Obscurity | smells.md group 2 |
| 3 Couplers | smells.md group 3 |
| 4 Dispensables & Others | smells.md group 4 |
| 5 Comment contract | smells.md group 5 |
| 6 Shallow Module | smells.md group 6 |
每個 sub agent 的指示:只讀不改;依該組的「定義 / 偵測訊號」逐檔檢查變更行與其所在函式/類別;每筆發現回報 `檔案:行號`、壞味道名稱、嚴重度(高/中/低,依 smells.md 分級)、一句話證據、建議重構手法。
3. 彙整六組發現:去除重複(同位置多組命中時合併並列出所有壞味道)、依嚴重度排序。
4. 回報審查結果清單。**本技能不修改程式碼**;是否修正由呼叫端決定(實作流程中通常高、中必修,低擇要修)。
Instructions for each sub agent: read only, change nothing; check every changed line and its enclosing function or class against the group's definitions and detection signals in smells.md; report each finding as `file:line`, smell name, severity (高、中、低 per the smells.md scale), one sentence of evidence, and the suggested refactoring. Findings are reported in Traditional Chinese.
3. Merge the six groups' findings: deduplicate (when one location hits several groups, merge and list every smell), then sort by severity.
4. Report the finding list. **This skill never modifies code**; the caller decides what to fix (inside the implementation flow, 高 and 中 are normally mandatory, 低 is judgment).
## 注意
## Notes
- 第 5 組範例資料若查詢資料庫取得,必須去識別化,不可含個資。
- 無任何發現時明確回報「無發現」,不可留白。
- If group 5 examples are fetched from a database, they must be de-identified; never include personal data.
- When there are no findings, report the literal 「無發現」 explicitly; never leave the report empty.