Files
sdlc/skills/implement/SKILL.md
T
jiantw83andClaude Fable 5 2705771c20 feat(gate): 四階段模型閘門改為指定模型優先、能力標籤備援,並以 sdlc-gate 上鎖
What:plan、analyze、implement、maintain 四個 SKILL.md 的第一步從單純的能力標籤檢查,改為「模型閘門與階段上鎖」三段流程:先以 jsc-cli/tools/model-config.sh get {stage} 解析該階段的指定模型鏈,鏈上第一個當前 CLI 可用的模型即為必用模型;沒有設定指定模型時才退回 jsc-cli:models 的能力標籤檢查。閘門通過後執行 jsc-hooks/hooks/sdlc-gate.sh lock {stage} {current-model} 寫入鎖檔,並以 sdlc-gate.sh report 驗證。

Why:原本只驗能力標籤,同一標籤下模型可任意替換,階段中途換模型也無人攔阻,導致產出品質與可重現性不穩定。改為指定模型鏈優先可讓團隊明確指派每階段用哪個模型,標籤備援則保留未設定時的彈性;上鎖後由 hook 在每次 prompt 強制檢查,階段內換模型會被擋下。

How:每個技能的步驟一拆成三小步(解析模型鏈、驗證當前模型、上鎖並驗證鎖檔),各小步附完成條件;maintain 另加第四小步,明確規定只在換階段時重跑閘門,維護階段內跨專案不重複驗證。frontmatter description 同步更新。鎖定自 plan 起手生效,直到下一階段(如 analyze)的閘門重新上鎖前,強制沿用同一模型。

Who:jsc-sdlc 的 plan/analyze/implement/maintain 四個技能,及依賴其閘門行為的 jsc-hooks sdlc-gate hook。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-24 11:36:33 +08:00

3.9 KiB

name, description
name description
implement SDLC implementation stage. Gate on the designated model (model-config) or capability tags, lock the model for the stage via sdlc-gate, claim a ready work package from ANALYZE_CONTENTS with a work ticket, then 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

  1. Model gate and stage lock:
    1. Resolve the implement stage's designated model chain: run jsc-cli/tools/model-config.sh get implement. If it prints a chain, the required model is the first entry of the chain the current CLI can use (fallbacks apply in chain order). If it prints nothing, fall back to the capability-tag check via jsc-cli:models (implementation requires the coding tag).
    2. If the current model is not the required model, or fails the tag check, block the flow and tell the user which model to switch to. Completion condition: the current model satisfies the gate.
    3. Lock the stage: run jsc-hooks/hooks/sdlc-gate.sh lock implement {current-model}. From now until the next SDLC stage's gate runs, the sdlc-gate hook enforces this model on every prompt; switching models mid-stage gets blocked. Completion condition: the lock file is written, verified with sdlc-gate.sh report.
  2. Resolve environment first: inspect JSC_WIKI_REPO_ANALYZE, JSC_WIKI_REPO, JSC_WIKI_REPO_QUESTION, GITEA_HOST, and GITEA_TOKEN before asking the user anything. Use inherited shell values first. If the env vars are present but the tool cannot read them, check the current shell environment before asking.
  3. Generate a work ticket: format TICKET_{yyyyMMdd}_{HHmmss}_{HASH}. Use the shared wiki hash for {owner}/{repo} for {HASH}: take the first 8 uppercase hex chars of its SHA-1, then replace a leading digit or A/B/C with H plus the next 7 chars. Try to rename the current session to the ticket name (skip when the CLI does not support it).
  4. Read ANALYZE_CONTENTS via jsc-gitea:wiki and 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.
  5. Let the user pick a work package per jsc-ask:ask rules (options state open-item count and estimated effort). 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.
  6. 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.
  7. When all items are done, call jsc-review:code-review and wait for the review; on failure, fix and re-review until it passes.
  8. Ask per jsc-ask:ask rules whether to register this project for maintenance: append to MAINTAIN_CONTENTS with templates/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.
  • Everything the skill writes out (wiki content, commit messages, PR descriptions) stays Traditional Chinese per the STE100 rule.