Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
8.3 KiB
name, description
| name | description |
|---|---|
| analyze | SDLC analysis stage. Gate on capability tags enforced in code by sdlc-gate (analyze requires reasoning-max, verified against the transcript's actual model id), confirm the source branch with the user, pick a plan from PLAN_CONTENTS, analyze user stories against the current state (working directory plus REPO_{HASH} inventory for reuse). Keep questioning until consensus per references/consensus.md, run WBS with the delivery/handover package as a standalone WP-01 that implementation packages depend on, estimate them with CPM, split each into TDD todos, and write wiki page ANALYZE_{HASH} with real sample data. Logic only - never write code or modify files. Use after planning and before implementation. |
analyze
Goal: create or extend the wiki analysis page ANALYZE_{HASH}.
This skill is a logic-only stage: never output code, and never modify any file.
{HASH} = the shared wiki hash for {owner}/{repo} used to build the ANALYZE_{HASH} page name, computed by jsc-gitea/tools/hash-id (see jsc-gitea:wiki).
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 analyze. The script reads the actual model id from the transcript, compares it against this stage's required tags (reasoning-max), 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 source branch — the branch whose code counts as the current state:
- Report the working directory's current branch, plus the remote branches available (
git branch -r) and whether the working tree is clean. - Ask per
jsc-ask:askrules which branch the analysis reads from; state the impact scope on every option (analysing the wrong branch produces work packages for code that does not exist). - When the chosen branch is not the current one, stop and ask the user to switch. This stage never switches branches, never stashes, and never touches the working tree — see
/jsc-shared:spec-git-safety. - Record the confirmed branch and its head sha on the analysis page. Completion condition: the user has confirmed the branch explicitly; never infer it from the current checkout alone.
- Report the working directory's current branch, plus the remote branches available (
- Read
PLAN_CONTENTSviajsc-gitea:wikifor plans whose status is the literal 「未分析」 (name and HASH), and readANALYZE_CONTENTSfor existing analyses. - Let the user choose per
jsc-ask:askrules: extend an existing analysis or analyze a new plan. State the impact scope on every option. - Analyze the plan page's user stories one by one against the current state, questioning until consensus per
references/consensus.md(the single authority for both planning and analysis): every answer produces the next question, and consensus needs both no output-changing unknown and the user's explicit confirmation. Never assume a missing detail, and never start the WBS while any item is still open. Current state means:- Every file in the working directory, on the branch confirmed in step 2.
- Reuse existing methods and endpoints whenever possible:
- Check the
REPO_{HASH}inventory page first. Re-inventory when the feature or endpoint is missing, or when the recorded commit sha differs from the current one. - Re-inventory MUST run as a sub agent: analyze the repository's features and endpoints, attach the current commit sha, write back to
REPO_{HASH}withtemplates/repo-page.md, and updateREPO_CONTENTSpertemplates/repo-contents.md. - For each reuse candidate, confirm the file path and method name first, then analyze whether its logic fits the requirement.
- Check the
- Run a Work Breakdown Structure (WBS): split the user stories into work packages, number them sequentially (
WP-01,WP-02, ...) and mark dependencies. WP-01is always the delivery/handover work package — see 「交付工作包最優先」 below. It stands alone, never merged into an implementation package, and every implementation package that consumes its spec depends on it.- Estimate every work package's effort in hours and days with the Critical Path Method (CPM), and mark the critical path.
- Split every work package into todos with Test-Driven Development (TDD), formatted
[ ](open) /[x](done). Each todo is one vertical slice: one seam, one test, one minimal implementation. Seams and anti-patterns:references/tdd.md. - Apply
templates/analyze-page.mdto create or update the analysis page and write it back viajsc-gitea:wiki. The page content is Traditional Chinese, exactly as the template dictates. - If the analysis page is new: add it to
ANALYZE_CONTENTSpertemplates/analyze-contents.md, and flip the plan's status inPLAN_CONTENTSto the literal 「已分析」.
交付工作包最優先(delivery package is WP-01)
A work package is a delivery/handover package when someone else — another person, another CLI, another team — has to act on its output. Interfaces, schemas, spec documents, acceptance criteria and sample payloads are delivery output; endpoint bodies and UI wiring are not.
WP-01is the delivery/handover package, always first, always standalone. Pull every spec-shaped item out of the implementation packages and put it here. Never merge a spec into the package that implements it — merging removes the ability to hand the spec over early, which is the whole point.- Implementation packages depend on
WP-01when they consume its spec, and they are the backup queue (實作候補): still numbered, still estimated, still on the page, just ranked after it. - Mark every work package as 交付
是/否in the WBS table, and recordWP-01's intended content type in the 交付型別 column when the user has already decided it (options inreferences/deliver-formats.md; the type is confirmed for real whenimplementstarts that package). - Dependencies still win among the rest: never place a package before one it depends on. Within the same dependency level, delivery-shaped packages come first.
- When nothing is genuinely deliverable (say, an internal refactor with no interface change), do not invent an empty
WP-01: confirm with the user perjsc-ask:askthat this analysis has no handover output, then note the reason on the page and number the implementation packages fromWP-01.
範例資料(sample data)
Every sample value on the analysis page — request and response payloads, field values, config snippets, test fixtures — follows this order:
- Real data first. Take values from an actual source: the database schema and rows, a real API response, an existing config or fixture file, logs. Record where each sample came from in the WBS table's 資料來源 column (for example
真實:dbo.Member). - Only when no source exists, derive the value by reasoning from the surrounding logic — and label it as inferred (for example
推論:無來源), so the receiving side knows it is unverified. - Never invent a plausible-looking value and present it as real, and never leave the origin of a sample unstated.
- Real data goes on the page as structure and format only: field names, types, shapes. Never copy personal data onto the wiki — mask any personal identifier, and prefer describing the format over pasting the value.
- When
WP-01's content type is an API document, the required fields and the new-versus-existing parameter marking are defined inreferences/deliver-formats.md; follow it rather than inventing a layout.
Hard limits
- Never output a code snippet (file paths and method names are allowed).
- Never modify any file in the working directory.
- Never switch, create or clean branches in this stage; ask the user to do it.