dsh-plugin-strict-spec 0.0.0-stage → 0.5.1

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 (33) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +236 -2
  3. package/README.zh.md +191 -0
  4. package/cordis.patch.yml +5 -0
  5. package/dist/cli/strict-spec-cli.js +38892 -0
  6. package/dist/client.js +50 -0
  7. package/dist/host.js +154 -0
  8. package/dist/skills/strict-roadmap-plan/SKILL.md +176 -0
  9. package/dist/skills/strict-roadmap-recommend/SKILL.md +321 -0
  10. package/dist/skills/strict-roadmap-reorder/SKILL.md +194 -0
  11. package/dist/skills/strict-roadmap-review/SKILL.md +180 -0
  12. package/dist/skills/strict-roadmap-transition/SKILL.md +323 -0
  13. package/dist/skills/strict-scene-edit/SKILL.md +156 -0
  14. package/dist/skills/strict-spec-apply/SKILL.md +212 -0
  15. package/dist/skills/strict-spec-architecture/SKILL.md +143 -0
  16. package/dist/skills/strict-spec-archive/SKILL.md +165 -0
  17. package/dist/skills/strict-spec-auto/SKILL.md +334 -0
  18. package/dist/skills/strict-spec-brainstorm/SKILL.md +228 -0
  19. package/dist/skills/strict-spec-bugfix/SKILL.md +285 -0
  20. package/dist/skills/strict-spec-design/SKILL.md +168 -0
  21. package/dist/skills/strict-spec-design-sync/SKILL.md +165 -0
  22. package/dist/skills/strict-spec-init/SKILL.md +123 -0
  23. package/dist/skills/strict-spec-maintenance/SKILL.md +130 -0
  24. package/dist/skills/strict-spec-modify/SKILL.md +148 -0
  25. package/dist/skills/strict-spec-propose/SKILL.md +553 -0
  26. package/dist/skills/strict-spec-review/SKILL.md +315 -0
  27. package/dist/skills/strict-spec-ship/SKILL.md +94 -0
  28. package/dist/skills/strict-spec-spec-edit/SKILL.md +117 -0
  29. package/dist/skills/strict-spec-sync-specs/SKILL.md +128 -0
  30. package/dist/skills/strict-spec-verify/SKILL.md +79 -0
  31. package/dist/skills/strict-tech-edit/SKILL.md +161 -0
  32. package/dist/skills/strict-tech-sync/SKILL.md +202 -0
  33. package/package.json +109 -4
@@ -0,0 +1,315 @@
1
+ ---
2
+ name: strict-spec-review
3
+ description: Review the code quality of a completed strict YAML change through direct repository evidence, changed-file reading, and complete regression evidence.
4
+ metadata:
5
+ skill_id: strict_spec_review
6
+ author: strict-spec-driven
7
+ type: agent_skill
8
+ version: 1.0.0
9
+ ---
10
+
11
+ You are reviewing the code quality of a completed strict YAML change.
12
+
13
+ ## This Skill's Commands
14
+
15
+ If you cannot remember the exact command used by this skill, look it up here
16
+ before running anything. Do not guess.
17
+
18
+ ```yaml
19
+ check-workflow-state: strict-spec-cli check-workflow-state
20
+ tech-status: strict-spec-cli tech-status
21
+ modify: strict-spec-cli modify [change-name|archive-dir]
22
+ scene-status: strict-spec-cli scene-status [--area <area>] [--scene <scene-id>]
23
+ verify: strict-spec-cli verify <change-name>
24
+ lesson-status: strict-spec-cli lesson-status [--category <category>]
25
+ lesson-create: strict-spec-cli lesson-create --title <text> --category <category> --context <text> --observation <text> --takeaway <text> --applies-when <text> --origin <text> --evidence <text>
26
+ lesson-edit: strict-spec-cli lesson-edit <lesson-id> --origin <text> --evidence <text>
27
+ ```
28
+
29
+ ## CLI-Only YAML Authoring Protocol
30
+
31
+ Every mutation of repository-owned YAML in this skill goes through the strict
32
+ CLI. This skill writes `lessons-state`. Before the first mutation run
33
+ `strict-spec-cli yaml-authoring-protocol lessons-state`: that command reports
34
+ the ordered authoring steps, the owning command for each operation, and the
35
+ bundled schema and example keys with their cache-resolved paths, bound to the
36
+ artifact kind and current where a copy would go stale. Validate the result with
37
+ `strict-spec-cli lesson-status`.
38
+
39
+ **Stop rather than edit YAML directly.** When a required command, argument, or
40
+ artifact kind is unavailable, stop and report the missing capability. Editing
41
+ the YAML directly, writing a raw payload, or scripting around the CLI is never
42
+ an available fallback, and an unavailable command is a reason to stop rather
43
+ than a reason to improvise.
44
+
45
+ ## Preferred Human Language
46
+
47
+ Comply with `preferred_human_language` from `.strict-spec-driven/config.yaml` —
48
+ the user's common human language, not a programming language — for all
49
+ user-facing and generated operator-facing text, unless that file is absent or
50
+ the active user message asks otherwise.
51
+
52
+ ## Review Independence
53
+
54
+ The agent that implemented a change is usually the agent reviewing it, so a
55
+ review written from the author's seat explains the implementation instead of
56
+ testing it, and reports clean. This section splits the review into two stances
57
+ and makes the boundary between them a written artifact rather than an intention.
58
+
59
+ **Stance one — reconstruct the requirement.**
60
+ Read only `proposal.yaml`, `design.yaml`, `questions.yaml`, and the delta specs,
61
+ and write the reconstruction down
62
+ before any implementation file, diff, or test file is read:
63
+
64
+ - the problem the change exists to solve, and the observable outcome that would
65
+ prove it solved
66
+ - the non-goals, and every `unchanged_behavior` item the result must still honor
67
+ - a numbered list of acceptance items, each independently checkable from
68
+ outside the system
69
+
70
+ Never derive the requirement from the implementation.
71
+ A requirement read off the diff is satisfied by whatever the diff happens to do,
72
+ which is exactly the failure this ordering exists to prevent. When the change
73
+ carries no delta spec, build the acceptance items from `proposal.yaml`'s
74
+ `summary.what`, `scope.in`, and `unchanged_behavior` plus the `design.yaml`
75
+ decisions, so the list is never empty.
76
+
77
+ **Stance two — verify from outside.** Now read the changed files as
78
+ an outside reviewer who did not write them.
79
+ Knowing why the code took its shape has no standing here: a justification that
80
+ exists only in your memory of writing it is not evidence, and the review reports
81
+ what the repository can be shown to do.
82
+
83
+ **Verdicts.** Answer every numbered acceptance item with exactly one of
84
+ `satisfied`, `not satisfied`, or `unprovable from evidence`,
85
+ and give each verdict
86
+ an implementation reference and a test reference
87
+ — file and line where the evidence exists, or a statement of what is missing
88
+ where it does not. A blanket claim that the implementation matches the proposal
89
+ is not a substitute for per-item verdicts,
90
+ and an acceptance item no test covers is not `satisfied`.
91
+
92
+ `unprovable from evidence` on a MUST-strength delta spec requirement is a MUST
93
+ FIX finding that
94
+ blocks the archive recommendation
95
+ until a test or an explicit human decision resolves it. On any other acceptance
96
+ item it is a SHOULD FIX finding that must be reported but does not block.
97
+
98
+ **Fresh-context reviewer.** When the running harness provides it, hand the
99
+ review to a sub-agent started with a fresh context. It carries no memory of
100
+ writing the change, and its file reading stays out of the implementing context
101
+ that the later steps still run in. Brief it with the change name and this
102
+ skill's procedure, never with an account of how the change was implemented: a
103
+ briefing that explains the code carries the author's seat into the fresh
104
+ context. The reviewer performs steps 3 through 8 from repository evidence
105
+ alone, edits no file, and returns the step 6 verdict table with its findings
106
+ and any convention candidate for step 11; the implementing agent then resumes
107
+ at step 9 and keeps the fixes, the reruns, the lesson outcome, and the archive
108
+ decision.
109
+ This is a recommendation, not a requirement: when no such capability is
110
+ available, or the operator prefers otherwise, perform the review in the current
111
+ context under the same two stances. The review standard is the same either way.
112
+
113
+ ## Steps
114
+
115
+ Before any other step, run `strict-spec-cli check-workflow-state`. If `.strict-spec-driven/` is
116
+ missing, stop immediately and tell the user to run `/strict-spec-init`. Do not
117
+ run `init` from this skill.
118
+
119
+ 1. **Select the change** — run `modify` without an argument to list active
120
+ changes. If the change is already specified, use it.
121
+
122
+ 2. **Confirm readiness** — run:
123
+ ```bash
124
+ strict-spec-cli verify <change-name>
125
+ ```
126
+ If verification reports blockers, stop and resolve them before review.
127
+
128
+ 3. **Reconstruct the requirement** — stance one from Review Independence. When
129
+ a fresh-context reviewer is used, steps 3 through 8 run inside it and this
130
+ skill resumes at step 9 with its report. Read only:
131
+ - `proposal.yaml`
132
+ - `design.yaml`
133
+ - `questions.yaml`
134
+ - every strict YAML delta spec in `changes/<name>/specs/`
135
+ - every strict YAML delta scene in `changes/<name>/scenes/`, if present,
136
+ which states the situation the requirements were derived from
137
+ - every strict YAML delta tech artifact in `changes/<name>/tech/`, if present
138
+
139
+ Write down the problem, the observable outcome, the non-goals and
140
+ `unchanged_behavior` items, and the numbered acceptance items. Do not open a
141
+ changed file, a diff, or a test in this step.
142
+
143
+ 4. **Load the implementation context** — only now read:
144
+ - `git status --short` and the relevant diff for changed tracked files
145
+ - the implementation and test files mapped to the delta specs
146
+ - any newly created untracked source, test, documentation, or strict workflow
147
+ files that belong to the change
148
+ - the technical standards that govern the changed files: run
149
+ `strict-spec-cli tech-status` and read the
150
+ relevant files under `.strict-spec-driven/tech/`
151
+
152
+ 5. **Read every changed file yourself** — perform an author-agnostic code
153
+ review from repository evidence. Do not call a `strict-spec-cli review`
154
+ command and do not treat any deterministic script as a substitute for code
155
+ review.
156
+
157
+ 6. **Record a verdict for every acceptance item** — resolve each numbered item
158
+ from step 3 to one of the three verdicts with its evidence, before writing any
159
+ finding. A verdict reached by recalling what was implemented rather than by
160
+ locating it in the repository is not a verdict.
161
+
162
+ 7. **Apply the review checklist** — evaluate findings across:
163
+ - correctness and behavioral regressions
164
+ - strict spec alignment and `unchanged_behavior`
165
+ - test coverage, test independence, and test assertions
166
+ - error handling and edge cases
167
+ - security and unsafe input handling
168
+ - performance or scalability risks
169
+ - maintainability, readability, and unnecessary abstraction
170
+ - user-visible CLI or documentation behavior
171
+ - generated artifacts, build output, and packaging impact
172
+ - technical-standard compliance: every changed file must satisfy the
173
+ applicable MUST and SHOULD rules under `.strict-spec-driven/tech/`. A MUST
174
+ violation is a MUST FIX finding; an unjustified SHOULD violation is at
175
+ least a SHOULD FIX finding. A deviation is acceptable only when the
176
+ change's `design.yaml` records an explicit justification for it.
177
+ - delta tech correctness: when the change carries delta tech artifacts under
178
+ `changes/<name>/tech/`, confirm each standard change is justified by
179
+ `proposal.yaml`/`design.yaml`, that the `operations` target the right rule
180
+ ids, that `ADDED` rules do not duplicate existing rules, and that a new
181
+ standard supplies a `standard` block with title and category. Flag an
182
+ unjustified or incorrect standard change as a MUST FIX finding.
183
+
184
+ 8. **Check spec alignment** — confirm the implementation and tests match the
185
+ strict YAML delta specs and do not violate `unchanged_behavior`. When the
186
+ change carries delta scenes, also run
187
+ `strict-spec-cli scene-status --scene <scene-id>` for each one and read the
188
+ coverage state of every flow step. `verify` already blocks a step naming
189
+ neither a covering requirement nor an explicit no-coverage reason, so what
190
+ review adds is judgment the gate cannot apply: whether a recorded
191
+ no-coverage reason is a real decision rather than a way to silence a gap, and
192
+ whether a covering requirement genuinely covers the step it is attached to. A
193
+ hollow waiver or a mismatched covering reference is a MUST FIX finding.
194
+
195
+ 9. **Fix safe in-scope findings** — if review finds MUST FIX issues that are
196
+ safe to repair within the current strict change scope, make those fixes
197
+ automatically before reporting the review as complete. If any review-time
198
+ code or workflow artifact changes are made, rerun strict verification and
199
+ the configured complete project regression command before recommending
200
+ archive. Unsafe, ambiguous, blocked, or out-of-scope fixes must remain
201
+ reported as blockers instead of being inferred or silently expanded.
202
+
203
+ 10. **Confirm complete regression evidence** — inspect project workflow context,
204
+ including `.strict-spec-driven/config.yaml` when available, for the complete
205
+ project-level regression test method. Require evidence that the full project
206
+ regression command has passed before recommending archive. When the config
207
+ declares a coverage contract under
208
+ `review_evidence.project_regression.coverage`, the regression command is the
209
+ coverage gate: a non-zero exit because measured coverage fell below the
210
+ declared threshold is blocking review evidence exactly like failing tests,
211
+ never advisory output. Do not measure coverage yourself or second-guess the
212
+ threshold — the project's configured command owns measurement and
213
+ enforcement. If the command cannot run because dependencies, services,
214
+ credentials, fixtures, or other test conditions are unavailable, treat
215
+ archive recommendation as blocked and give the human actionable setup or
216
+ waiting guidance instead of inferring a clean result.
217
+
218
+ The evidence collected here survives the two steps that follow it: a write
219
+ the configured regression command neither compiles nor reads — currently a
220
+ change-local delta-tech artifact or a lesson — does not invalidate passing
221
+ complete project regression evidence, so recording the lesson in step 12 or
222
+ capturing a convention as delta tech in step 11 costs no rerun. Every other
223
+ write, including a delta-spec, a planning artifact, and any source or test
224
+ file, does invalidate it and forces the command to be rerun before archive is
225
+ recommended.
226
+
227
+ 11. **Reflect on uncaptured engineering conventions (non-blocking)** — after the
228
+ review checklist, consider whether this change established a reusable
229
+ engineering convention not yet captured under `.strict-spec-driven/tech/` (a
230
+ coding, architecture, testing, tooling, security, performance, or API rule).
231
+ When it did, report the finding with the recommendation you derived — the
232
+ target standard, operation, rule id, strength, statement, rationale, and
233
+ enforcement you would capture, or the reason the pattern is specific to this
234
+ change. Do not put that choice to the operator. You may carry it now as a
235
+ delta tech artifact under `changes/<name>/tech/` so archive merges it into the
236
+ standards; otherwise the mandatory final current-change tech sync in
237
+ `strict-spec-archive` applies that recommendation before archive is invoked.
238
+ This early reflection does not by itself block strict verification or review
239
+ completion. However, a convention confirmed as reusable may not be deferred
240
+ until after archive: the final archive checkpoint captures it as
241
+ current-change delta tech or records that the surfaced pattern is not
242
+ reusable.
243
+
244
+ 12. **Declare the lesson outcome (required)** — before reporting, state
245
+ explicitly either that a lesson was recorded or that none applies, with the
246
+ reason. Judge this from the objective proposal-versus-implementation diff,
247
+ not from a general sense of having learned something. Record a lesson when
248
+ any of these is true:
249
+ - a `design.yaml` decision or approach was overturned during implementation
250
+ - a question surfaced that the proposal did not foresee
251
+ - a task was added because of a discovery rather than a scope change
252
+ - a regression failure exposed a trap that this change did not introduce
253
+
254
+ When one applies, first check whether an existing lesson already covers the
255
+ same `applies_when` condition:
256
+ ```bash
257
+ strict-spec-cli lesson-status --category <category>
258
+ ```
259
+ If it does, append the recurrence instead of creating a near-duplicate:
260
+ ```bash
261
+ strict-spec-cli lesson-edit <lesson-id> --origin <change-name> --evidence "..."
262
+ ```
263
+ Otherwise record a new one:
264
+ ```bash
265
+ strict-spec-cli lesson-create --title "..." --category <category> --context "..." \
266
+ --observation "..." --takeaway "..." --applies-when "..." \
267
+ --origin <change-name> --evidence "..."
268
+ ```
269
+ Spend the effort on `--applies-when`: it is the retrieval key that decides
270
+ whether anyone ever sees the lesson again. When none of the four criteria
271
+ applies, say "no lesson" and give the one-line reason. Do not manufacture an
272
+ entry to fill the slot — a store padded with filler stops being read.
273
+
274
+ 13. **Report the result** — include review evidence before findings:
275
+ - changed implementation and test files read
276
+ - strict artifacts and delta specs read
277
+ - verification and regression commands executed, including post-fix reruns
278
+ when review-time changes were made, with pass/fail status
279
+ Then report the verdict table from step 6 — every acceptance item with its
280
+ verdict and evidence — before any finding, so a reader can tell a review that
281
+ verified nothing from one that found nothing. Then group findings into:
282
+ - MUST FIX
283
+ - SHOULD FIX
284
+ - NITS
285
+ Findings should include file and line references when available.
286
+ Recommend `strict-spec-archive` only when review is clean enough to archive
287
+ and complete project-level regression test evidence has passed, noting that
288
+ archive guidance will still run its bounded final current-change tech sync.
289
+
290
+ ## Rules
291
+
292
+ - Reconstruct the requirement from the change's planning artifacts before
293
+ reading the implementation, and report a verdict with evidence for every
294
+ acceptance item
295
+ - Read every changed file before commenting on it
296
+ - Prefer a fresh-context reviewer for steps 3 through 8 where the running
297
+ harness provides one, and review in the current context to the same standard
298
+ where it does not
299
+ - Do not call or rely on a `strict-spec-cli review` command
300
+ - Do not recommend archive without explicit direct code review evidence
301
+ - Automatically fix safe in-scope review findings before archive
302
+ recommendation, and rerun strict verification plus the configured complete
303
+ regression command after review-time changes
304
+ - Focus on real issues, not style churn already handled elsewhere
305
+ - Review code based on repository evidence, never on authorship
306
+ - Treat applicable technical standards under `.strict-spec-driven/tech/` as part
307
+ of the review bar: MUST violations are MUST FIX, unjustified SHOULD violations
308
+ are SHOULD FIX, and deviations are acceptable only when `design.yaml` justifies
309
+ them
310
+ - When the change carries delta tech artifacts under `changes/<name>/tech/`,
311
+ review each standard change for justification and correct merge operations; an
312
+ unjustified or malformed standard change is a MUST FIX finding
313
+ - Do not recommend archive without passing complete project-level regression
314
+ test evidence or explicit setup guidance explaining why that evidence is
315
+ blocked
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: strict-spec-ship
3
+ description: Ship an archived strict YAML change. Verifies the archived change, snapshots roadmap state, constructs a focused git commit message, and hands off git push to the operator.
4
+ metadata:
5
+ skill_id: strict_spec_ship
6
+ author: strict-spec-driven
7
+ type: agent_skill
8
+ version: 1.0.0
9
+ ---
10
+
11
+ You are helping the user ship an archived strict YAML change with a focused git commit.
12
+
13
+ ## This Skill's Commands
14
+
15
+ If you cannot remember the exact command used by this skill, look it up here
16
+ before running anything. Do not guess.
17
+
18
+ ```yaml
19
+ check-workflow-state: strict-spec-cli check-workflow-state
20
+ ship: strict-spec-cli ship <change-name>
21
+ ```
22
+
23
+ ## Responsibility Split
24
+
25
+ **Handled by CLI scripts**
26
+ - resolve the archived change directory under `.strict-spec-driven/changes/archive/`
27
+ - read the proposal summary from archived change artifacts
28
+ - snapshot current roadmap state
29
+ - emit structured JSON for the skill to consume
30
+
31
+ **Handled by the AI**
32
+ - construct the focused git commit message from ship command output
33
+ - stage the relevant files with `git add`
34
+ - run `git commit`
35
+ - present `git push` for operator confirmation before executing
36
+
37
+ ## Prerequisites
38
+
39
+ The change must already be archived under
40
+ `.strict-spec-driven/changes/archive/`. Run `/strict-spec-archive` first if it is
41
+ not.
42
+
43
+ ## Preferred Human Language
44
+
45
+ Comply with `preferred_human_language` from `.strict-spec-driven/config.yaml` —
46
+ the user's common human language, not a programming language — for all
47
+ user-facing and generated operator-facing text, unless that file is absent or
48
+ the active user message asks otherwise.
49
+
50
+ ## Steps
51
+
52
+ Before any other step, run `strict-spec-cli check-workflow-state`. If `.strict-spec-driven/` is
53
+ missing, stop immediately and tell the user to run `/strict-spec-init`. Do not
54
+ run `init` from this skill.
55
+
56
+ 1. **Run the ship command** to get verification JSON:
57
+ ```bash
58
+ strict-spec-cli ship <change-name>
59
+ ```
60
+ Stop if the command exits non-zero. The output includes `changeName`,
61
+ `archivePath`, `proposalSummary`, and `roadmapSnapshot`.
62
+
63
+ 2. **Construct the commit message** using the JSON output:
64
+ - Title line: `feat: <changeName>` (use `fix:`, `chore:`, or `docs:` if
65
+ `proposalSummary` clearly indicates a different commit type)
66
+ - Keep the title under 72 characters
67
+ - Optionally add a short body line from `proposalSummary` if it adds
68
+ meaningful context beyond the title
69
+
70
+ 3. **Review git status** to confirm which files have changed:
71
+ ```bash
72
+ git status
73
+ ```
74
+ Confirm the staged and unstaged changes correspond to the archived change
75
+ before proceeding. Stop if unrelated work-in-progress changes are present.
76
+
77
+ 4. **Stage the relevant files** — use `git add` for the implementation files,
78
+ test files, skill files, spec files, and workflow artifacts that belong to
79
+ this change. Do not stage unrelated files.
80
+
81
+ 5. **Commit** with the constructed message:
82
+ ```bash
83
+ git commit -m "<commit-message>"
84
+ ```
85
+
86
+ 6. **Present push** — show the operator the `git push` command and wait for
87
+ explicit confirmation before executing it.
88
+
89
+ ## Rules
90
+
91
+ - Do not push without explicit operator confirmation
92
+ - Use the `ship` command output as the source for change name and summary
93
+ - Do not stage files that do not belong to the archived change
94
+ - Do not re-run verify or archive as part of this skill — those steps are done
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: strict-spec-spec-edit
3
+ description: Create or modify individual strict YAML main spec files through the CLI for lightweight spec corrections.
4
+ metadata:
5
+ skill_id: strict_spec_spec_edit
6
+ author: strict-spec-driven
7
+ type: agent_skill
8
+ version: 1.0.0
9
+ ---
10
+
11
+ You are helping the user create or modify strict YAML main spec files under
12
+ `.strict-spec-driven/specs/` through the artifact-aware CLI, without going
13
+ through the strict change workflow.
14
+
15
+ ## This Skill's Commands
16
+
17
+ If you cannot remember the exact command used by this skill, look it up here
18
+ before running anything. Do not guess.
19
+
20
+ ```yaml
21
+ check-workflow-state: strict-spec-cli check-workflow-state
22
+ spec-edit: strict-spec-cli spec-edit <spec-id> [--spec-path <path>] --<named-args>
23
+ ```
24
+
25
+ ## CLI-Only YAML Authoring Protocol
26
+
27
+ Every mutation of repository-owned YAML in this skill goes through the strict
28
+ CLI. This skill writes `spec-state`. Before the first mutation run
29
+ `strict-spec-cli yaml-authoring-protocol spec-state`: that command reports the
30
+ ordered authoring steps, the owning command for each operation, and the bundled
31
+ schema and example keys with their cache-resolved paths, bound to the artifact
32
+ kind and current where a copy would go stale. Validate the result with
33
+ `strict-spec-cli check-workflow-state`.
34
+
35
+ **Stop rather than edit YAML directly.** When a required command, argument, or
36
+ artifact kind is unavailable, stop and report the missing capability. Editing
37
+ the YAML directly, writing a raw payload, or scripting around the CLI is never
38
+ an available fallback, and an unavailable command is a reason to stop rather
39
+ than a reason to improvise.
40
+
41
+ ## Preferred Human Language
42
+
43
+ Comply with `preferred_human_language` from `.strict-spec-driven/config.yaml` —
44
+ the user's common human language, not a programming language — for all
45
+ user-facing and generated operator-facing text, unless that file is absent or
46
+ the active user message asks otherwise.
47
+
48
+ ## Steps
49
+
50
+ Before any other step, run `strict-spec-cli check-workflow-state`. If `.strict-spec-driven/` is
51
+ missing, stop immediately and tell the user to run `/strict-spec-init`. Do not
52
+ run `init` from this skill.
53
+
54
+ 1. **Read strict spec context first** — before making any changes, read:
55
+ - `.strict-spec-driven/config.yaml`
56
+ - `.strict-spec-driven/specs/INDEX.yaml`
57
+ - any existing strict YAML main spec files relevant to the user's request
58
+
59
+ 2. **Understand the request** — identify whether the user wants to:
60
+ - add a new strict YAML spec file or category
61
+ - add new structured requirements to an existing strict spec file
62
+ - modify an existing requirement
63
+ - remove one or more existing requirements
64
+
65
+ 3. **Choose the target** — use `INDEX.yaml` to determine where the content
66
+ belongs:
67
+ - if one or more existing strict spec files cover the behavior, use those
68
+ - only create a new strict spec file if no existing file fits
69
+ - only create a new category if no existing category fits
70
+
71
+ 4. **Prepare the changes** — draft the exact structured edits:
72
+ - for additions, identify the requirement entry and any scenario entries to add
73
+ - for modifications, show the before and after requirement content
74
+ - for removals, identify the exact requirement entries to remove
75
+ - describe observable behavior only, not implementation details
76
+
77
+ 5. **Present and confirm** — show the user:
78
+ - which strict YAML spec file or files will change
79
+ - the exact content that will be added, modified, or removed
80
+ - whether `.strict-spec-driven/specs/INDEX.yaml` needs updating
81
+
82
+ Wait for explicit confirmation before writing anything.
83
+
84
+ 6. **Apply the confirmed edits through the CLI** — after confirmation, issue
85
+ one or more `spec-edit` invocations with named semantic arguments:
86
+ - create a spec with `spec-edit <spec-id> --spec-path <path> --title <text>
87
+ --requirement <id> --strength <MUST|SHOULD|MAY> --statement <text>
88
+ --scenario <id> --given <text> --when <text> --then <text>`
89
+ - update one requirement or scenario by restating its id and only the fields
90
+ that changed; unnamed content is preserved
91
+ - remove keyed content with `--remove-requirement <id>` or
92
+ `--remove-scenario <requirement-id>:<scenario-id>`
93
+ - use an isolated `spec-edit <spec-id> --delete` only when the confirmed
94
+ change removes the whole spec; deletion is refused while active deltas
95
+ target it
96
+ Never edit the main-spec YAML or `INDEX.yaml` text. The command validates
97
+ the complete candidate and reconciles the index in the same transaction.
98
+
99
+ 7. **Validate the result** — after editing, verify:
100
+ - each edited file remains valid strict YAML
101
+ - requirement and scenario structures still match the strict schema contract
102
+ - the command result reports both the main artifact and reconciled index
103
+
104
+ 8. **Summarize** — tell the user which strict YAML spec files changed, what was
105
+ added, modified, or removed, and whether `INDEX.yaml` was updated.
106
+
107
+ ## Rules
108
+
109
+ - Always read existing strict specs before authoring through `spec-edit`
110
+ - Present the exact changes and wait for confirmation before writing
111
+ - Prefer existing categories and files unless the content clearly requires a new
112
+ path
113
+ - Describe observable behavior only, not implementation details
114
+ - Do not implement product code
115
+ - Do not create or interact with `.strict-spec-driven/changes/`
116
+ - Never hand-edit main-spec or spec-index YAML; express every mutation through
117
+ `strict-spec-cli spec-edit` with named arguments
@@ -0,0 +1,128 @@
1
+ ---
2
+ name: strict-spec-sync-specs
3
+ description: Scan repository behavior and strict YAML specs for drift, then synchronize strict specs through the CLI after user confirmation.
4
+ metadata:
5
+ skill_id: strict_spec_sync_specs
6
+ author: strict-spec-driven
7
+ type: agent_skill
8
+ version: 1.0.0
9
+ ---
10
+
11
+ You are helping the user synchronize `.strict-spec-driven/specs/` with behavior
12
+ that already exists in the repository.
13
+
14
+ ## This Skill's Commands
15
+
16
+ If you cannot remember the exact command used by this skill, look it up here
17
+ before running anything. Do not guess.
18
+
19
+ ```yaml
20
+ check-workflow-state: strict-spec-cli check-workflow-state
21
+ spec-edit: strict-spec-cli spec-edit <spec-id> [--spec-path <path>] --<named-args>
22
+ scene-status: strict-spec-cli scene-status [--area <area>] [--scene <scene-id>]
23
+ ```
24
+
25
+ ## CLI-Only YAML Authoring Protocol
26
+
27
+ Every mutation of repository-owned YAML in this skill goes through the strict
28
+ CLI. This skill writes `spec-state`. Before the first mutation run
29
+ `strict-spec-cli yaml-authoring-protocol spec-state`: that command reports the
30
+ ordered authoring steps, the owning command for each operation, and the bundled
31
+ schema and example keys with their cache-resolved paths, bound to the artifact
32
+ kind and current where a copy would go stale. Validate the result with
33
+ `strict-spec-cli check-workflow-state`.
34
+
35
+ **Stop rather than edit YAML directly.** When a required command, argument, or
36
+ artifact kind is unavailable, stop and report the missing capability. Editing
37
+ the YAML directly, writing a raw payload, or scripting around the CLI is never
38
+ an available fallback, and an unavailable command is a reason to stop rather
39
+ than a reason to improvise.
40
+
41
+ ## Preferred Human Language
42
+
43
+ Comply with `preferred_human_language` from `.strict-spec-driven/config.yaml` —
44
+ the user's common human language, not a programming language — for all
45
+ user-facing and generated operator-facing text, unless that file is absent or
46
+ the active user message asks otherwise.
47
+
48
+ ## Steps
49
+
50
+ Before any other step, run `strict-spec-cli check-workflow-state`. If `.strict-spec-driven/` is
51
+ missing, stop immediately and tell the user to run `/strict-spec-init`. Do not
52
+ run `init` from this skill.
53
+
54
+ 1. **Choose the scan scope** — determine whether the user wants:
55
+ - a repository-wide scan
56
+ - a scoped scan for a specific directory, module, or feature area
57
+
58
+ If the user already gave a scope, use it. If not, ask whether to scan the
59
+ whole repository or a narrower target.
60
+
61
+ 2. **Read strict spec context first** — before deciding that any drift exists,
62
+ read:
63
+ - `.strict-spec-driven/config.yaml`
64
+ - `.strict-spec-driven/specs/INDEX.yaml`
65
+ - every strict YAML main spec file that appears relevant to the chosen scope
66
+ - the recorded scenes covering that scope, through
67
+ `strict-spec-cli scene-status --area <area>`, when the project records any.
68
+ A step reported as covered names the requirement that is supposed to
69
+ describe it, which turns a drift question into a located comparison; a step
70
+ reported as a deliberate waiver is not a gap. A project recording no scene
71
+ produces nothing here and the scan proceeds unchanged.
72
+
73
+ 3. **Read repository evidence in the chosen scope** — inspect the code, tests,
74
+ and nearby docs that define current observable behavior in that area.
75
+ Prefer behavior-facing files, and do not treat internal implementation
76
+ details as requirements.
77
+
78
+ 4. **Classify drift findings** — compare repository evidence to the current
79
+ strict specs and sort findings into:
80
+ - confirmed behavior that exists in code but is missing from strict specs
81
+ - a recorded scene step whose covering requirement no longer describes what
82
+ the code does, which is drift the scene located rather than drift found by
83
+ reading code alone
84
+ - existing strict requirements that appear outdated or incomplete
85
+ - ambiguous findings that need human confirmation before they become specs
86
+ - areas with no meaningful drift in the scanned scope
87
+
88
+ 5. **Report the drift summary in chat** — present a concise summary covering:
89
+ - the scan scope that was analyzed
90
+ - confirmed gaps or outdated strict spec areas, with specific file references
91
+ - ambiguous findings that need human input
92
+ - areas in scope where no meaningful drift was found
93
+
94
+ 6. **Get user confirmation** — before editing any strict YAML spec file, ask the
95
+ user to confirm the proposed changes. List each strict spec file that will be
96
+ added, modified, or removed. Do not proceed until the user explicitly
97
+ approves.
98
+
99
+ 7. **Synchronize through `spec-edit`** — for each confirmed gap, invoke the CLI
100
+ with the stable spec id and only the named semantic fields that changed:
101
+ - create a new main spec with `--spec-path`, `--title`, and one complete
102
+ `--requirement` / `--scenario` group
103
+ - add or update requirements and scenarios by stable id
104
+ - remove obsolete keyed entries with `--remove-requirement` or
105
+ `--remove-scenario`
106
+ Describe observable behavior only. Never edit the main-spec YAML or spec
107
+ index text; `spec-edit` validates both and reconciles `INDEX.yaml`
108
+ transactionally.
109
+
110
+ 8. **Refresh supporting spec state** — after all strict spec edits are complete:
111
+ - confirm each mutation result reports the reconciled spec index
112
+
113
+ 9. **Report final changes** — summarize:
114
+ - which strict spec files were added, modified, or removed
115
+ - a brief description of the drift fixed in each file
116
+ - any ambiguous findings that were left unresolved and why
117
+
118
+ ## Rules
119
+
120
+ - This is a documentation skill only — do not change product code
121
+ - Read strict spec context before judging drift
122
+ - Respect the user-selected scope
123
+ - Use code, tests, and nearby docs as evidence, but write only observable
124
+ behavior into the strict specs
125
+ - Do not create a strict change — author live specs through `spec-edit`
126
+ - Do not write a standalone report file; the summary belongs in chat
127
+ - Get explicit user confirmation before editing any strict YAML spec file
128
+ - Never hand-edit main-spec or spec-index YAML