--- name: plan 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 Goal: create or extend the wiki plan page `PLAN_{HASH}`. This skill is a **logic-only** stage: never output code, and **never modify any file**. `{HASH}` = the shared wiki hash for `{owner}/{repo}`: take the first 8 uppercase hex chars of its SHA-1. If the first char is a digit, or `A`/`B`/`C`, replace it with `H` and keep the next 7 chars. All wiki reads and writes go through `jsc-gitea:wiki`. ## Steps 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: - Goal: the problem to solve and the criteria for success. - Scope: what is included, what is excluded, which repositories are involved. - Feasibility: whether the system architecture and data sources support the goal. 5. Turn the consensus into **user stories** (the zh-TW pattern 「身為⋯⋯我想要⋯⋯以便⋯⋯」), one per line. 6. Apply `templates/plan-page.md` to create or update the plan page, and write it back via `jsc-gitea:wiki`. The page content is Traditional Chinese, exactly as the template dictates. 7. If the plan page is new, add it to `PLAN_CONTENTS` using the entry format of `templates/plan-contents.md`, with status set to the literal 「未分析」. ## Hard limits - Never output a code snippet. - Never modify any file in the working directory. - Never skip the decision tree and assume requirements.