[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M752T886YHH8QVHD2TQJK0NQ":3,"skill-same:01M752T886YHH8QVHD2TQJK0NQ":42},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":14,"categories":15,"keywords":16,"publishedAt":17,"linkOnly":18,"markdownContent":19,"markdownBody":19,"frontMatter":20,"refName":21,"commitSha":22,"skillDirectory":23,"forksCount":24,"repositoryHtmlUrl":25,"repositoryHomepageUrl":6,"ownerHtmlUrl":26,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":27,"install":28,"resources":41},"01M752T886YHH8QVHD2TQJK0NQ","sd-spec-templates",null,"developzoneio\u002Fspecwright","developzoneio","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F288244965?v=4","01M752S4GQXBCH6H67H28M9HTN","01M752S4HXZ73BTCHG2K1VCYQA",10,"MIT","https:\u002F\u002Fgithub.com\u002Fdevelopzoneio\u002Fspecwright\u002Fblob\u002Fmain\u002Fskills\u002Fsd-spec-templates\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"# sd-spec-templates\n\nPer-template authoring rules for specwright. Used by `sd-spec-architect` when `TASK = create`.\nEach template has a dedicated section below. Read only the section matching the spec type being authored.\n\n---\n\n## Common rules (apply to all templates)\n\n- Output goes to the **file**, not to the prose response. Response = one-paragraph summary + file path.\n- Follow the template structure **exactly** — sections, order, headings. Reordering breaks downstream agents.\n- Cross-phase fields carry a `\u003C\u003CPHASE-N: description>>` token. Leave the token **verbatim** — do\n  not pre-fill it, do not delete it. Phase N of the owning workflow replaces it with measured\n  evidence. `\u002Fsd:spec validate` fails a `draft` or `approved` spec whose phase-deferred tokens are\n  already filled, so pre-filling is caught, not just discouraged.\n- Author-fill fields use the plain `\u003C\u003Cdescription>>` token and must be replaced before `approved`.\n- `created` = current UTC date in `YYYY-MM-DD`.\n- If anything is genuinely uncertain, surface as an **Open question** — never silently allow.\n\n### Required frontmatter fields\n\n| Type | Fields |\n|---|---|\n| All | `id`, `type`, `status: draft`, `created`, `linked_specs` |\n| Feature | `jira` (or `none`), `complexity` (`S` \\| `M` \\| `L`) |\n| Bug | `severity` (P0–P3), `jira` |\n| Refactor | `smell` |\n| Perf | `target_metric` |\n| RCA | `severity`, `incident_started`, `incident_resolved` |\n| Port | `jira` (or `none`), `scope` (`endpoint`\\|`module`\\|`feature`\\|`pattern`), `source_repo`, `source_commit`, `source_license`, `snapshot` (`contract`\\|`contract+source`) |\n\n`linked_specs` is always `[]` at authoring time. Cross-references are written later by\n`\u002Fsd:spec link`, which maintains the inverse entry on the other spec — never hand-write the list,\nand never add a \"Linked specs\" body section. A one-sided link fails `\u002Fsd:spec validate`.\n\n---\n\n## feature.template.md\n\nFill:\n- **Why** — one paragraph, quantify impact if possible.\n- **What** — Given\u002FWhen\u002FThen scenarios: happy path, edge cases, failure modes.\n- **Success criteria** — concrete and checkable (observable test outcome, not \"works correctly\").\n- **Out of scope** — explicit list; prevents scope creep disputes.\n- **Open questions** — real ambiguities only; don't pad.\n- **`complexity` frontmatter** — the whole-spec size estimate, `S` | `M` | `L`, with a one-line\n  rationale in the trailing comment. See \"Complexity estimate\" below.\n\n**Leave empty**: `## Spawned specs` — header + separator only, no rows and no `\u003C\u003C...>>` token. It\nmirrors `rca.template.md`'s four-column table and is filled at close-out by the owning workflow,\nnot at create time. A reserved ID is a placeholder, never an `.specs\u002Findex.md` row.\n\n- Scenario headings use stable IDs: `### SC-\u003Cn>: \u003Cname>`. IDs are sequential from SC-1 and are\n  never renumbered or reused after a scenario is deleted - downstream `Covers` fields and\n  `\u002Fsd:verify` reports reference them.\n- Success criteria use stable IDs: `- [ ] AC-\u003Cn>: \u003Ccriterion>`. Same stability rule as SC IDs.\n- Every SC and AC ID must be covered by at least one task's `Covers` field in `02-tasks.md`\n  before `\u002Fsd:verify` can pass (see sd-atomic-task-format).\n\nConstitution check: list applicable `§N.M` references. Flag any potential violation as an Open question.\n\n### Complexity estimate (feature only)\n\nThe `complexity` frontmatter field is the architect's whole-spec size estimate. It exists to route\noversized work into the regime the engine handles well: at Gate 2, `\u002Fsd:feature` measures the real\nplan against the thresholds below and, if the plan exceeds them, refuses a single oversized plan and\nforces a decompose into medium child specs (see `commands\u002Ffeature.md`, Gate Complexity).\n\n**`complexity` is a spec-level field. It is NOT the same as a task's `Estimated complexity`\nfield in `02-tasks.md`.** The task field sizes one line item; this field sizes the whole feature.\nThey share the `S` | `M` | `L` vocabulary on purpose (one house currency) but answer different\nquestions. Never conflate them.\n\n**Estimate at create, measure at plan.** At `create` the architect has only Why \u002F What \u002F SC \u002F AC \u002F\nOpen questions — no plan yet — so `complexity` is an honest *estimate*, written with a one-line\nrationale. It is not a measured field, so it is a plain author-fill token, not a `\u003C\u003CPHASE-N: ...>>`\ntoken, and it is filled at create time. Phase 3 is where the plan is *measured* against the\nthresholds; the create-time estimate does not have to be re-derived, but it must be a genuine\njudgement, not always `M`.\n\nRubric for the estimate:\n\n| Value | Guideline (estimate) |\n|---|---|\n| `S` | One layer, a handful of tasks (≈1-4), single subsystem, no unresolved Open questions. |\n| `M` | Up to 2 layers, ≈5-8 tasks, one boundary crossing. The regime the engine plans well. |\n| `L` | Spans > 2 production layers\u002Fsubsystems, likely > 8 tasks, or carries unresolved Open questions at plan time. Candidate for decomposition. |\n\n**Decompose thresholds (measured at Gate 2).** A plan is over-threshold when **any** of these hold:\n\n- estimated\u002Fauthored tasks **> 8**\n- spans **> 2** production layers\u002Fsubsystems — count the distinct `Layer` values across tasks, but\n  **exclude `Tests` and `Config`**: they cross-cut nearly every change, so counting them would make\n  an ordinary 2-layer feature (e.g. `Application` + `Domain` + `Tests`) read as 3 and over-fire\n- impact surface **> 8** files (from `03-decisions.md`)\n- **any** unresolved Open question remains at plan time\n\nThe `> 8` task line is set from the only live corpus (`asian-sportsbook-v2`): real feature specs\ncluster at 3-4 tasks (medium) and 10-12 tasks (the two specs a human had already hand-split into a\nparent + child), with nothing in between — `> 8` sits in that canyon, so mediums pass untouched and\nthe genuinely large trip the gate. The Tests\u002FConfig exclusion is set from the same corpus: the\n3-4-task mediums touch `Application` + `Domain` + `Tests`, so a naive layer count would have tripped\nthe gate on exactly the specs that must pass with zero friction.\n\n**Count tasks with the tolerant grammar, never a naive regex.** When measuring the task count, use\nthe **Field label \u002F heading grammar** the way `sd-atomic-task-format` describes — live specs write\ntask headings as `### T01`, `### ✅ T01`, and other drifted forms. A counter that matches only\n`^### T\u003CNN>` undercounts real specs and the gate silently never fires. Match tolerantly: a task\nheading is an H3 (or deeper) whose text contains a `T\u003Cdigits>` token.\n\n**A create-time estimate of `L` also escalates models** — `\u002Fsd:feature` applies the\n**sd-model-escalation** rules that read it. That is a main-thread action; the architect only writes\nthe estimate.\n\n---\n\n## bug.template.md\n\nFill:\n- **Symptom** — observed behavior.\n- **Expected** — correct behavior.\n- **Reproduction** — deterministic steps (numbered list).\n- **Affected** — components, scope, first introduced (version \u002F PR if known).\n- **Severity** — P0 (production down) \u002F P1 (major feature broken) \u002F P2 (partial degradation) \u002F P3 (minor).\n\n**Leave empty**: Root cause section, Fix approach section, `## Spawned specs` (header + separator\nonly, no `\u003C\u003C...>>` token) — the first two are filled in Phase 3 (debugger) and Phase 5 (main thread\n+ implementer); `## Spawned specs` is filled at close-out by the owning workflow. Pre-filling\nbreaks the workflow gate discipline.\n\n---\n\n## refactor.template.md\n\nFill:\n- **Smell \u002F Driver** — named code smell or architectural reason.\n- **Current state** — high level. Code-explorer fills detailed impact in `03-decisions.md`.\n- **Target state** — the intended structure after refactor.\n- **Invariants — MUST preserve** — concrete and checkable; each invariant gets a test witness.\n- **Out of scope** — explicit.\n\nLeave TBD:\n- **Impact surface** — Phase 2 explorer fills.\n- **Test coverage prerequisite measurements** — Phase 3 fills.\n- **`## Spawned specs`** — header + separator only, no `\u003C\u003C...>>` token; filled at close-out by the\n  owning workflow, not at create time.\n\nPublic API: preserved by default. Any public API change requires explicit mention in the spec.\n\n---\n\n## perf.template.md\n\nFill:\n- **Target** — metric (e.g. `p95 latency`), goal SLA (e.g. `\u003C 200ms`), environment, load profile, workload type.\n- **Measurement methodology** — tool, script, warm-up rounds, duration, reps, DB state, cache state.\n- **Constraints** — correctness non-negotiables, behavioral invariants, forbidden side effects.\n- **Out of scope**.\n\nLeave empty:\n- \"Current observed\" in Target table — filled by Phase 2 baseline measurement.\n- **Results log** — filled iteratively in Phase 4.\n- **Hypothesis tree** — filled by debugger in Phase 3.\n- **Trade-offs accepted** — filled at close-out.\n- **`## Spawned specs`** — header + separator only, no `\u003C\u003C...>>` token; filled at close-out.\n\n---\n\n## rca.template.md\n\nProduce skeleton only. The following are filled **interactively** by the main thread with user input in Phase 1 — do NOT pre-fill them:\n- Timeline\n- Symptoms\n- Affected scope\n- Recent changes\n\nLeave TBD (filled by later phases):\n- Hypothesis tree (Phase 2 debugger)\n- Root cause (Phase 3 verification)\n- Affected components, Mitigation, Follow-up actions, Spawned specs, Lessons learned\n\nSpec ID format: `RCA-\u003Cslug>-\u003CYYYYMMDD>` using UTC date.\n\n---\n\n## port.template.md\n\n`source_repo` \u002F `source_commit` are required **values**, not just present fields, when `scope` is\nnot `pattern` (write `none` for `pattern`). The three fidelity tables - Path mapping table, Member\nmanifest, Deviation table - and the mandatory fidelity acceptance criterion (`AC-1`, pre-filled,\nnever reworded or renumbered) are owned by **sd-port-fidelity**: read that skill for the column\nschemas and completeness conditions rather than re-deriving them here.\n\nFill:\n- **Why**, **Donor provenance**, **Behavioral contract** (fixed 7-row table), **Success criteria**\n  `AC-2` onward, **Out of scope**, **Open questions**.\n- **`## Behavioral invariants (non-obvious)`** is mandatory even when short and must never be\n  deleted - it is the single highest-value section in the spec.\n- **`## Spawned specs`** mirrors `rca.template.md`'s 4-column table: one row per donor defect\n  reproduced deliberately, not per sanctioned deviation.\n\n**No `\u003C\u003CPHASE-N: ...>>` tokens exist for this template** (same as `feature.template.md`) - the\nfidelity tables and `Frozen:` line are progressively filled by `sd-spec-architect` `refine` calls\nand main-thread edits across `\u002Fsd:port`'s phases, not gated by phase-deferred tokens. Do not invent\none.\n\nSpec ID format: `PORT-\u003Cslug>-\u003CYYYYMMDD>` using UTC date.\n\n---\n\n## Anti-patterns\n\n- Filling cross-phase fields prematurely (bug root cause, perf results log, rca root cause).\n- Reordering sections in the template output — downstream agents key off section headers.\n- Hardcoding stack assumptions — always read `CLAUDE.md` first; never default to a stack from prior invocations.\n- Producing the spec text in the prose response — write to the file; return only the summary + path.\n- Glossing over a constitution violation — if §1.1 is at risk, that is an Open question.\n- Inventing a line-range column in the port member manifest — line ranges live only in\n  `04-artifacts\u002Fsource\u002FMANIFEST.md`, keyed by `(Snapshot path, Ordinal)`.\n",{},"main","cb6a2aef549bb625b9ba1869d220d40938e83c18","skills\u002Fsd-spec-templates",0,"https:\u002F\u002Fgithub.com\u002Fdevelopzoneio\u002Fspecwright","https:\u002F\u002Fgithub.com\u002Fdevelopzoneio","2026-11-11 17:12:43",{"source":7,"skillName":5,"commands":29,"prompt":39,"zipAvailable":40},[30,33,36],{"tool":31,"command":32},"npx","npx skills add developzoneio\u002Fspecwright --skill sd-spec-templates",{"tool":34,"command":35},"bunx","bunx skills add developzoneio\u002Fspecwright --skill sd-spec-templates",{"tool":37,"command":38},"pnpm","pnpm dlx skills add developzoneio\u002Fspecwright --skill sd-spec-templates","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdevelopzoneio\u002Fspecwright\u002Fblob\u002Fmain\u002Fskills\u002Fsd-spec-templates\u002FSKILL.md",true,[],[43,49,54,60,65,70],{"skillNo":44,"name":45,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":46,"categories":47,"keywords":48,"publishedAt":17},"01M752V2C4FNMKBZTZETKKN70B","sd-model-escalation","https:\u002F\u002Fgithub.com\u002Fdevelopzoneio\u002Fspecwright\u002Fblob\u002Fmain\u002Ftests\u002Fcontract-lint\u002Ffixtures\u002Ffp-cl605-alias-list\u002Foverlay\u002Fskills\u002Fsd-model-escalation\u002FSKILL.md",[],[],{"skillNo":50,"name":45,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":17},"01M752V0C3S0BHSXZ4JM3B7MF2","https:\u002F\u002Fgithub.com\u002Fdevelopzoneio\u002Fspecwright\u002Fblob\u002Fmain\u002Ftests\u002Fcontract-lint\u002Ffixtures\u002Ffp-cl601-allow-comment\u002Foverlay\u002Fskills\u002Fsd-model-escalation\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":17},"01M752TYQZVASA2BTDRZB4N8W6","sd-demo-guard","https:\u002F\u002Fgithub.com\u002Fdevelopzoneio\u002Fspecwright\u002Fblob\u002Fmain\u002Ftests\u002Fcontract-lint\u002Ffixtures\u002Ffp-cl009-phrase-outside-phase0\u002Foverlay\u002Fskills\u002Fsd-demo-guard\u002FSKILL.md",[],[],{"skillNo":61,"name":45,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":17},"01M752TXBFQHK7NCDTZEBHZRFN","https:\u002F\u002Fgithub.com\u002Fdevelopzoneio\u002Fspecwright\u002Fblob\u002Fmain\u002Ftests\u002Fcontract-lint\u002Ffixtures\u002Fcl605-command-restates-ladder\u002Foverlay\u002Fskills\u002Fsd-model-escalation\u002FSKILL.md",[],[],{"skillNo":66,"name":45,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":17},"01M752TVDG89BJRTGFET80RCK2","https:\u002F\u002Fgithub.com\u002Fdevelopzoneio\u002Fspecwright\u002Fblob\u002Fmain\u002Ftests\u002Fcontract-lint\u002Ffixtures\u002Fcl604-row-skips-rung\u002Foverlay\u002Fskills\u002Fsd-model-escalation\u002FSKILL.md",[],[],{"skillNo":71,"name":45,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":17},"01M752TT6SD0SSK6Z0GQ4HM68P","https:\u002F\u002Fgithub.com\u002Fdevelopzoneio\u002Fspecwright\u002Fblob\u002Fmain\u002Ftests\u002Fcontract-lint\u002Ffixtures\u002Fcl603-full-model-id-in-row\u002Foverlay\u002Fskills\u002Fsd-model-escalation\u002FSKILL.md",[],[]]