feat(commit): 認可前先掃註解是否夾帶文件相關資訊
What:在 commit 技能的清點步驟之後、實際認可之前,新增一個掃描步驟,呼叫 jsc-hooks 的 comment-scope.sh sweep 掃過整個工作區,並在 README 的技能目錄補上同一句說明。原步驟編號往後順延。 Why:註解禁止夾帶文件相關資訊這條規則,目前只有 claude 接得到寫檔後的即時掃描;codex、copilot、antigravity、kiro 都得等到每輪結束或工作階段結束才有機會發現。commit 是五支 CLI 共用的提交路徑,在這裡掃一次,違規註解就進不了 commit。 How:新步驟只指向 jsc-review 的 references/comment-scope.md,不抄規則清單。腳本找不到 git 工作區或 jsc-hooks 不在本機時會安靜結束,此時跳過這一步並在回報中說明,不中止認可;exit 2 代表命中,就地修好再重跑到 exit 0 才認可。警告是給人與模型判讀,不是硬性阻擋,確認誤判就照實說明後繼續。步驟附可檢核的完成條件。 Who:jsc-git 的 commit 技能,以及所有經由它提交的 CLI。
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: commit
|
||||
description: Group all pending file changes by conventional type and feature, then commit each group as {type}({scope}): {message}. Message style is full (What/Why/How/Who), brief (one line from git diff), or custom, chosen via decision tree. Use whenever changes must be committed; not for push or PR creation.
|
||||
description: Group all pending file changes by conventional type and feature, then commit each group as {type}({scope}): {message}. Before committing, sweep the working tree with jsc-hooks/hooks/comment-scope.sh so no comment carrying document tracking information enters a commit. Message style is full (What/Why/How/Who), brief (one line from git diff), or custom, chosen via decision tree. Use whenever changes must be committed; not for push or PR creation.
|
||||
---
|
||||
|
||||
# commit — group and commit file changes
|
||||
@@ -8,8 +8,13 @@ description: Group all pending file changes by conventional type and feature, th
|
||||
## Steps
|
||||
|
||||
1. Track every file change: inspect all changes with `git status --porcelain` first, then `git add` group by group. `git add -A` followed by one bulk commit is forbidden. Done when every path listed by `git status --porcelain` is assigned to exactly one group, before the first commit runs.
|
||||
2. Group the changes by same type plus same requirement or feature. One group is one commit. Done when each group carries one type and one requirement or feature, and no path sits in two groups.
|
||||
3. Commit each group with the format `{type}({requirement or feature}): {message}`. Done when `git status --porcelain` returns empty; report done only then.
|
||||
2. Sweep the comments about to be committed: run `jsc-hooks/hooks/comment-scope.sh sweep` over this working tree. A code comment states why the code is written this way, never where the work is documented; the rule text and its allow list live in one place only, `jsc-review/references/comment-scope.md`.
|
||||
- The script exits 0 in silence when it finds no git working tree and when `jsc-hooks` is not on this machine. **If the script is not found, skip this step, say so in the report and commit anyway** — missing infrastructure is not a violation.
|
||||
- Exit 2 means a hit. Fix every comment line the warning points at, in place, then run the sweep again until it exits 0, and commit only after that.
|
||||
- The warning is written for a person and a model to judge, **not a hard block**. When it is a false positive, say plainly why and carry on with the commit; never delete a useful comment just to keep the script quiet.
|
||||
- Done when one of these is true and reported: the sweep exited 0, or every remaining warning is reported with the reason it is a false positive, or the script was not found on this machine.
|
||||
3. Group the changes by same type plus same requirement or feature. One group is one commit. Done when each group carries one type and one requirement or feature, and no path sits in two groups.
|
||||
4. Commit each group with the format `{type}({requirement or feature}): {message}`. Done when `git status --porcelain` returns empty; report done only then.
|
||||
|
||||
## Type table
|
||||
|
||||
|
||||
Reference in New Issue
Block a user