dsh-plugin-strict-spec 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/README.md +13 -13
  2. package/README.zh.md +10 -12
  3. package/dist/cli/strict-spec-cli.js +108 -770
  4. package/dist/skills/strict-roadmap-plan/SKILL.md +49 -139
  5. package/dist/skills/strict-roadmap-recommend/SKILL.md +63 -282
  6. package/dist/skills/strict-roadmap-reorder/SKILL.md +40 -158
  7. package/dist/skills/strict-roadmap-review/SKILL.md +48 -144
  8. package/dist/skills/strict-roadmap-transition/SKILL.md +52 -274
  9. package/dist/skills/strict-scene-edit/SKILL.md +51 -121
  10. package/dist/skills/strict-spec-apply/SKILL.md +63 -173
  11. package/dist/skills/strict-spec-architecture/SKILL.md +39 -97
  12. package/dist/skills/strict-spec-archive/SKILL.md +57 -127
  13. package/dist/skills/strict-spec-auto/SKILL.md +98 -270
  14. package/dist/skills/strict-spec-brainstorm/SKILL.md +73 -176
  15. package/dist/skills/strict-spec-bugfix/SKILL.md +101 -225
  16. package/dist/skills/strict-spec-design/SKILL.md +55 -124
  17. package/dist/skills/strict-spec-design-sync/SKILL.md +55 -123
  18. package/dist/skills/strict-spec-init/SKILL.md +45 -93
  19. package/dist/skills/strict-spec-maintenance/SKILL.md +44 -94
  20. package/dist/skills/strict-spec-modify/SKILL.md +44 -113
  21. package/dist/skills/strict-spec-propose/SKILL.md +180 -495
  22. package/dist/skills/strict-spec-review/SKILL.md +121 -273
  23. package/dist/skills/strict-spec-ship/SKILL.md +25 -60
  24. package/dist/skills/strict-spec-spec-edit/SKILL.md +35 -84
  25. package/dist/skills/strict-spec-sync-specs/SKILL.md +44 -94
  26. package/dist/skills/strict-spec-verify/SKILL.md +28 -43
  27. package/dist/skills/strict-tech-edit/SKILL.md +43 -124
  28. package/dist/skills/strict-tech-sync/SKILL.md +60 -162
  29. package/package.json +2 -1
@@ -8,19 +8,12 @@ metadata:
8
8
  version: 1.0.0
9
9
  ---
10
10
 
11
- You are fixing a known bug through the strict workflow.
12
-
13
- This skill owns the bugfix-specific discipline — confirming the issue is a known
14
- bug, reproducing it before touching production code, keeping the fix minimal,
15
- and proving it with before-and-after regression evidence. The general workflow
16
- procedures it sits on top of are owned by the skills listed under Delegated
17
- Procedures below, and this skill does not restate them.
11
+ Fix a known bug through a narrow strict change: reproduce it before touching
12
+ production code, make the smallest fix, and prove it with regression evidence
13
+ that fails before the fix and passes after it.
18
14
 
19
15
  ## This Skill's Commands
20
16
 
21
- If you cannot remember the exact command used by this skill, look it up here
22
- before running anything. Do not guess.
23
-
24
17
  ```yaml
25
18
  check-workflow-state: strict-spec-cli check-workflow-state
26
19
  tech-status: strict-spec-cli tech-status
@@ -36,77 +29,41 @@ verify: strict-spec-cli verify <change-name>
36
29
  archive: strict-spec-cli archive <change-name>
37
30
  ```
38
31
 
39
- ## YAML Writing Rules
40
-
41
- - Keep strict artifacts in valid YAML structures at every stage. Do not replace
42
- structured fields with Markdown prose.
43
- - If artifact fields are unclear, use `strict-spec-cli schema-show <schema-name>`;
44
- installed skills do not carry a `templates` directory.
45
- - Shared schema cache root: `~/.strict-spec-schemas/`. When a YAML artifact already declares `schema_file`, resolve that relative path under the shared cache root to inspect the concrete schema file without relying on a local templates directory.
46
- - If a valid artifact example would clarify the shape, use
47
- `strict-spec-cli sample-show <sample-name>`; installed skills do not rely on a
48
- local `examples` directory.
49
- - Use block scalars only for free-text content. Prefer `>-` for wrapped prose
50
- such as longer `summary`, `approach`, `decision`, `rationale`, `question`,
51
- `context`, `answer`, and spec `statement` values. Use `|` only when literal
52
- line breaks must be preserved.
53
- - Quote short strings that may contain YAML-sensitive characters or ambiguous
54
- scalar values, including `command` strings, URLs, paths, text containing `:`
55
- or `#`, leading `-`, JSON-like fragments, boolean-like words, and timestamp-
56
- like values.
57
- - Keep short structural fields as plain scalars unless quoting is needed for
58
- correctness. Do not force IDs, enums, schema identifiers, artifact types,
59
- task references, or similar fields into block scalars.
60
- - Before moving between workflow stages, self-check indentation, list nesting,
61
- quote closure, and colon spacing, then use the documented verification
62
- commands to catch remaining schema or YAML issues.
63
-
64
32
  ## CLI-Only YAML Authoring Protocol
65
33
 
66
- Every mutation of repository-owned YAML in this skill goes through the strict
67
- CLI. This skill writes `change-planning-state`, `change-delta-state`,
68
- `spec-state`, `tech-state`, `lessons-state`. Before the first mutation run
69
- `strict-spec-cli yaml-authoring-protocol <artifact-kind>` for each of them:
70
- that command reports the ordered authoring steps, the owning command for each
71
- operation, and the bundled schema and example keys with their cache-resolved
72
- paths, bound to the artifact kind and current where a copy would go stale.
73
- Validate the result with `strict-spec-cli verify <change-name>`,
34
+ This skill writes `change-planning-state`, `change-delta-state`, `spec-state`,
35
+ `tech-state`, `lessons-state`. Before its first mutation, run
36
+ `strict-spec-cli yaml-authoring-protocol <artifact-kind>` for each kind and
37
+ follow it, including its rule to stop and report a missing command rather than
38
+ work around it; validate the result with `strict-spec-cli verify <change-name>`,
74
39
  `strict-spec-cli lesson-status`.
75
40
 
76
- **Stop rather than edit YAML directly.** When a required command, argument, or
77
- artifact kind is unavailable, stop and report the missing capability. Editing
78
- the YAML directly, writing a raw payload, or scripting around the CLI is never
79
- an available fallback, and an unavailable command is a reason to stop rather
80
- than a reason to improvise.
81
-
82
41
  ## Preferred Human Language
83
42
 
84
- Comply with `preferred_human_language` from `.strict-spec-driven/config.yaml` —
85
- the user's common human language, not a programming language — for all
86
- user-facing and generated operator-facing text, unless that file is absent or
87
- the active user message asks otherwise.
43
+ Write user-facing and generated operator-facing text in the human language named
44
+ by `preferred_human_language` in `.strict-spec-driven/config.yaml`, unless the
45
+ active user message asks otherwise.
88
46
 
89
47
  ## Delegated Procedures
90
48
 
91
- Each procedure below is owned by the skill named beside it. That skill's
92
- guidance is authoritative for it, and this skill does not restate it. Follow the
93
- owning skill's procedure at the step that needs it; how it is loaded is whatever
94
- the running harness provides.
49
+ Each procedure below is owned by the skill named beside it, whose guidance is
50
+ authoritative; follow it at the step that needs it, however the running harness
51
+ loads it.
95
52
 
96
53
  - requirement-interrogation: owned by `strict-spec-propose`
97
54
  - change-intake-gate: owned by `strict-spec-propose`
98
55
  - spec-artifact-routing: owned by `strict-spec-propose`
56
+ - task-list-authoring: owned by `strict-spec-propose`
99
57
  - delta-artifact-authoring: owned by `strict-spec-propose`
100
58
  - implementation-order: owned by `strict-spec-apply`
59
+ - review-independence: owned by `strict-spec-review`
101
60
  - lesson-outcome: owned by `strict-spec-review`
102
61
 
103
- Delegation moves where a procedure is stated, never whether it runs. Every gate
104
- this skill declares below still binds, and a delegated procedure that cannot be
105
- followed stops the run exactly as an inline one would.
106
-
107
- What a bugfix adds to those procedures stays here, at the step that needs it.
108
- The one that shapes every later step: interrogate the defect's real impact and
109
- the outcome the requester expects, not the patch you already have in mind.
62
+ Delegation moves where a procedure is stated, never whether it runs: every gate
63
+ below still binds, and a delegated procedure that cannot be followed stops the
64
+ run. What a bugfix adds stays at the step that needs it, and the one that shapes
65
+ every step is to interrogate the defect's real impact and the outcome the
66
+ requester expects, not the patch already in mind.
110
67
 
111
68
  ## Steps
112
69
 
@@ -114,172 +71,91 @@ Before any other step, run `strict-spec-cli check-workflow-state`. If `.strict-s
114
71
  missing, stop immediately and tell the user to run `/strict-spec-init`. Do not
115
72
  run `init` from this skill.
116
73
 
117
- 1. **Confirm bugfix fit** — use this skill only when the issue is a known bug:
118
- observed incorrect behavior, expected behavior, affected path or component,
119
- and reproduction evidence or a credible failing assertion are available. If
120
- the issue cannot be reproduced or needs evidence gathering before code
121
- changes, stop and recommend `strict-spec-brainstorm`, which interrogates the
122
- problem before any scope is committed. If the request is a new product
123
- behavior or a broad design decision, stop and recommend
124
- `strict-spec-brainstorm` or `strict-spec-propose`.
125
-
126
- 2. **Reset context from targeted files** — treat prior chat context as stale
127
- unless it has been revalidated from current repository state. Read:
128
- - `.strict-spec-driven/config.yaml`
129
- - `.strict-spec-driven/specs/INDEX.yaml`
130
- - every strict YAML main spec the bug appears to violate or touch, if any;
131
- for a purely internal defect, confirm from the spec index that no main spec
132
- requirement is implicated instead of forcing one
133
- - the relevant implementation and test files
134
- - the applicable technical standards by running
135
- `strict-spec-cli tech-status` and reading the relevant files under
136
- `.strict-spec-driven/tech/`
137
- - the recorded experience that may bear on this defect by running
138
- `strict-spec-cli lesson-status --category <category>` for the category matching the failing
139
- area and matching its `applies_when` conditions
140
- against the failing area. Lessons carry no MUST or SHOULD strength; treat
141
- them as warnings worth checking, and weight a lesson with several
142
- occurrences because it has bitten this project repeatedly.
143
- Use this evidence to run the delegated change-intake-gate procedure before
144
- asking the human or continuing into implementation.
145
-
146
- 3. **Reproduce before fixing** — prove the failure before making production
147
- code changes. Reading code and inferring a likely defect is not enough to
148
- edit production code.
149
- - Use an existing failing test, a new minimal failing regression test, or a
150
- deterministic command that demonstrates the defect.
151
- - If reproduction is impossible in the local environment because of missing
152
- dependencies, credentials, fixtures, services, platform state, or unclear
153
- reproduction steps, record the blocker in `questions.yaml` and stop before
154
- implementation.
155
- - Do not use this skill for unclear or unreproduced issues. Route evidence
156
- gathering to `strict-spec-brainstorm` instead of making a source-level fix
157
- from code inspection alone.
158
-
159
- 4. **Propose or resume a narrow change** — derive a short kebab-case change
160
- name from the defect, usually starting with `fix-`. If the change does not
161
- exist, run:
162
- ```bash
163
- strict-spec-cli propose <change-name>
164
- ```
165
- If a populated change already exists, resume it without regenerating
166
- planning artifacts.
167
-
168
- 5. **Populate bugfix planning artifacts** — for new or empty scaffolds, generate
169
- supported artifacts in this order and keep every artifact scoped to the bug.
170
- - `proposal.yaml`: state the observed bug, expected behavior, why the
171
- current behavior violates a strict spec or intended contract, in-scope
172
- affected paths, explicit out-of-scope adjacent issues, and unchanged
173
- behavior.
174
- - `design.yaml`: record the minimal fix strategy, why the fix belongs at the
175
- selected layer, and any risk to unchanged behavior.
176
- - `tasks.yaml`: use concrete sections for Reproduction, Implementation,
177
- Testing, and Verification. Include a failing-regression-test or equivalent
178
- deterministic reproduction task before the production fix. Testing tasks
179
- must include runnable `command` fields. For technical-only bugfixes,
180
- include the concrete scripts, tooling, generated assets, documentation, or
181
- skill-prompt edits in scope; include validation, strict `ready`/`verify`,
182
- and archive-readiness or archive-merge checks when relevant.
183
- The reproduction task must come first in list order, so place a task with
184
- `--before <task-id>` or `--after <task-id>` instead of letting it append;
185
- task order is the order `apply` walks, so a task that must run before
186
- existing pending work is anchored rather than appended, and naming an
187
- existing task id with an anchor moves it there while preserving its
188
- `status` and `command`.
189
- - `questions.yaml`: resolve the seeded requirement questions through the
190
- delegated requirement-interrogation procedure. Leave `open: []` only when
191
- reproduction, scope, expected behavior, and regression validation are all
192
- clear. Otherwise record the missing decision and stop before
193
- implementation.
194
- - delta specs: route them with the delegated spec-artifact-routing and
195
- delta-artifact-authoring procedures, and prefer `MODIFIED` operations when
196
- the bug corrects an existing requirement; use `ADDED` only when the
197
- expected behavior is not already represented. Leave `specs/` empty only for
198
- a purely internal defect with no observable spec impact.
199
-
200
- 6. **Run the proposal checkpoint** — before implementation, semantically check
201
- every generated or edited file under `.strict-spec-driven/changes/<change-name>/`
202
- against the known bug, reproduction evidence, expected behavior, relevant
203
- main specs, applicable technical standards, unchanged behavior, task
204
- coverage, unresolved-question impact, delta spec scenarios, and delta tech
205
- use when applicable. When no delta specs are appropriate, replace delta spec
206
- scenario review with a justified absence check for the technical-only bugfix. For technical-only bugfixes, verify that
207
- tasks cover reproduction evidence, scripts or tooling, validation commands,
208
- `ready`/`verify`, and archive or archive-merge checks when archive behavior
209
- is affected. The checkpoint should fix safe, in-scope
210
- documentation gaps immediately. Do not expand scope or answer unresolved
211
- human questions silently.
212
-
213
- 7. **Validate readiness** — run:
214
- ```bash
215
- strict-spec-cli ready <change-name>
216
- ```
217
- If you use `verify` before implementation, treat pending-task diagnostics as
218
- expected. If `questions.yaml.open` is not empty, explain each blocker,
219
- recommend concrete answers or options with tradeoffs, and stop.
74
+ 1. **Confirm bugfix fit** — a known bug has observed and expected behavior, an
75
+ affected path, and reproduction evidence or a credible failing assertion.
76
+ Route an issue that cannot be reproduced or still needs evidence gathering
77
+ to `strict-spec-brainstorm`, and new product behavior or a broad design
78
+ decision to `strict-spec-brainstorm` or `strict-spec-propose`, then stop.
79
+
80
+ 2. **Load context** — treat prior chat as stale until revalidated. Read the
81
+ config, the spec index and every main spec the bug violates or touches (for
82
+ an internal defect, confirm none is implicated), the implementation and test
83
+ files, the standards `tech-status` shows apply, and the lessons
84
+ `lesson-status --category <category>` ranks for the failing area by
85
+ `applies_when` — warnings weighted by occurrence, not rules. Then run the
86
+ delegated change-intake-gate from that evidence.
87
+
88
+ 3. **Reproduce before fixing** — prove the failure with an existing failing
89
+ test, a new minimal failing regression test, or a deterministic command;
90
+ code inspection alone never justifies a production edit. When reproduction
91
+ is impossible locally, record the blocker in `questions.yaml` and stop, or
92
+ route the investigation to `strict-spec-brainstorm`.
93
+
94
+ 4. **Propose or resume a narrow change** — `propose` a short kebab-case name,
95
+ usually `fix-…`; resume a populated change without regenerating it.
96
+
97
+ 5. **Plan the fix** — every artifact stays scoped to the bug.
98
+ - The proposal states observed and expected behavior, the spec or contract
99
+ violated, affected paths, adjacent issues out of scope, and unchanged
100
+ behavior; the design records the minimal fix, why it belongs at that
101
+ layer, and its risk to unchanged behavior.
102
+ - Tasks follow the delegated task-list-authoring procedure, with the
103
+ failing-regression task anchored ahead of the production fix; a
104
+ technical-only fix still covers reproduction evidence, validation
105
+ commands, `ready`/`verify`, and archive or archive-merge checks.
106
+ - The seeded requirement questions go through the delegated
107
+ requirement-interrogation procedure; `open` empties only once
108
+ reproduction, scope, expected behavior, and regression validation are
109
+ clear.
110
+ - Delta specs follow the delegated spec-artifact-routing and
111
+ delta-artifact-authoring procedures, preferring `MODIFIED` when the bug
112
+ corrects an existing requirement; `specs/` stays empty only for a purely
113
+ internal defect.
114
+
115
+ 6. **Run the proposal checkpoint** — check every change artifact against the
116
+ bug, its reproduction evidence, expected behavior, main specs, standards,
117
+ unchanged behavior, task coverage, unresolved-question impact, and delta
118
+ spec and delta tech use. Fix safe in-scope documentation gaps; never expand
119
+ scope or silently answer a human question.
120
+
121
+ 7. **Validate readiness** — `ready <change-name>` must pass; with open
122
+ questions, explain each blocker with recommended answers and stop.
220
123
 
221
124
  8. **Implement the minimal fix** — follow the delegated implementation-order
222
- procedure, and hold it to the bugfix's narrower bar:
223
- - Create or confirm the failing regression evidence before production edits.
224
- - Make the smallest production change that satisfies the expected behavior.
225
- - Preserve every `proposal.yaml.unchanged_behavior` item.
226
- - Do not opportunistically refactor, rename, reformat, or fix adjacent bugs
227
- unless required for the target bugfix.
228
-
229
- 9. **Run regression evidence** — complete every Testing task by running its
230
- `command`. The targeted regression must fail before the fix and pass after
231
- the fix. If the before/after evidence cannot be produced locally, leave the
232
- implementation unstarted or unarchived and record the blocker instead of
233
- claiming the bug is fixed. Then run the configured complete project-level
234
- regression command from `.strict-spec-driven/config.yaml` before archive.
235
- That evidence survives the lesson declaration in step 11: a write the
236
- configured regression command neither compiles nor reads — currently a
237
- change-local delta-tech artifact or a lesson — does not invalidate passing
238
- complete project regression evidence. Any other write after it, including a
239
- delta-spec, a planning artifact, or a source or test file, forces a rerun
240
- before archive.
241
-
242
- 10. **Verify and review before archive** — run:
243
- ```bash
244
- strict-spec-cli verify <change-name>
245
- ```
246
- When the running harness provides it, hand this review to
247
- a sub-agent started with a fresh context, briefed with the change name and
248
- this step rather than an account of the fix; it reads and reports,
249
- edits no file, and you keep the fixes and reruns that follow.
250
- This is a recommendation, not a requirement: without such a capability, or
251
- when the operator prefers otherwise, review in the current context to the
252
- same standard. The reviewer reads the
253
- changed implementation, tests, strict artifacts, relevant main specs, and
254
- tracked diff directly. Check correctness, spec alignment,
255
- unchanged behavior, regression assertions, error handling, and technical
256
- standard compliance. Automatically fix safe in-scope review findings and
257
- rerun strict verification plus the configured complete regression command
258
- after review-time changes. Do not call or rely on a `strict-spec-cli review` command.
125
+ procedure under a narrower bar: the failing regression exists before any
126
+ production edit, the change is the smallest that meets the expected
127
+ behavior, every `unchanged_behavior` item holds, and no adjacent refactor,
128
+ rename, reformat, or fix rides along unless the target fix requires it.
129
+
130
+ 9. **Run regression evidence** — run every Testing task's command: the targeted
131
+ regression fails before the fix and passes after it, or the blocker is
132
+ recorded and the bug is not claimed fixed. Then run the configured complete
133
+ project regression command from `.strict-spec-driven/config.yaml`. That
134
+ evidence survives step 11: a write the configured regression command neither
135
+ compiles nor reads — currently a change-local delta-tech artifact or a
136
+ lesson — does not invalidate passing complete project regression evidence.
137
+ Any other later write, a delta spec, planning artifact, source, or test file
138
+ included, forces a rerun before archive.
139
+
140
+ 10. **Verify and review** — `verify <change-name>`, then direct review under the
141
+ delegated review-independence procedure, reading the changed code, tests,
142
+ strict artifacts, main specs, and diff yourself; no `strict-spec-cli review`
143
+ command stands in for it. Fix safe in-scope findings, then rerun `verify`
144
+ and the complete regression command.
259
145
 
260
146
  11. **Declare the lesson outcome (required)** — follow the delegated
261
- lesson-outcome procedure before archiving. A defect that reached a fix is
262
- direct evidence about why the existing tests and technical standards failed
263
- to catch it, which is the reusable part of a bugfix, so the trigger to
264
- record one is a gap that will let the next defect through too — a missing
265
- test shape, a misleading error message, an invariant nothing enforces. A fix
266
- for a plain typo teaches nothing and is declared "no lesson".
147
+ lesson-outcome procedure. Record a lesson when the gap that let this defect
148
+ through — a missing test shape, a misleading error, an unenforced invariant
149
+ — will let the next one through too; a plain typo is "no lesson".
267
150
 
268
- 12. **Archive only when clean** — archive only after strict verification,
269
- direct review, targeted regression, and complete regression evidence pass:
270
- ```bash
271
- strict-spec-cli archive <change-name>
272
- ```
273
- Summarize the fixed bug, regression evidence, updated specs, archive
274
- destination, and any follow-up that remains outside the bugfix scope.
151
+ 12. **Archive only when clean** — `archive <change-name>` once strict
152
+ verification, direct review, targeted regression, and complete regression
153
+ evidence pass; summarize the bug, evidence, updated specs, archive
154
+ destination, and follow-up outside the fix's scope.
275
155
 
276
156
  ## Rules
277
157
 
278
- - Use this skill for known bug fixes, not open-ended design or investigation.
279
- - Reproduce before fixing; code inspection alone is not sufficient evidence to
280
- modify production code.
281
- - Use regression evidence that fails before the fix and passes after it.
282
- - Keep the change narrow and preserve documented unchanged behavior.
283
- - Do not implement adjacent fixes or refactors unless required for the target bug.
284
- - Stop for explicit human input when reproduction, expected behavior, or scope is ambiguous.
285
- - Archive only after strict verification, direct review, targeted regression, and complete project regression evidence pass.
158
+ - Known bugs only; unclear or unreproduced issues go to `strict-spec-brainstorm`.
159
+ - Reproduce before fixing, keep the fix minimal, preserve unchanged behavior,
160
+ and stop for a human answer when reproduction, expected behavior, or scope is
161
+ ambiguous.
@@ -8,23 +8,14 @@ metadata:
8
8
  version: 1.0.0
9
9
  ---
10
10
 
11
- You are helping the user author or refresh `.strict-spec-driven/design-system.yaml`
12
- and render the generated design document from it.
13
-
14
- `DESIGN.md` is a generated file. It is never hand-edited. It is rendered in the
15
- design.md interchange format: YAML front matter carrying the machine-readable
16
- design tokens, then a generated banner, then the canonical sections. Your job is
17
- the design-system artifact; the CLI owns rendering, comparison, and validation.
18
-
19
- The design-system artifact is optional. A project with no user interface — a
20
- library, a backend service, a CLI — simply does not have one, and `init`
21
- deliberately does not scaffold it. Do not create one to satisfy artifact shape.
11
+ Author or refresh `.strict-spec-driven/design-system.yaml` from the interface's
12
+ real visual identity and render `DESIGN.md` from it. The document is generated
13
+ and never hand-edited; the CLI owns rendering, comparison, and validation. The
14
+ artifact is optional: a project with no user interface has none, and `init`
15
+ never scaffolds one.
22
16
 
23
17
  ## This Skill's Commands
24
18
 
25
- If you cannot remember the exact command used by this skill, look it up here
26
- before running anything. Do not guess.
27
-
28
19
  ```yaml
29
20
  check-workflow-state: strict-spec-cli check-workflow-state
30
21
  design-status: strict-spec-cli design-status
@@ -39,51 +30,31 @@ tech-status: strict-spec-cli tech-status
39
30
 
40
31
  ## CLI-Only YAML Authoring Protocol
41
32
 
42
- Every mutation of repository-owned YAML in this skill goes through the strict
43
- CLI. This skill writes `design-system-state`. Before the first mutation run
44
- `strict-spec-cli yaml-authoring-protocol design-system-state`: that command
45
- reports the ordered authoring steps, the owning command for each operation, and
46
- the bundled schema and example keys with their cache-resolved paths, bound to
47
- the artifact kind and current where a copy would go stale. Validate the result
48
- with `strict-spec-cli design-status`.
49
-
50
- **Stop rather than edit YAML directly.** When a required command, argument, or
51
- artifact kind is unavailable, stop and report the missing capability. Editing
52
- the YAML directly, writing a raw payload, or scripting around the CLI is never
53
- an available fallback, and an unavailable command is a reason to stop rather
54
- than a reason to improvise.
33
+ This skill writes `design-system-state`. Before its first mutation, run
34
+ `strict-spec-cli yaml-authoring-protocol <artifact-kind>` for each kind and
35
+ follow it, including its rule to stop and report a missing command rather than
36
+ work around it; validate the result with `strict-spec-cli design-status`.
55
37
 
56
38
  ## Preferred Human Language
57
39
 
58
- Comply with `preferred_human_language` from `.strict-spec-driven/config.yaml` —
59
- the user's common human language, not a programming language — for all
60
- user-facing and generated operator-facing text, including generated design
61
- prose, unless that file is absent or the active user message asks otherwise.
40
+ Write user-facing and generated operator-facing text in the human language named
41
+ by `preferred_human_language` in `.strict-spec-driven/config.yaml`, including
42
+ generated design prose, unless the active user message asks otherwise.
62
43
 
63
44
  ## What Belongs in the Design-System Artifact
64
45
 
65
- The strict workflow splits user interface work three ways. This artifact owns
66
- exactly one of them.
67
-
68
- - **This artifact — visual identity.** The design tokens the interface is built
69
- from (`tokens.colors`, `tokens.typography`, `tokens.layout`,
70
- `tokens.elevation`, `tokens.shapes`), the `components` that consume those
71
- tokens, and the `guidance` that explains the identity.
72
- - **Main spec requirements — observable UI behavior.** What is shown, what is
73
- interactive, how state changes, and the loading, error, and empty conditions.
74
- These belong in a strict main spec, not here.
75
- - **`ui`-category technical standards — UI engineering rules.** Design-system
76
- usage rules, styling conventions, accessibility baselines, and
77
- internationalization. These belong in `.strict-spec-driven/tech/`, not here.
78
-
79
- Pixel-level visual fidelity is governed by visual-regression snapshots. Reference
80
- them from `components.<id>.mapping.snapshots` so `design-status` can report a
81
- snapshot path that no longer exists; never inline pixel detail into the artifact.
82
-
83
- Token groups are fixed by the schema, but the entries inside each group are
84
- open: no schema decides what a project's palette or spacing scale is named. A
85
- token group you do not declare is omitted from the rendered document rather than
86
- rendered empty, so declare only what the project actually has.
46
+ User interface work splits three ways, and this artifact owns only the first:
47
+
48
+ - **Visual identity** — design tokens, the components that consume them, and the
49
+ guidance explaining the identity. Pixel fidelity stays in visual-regression
50
+ snapshots the components reference by path, never inlined.
51
+ - **Observable UI behavior** — what is shown, what is interactive, state
52
+ changes, and loading, error, and empty conditions — belongs in a main spec.
53
+ - **UI engineering rules** — design-system usage, styling, accessibility, and
54
+ internationalization — belong in a `ui`-category technical standard.
55
+
56
+ Declare only token groups and entries the project actually has; an undeclared
57
+ group is omitted from the rendered document.
87
58
 
88
59
  ## Steps
89
60
 
@@ -91,78 +62,38 @@ Before any other step, run `strict-spec-cli check-workflow-state`. If
91
62
  `.strict-spec-driven/` is missing, stop immediately and tell the user to run
92
63
  `/strict-spec-init`. Do not run `init` from this skill.
93
64
 
94
- 1. **Check workflow state** — run `strict-spec-cli check-workflow-state` first.
95
-
96
- 2. **Read the current state** — run `strict-spec-cli design-status`. It reports
97
- whether the artifact validates, how many token groups, tokens, and components
98
- it declares, and which mapped implementation and snapshot paths no longer
99
- exist. Treat reported mapping drift as work to do: a component mapped to a
100
- deleted file is either a stale mapping or a component that no longer exists.
101
- The command exits non-zero when the artifact is absent, which is the expected
102
- state for a project that has no user interface.
103
-
104
- 3. **Create the artifact when it is absent** — once the project is confirmed to
105
- have a user interface, run `strict-spec-cli design-init`. It writes a
106
- schema-valid skeleton with empty token and component collections so you edit a
107
- valid artifact instead of composing one from nothing, and it reports an
108
- existing artifact as skipped rather than overwriting it, so it is safe to run
109
- before a refresh. `init` never creates this artifact, so this is the only way
110
- to scaffold it.
111
-
112
- 4. **Inspect the schema when the shape is unclear** — run
113
- `strict-spec-cli schema-show design-system` and
114
- `strict-spec-cli sample-show design-system`. Do not guess field names.
115
-
116
- 5. **Gather evidence before writing** — derive tokens from what the interface
117
- actually uses, not from an idealized palette: read the stylesheets, theme
118
- files, component library configuration, and existing UI source. Run
119
- `strict-spec-cli tech-status` and read any `ui`-category standard so the
120
- identity you record is consistent with the rules that bind the code.
121
-
122
- 6. **Write or update `.strict-spec-driven/design-system.yaml` through the CLI** — invoke `strict-spec-cli design-edit` once per identity, token, component, guidance, mapping, snapshot, or exact named removal. Never edit the YAML directly. Keep token and
123
- component ids stable across edits: they are the anchors readers, diffs, and
124
- component token references rely on. Preserve authoring order within a group,
125
- because the renderer emits entries in document order. Reference tokens from
126
- components by their dotted path, such as `colors.primary`, so a reader can
127
- follow a component property back to the token that defines it.
128
-
129
- 7. **Render the document** — run `strict-spec-cli design-generate`. It writes
130
- `DESIGN.md` at the repository root, or the path given to `--output`.
131
-
132
- 8. **Confirm the result** — run `strict-spec-cli design-status` again for a clean
133
- validation and no mapping drift, then `strict-spec-cli design-generate --check`
134
- to confirm the rendered document matches its source. Check mode exits non-zero
135
- and names the stale source artifact when it does not.
136
-
137
- ## Detecting Staleness Later
138
-
139
- `strict-spec-cli design-generate --check` is the drift gate. It renders in
140
- memory, compares against the file on disk, never writes, and exits non-zero when
141
- the document is stale or absent, naming which source artifact changed. It is an
142
- on-demand check: it is deliberately not wired into `verify`, `ready`, or
143
- `archive`. A project that wants it run on a schedule instead declares a
144
- `generated-doc-check` entry under `maintenance.checks` in
145
- `.strict-spec-driven/config.yaml`, which reports a stale document as a
146
- maintenance finding.
147
-
148
- That check compares the document against the artifact. It cannot tell that the
149
- artifact itself has fallen behind the interface code — that a component was
150
- deleted or a palette retuned. Use `/strict-spec-design-sync` for that: it scans
151
- the UI sources, reports the divergence, and reconciles the artifact after you
152
- confirm each edit.
65
+ 1. **Read the current state** — run `design-status`; it exits non-zero when the
66
+ artifact is absent, which is expected for a project with no interface.
67
+ Fix reported mapping drift; never delete a mapping to silence it.
68
+
69
+ 2. **Create the artifact when absent** — only once the project is confirmed to
70
+ have a user interface, run `design-init` for a valid skeleton; it never
71
+ overwrites an existing artifact.
72
+
73
+ 3. **Gather evidence** — derive tokens and components from the stylesheets,
74
+ theme files, component-library configuration, and UI source the interface
75
+ actually uses, and run `tech-status` to read any `ui` standard.
76
+ `schema-show design-system` and `sample-show design-system` render the shape.
77
+
78
+ 4. **Write through `design-edit`** — one named upsert or exact removal at a
79
+ time; read `strict-spec-cli design-edit --help --json` for its arguments.
80
+ Keep token and component ids stable, since components reference tokens by
81
+ dotted path such as `colors.primary`, and keep authoring order, which is
82
+ render order.
83
+
84
+ 5. **Render and confirm** — run `design-generate`, then `design-status` and
85
+ `design-generate --check`. Done when status is clean with no mapping drift
86
+ and the check passes.
87
+
88
+ `design-generate --check` is the on-demand artifact-to-document drift gate
89
+ (schedulable as the `generated-doc-check` maintenance check); drift between the
90
+ artifact and the interface code is `strict-spec-design-sync`'s job.
153
91
 
154
92
  ## Rules
155
93
 
156
94
  - Never hand-edit `DESIGN.md` or any file carrying the generated banner; change
157
- the source artifact and re-render
158
- - Never hand-edit `.strict-spec-driven/design-system.yaml`; use `design-edit` named fields and removals so unrelated entries are preserved and the full candidate validates before commit
159
- - Never record observable UI behavior or UI engineering rules here; they belong
160
- in main specs and `ui`-category technical standards respectively
161
- - Keep token and component ids stable; renaming an id is a content change
162
- readers see as a deletion plus an addition, and it silently breaks every
163
- component token reference that points at it
164
- - Map components to real repo-relative implementation and snapshot paths and fix
165
- mapping drift rather than deleting the mapping to silence it
166
- - Do not create a design-system artifact for a project with no user interface,
167
- and do not invent tokens or components the interface does not have; ask the
168
- user when the intended identity is genuinely ambiguous
95
+ the source artifact and re-render.
96
+ - Never edit `.strict-spec-driven/design-system.yaml` directly; use
97
+ `design-edit`.
98
+ - Do not create an artifact for a project with no user interface, and do not
99
+ invent tokens or components; ask the user when the identity is ambiguous.