From 2705771c20cf3ea9d40d9a989a77374f94ecdf7a Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 11:36:33 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(gate):=20=E5=9B=9B=E9=9A=8E=E6=AE=B5?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E9=96=98=E9=96=80=E6=94=B9=E7=82=BA=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E6=A8=A1=E5=9E=8B=E5=84=AA=E5=85=88=E3=80=81=E8=83=BD?= =?UTF-8?q?=E5=8A=9B=E6=A8=99=E7=B1=A4=E5=82=99=E6=8F=B4=EF=BC=8C=E4=B8=A6?= =?UTF-8?q?=E4=BB=A5=20sdlc-gate=20=E4=B8=8A=E9=8E=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- skills/analyze/SKILL.md | 7 +++++-- skills/implement/SKILL.md | 7 +++++-- skills/maintain/SKILL.md | 8 ++++++-- skills/plan/SKILL.md | 7 +++++-- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/skills/analyze/SKILL.md b/skills/analyze/SKILL.md index 7000f34..ea19d5c 100644 --- a/skills/analyze/SKILL.md +++ b/skills/analyze/SKILL.md @@ -1,6 +1,6 @@ --- name: analyze -description: SDLC analysis stage. Gate on model capability tags, pick a plan from PLAN_CONTENTS, analyze user stories against the current state (working directory plus REPO_{HASH} inventory for reuse). Run WBS to produce numbered work packages, estimate them with CPM, split each into TDD todos, and write wiki page ANALYZE_{HASH}. Logic only - never write code or modify files. Use after planning and before implementation. +description: SDLC analysis stage. Gate on the designated model (model-config) or capability tags, lock the model for the stage via sdlc-gate, pick a plan from PLAN_CONTENTS, analyze user stories against the current state (working directory plus REPO_{HASH} inventory for reuse). Run WBS to produce numbered work packages, estimate them with CPM, split each into TDD todos, and write wiki page ANALYZE_{HASH}. Logic only - never write code or modify files. Use after planning and before implementation. --- # analyze @@ -13,7 +13,10 @@ All wiki reads and writes go through `jsc-gitea:wiki`. ## Steps -1. **Model capability gate**: check the capability tags from `jsc-cli:models` and confirm the current model qualifies for analysis. If not, block the flow and tell the user which model to switch to. +1. **Model gate and stage lock**: + 1. Resolve the analyze stage's designated model chain: run `jsc-cli/tools/model-config.sh get analyze`. 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` (analysis requires the reasoning-high 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 analyze {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. Read `PLAN_CONTENTS` via `jsc-gitea:wiki` for plans whose status is the literal 「未分析」 (name and HASH), and read `ANALYZE_CONTENTS` for existing analyses. 3. Let the user choose per `jsc-ask:ask` rules: **extend an existing analysis** or **analyze a new plan**. State the impact scope on every option. 4. Analyze the plan page's user stories one by one against the **current state**, questioning via the `jsc-ask:ask` decision tree until no doubt remains; keep asking while consensus is missing. Current state means: diff --git a/skills/implement/SKILL.md b/skills/implement/SKILL.md index a7b20db..6f29dea 100644 --- a/skills/implement/SKILL.md +++ b/skills/implement/SKILL.md @@ -1,6 +1,6 @@ --- name: implement -description: SDLC implementation stage. Gate on model capability tags, 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. +description: 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 @@ -10,7 +10,10 @@ All wiki reads and writes go through `jsc-gitea:wiki`. ## Steps -1. **Model capability gate**: check the capability tags from `jsc-cli:models` and confirm the current model qualifies for implementation. If not, block the flow and tell the user which model to switch to. +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**. diff --git a/skills/maintain/SKILL.md b/skills/maintain/SKILL.md index 4243fb8..06499c2 100644 --- a/skills/maintain/SKILL.md +++ b/skills/maintain/SKILL.md @@ -1,6 +1,6 @@ --- name: maintain -description: SDLC maintenance stage. Gate on model capability tags for the maintenance stage, read projects still inside their maintenance window from MAINTAIN_CONTENTS, then run one sub agent per project: switch to develop or master, propose at least five maintenance actions, commit to a new branch, push, and PR. Update the last-maintained timestamp afterward. Use for periodic upkeep of delivered projects. +description: SDLC maintenance stage. Gate on the designated model (model-config) or capability tags for the maintenance stage, lock the model via sdlc-gate, read projects still inside their maintenance window from MAINTAIN_CONTENTS, then run one sub agent per project: switch to develop or master, propose at least five maintenance actions, commit to a new branch, push, and PR. Update the last-maintained timestamp afterward. Use for periodic upkeep of delivered projects. --- # maintain @@ -10,7 +10,11 @@ All wiki reads and writes go through `jsc-gitea:wiki`. ## Steps -1. **Model capability gate**: check the 「SDLC 階段需求」 table from `jsc-cli:models` and confirm the current model qualifies for maintenance (any tag qualifies, but the model must be listed in the mapping table). If not, block the flow and tell the user which model to switch to. Re-check only when the stage changes. +1. **Model gate and stage lock**: + 1. Resolve the maintain stage's designated model chain: run `jsc-cli/tools/model-config.sh get maintain`. 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 「SDLC 階段需求」 table from `jsc-cli:models` (any listed model qualifies for maintenance). + 2. If the current model is not the required model, or is missing from the mapping table, 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 maintain {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`. + 4. Run this gate only when the stage changes; inside the maintenance stage the lock already enforces the model, so never re-gate between projects. 2. Read `MAINTAIN_CONTENTS` via `jsc-gitea:wiki` and filter projects **still inside their maintenance window**: start date ≤ today, and (end date is NULL or ≥ today). 3. Every project **MUST run as a sub agent** with this flow: 1. Switch the project to the `develop` branch, falling back to `master`, and pull to latest. diff --git a/skills/plan/SKILL.md b/skills/plan/SKILL.md index cc9180a..e01b3a3 100644 --- a/skills/plan/SKILL.md +++ b/skills/plan/SKILL.md @@ -1,6 +1,6 @@ --- name: plan -description: SDLC planning stage. Gate on model capability tags, pick or create a plan from PLAN_CONTENTS, then run a decision tree until goal, scope, and feasibility reach consensus. Produce user stories into wiki page PLAN_{HASH}. Logic only - never write code or modify files. Use when the user wants to start or refine a plan; not for analysis or implementation. +description: SDLC planning stage. Gate on the designated model (model-config) or capability tags, lock the model for the stage via sdlc-gate, pick or create a plan from PLAN_CONTENTS, then run a decision tree until goal, scope, and feasibility reach consensus. Produce user stories into wiki page PLAN_{HASH}. Logic only - never write code or modify files. Use when the user wants to start or refine a plan; not for analysis or implementation. --- # plan @@ -13,7 +13,10 @@ All wiki reads and writes go through `jsc-gitea:wiki`. ## Steps -1. **Model capability gate**: check the capability tags from `jsc-cli:models` and confirm the current model qualifies for planning. If not, block the flow and tell the user which model to switch to. +1. **Model gate and stage lock**: + 1. Resolve the plan stage's designated model chain: run `jsc-cli/tools/model-config.sh get plan`. 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` (planning requires the reasoning-high 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 plan {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. Read `PLAN_CONTENTS` via `jsc-gitea:wiki` and list the plans whose status is the literal 「未分析」 (not analyzed), with names and HASH. 3. Let the user choose per `jsc-ask:ask` rules: **extend an existing plan** (list the not-analyzed plans as options) or **create a new plan**. State the impact scope on every option. 4. Question via the `jsc-ask:ask` decision tree until no doubt remains on all three items; keep asking while consensus is missing: -- 2.53.0 From 91d88df37b347cadc24eb7903931a545c365424e Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 11:36:49 +0800 Subject: [PATCH 2/3] =?UTF-8?q?docs(readme):=20=E8=AA=AA=E6=98=8E=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E6=A8=A1=E5=9E=8B=E9=8F=88=E9=96=98=E9=96=80=E8=88=87?= =?UTF-8?q?=20sdlc-gate=20=E9=9A=8E=E6=AE=B5=E9=8E=96=E5=AE=9A=E6=A9=9F?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What:README 開頭的階段模型檢查說明改寫:每次切換階段先以 jsc-cli/tools/model-config.sh get {stage} 解析指定模型鏈(專案 .jsc/models 優先於 $JSC_HOME/models.conf),未設定才退回能力標籤檢查;通過後由 jsc-hooks 的 sdlc-gate hook 鎖定模型直到下一階段重新上鎖。「相關 domain」清單同步更新:jsc-cli 條目補上指定模型鏈工具,新增 jsc-hooks 條目說明 sdlc-gate 階段模型鎖定。 Why:四個技能的閘門邏輯已改為指定模型優先、標籤備援並上鎖,README 若仍描述舊的「僅檢查能力標籤」流程會誤導使用者,也漏掉新依賴的 jsc-hooks domain。 How:改寫首段的階段檢查敘述,補明設定檔優先序與鎖定生效範圍(同一階段內換模型會被擋下);相關 domain 章節加入 jsc-hooks 連結並擴充 jsc-cli 條目。 Who:jsc-sdlc domain 的 README 文件,服務安裝與使用此技能組的使用者。 Co-Authored-By: Claude Fable 5 --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fce5bf4..e121310 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # jsc-sdlc — 開發生命週期 -jsc 技能組的 sdlc domain:規劃 → 分析 → 實作 → 維護四個階段,全程以 wiki 頁追蹤(`PLAN_CONTENTS`、`PLAN_{HASH}`、`ANALYZE_CONTENTS`、`ANALYZE_{HASH}`、`REPO_CONTENTS`、`REPO_{HASH}`、`MAINTAIN_CONTENTS`)。另有異常頁(`ERROR_CONTENTS`、`ERROR_{HASH}`)記錄 hook 或流程失敗。每次切換階段才重新檢查該階段需要的模型能力標籤;同一階段內不重複變更。 +jsc 技能組的 sdlc domain:規劃 → 分析 → 實作 → 維護四個階段,全程以 wiki 頁追蹤(`PLAN_CONTENTS`、`PLAN_{HASH}`、`ANALYZE_CONTENTS`、`ANALYZE_{HASH}`、`REPO_CONTENTS`、`REPO_{HASH}`、`MAINTAIN_CONTENTS`)。另有異常頁(`ERROR_CONTENTS`、`ERROR_{HASH}`)記錄 hook 或流程失敗。每次切換階段先解析該階段的指定模型鏈(`jsc-cli/tools/model-config.sh get {stage}`,專案 `.jsc/models` 優先於 `$JSC_HOME/models.conf`);沒有設定才退回模型能力標籤檢查。通過閘門後由 `jsc-hooks` 的 sdlc-gate hook 鎖定模型,直到下一階段的閘門重新上鎖;同一階段內換模型會被擋下。 ## 安裝、更新、移除 @@ -59,7 +59,8 @@ HASH 規則:一律先算 `{owner}/{repo}` 的 SHA-1 前 8 碼並轉大寫; ## 相關 domain -- [`jsc-cli`](https://gitea.jsc.idv.tw/plugins/cli):模型能力標籤(`jsc-cli:models`) +- [`jsc-cli`](https://gitea.jsc.idv.tw/plugins/cli):指定模型鏈(`tools/model-config.sh`)與模型能力標籤(`jsc-cli:models`) +- [`jsc-hooks`](https://gitea.jsc.idv.tw/plugins/hooks):sdlc-gate 階段模型鎖定 - [`jsc-gitea`](https://gitea.jsc.idv.tw/plugins/gitea):wiki 讀寫 - [`jsc-review`](https://gitea.jsc.idv.tw/plugins/review):實作完成後的程式碼審查 - [`jsc-git`](https://gitea.jsc.idv.tw/plugins/git) / [`jsc-pkg`](https://gitea.jsc.idv.tw/plugins/pkg):維護階段的 commit / PR 與套件更新 -- 2.53.0 From 923fb8e83e2c6dca48539a22a57b76eae97912f3 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 11:37:01 +0800 Subject: [PATCH 3/3] =?UTF-8?q?chore(manifest):=20=E4=B8=89=E4=BB=BD=20plu?= =?UTF-8?q?gin.json=20=E7=89=88=E6=9C=AC=E5=8D=87=E8=87=B3=200.0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What:plugin.json、.claude-plugin/plugin.json、.codex-plugin/plugin.json 三份 manifest 的 version 由 0.0.2 升為 0.0.3。 Why:本次加入指定模型閘門與 sdlc-gate 階段鎖定屬功能性變更,需要提升版本號讓各 AI CLI 的 plugin 更新機制偵測到新版並重新安裝。 How:同步修改三份 manifest 的 version 欄位,維持三處版本一致。 Who:jsc-sdlc plugin 的安裝與更新流程(jsc-cli:deploy 及各 CLI 原生 plugin 指令)。 Co-Authored-By: Claude Fable 5 --- .claude-plugin/plugin.json | 2 +- .codex-plugin/plugin.json | 2 +- plugin.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index d087e35..46e8904 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-sdlc", - "version": "0.0.2", + "version": "0.0.3", "description": "開發生命週期:規劃/分析/實作/維護(wiki 追蹤)", "skills": "./skills", "author": { diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 7be74c9..91aae39 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-sdlc", - "version": "0.0.2", + "version": "0.0.3", "description": "開發生命週期:規劃/分析/實作/維護(wiki 追蹤)", "skills": "./skills" } diff --git a/plugin.json b/plugin.json index 4ce9145..1a89807 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-sdlc", - "version": "0.0.2", + "version": "0.0.3", "description": "開發生命週期:規劃/分析/實作/維護(wiki 追蹤)", "skills": "./skills/" } -- 2.53.0