[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M752SQCXMZ3QZWHPVNQJGNXJ":3,"skill-same:01M752SQCXMZ3QZWHPVNQJGNXJ":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},"01M752SQCXMZ3QZWHPVNQJGNXJ","sd-pattern-discipline",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-pattern-discipline\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"# sd-pattern-discipline\n\nPattern discovery and adherence rules for specwright. New code must read as if written by the\nteam that wrote the surrounding code. Applied by `sd-spec-architect` (authoring `Pattern refs`),\n`sd-implementer` (following them), and `sd-reviewer` (verifying conformance).\n\nRead the section matching your role. The core rule applies to everyone.\n\n---\n\n## The core rule\n\nBefore writing new code, find the precedent. The codebase - not your training data - defines what\n\"idiomatic\" means here. Discovery is always by sampling (Glob \u002F Grep \u002F Read of 1-3 files), never\nby stack assumption. If the precedent and your habits disagree, the precedent wins.\n\n---\n\n## Discovering precedents (sd-spec-architect)\n\nFor every task that creates a new file or introduces a new public symbol:\n\n- **New file** -> `Glob` the target directory (and the nearest sibling directory if the target is\n  new or sparse). Pick the 1-3 existing files closest in role to what the task creates. Those are\n  the `Pattern refs`.\n- **New symbol** (class \u002F function \u002F endpoint \u002F handler \u002F etc.) -> `Grep` for existing symbols of\n  the same kind. Observe the naming morphology (prefix, suffix, casing, pluralization) and cite\n  one representative example.\n- **New utility \u002F helper** -> search for an existing equivalent FIRST (`Grep` the domain noun and\n  verb). If found, the ref says \"reuse this - do not write a new one\". If not found, state what\n  was searched so the implementer does not repeat the search.\n- **Budget**: max 3 sampled files per target directory. Verify every ref exists (`Glob` or `Read`)\n  before citing it - a hallucinated precedent is worse than none.\n\n## Authoring Pattern refs (sd-spec-architect)\n\n- Field format lives in **sd-atomic-task-format**. Each ref is `file:line` plus a one-line\n  instruction of WHAT to mirror (\"mirror handler structure and registration\", \"name after this\n  precedent\", \"reuse this helper - do not duplicate\").\n- Required for any task that creates a new file or introduces a new public symbol.\n- `none` is acceptable only for tasks that exclusively edit existing files - there, the file\n  itself is the precedent.\n\n---\n\n## Following patterns (sd-implementer)\n\n- Read every file cited in `Pattern refs` BEFORE creating or editing anything. Cap: 3 files.\n- **Creating a new file**: mirror the closest ref - file placement, header \u002F import organization,\n  member ordering, naming, and where its test file lives.\n- **Naming a new symbol**: follow the morphology of the cited precedent, not your default style.\n- **Before writing any helper not named in the task**: ONE `Grep` for an existing equivalent.\n  Found -> use it. Not found -> write it, and note the search in your summary.\n- **Stale refs**: line numbers may have drifted since planning. Treat a ref as file + nearby\n  region. If the cited symbol moved, `Grep` its name once. If the file is gone, fall back to the\n  nearest sibling file and note the substitution in your summary - do NOT stop for ref drift.\n- **Conflict**: if a Pattern ref contradicts the constitution, the constitution wins. Follow the\n  constitution and surface the mismatch in your summary.\n\n---\n\n## Verifying conformance (sd-reviewer)\n\n- For each NEW file in the changeset: compare it against the task's `Pattern refs` (or the\n  nearest sibling file if the task has none). State explicitly what you compared against (`file`).\n- Deviation from an explicit Pattern ref -> WARN, anchored to the task block.\n- Convention drift with no Pattern ref and no constitution anchor -> SUGGEST.\n- A new utility duplicating an existing one -> WARN, citing both `file:line`.\n- Never BLOCK solely because a task lacks a `Pattern refs` field. The field is required on every\n  task, but a missing one is a spec-authoring defect, not a defect in the code under review - it\n  belongs to `\u002Fsd:spec validate` as `SL060` (WARN), and older specs predate the requirement\n  entirely. Reviewing the code against the nearest sibling file is the right response; failing the\n  review is not.\n\n---\n\n## Anti-patterns\n\n- **Inventing a \"better\" structure than the precedent.** Consistency beats local optimality. If\n  the precedent is genuinely bad, surface it - do not silently diverge.\n- **Scanning the repo broadly.** 1-3 reference files, sampled and cited. Pattern discovery is a\n  bounded read, not an audit.\n- **Citing precedents from memory.** Verify the file exists before citing it.\n- **Writing a helper without one search for an existing equivalent.** Duplicated utilities are\n  how codebases rot.\n- **Treating Pattern refs as optional reading.** They are part of the task contract, same as\n  `Acceptance`.\n",{},"main","cb6a2aef549bb625b9ba1869d220d40938e83c18","skills\u002Fsd-pattern-discipline",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-pattern-discipline",{"tool":34,"command":35},"bunx","bunx skills add developzoneio\u002Fspecwright --skill sd-pattern-discipline",{"tool":37,"command":38},"pnpm","pnpm dlx skills add developzoneio\u002Fspecwright --skill sd-pattern-discipline","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdevelopzoneio\u002Fspecwright\u002Fblob\u002Fmain\u002Fskills\u002Fsd-pattern-discipline\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",[],[]]