feat(implement): implement 步驟加上註解界線規則
What:步驟 9 新增 9.3「註解只寫原因」,原 9.3 順延為 9.4;步驟 10 交給 code-review 前先掃整包 diff。 Why:實作階段手上一直握著工作包編號、分析頁編號、待辦編號、分支名與 PR 編號,這些追蹤資訊很容易被寫進程式碼註解,讓註解變成文件索引。 How:規則正文放在 jsc-review 的 references/comment-scope.md,本技能只寫指引與完成條件,不重複清單;並指向 jsc-hooks 的 comment-scope.sh 當寫檔後的即時警告。 Who:jsc-sdlc 的 implement 技能。
This commit is contained in:
@@ -39,8 +39,9 @@ All wiki reads and writes go through `jsc-gitea:wiki`.
|
|||||||
9. **Complete the work package's open items one at a time. Every item MUST run as a sub agent**, working inside the worktree:
|
9. **Complete the work package's open items one at a time. Every item MUST run as a sub agent**, working inside the worktree:
|
||||||
1. One sub agent takes one item and follows the TDD loop: red before green, one vertical slice. Rules and anti-patterns: `references/tdd.md` (refactoring belongs to the review stage).
|
1. One sub agent takes one item and follows the TDD loop: red before green, one vertical slice. Rules and anti-patterns: `references/tdd.md` (refactoring belongs to the review stage).
|
||||||
2. The main agent keeps only the wiki bookkeeping: when the sub agent reports the item done, flip its `[ ]` to `[x]` on the analysis page and save to the wiki.
|
2. The main agent keeps only the wiki bookkeeping: when the sub agent reports the item done, flip its `[ ]` to `[x]` on the analysis page and save to the wiki.
|
||||||
3. Completion condition: every item of the package shows `[x]` on the saved analysis page, and each save happened before the next item's sub agent started.
|
3. **A code comment states why the code is written this way; it never states where the work is documented.** The tracking numbers this stage always holds — the work package number, the analysis page number, the TDD todo number, the source branch name and the PR number — stay out of every code comment; write the reason itself into the comment instead. Full list and the allowed exceptions: `jsc-review/references/comment-scope.md`. `jsc-hooks/hooks/comment-scope.sh` compares each file after it is written and prints a warning; fix the flagged line at once, then carry on with the same item. Completion condition: the item's own diff holds no comment line carrying any of those numbers, and every warning the hook printed for this item is fixed.
|
||||||
10. When all items are done, call `jsc-review:code-review` and wait for the verdict. Each round of fixes **MUST run as a sub agent** inside the same worktree. Completion condition: the review passes.
|
4. Completion condition: every item of the package shows `[x]` on the saved analysis page, and each save happened before the next item's sub agent started.
|
||||||
|
10. When all items are done, sweep the work package's whole diff for the comment rule of step 9.3, then call `jsc-review:code-review` and wait for the verdict. Each round of fixes **MUST run as a sub agent** inside the same worktree. Completion condition: the review passes, and the diff handed to it holds no comment line carrying the work package number, the analysis page number, a TDD todo number, the source branch name or a PR number (full list: `jsc-review/references/comment-scope.md`).
|
||||||
11. **One work package finished → commit, push, PR back to the source branch. Then stop and wait for that PR**:
|
11. **One work package finished → commit, push, PR back to the source branch. Then stop and wait for that PR**:
|
||||||
1. Call `jsc-git:pr` from inside the worktree, **passing `{source-branch}` as the base branch**. One package, one PR; the branch rules behind that are in `references/branch.md`.
|
1. Call `jsc-git:pr` from inside the worktree, **passing `{source-branch}` as the base branch**. One package, one PR; the branch rules behind that are in `references/branch.md`.
|
||||||
2. Write the PR URL and number into that work package's PR column on the analysis page and save it back to the wiki, so the next run of this skill can find it (step 4).
|
2. Write the PR URL and number into that work package's PR column on the analysis page and save it back to the wiki, so the next run of this skill can find it (step 4).
|
||||||
|
|||||||
Reference in New Issue
Block a user