Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
5.1 KiB
5.1 KiB
name, description
| name | description |
|---|---|
| implement | SDLC implementation stage. Gate on capability tags enforced in code by sdlc-gate (implement requires coding, verified against the transcript's actual model id), confirm the target branch with the user before writing any file, then claim a ready work package from ANALYZE_CONTENTS with a work ticket and complete its TDD todos one by one, updating the wiki after every item. Ends with jsc-review code-review and an optional MAINTAIN_CONTENTS entry. Use when analysis is done and code must be written; not for planning or analysis. |
implement
Goal: complete the analysis page's todos one by one; update the wiki status immediately after every completed item.
All wiki reads and writes go through jsc-gitea:wiki.
Steps
- Model gate and stage lock (capability tags, enforced in code — never self-assessed):
- Run
jsc-cli/tools/model-tags.sh syncto refresh$JSC_HOME/model-tags.tsvfromjsc-cli/references/model-tags.md. - Run
jsc-hooks/hooks/sdlc-gate.sh lock implement. The script reads the actual model id from the transcript, compares it against this stage's required tags (coding), and locks the stage only when they match. - Never claim a capability tag you have not verified with that script, and never substitute your own judgement for its verdict. Non-zero exit = blocked: relay the script's message verbatim, stop the skill, do nothing else this turn. Do not run
unlockto get past the gate; only the user may decide that. - Exit 0 means the stage is locked. From now until the next stage's gate runs, the sdlc-gate hook blocks every prompt whose model stops satisfying the tags.
- Run
- Confirm the target branch — do this before writing any file:
- Report the current branch, whether the working tree is clean, and which of
origin/develop/origin/masterexist, plus the remote default branch resolved per/jsc-shared:spec-git-safety. - Ask per
jsc-ask:askrules which branch this work merges into; state the impact scope on every option (the answer decides the PR target and, when it collides with the current branch, forces a new working branch). - Uncommitted changes in the working tree → warn first and let the user commit or back them up; never discard them.
- Apply
/jsc-shared:spec-git-safetyto the confirmed target: source branch and target branch sharing a name means creating a new working branch instead of committing on the target; report the resulting branch name. - Record the confirmed target branch on the analysis page next to the work ticket, and reuse it as the PR target in
jsc-git:pr. Completion condition: the user has confirmed the target branch explicitly; never fall back todevelopsilently.
- Report the current branch, whether the working tree is clean, and which of
- Generate a work ticket: format
TICKET_{yyyyMMdd}_{HHmmss}_{HASH}.{HASH}= the shared wiki hash for{owner}/{repo}, computed byjsc-gitea/tools/hash-id(seejsc-gitea:wiki). Try to rename the current session to the ticket name (skip when the CLI does not support it). - Read
ANALYZE_CONTENTSviajsc-gitea:wikiand list what is unfinished: plan name, HASH, work package number, count of open items. A selectable work package must satisfy all three: unfinished, dependency-free (or all dependencies done), and not holding a work ticket. - Let the user pick a work package per
jsc-ask:askrules (options state open-item count and estimated effort). List handover packages (交接是) first — the analysis page ranks spec delivery ahead of implementation, so keep that order in the options. Write the ticket into that work package's ticket column (the zh-TW field 「工作證」) on the analysis page and save it back to the wiki. Only after the ticket is saved successfully may you proceed. - List every open item of the work package and implement them one at a time:
- Follow the TDD loop: red before green, one slice at a time; rules and anti-patterns in
references/tdd.md(refactoring belongs to the review stage). - After each item, flip its
[ ]to[x]on the analysis page and save to the wiki before starting the next item.
- Follow the TDD loop: red before green, one slice at a time; rules and anti-patterns in
- When all items are done, call
jsc-review:code-reviewand wait for the review; on failure, fix and re-review until it passes. - Ask per
jsc-ask:askrules whether to register this project for maintenance: append toMAINTAIN_CONTENTSwithtemplates/maintain-contents.md. Required: repository{owner}/{repo}, maintenance method, start date. Optional: end date (NULL = maintain forever), last-maintained time.
Rules
- The work ticket is a mutex: always skip work packages that already hold a ticket; never take one over.
- Never batch wiki updates across items; one item, one update.
- Sample data written into code or fixtures follows the analysis page's 資料來源 column: real data where a source exists, reasoned values labelled as inferred where none does. Never invent a value and present it as real, and never copy personal data into fixtures — keep the format, drop the identity.
- Everything the skill writes out (wiki content, commit messages, PR descriptions) stays Traditional Chinese per the STE100 rule.