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,123 @@
1
+ ---
2
+ name: strict-spec-init
3
+ description: Initialize a .strict-spec-driven/ directory in a project. Creates strict YAML scaffold files, then guides the user to fill in project context and initial specs.
4
+ metadata:
5
+ skill_id: strict_spec_init
6
+ author: strict-spec-driven
7
+ type: agent_skill
8
+ version: 1.0.0
9
+ ---
10
+
11
+ You are helping the user initialize the strict spec-driven workflow in a
12
+ project.
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
+ init: strict-spec-cli init
21
+ config-edit: strict-spec-cli config-edit --<named-args>
22
+ spec-edit: strict-spec-cli spec-edit <spec-id> [--spec-path <path>] --<named-args>
23
+ ```
24
+
25
+ ## Prerequisites
26
+
27
+ The target project directory must exist and be the intended project root;
28
+ confirm the path before initializing it.
29
+
30
+ ## CLI-Only YAML Authoring Protocol
31
+
32
+ Every mutation of repository-owned YAML in this skill goes through the strict
33
+ CLI. This skill writes `workflow-config` and `spec-state`. Before the first
34
+ mutation run `strict-spec-cli yaml-authoring-protocol <artifact-kind>` for each
35
+ of them: that command reports the ordered authoring steps, the owning command
36
+ for each operation, and the bundled schema and example keys with their
37
+ cache-resolved paths, bound to the artifact kind and current where a copy would
38
+ go stale. Validate the result with `strict-spec-cli check-workflow-state`.
39
+
40
+ **Stop rather than edit YAML directly.** When a required command, argument, or
41
+ artifact kind is unavailable, stop and report the missing capability. Editing
42
+ the YAML directly, writing a raw payload, or scripting around the CLI is never
43
+ an available fallback, and an unavailable command is a reason to stop rather
44
+ than a reason to improvise.
45
+
46
+ ## Preferred Human Language
47
+
48
+ Comply with `preferred_human_language` from `.strict-spec-driven/config.yaml` —
49
+ the user's common human language, not a programming language — for all
50
+ user-facing and generated operator-facing text, unless that file is absent or
51
+ the active user message asks otherwise.
52
+
53
+ ## Steps
54
+
55
+ 1. **Confirm the target project** — ask which project to initialize. If the user
56
+ is already in the project root, use the current directory.
57
+
58
+ 2. **Run init** — run:
59
+ ```bash
60
+ strict-spec-cli init
61
+ ```
62
+ - If `.strict-spec-driven/` does not exist, this bootstraps it from scratch.
63
+ - If `.strict-spec-driven/` already exists, this repairs missing scaffold
64
+ files without overwriting existing strict artifacts.
65
+
66
+ 3. **Draft context** — read project files that describe the system
67
+ (`README.md`, `AGENTS.md`, `package.json`, and similar) and draft a concise
68
+ `context` value for `.strict-spec-driven/config.yaml`. Also set or preserve
69
+ `preferred_human_language`, which records the user's common human language
70
+ for AI interaction (for example English or Chinese) and is not a programming
71
+ language field. Use `English` when no stronger project or user preference is
72
+ known. Cover:
73
+ - what the project does
74
+ - the tech stack and languages
75
+ - key conventions or constraints worth preserving
76
+ Apply the drafted values through `strict-spec-cli config-edit` named
77
+ arguments; never edit `config.yaml` directly. Then configure
78
+ `review_evidence.project_regression.command` with the
79
+ project's real complete regression command (build plus full test run) for
80
+ the detected toolchain — the scaffold ships a REPLACE placeholder, not a
81
+ runnable command. Recommend declaring the commented coverage contract
82
+ (`coverage: threshold / metric / scope`) so minimum test coverage becomes a
83
+ blocking review-evidence gate; the regression command must then enforce that
84
+ threshold by exiting non-zero below it (for example via the test runner's
85
+ own coverage threshold support). The strict CLI validates the declaration
86
+ but never measures coverage itself.
87
+
88
+ 4. **Ensure AGENTS.md exists** — check the target project root for an `AGENTS.md`.
89
+ If none exists, generate a concise `AGENTS.md` describing the project for future
90
+ agents, reusing the understanding you gathered while drafting context:
91
+ - what the project does
92
+ - the tech stack and languages
93
+ - key conventions, constraints, and commands worth preserving
94
+ Do not overwrite an existing `AGENTS.md`; if one is already present, leave it
95
+ untouched.
96
+
97
+ 5. **Capture existing behavior** — if the project already has stable behavior,
98
+ help the user create initial strict YAML main specs under
99
+ `.strict-spec-driven/specs/` by invoking `strict-spec-cli spec-edit <spec-id>
100
+ --spec-path <path> --title <text> --requirement <id> --strength
101
+ <MUST|SHOULD|MAY> --statement <text>` once per spec, adding `--scenario <id>
102
+ --given <text> --when <text> --then <text>` for each scenario.
103
+ - do not write `.strict-spec-driven/specs/INDEX.yaml`; `spec-edit` reconciles
104
+ the index in the same transaction as the spec it writes
105
+ - supply `spec.id`, `spec.title`, and `requirements` content as named
106
+ arguments rather than as YAML text
107
+ - describe current observable behavior, not future aspirations
108
+ - run `strict-spec-cli check-workflow-state` once the specs are in place
109
+
110
+ 6. **Confirm** — summarize what was created and suggest
111
+ `strict-roadmap-plan` to shape the roadmap or `strict-spec-propose` to create
112
+ the first strict change.
113
+
114
+ ## Rules
115
+
116
+ - Do not create a change during initialization
117
+ - Never hand-edit `.strict-spec-driven/config.yaml`; use `config-edit` for every
118
+ post-init field, list, and named-removal mutation
119
+ - Keep the `context` field concise; a few sentences are enough
120
+ - Do not overwrite existing `.strict-spec-driven/` artifacts when repairing
121
+ scaffold files
122
+ - Generate an `AGENTS.md` only when the project has none, and never overwrite an
123
+ existing `AGENTS.md`
@@ -0,0 +1,130 @@
1
+ ---
2
+ name: strict-spec-maintenance
3
+ description: Run configured maintenance checks against the strict workflow repository state, seed a maintenance change from findings, and guide through task completion and archive.
4
+ metadata:
5
+ skill_id: strict_spec_maintenance
6
+ author: strict-spec-driven
7
+ type: agent_skill
8
+ version: 1.0.0
9
+ ---
10
+
11
+ # strict-spec-maintenance
12
+
13
+ ## This Skill's Commands
14
+
15
+ ```yaml
16
+ check-workflow-state: strict-spec-cli check-workflow-state
17
+ run-maintenance: strict-spec-cli maintenance
18
+ seed-maintenance-change: strict-spec-cli maintenance --seed
19
+ list-changes: strict-spec-cli list
20
+ verify-change: strict-spec-cli verify <change-name>
21
+ archive-change: strict-spec-cli archive <change-name>
22
+ retire-lesson: strict-spec-cli lesson-obsolete <lesson-id> --reason <text>
23
+ ```
24
+
25
+ ## Prerequisites
26
+
27
+ `.strict-spec-driven/config.yaml` must contain a `maintenance` section with at
28
+ least one configured check; without one the command exits with zero findings.
29
+
30
+ ## Maintenance Check Types
31
+
32
+ Add a check entry to enable maintenance behavior:
33
+
34
+ ```yaml
35
+ maintenance:
36
+ checks:
37
+ - type: roadmap-sync-check
38
+ - type: generated-doc-check
39
+ - type: lesson-staleness-check
40
+ ```
41
+
42
+ Supported check types:
43
+
44
+ | Type | What it reports | Corrections applied |
45
+ |---|---|---|
46
+ | `roadmap-sync-check` | Each roadmap file whose state was reconciled | Yes — sync is applied, the finding records it |
47
+ | `specs-directory-structure-check` | A workflow state directory misplaced under `.strict-spec-driven/specs/` | No — the finding names the directory to remove |
48
+ | `generated-doc-check` | A rendered `ARCHITECTURE.md` or `DESIGN.md` that no longer matches its strict YAML sources | No — the finding names the stale sources and the re-render command |
49
+ | `lesson-staleness-check` | An active lesson whose `applies_when` names a repository path that no longer exists, or whose every occurrence comes from archived work with the newest older than 180 days | No — the finding names why the lesson is a candidate and the `lesson-obsolete` command that retires it |
50
+
51
+ `lesson-staleness-check` only nominates candidates and never changes a lesson.
52
+ Deciding that experience has expired is a judgment call, and a lesson retired
53
+ wrongly takes with it the motivating context that its promoted technical-standard
54
+ rule deliberately omits. Review each finding and either retire the lesson with
55
+ `strict-spec-cli lesson-obsolete <lesson-id> --reason "<why>"` or update its
56
+ `applies_when` condition — a lesson that is simply rarely triggered is not stale.
57
+
58
+ `generated-doc-check` is read-only for the documents it inspects: it renders in
59
+ memory, compares, and never writes. It reports only a document that is already on
60
+ disk, because both generated documents are opt-in — a project that never rendered
61
+ one has declined it rather than let it go stale. A project with no design-system
62
+ artifact therefore gets no `DESIGN.md` finding.
63
+
64
+ ## CLI-Only YAML Authoring Protocol
65
+
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
+ `lessons-state`. Before the first mutation run `strict-spec-cli
69
+ yaml-authoring-protocol <artifact-kind>` for each of them: that command reports
70
+ the ordered authoring steps, the owning command for each operation, and the
71
+ bundled schema and example keys with their cache-resolved paths, bound to the
72
+ artifact kind and current where a copy would go stale. Validate the result with
73
+ `strict-spec-cli verify <change-name>`, `strict-spec-cli lesson-status`.
74
+
75
+ **Stop rather than edit YAML directly.** When a required command, argument, or
76
+ artifact kind is unavailable, stop and report the missing capability. Editing
77
+ the YAML directly, writing a raw payload, or scripting around the CLI is never
78
+ an available fallback, and an unavailable command is a reason to stop rather
79
+ than a reason to improvise.
80
+
81
+ ## Preferred Human Language
82
+
83
+ Comply with `preferred_human_language` from `.strict-spec-driven/config.yaml` —
84
+ the user's common human language, not a programming language — for all
85
+ user-facing and generated operator-facing text, unless that file is absent or
86
+ the active user message asks otherwise.
87
+
88
+ ## Steps
89
+
90
+ Before any other step, run `strict-spec-cli check-workflow-state`. If `.strict-spec-driven/` is
91
+ missing, stop immediately and tell the user to run `/strict-spec-init`. Do not
92
+ run `init` from this skill.
93
+
94
+ 1. **Report the findings first** — execute:
95
+ ```
96
+ strict-spec-cli maintenance
97
+ ```
98
+ This run creates no change. Parse the JSON output. Fields: `valid`, `checksRun`,
99
+ `findingsCount`, `generatedChange`, `seedingSkippedReason`.
100
+
101
+ 2. **If `findingsCount` is zero** — nothing to act on. Report the clean state and stop.
102
+
103
+ 3. **Show the findings and seed the change** — report what the checks found, then create the
104
+ change from those same findings:
105
+ ```
106
+ strict-spec-cli maintenance --seed
107
+ ```
108
+ Only `--seed` writes; a bare run reports `generatedChange` null with a
109
+ `seedingSkippedReason` naming the flag. If `generatedChange` is still null after `--seed`,
110
+ read `seedingSkippedReason`: the two-active-change limit blocks seeding until a change is
111
+ archived or cancelled.
112
+
113
+ 4. **Inspect the seeded change** — it is created under `.strict-spec-driven/changes/<generatedChange>/` and contains:
114
+ - `proposal.yaml`: scope listing each finding
115
+ - `tasks.yaml`: one implementation task per finding, plus standard testing and verification tasks
116
+ - `questions.yaml`: the requirement-interrogation set, seeded open for operator answers
117
+ - `design.yaml`: not written; author it with `generate <change-name> design` before verify
118
+
119
+ 5. **Work through tasks** — use the standard `/strict-spec-apply <generatedChange>` workflow to complete all pending tasks. For `roadmap-sync-check` findings, the roadmap sync was already applied; implementation tasks are to review and confirm the changes were correct. For `generated-doc-check` findings, nothing was applied: run the re-render command named in the finding, and if the stale sources reveal that the source artifact itself is wrong, fix the artifact through its own skill before re-rendering.
120
+
121
+ 6. **Verify and archive** — once all tasks are complete:
122
+ ```
123
+ strict-spec-cli verify <generatedChange>
124
+ strict-spec-cli archive <generatedChange>
125
+ ```
126
+
127
+ ## Notes
128
+
129
+ - A bare `maintenance` run only reports. With `--seed` it runs the configured checks, applies automated corrections as a side effect (for example, updating roadmap sync state), and writes the change. The generated change is an auditable record of what was done. Not every check applies a correction; see the table above for which do.
130
+ - The maintenance change name uses the format `maintenance-YYYY-MM-DD` (with a numeric suffix if a collision exists).
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: strict-spec-modify
3
+ description: Modify an existing strict YAML change artifact while preserving completed task state and keeping strict delta specs aligned with main spec paths.
4
+ metadata:
5
+ skill_id: strict_spec_modify
6
+ author: strict-spec-driven
7
+ type: agent_skill
8
+ version: 1.0.0
9
+ ---
10
+
11
+ You are helping the user modify an existing strict YAML change artifact.
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
+ modify: strict-spec-cli modify [change-name|archive-dir]
21
+ generate: strict-spec-cli generate <change-name> <proposal|design|questions|tasks|delta-spec|delta-tech> --<named-args>
22
+ verify: strict-spec-cli verify <change-name>
23
+ ```
24
+
25
+ ## YAML Writing Rules
26
+
27
+ - Keep updated artifacts in valid strict YAML structures. Do not replace
28
+ structured fields with Markdown prose or side notes.
29
+ - If artifact fields are unclear, use `strict-spec-cli schema-show <schema-name>`;
30
+ installed skills do not carry a `templates` directory.
31
+ - 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.
32
+ - If a valid artifact example would clarify the shape, use
33
+ `strict-spec-cli sample-show <sample-name>`; installed skills do not rely on a
34
+ local `examples` directory.
35
+ - Use block scalars only for free-text content. Prefer `>-` for wrapped prose
36
+ such as longer `summary`, `approach`, `decision`, `rationale`, `question`,
37
+ `context`, `answer`, and spec `statement` values. Use `|` only when literal
38
+ line breaks must be preserved.
39
+ - Quote short strings that may contain YAML-sensitive characters or ambiguous
40
+ scalar values, including `command` strings, URLs, paths, text containing `:`
41
+ or `#`, leading `-`, JSON-like fragments, boolean-like words, and timestamp-
42
+ like values.
43
+ - Keep short structural fields as plain scalars unless quoting is needed for
44
+ correctness. Do not force IDs, enums, schema identifiers, artifact types,
45
+ task references, or similar fields into block scalars.
46
+ - Before finishing, self-check indentation, list nesting, quote closure, and
47
+ colon spacing, then run `verify` when the skill instructions call for it.
48
+
49
+ ## CLI-Only YAML Authoring Protocol
50
+
51
+ Every mutation of repository-owned YAML in this skill goes through the strict
52
+ CLI. This skill writes `change-planning-state`, `change-delta-state`. Before
53
+ the first mutation run `strict-spec-cli yaml-authoring-protocol
54
+ <artifact-kind>` for each of them: that command reports the ordered authoring
55
+ steps, the owning command for each operation, and the bundled schema and
56
+ example keys with their cache-resolved paths, bound to the artifact kind and
57
+ current where a copy would go stale. Validate the result with `strict-spec-cli
58
+ verify <change-name>`.
59
+
60
+ **Stop rather than edit YAML directly.** When a required command, argument, or
61
+ artifact kind is unavailable, stop and report the missing capability. Editing
62
+ the YAML directly, writing a raw payload, or scripting around the CLI is never
63
+ an available fallback, and an unavailable command is a reason to stop rather
64
+ than a reason to improvise.
65
+
66
+ ## Preferred Human Language
67
+
68
+ Comply with `preferred_human_language` from `.strict-spec-driven/config.yaml` —
69
+ the user's common human language, not a programming language — for all
70
+ user-facing and generated operator-facing text, unless that file is absent or
71
+ the active user message asks otherwise.
72
+
73
+ ## Steps
74
+
75
+ Before any other step, run `strict-spec-cli check-workflow-state`. If `.strict-spec-driven/` is
76
+ missing, stop immediately and tell the user to run `/strict-spec-init`. Do not
77
+ run `init` from this skill.
78
+
79
+ 1. **Select the change** — run `modify` without an argument to list active
80
+ changes. If the change is already specified, use it.
81
+
82
+ 2. **Understand the requested edit** — clarify the content change, not just which
83
+ file to touch.
84
+
85
+ 3. **Read affected strict artifacts** — choose from:
86
+ - `proposal.yaml`
87
+ - `design.yaml`
88
+ - `tasks.yaml`
89
+ - `questions.yaml`
90
+ - strict YAML delta specs under `changes/<name>/specs/`
91
+ Also read `.strict-spec-driven/config.yaml`, `.strict-spec-driven/specs/INDEX.yaml`,
92
+ and relevant main specs when editing delta specs.
93
+
94
+ 4. **Apply targeted edits through `generate`**
95
+ - for `proposal.yaml`, use the proposal generator's named summary, scope,
96
+ unchanged-behavior, status, roadmap-link, and removal arguments
97
+ - for `design.yaml`, use named approach, decision, alternative, risk,
98
+ removal, or isolated deletion arguments
99
+ - for strict YAML delta specs and delta tech, use target-confined operation,
100
+ requirement/rule, scenario, removal, and deletion arguments; preserve
101
+ `target_spec` or `target_standard` identity
102
+ - for `tasks.yaml`, use `strict-spec-cli generate <change-name> tasks` to
103
+ add or update a task. Read `strict-spec-cli generate --help --json` (or `--help`).
104
+ Choose `--implementation`, `--testing`, or `--verification` for the fixed
105
+ section; each takes no value and opens one task group whose following fields
106
+ belong to it. Use one invocation per task, for example `--implementation
107
+ --task <id> --text "..."`; repeat a selector per task in multi-task calls.
108
+ The command upserts by section and task id, so
109
+ other tasks are untouched. Restating a task is a field-level merge that
110
+ overwrites only the fields you pass, so an existing `status: complete` and
111
+ `command` are preserved automatically on a text-only edit — you no longer
112
+ need to re-pass `--status complete`. Delete a task with `--remove <id>`,
113
+ and move a task between sections by `--remove`-ing it and restating it
114
+ under the new section in the same call. Place a task with
115
+ `--before <task-id>` or `--after <task-id>` instead of letting it append;
116
+ task order is the order `apply` walks, so a task that must run before
117
+ existing pending work is anchored rather than appended, and naming an
118
+ existing task id with an anchor moves it there while preserving its
119
+ `status` and `command`. Set gates with
120
+ `--validation-task`/`--unit-test-task`; both reference Testing task ids.
121
+ Removal and gate flags are global and need no selector. `valid` reports write
122
+ success and `ready` reports completeness; `valid: true, ready: false` is a
123
+ successful incomplete write. Use `--text=...`/`--command=...`
124
+ when a value begins with a dash. Rename a task id by removing the old id
125
+ and restating it under the new id in one invocation. Preserve existing
126
+ `status: complete` entries unless the user explicitly asks to change
127
+ completed work
128
+ - for `questions.yaml`, use named open, resolved, resolve, and removal
129
+ arguments; canonical requirement questions remain protected
130
+
131
+ 5. **Validate after editing** — when the edited change is implementation-complete,
132
+ run:
133
+ ```bash
134
+ strict-spec-cli verify <change-name>
135
+ ```
136
+ If the change still has pending tasks or open questions, use the output only
137
+ as a strict YAML structure check and treat those lifecycle diagnostics as
138
+ expected until implementation is complete.
139
+
140
+ 6. **Summarize the change** — explain what changed across the updated YAML
141
+ artifacts and confirm the resulting proposal state.
142
+
143
+ ## Rules
144
+
145
+ - Preserve completed task state unless the user explicitly asks otherwise
146
+ - Keep strict delta specs aligned to the target main spec paths
147
+ - Never hand-edit change planning or delta YAML; every supported mutation flows
148
+ through `generate`