@llman-sdd/core 0.3.1 → 0.5.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 (107) hide show
  1. package/package.json +2 -1
  2. package/src/archive/freeze.ts +86 -18
  3. package/src/archive/frozenCard.ts +105 -0
  4. package/src/archive/sevenzip.ts +15 -13
  5. package/src/change/closeOutHarness.ts +29 -0
  6. package/src/change/collect.ts +140 -0
  7. package/src/change/frontmatter.ts +48 -6
  8. package/src/change/id.ts +2 -6
  9. package/src/change/lifecycle.ts +285 -86
  10. package/src/change/nextId.ts +63 -2
  11. package/src/change/resolve.ts +2 -2
  12. package/src/change/tasks.ts +59 -0
  13. package/src/config/changeId.ts +14 -12
  14. package/src/config/load.ts +14 -0
  15. package/src/config/schema.ts +4 -41
  16. package/src/config/surface.ts +6 -36
  17. package/src/context/indexStore.ts +7 -3
  18. package/src/context/retrieve.ts +8 -10
  19. package/src/context/tree.ts +28 -24
  20. package/src/git/spawnGit.ts +90 -2
  21. package/src/index.ts +67 -59
  22. package/src/init/defaultConfig.ts +1 -5
  23. package/src/init/init.ts +19 -4
  24. package/src/ports.ts +1 -7
  25. package/src/project/migrateNotes.ts +104 -0
  26. package/src/render/machine.ts +30 -0
  27. package/src/report/collect.ts +11 -127
  28. package/src/report/graph/analysis.ts +152 -0
  29. package/src/report/graph/deps.ts +30 -0
  30. package/src/report/graph/graphData.ts +53 -0
  31. package/src/report/graph/nodes.ts +130 -0
  32. package/src/report/graph/render.ts +83 -0
  33. package/src/report/graph/types.ts +47 -0
  34. package/src/report/graph.ts +9 -381
  35. package/src/report/show.ts +20 -22
  36. package/src/report/specHelpers.ts +42 -21
  37. package/src/report/specs.ts +23 -25
  38. package/src/review/review.ts +45 -30
  39. package/src/spec/authoring.ts +91 -63
  40. package/src/spec/ir.ts +43 -15
  41. package/src/spec/migrateNative.ts +167 -0
  42. package/src/spec/parser.ts +73 -77
  43. package/src/spec/reqRegistry.ts +8 -9
  44. package/src/templates/embedded.ts +10 -16
  45. package/src/templates/engine.ts +10 -5
  46. package/src/templates/locale.ts +1 -1
  47. package/src/templates/skills.ts +4 -5
  48. package/src/validation/changeCheck.ts +128 -105
  49. package/src/validation/harness.ts +161 -0
  50. package/src/validation/staleness.ts +9 -5
  51. package/src/validation/validate.ts +60 -88
  52. package/templates/en/skills/llman-sdd-apply-cycle.md +20 -28
  53. package/templates/en/skills/llman-sdd-apply.md +58 -76
  54. package/templates/en/skills/llman-sdd-arch-review.md +12 -19
  55. package/templates/en/skills/llman-sdd-archive.md +27 -42
  56. package/templates/en/skills/llman-sdd-continue.md +17 -24
  57. package/templates/en/skills/llman-sdd-draft.md +17 -28
  58. package/templates/en/skills/llman-sdd-explore.md +29 -43
  59. package/templates/en/skills/llman-sdd-ff.md +12 -17
  60. package/templates/en/skills/llman-sdd-graph.md +14 -32
  61. package/templates/en/skills/llman-sdd-propose.md +48 -63
  62. package/templates/en/skills/llman-sdd-quick.md +12 -27
  63. package/templates/en/skills/llman-sdd-research.md +13 -24
  64. package/templates/en/skills/llman-sdd-specs-compact.md +14 -39
  65. package/templates/en/skills/llman-sdd-validate.md +11 -15
  66. package/templates/en/skills/llman-sdd-verify.md +23 -44
  67. package/templates/en/skills/llman-sdd-wayfinder.md +18 -22
  68. package/templates/en/units/skills/cli-footer.md +2 -0
  69. package/templates/en/units/skills/git-native-flow-brief.md +7 -6
  70. package/templates/en/units/skills/git-native-flow.md +21 -11
  71. package/templates/en/units/skills/human-readable-summary.md +2 -3
  72. package/templates/en/units/skills/stage-guard.md +7 -7
  73. package/templates/en/units/skills/structured-protocol.md +5 -8
  74. package/templates/en/units/skills/validation-hints.md +10 -14
  75. package/templates/en/units/spec/feature-contract.md +27 -16
  76. package/templates/en/units/workflow/archive-freeze-guidance.md +6 -3
  77. package/templates/zh-Hans/skills/llman-sdd-apply-cycle.md +23 -31
  78. package/templates/zh-Hans/skills/llman-sdd-apply.md +63 -81
  79. package/templates/zh-Hans/skills/llman-sdd-arch-review.md +21 -28
  80. package/templates/zh-Hans/skills/llman-sdd-archive.md +29 -44
  81. package/templates/zh-Hans/skills/llman-sdd-continue.md +17 -24
  82. package/templates/zh-Hans/skills/llman-sdd-draft.md +18 -29
  83. package/templates/zh-Hans/skills/llman-sdd-explore.md +34 -48
  84. package/templates/zh-Hans/skills/llman-sdd-ff.md +13 -18
  85. package/templates/zh-Hans/skills/llman-sdd-graph.md +16 -34
  86. package/templates/zh-Hans/skills/llman-sdd-propose.md +51 -65
  87. package/templates/zh-Hans/skills/llman-sdd-quick.md +15 -30
  88. package/templates/zh-Hans/skills/llman-sdd-research.md +17 -28
  89. package/templates/zh-Hans/skills/llman-sdd-specs-compact.md +15 -40
  90. package/templates/zh-Hans/skills/llman-sdd-validate.md +11 -15
  91. package/templates/zh-Hans/skills/llman-sdd-verify.md +26 -47
  92. package/templates/zh-Hans/skills/llman-sdd-wayfinder.md +25 -29
  93. package/templates/zh-Hans/units/skills/cli-footer.md +2 -0
  94. package/templates/zh-Hans/units/skills/git-native-flow-brief.md +7 -6
  95. package/templates/zh-Hans/units/skills/git-native-flow.md +22 -12
  96. package/templates/zh-Hans/units/skills/human-readable-summary.md +4 -5
  97. package/templates/zh-Hans/units/skills/stage-guard.md +9 -9
  98. package/templates/zh-Hans/units/skills/structured-protocol.md +5 -8
  99. package/templates/zh-Hans/units/skills/validation-hints.md +10 -14
  100. package/templates/zh-Hans/units/spec/feature-contract.md +25 -16
  101. package/templates/zh-Hans/units/workflow/archive-freeze-guidance.md +6 -2
  102. package/templates/en/skills/llman-sdd-onboard.md +0 -34
  103. package/templates/en/skills/llman-sdd-show.md +0 -24
  104. package/templates/en/units/migrate-prompt.md +0 -28
  105. package/templates/zh-Hans/skills/llman-sdd-onboard.md +0 -34
  106. package/templates/zh-Hans/skills/llman-sdd-show.md +0 -24
  107. package/templates/zh-Hans/units/migrate-prompt.md +0 -28
@@ -1,84 +1,69 @@
1
1
  ---
2
2
  name: "llman-sdd-archive"
3
- description: "Archive completed llman SDD changes. Auto-merge back into the fork-point branch (squash by default), then rename change docs to archive/. Use after verify reports all-clear."
3
+ description: "Archive a completed change: merge back (squash default), rename docs into archive/, auto-commit the close-out. Run after verify is green."
4
4
  metadata:
5
5
  version: "{{ llman_version }}"
6
6
  ---
7
7
 
8
8
  # LLMAN SDD Archive
9
9
 
10
- Use this skill to archive completed changes. Prerequisites: verify all-green, and the change already has Branch binding plus Specs landing (or `needs_specs_change: false`; live specs are on the bound branch). `change finalize` **auto-merges** into the fork-point branch (target: `--into` > binding `base_branch` > default branch; method: `--method` > config `sdd.merge_method`, squash by default — feature diff + rename collapse into ONE close-out commit on the target), **renames** change docs to `changes/archive/`, then **auto-commits** `archive(sdd): <change-id>` (impl diff + rename in one commit; `--no-commit` skips). `change checkpoint` is removed (no mid-flight archive point; `change finalize` does not require a clean tree). `git push` / hosting PR are optional.
10
+ Archive completed changes. Prerequisites: verify all-green, and the change is branch-bound with specs landed (or `needs_specs_change: false`). `change finalize` **auto-merges** into the base branch (target: `--into` > binding `base_branch` > default branch; method: `--method` > config `sdd.merge_method`, squash by default — feature diff + rename collapse into ONE commit on the target), **renames** change docs into `changes/archive/`, then **auto-commits** `archive(sdd): <change-id>` (`--no-commit` skips). `git push` / PR are optional.
11
11
 
12
12
  ## Pipeline Position
13
13
 
14
14
  ```mermaid
15
15
  flowchart LR
16
- verify["llman-sdd-verify<br/>Verify"] --> archive
17
- archive["★ llman-sdd-archive ★<br/>Archive (you are here)"]
16
+ verify["llman-sdd-verify"] --> archive["★ llman-sdd-archive"]
18
17
 
19
18
  style archive fill:#fff3cd,stroke:#ffc107,stroke-width:3px
20
19
  ```
21
20
 
22
- > 📍 You are in the archive phase: the last stop in the Git-native lifecycle.
23
- > 📎 If specs get too large, run `llman-sdd-specs-compact` to compress.
21
+ > 📍 You are in archive: the last stop of the branch lifecycle. If specs grow too large, run `llman-sdd-specs-compact`.
24
22
 
25
23
  ## Hard Constraints
26
24
 
27
- - **Must pass verify phase all-green first**: don't archive changes that haven't passed verification.
28
- - **Must already have Branch binding**: `change start` / `attach` done; otherwise STOP.
29
- - **SSOT validation**: every change must pass `llman-sdd validate <id> --strict --no-interactive` before archiving.
25
+ - **Verify must be all-green first**; **the change must be branch-bound** (`change start` / `attach`) — otherwise STOP.
26
+ - Every change must pass `llman-sdd validate <id> --strict` before archiving.
30
27
  - **Don't ask "should I continue?"**: execute the full batch to completion unless you hit an unresolvable error.
31
- - **Close-out MUST NOT default to PR/push**: finalize performs a local merge (squash by default) + rename + one close-out commit (`archive(sdd): <id>`). `git push` / hosting PR are optional — only when the user or project explicitly requires remote review. **Agent MUST NOT** push or open a PR by default on this skill's account.
28
+ - **Close-out MUST NOT default to PR/push**: the CLI merges locally (squash default) + one close-out commit. Push / PR only when the user or project explicitly requires remote review — **Agent MUST NOT** push or open a PR by default.
32
29
 
33
30
  ## Steps
34
31
 
35
32
  ### 0) Preflight
36
- - `git status --porcelain`: confirm working tree changes belong to completed changes.
37
- - If unexpected changes exist, handle them (stash or report).
33
+ - `git status --porcelain`: confirm working-tree changes belong to completed changes; handle unexpected ones first (stash or report).
38
34
 
39
- ### 1) Confirm target changes
40
- - Determine target IDs: single or batch (from user input or `llman-sdd list --json`).
41
- - Always announce: "Archiving IDs: <id1>, <id2>, ...".
42
- - Confirm each change has passed verify phase all-green.
35
+ ### 1) Confirm targets
36
+ - Determine IDs (single or batch, from user input or `llman-sdd list --json`); always announce "Archiving IDs: <id1>, <id2>, ..." and confirm each change is verify all-green.
43
37
 
44
38
  ### 2) Archive one by one
45
- - **Human review checkpoint (before each id is archived, including batches)**: run `llman-sdd review --capability <id>`. Exit code zero → continue; non-zero = CRITICAL findings: STOP, fix, re-run; MUST NOT archive with CRITICAL findings open.
46
- - Validate each first: `llman-sdd validate <id> --strict --no-interactive`.
47
- - Validation failure → STOP and report; don't skip validation and force archive.
39
+ - **Human review gate (before each id, including batches)**: run `llman-sdd review` (plain; `--capability` takes a spec id only). Exit code zero → continue; non-zero = CRITICAL → STOP, fix, re-run; MUST NOT archive with CRITICAL findings open.
40
+ - Validate first: `llman-sdd validate <id> --strict`; failure → STOP and report, never force-archive.
48
41
  - Optional preview: `llman-sdd change archive <id> --dry-run`.
49
- - Execute archive:
50
- - default: `llman-sdd change archive <id>`
51
- - tooling-only: `llman-sdd change archive <id> --skip-specs`
52
- - **stop immediately on first failure**, report remaining unprocessed IDs.
53
- - **Git-native close-out**:
54
- - Prerequisites: Branch binding done (`change start` / `attach`); still on the bound branch (or the target branch after the auto merge).
55
- - `change archive` / `change finalize` run the **auto merge** (target `--into` > binding `base_branch` > default branch; method squash by default or `ff`; if the target is held by another worktree the merge is skipped with an explicit manual command), **then** rename change docs into `changes/archive/` — rename is never rolled back on merge failure and degradation is reported explicitly.
56
- - Legacy `*.feature.delta.toon` or `spec.toon` under specs is a migration blocker — run `llman-sdd project migrate --kind toon2features`.
57
- - **Default: `change finalize` (one-command close)** — gates → auto merge → docs rename → **auto commit** `archive(sdd): <change-id>` (squash default: impl diff + rename collapse into ONE commit on the target; no manual `git commit` needed; locked-rule edits are a report-only WARNING — warn, never block):
42
+ - Execute: `llman-sdd change archive <id>`; **stop immediately on first failure** and report the remaining IDs.
43
+ - **Branch close-out**:
44
+ - Prerequisites: branch bound; still on the bound branch (or on the target branch after the auto merge).
45
+ - `change archive` / `change finalize` run the **auto merge** (target `--into` > `base_branch` > default branch; method squash by default or `ff`; when the target is held by another worktree the merge and commit run in place inside it, with `executed in target worktree <path>` in the output; a dirty holding worktree aborts with disposal options and zero writes), **then** rename into `changes/archive/` — the rename is never rolled back on merge failure and degradation is reported explicitly.
46
+ - **Default: `change finalize` (one-command close)** — gates → merge → rename → **auto commit** `archive(sdd): <change-id>` (no manual `git commit` needed; locked-rule edits are a report-only WARNING — warn, never block):
58
47
  ```text
59
- 1. Implement live specs + code (working tree may stay dirty; commits on the branch are free — segmented or none)
48
+ 1. Implement specs + code (working tree may stay dirty; commits on the branch are free)
60
49
  2. llman-sdd change finalize <id> # gates + merge (squash default) + rename + auto commit
61
- 3. optional: git commit --amend # adjust the message; git branch -D <feature> # after squash the branch is no longer an ancestor; -d gets refused
50
+ 3. optional: git commit --amend to adjust the message; git branch -D <feature> # after squash the branch is no longer an ancestor; -d gets refused
62
51
  ```
63
- `--no-commit` skips the auto commit (CI / pre-commit-hook conflicts): finalize then leaves the tree dirty and prints the manual `git commit` command. Idempotent retry: a rerun after a failed auto commit detects the already-archived rename and finishes the commit.
64
- - **Fallback: plain `change archive <id>`** — same merge + rename, no auto commit; requires a clean tree. `checkpointed`/`checkpoint_sha` fields went away with checkpoint (no mid-flight archive point; `change finalize` needs no clean tree) — nothing to write beforehand, and nothing to review for the snapshot (use `change diff` instead).
52
+ `--no-commit` skips the auto commit (CI / pre-commit-hook conflicts): finalize leaves the tree dirty and prints the manual commit command. Idempotent retry: a rerun after a failed auto commit detects the already-archived rename and finishes the commit.
53
+ - **Fallback: plain `change archive <id>`** — same auto merge + rename + close-out commit as finalize (no `--no-commit` here); gates: tasks all checked + clean tree + on the bound non-default branch (`--force` skips the gates). Snapshot review: `change diff`.
65
54
 
66
55
  ### 3) Full validation
67
- - After all archives complete: `llman-sdd validate --all --strict --no-interactive`.
68
- - Confirm post-archive spec artifacts are consistent.
56
+ - After all archives: `llman-sdd validate --all --strict`; confirm spec artifacts are consistent.
69
57
 
70
58
  ### 4) Commit guidance
71
- - Finalize auto-committed (`archive(sdd): <id>`); with `--no-commit`, commit manually: `git add -A && git commit -m "archive(sdd): <id1>, <id2>"` (or the archive skill's suggested format).
72
- - Optional: `git branch -D <feature>` after the merge (squash leaves the branch outside main's ancestry). push / hosting PR only when the user or project explicitly requires remote review.
73
- - **Breaking contract changes** (removed/renamed frontmatter field, command, tag, or stage value) MUST ship an upgrade path under `migrations/v<from>-v<to>/` (README prompt + one-shot script, shipped in-repo) — verify it exists before closing the change.
74
- - **Archived `depends_on`**: archive renames the change dir to `archive/YYYY-MM-DD-<id>`, but validate recognizes `depends_on` pointing to archived/frozen ids as INFO (not ERROR), so you do **not** need to manually update other changes' `depends_on` frontmatter after archive.
75
-
76
- > 💡 Previous phase `llman-sdd-verify` (passed verification) → this phase completes the loop. If specs grow too large, run `llman-sdd-specs-compact`.
59
+ - Finalize already auto-committed; with `--no-commit`, commit manually: `git add -A && git commit -m "archive(sdd): <id1>, <id2>"`.
60
+ - Optional: `git branch -D <feature>` after the merge. Push / PR only when explicitly required.
61
+ - **Breaking contract changes** (removed/renamed frontmatter field, command, tag, or stage value) MUST ship an upgrade path under `migrations/v<from>-v<to>/` (README + one-shot script, shipped in-repo) — verify it exists before closing.
62
+ - **Archived `depends_on`**: archive renames the change dir to `archive/YYYY-MM-DD-<id>`; validate treats `depends_on` pointing to archived/frozen ids as INFO (not ERROR), so you do **not** need to update other changes' frontmatter after archive.
77
63
 
78
64
  {{ unit("workflow/archive-freeze-guidance") }}
79
65
 
80
- > For command details run `llman-sdd <cmd> --help`; the CLI is the command reference — skills embed no command tables.
81
- > "Spec" here = a `.feature` file under this project's `llmanspec/specs/`; run `llman-sdd list --specs` or `llman-sdd show <capability>`.
66
+ {{ unit("skills/cli-footer") }}
82
67
 
83
68
  {{ unit("skills/validation-hints") }}
84
69
 
@@ -1,41 +1,34 @@
1
1
  ---
2
2
  name: "llman-sdd-continue"
3
- description: "Continue an existing llman SDD change by creating the next artifact."
3
+ description: "Continue an existing change: create the next missing artifact."
4
4
  metadata:
5
5
  version: "{{ llman_version }}"
6
6
  ---
7
7
 
8
8
  # LLMAN SDD Continue
9
9
 
10
- Use this skill to continue an existing change and create the next missing artifact.
10
+ Continue an existing change and create the next missing artifact.
11
11
 
12
12
  ## Steps
13
- 1. Identify the change id:
14
- - If provided by the user, use it.
15
- - Otherwise run `llman-sdd list --json` and ask which change to continue.
16
- - Always announce: "Using change: <id>".
17
- 2. Read the change directory: `llmanspec/changes/<id>/`.
18
- > Stage gate: decide from `stage` / `readyToImplement` in `llman-sdd show <id> --json --type change`; full decision table lives in llman-sdd-apply.
19
- 3. Determine the next artifact to create (in order):
13
+ 1. Identify the change id: use it if provided; otherwise run `llman-sdd list --json` and ask which change to continue. Always announce "Using change: <id>".
14
+ 2. Read `llmanspec/changes/<id>/`.
15
+ > Stage decisions use `stage` / `readyToImplement` from `llman-sdd show <id> --output json --type change`; the full decision table lives in llman-sdd-apply.
16
+ 3. Determine the next missing artifact, in order:
20
17
  1) `proposal.md`
21
- 2) `design.md` (only if design tradeoffs matter)
18
+ 2) `design.md` (only when design tradeoffs matter)
22
19
  3) `tasks.md`
23
- 4) `llman-sdd change start <id>` (or `change attach <id>` if the branch already exists) — Branch binding
24
- 5) Edit live `llmanspec/specs/<capability>.feature` (flat, or directory main file) on the **bound branch** and commit — Specs landing (or set `needs_specs_change: false` when there is no contract edit)
25
- 4. Create exactly ONE missing artifact (or one live spec/feature edit on the bound branch).
26
- - Do NOT implement application code in continue mode.
27
- - Do NOT create `*.feature.delta.toon`, `spec.toon`, or files under `changes/<id>/specs/`.
28
- - Do NOT edit shared `llmanspec/specs/**` before start/attach.
29
- 5. If all artifacts already exist, suggest next actions from `llman-sdd show <id> --json`:
30
- - `readyToImplement=false` → finish Specs landing (or `needs_specs_change: false`); do **not** suggest apply yet
31
- - `readyToImplement=true` → Implement: `llman-sdd-apply`
32
- - After verify → Archive: `llman-sdd-archive`
33
- - Validate: `llman-sdd validate <id> --strict --no-interactive`
34
- - Review: `llman-sdd change diff <id>` (read-only)
20
+ 4) `llman-sdd change start <id>` (or `change attach <id>` if the branch exists) — bind the branch
21
+ 5) Edit `llmanspec/specs/<capability>.feature` (flat, or directory main file) on the **bound branch** and commit — land specs (or set `needs_specs_change: false` when there is no contract edit)
22
+ 4. Create exactly ONE missing artifact (or one spec edit on the bound branch).
23
+ - Do NOT write application code; do NOT create `changes/<id>/specs/`; do NOT edit `llmanspec/specs/**` before start/attach.
24
+ 5. If all artifacts exist, suggest next steps from `llman-sdd show <id> --output json`:
25
+ - specs-landed gate failing → land specs first (or `needs_specs_change: false`); do **not** suggest apply yet
26
+ - specs-landed gate green (even mid-implementation with `readyToImplement=false` while tasks remain) → `llman-sdd-apply`
27
+ - After verify → `llman-sdd-archive`
28
+ - Validate: `llman-sdd validate <id> --strict`; review: `llman-sdd change diff <id>` (read-only)
35
29
 
36
30
  {{ unit("skills/git-native-flow") }}
37
- > For command details run `llman-sdd <cmd> --help`; the CLI is the command reference — skills embed no command tables.
38
- > "Spec" here = a `.feature` file under this project's `llmanspec/specs/`; run `llman-sdd list --specs` or `llman-sdd show <capability>`.
31
+ {{ unit("skills/cli-footer") }}
39
32
  {{ unit("skills/validation-hints") }}
40
33
 
41
34
  {{ unit("skills/structured-protocol") }}
@@ -1,64 +1,53 @@
1
1
  ---
2
2
  name: "llman-sdd-draft"
3
- description: "Quickly capture a change idea as a draft proposal (proposal.md only, via `change new --from`). No tasks/design/specs/attach. Use to jot down ideas or future requirements; promote to full propose when ready."
3
+ description: "Capture a change idea as a draft (proposal.md only, no id asked). For jotting ideas/future needs; formalize with propose when ready."
4
4
  metadata:
5
5
  version: "{{ llman_version }}"
6
6
  ---
7
7
 
8
8
  # LLMAN SDD Draft
9
9
 
10
- Capture a change idea as a **draft proposal** (a `proposal.md` skeleton only). This is the lightweight entry point for "just record this idea / future need" — no triage, no tasks, no live specs, no attach. Promote to a formal change with `llman-sdd-propose` when the idea is ready to act on.
10
+ Capture a change idea as a **draft** (a `proposal.md` skeleton only) — the lightweight "just record it" entry: no scale assessment, no tasks, no specs edits, no attach. Formalize with `llman-sdd-propose` when ready to act.
11
11
 
12
12
  ## Pipeline Position
13
13
 
14
14
  ```mermaid
15
15
  flowchart LR
16
- draft["★ llman-sdd-draft ★<br/>Draft (you are here)"] -.->|"promote"| propose["llman-sdd-propose<br/>Propose"]
17
- propose --> apply["llman-sdd-apply<br/>Implement"]
18
- apply --> verify["llman-sdd-verify<br/>Verify"]
19
- verify --> archive["llman-sdd-archive<br/>Archive"]
16
+ draft["★ llman-sdd-draft"] -.->|"formalize"| propose["llman-sdd-propose"]
17
+ propose --> apply["llman-sdd-apply"] --> verify["llman-sdd-verify"] --> archive["llman-sdd-archive"]
20
18
 
21
19
  style draft fill:#fff3cd,stroke:#ffc107,stroke-width:3px
22
20
  ```
23
21
 
24
- > 📍 You are at the draft stage → next: flesh out `proposal.md`, then run `llman-sdd-propose` to formalize
25
- > 📎 This skill creates a **draft** change (proposal.md only). Full propose follows Git-native: tasks → Branch binding → Specs landing (see propose lifecycle diagram)
26
- > 🗺️ Skill navigation ≠ Git-native lifecycle; Branch binding / Specs landing are not separate skills
22
+ > 📍 Draft stage → next: flesh out `proposal.md`, then `llman-sdd-propose` to formalize.
27
23
 
28
24
  ## Hard Constraints
29
25
 
30
26
  - **MUST NOT ask the user for a change id**: derive it from the description via `change new --from` and announce it.
31
- - **MUST NOT create tasks/design/specs/attach**: this skill creates only the `proposal.md` draft shell. Full planning artifacts belong to `llman-sdd-propose`.
32
- - **MUST NOT run triage or assess change scale**: that is propose's job. If the user wants to start implementing, suggest `llman-sdd-propose`.
33
- - **Scope boundary**: if the description clearly involves MUST/SHALL behavioral contract changes or multi-file impact, suggest `llman-sdd-propose` instead of stopping at a draft — but still create the draft shell first so the idea isn't lost.
34
- - **Frontmatter has a fixed schema**: when fleshing out `proposal.md`, only the allowed fields in `llmanspec/AGENTS.md` "Change Proposal Frontmatter SSOT" are accepted (including `depends_on`, `blocks`, `branch`, `base_sha`, `needs_specs_change`). `status`/`title`/`priority`/`author` etc. are rejected by `llman-sdd validate` as ERROR. Lifecycle stage is inferred — query it via `llman-sdd show`/`list`, never store it in frontmatter. Do not re-declare frontmatter fields in the prose body (no `## Status` block); the body H1 is a human-readable title, not a repeat of the change id.
27
+ - **MUST NOT create tasks/design/specs/attach**: only the `proposal.md` draft; full planning belongs to `llman-sdd-propose`.
28
+ - **MUST NOT assess change scale**: that is propose's job. If the user wants to start implementing → suggest `llman-sdd-propose`.
29
+ - **Scope boundary**: if the description clearly involves MUST/SHALL contract changes or multi-file impact, suggest `llman-sdd-propose` — but still create the draft first so the idea isn't lost.
30
+ - **Frontmatter has a fixed schema**: `proposal.md` accepts only the allowed fields in `llmanspec/AGENTS.md` "Change Proposal Frontmatter SSOT" (`depends_on`, `blocks`, `branch`, `base_sha`, `needs_specs_change`, etc.); `status`/`title`/`priority`/`author` are rejected by `llman-sdd validate` as ERROR. Lifecycle stage is inferred (query via `llman-sdd show`/`list`), never stored in frontmatter. Do not re-declare frontmatter fields in the prose body (no `## Status` block); the H1 is a human-readable title, not a repeat of the change id.
35
31
 
36
32
  ## Steps
37
33
 
38
34
  ### 0) Preflight
39
- - Read `llmanspec/config.yaml` for project context, rules, locale.
40
- - `llmanspec/` must exist; if missing, tell the user to run `llman-sdd init`, then STOP.
35
+ - Read `llmanspec/config.yaml`; if `llmanspec/` is missing, tell the user to run `llman-sdd init`, then STOP.
41
36
 
42
37
  ### 1) Capture the description
43
- - Take the user's description as-is (e.g. "draft: add a export-to-json command", "note down: we should support worktrees for sdd changes").
44
- - **MUST NOT ask for a change id.** Derive it from the description.
38
+ - Take the user's description as-is (e.g. "draft: add an export-to-json command", "note: sdd changes should support worktrees"). **MUST NOT ask for a change id.**
45
39
 
46
- ### 2) Create the draft shell
40
+ ### 2) Create the draft
47
41
  ```bash
48
42
  llman-sdd change new --from "<user description>"
49
43
  ```
50
- - The CLI generates a legal kebab-case id (sanitized + validated), creates `llmanspec/changes/<derived id>/proposal.md` (a skeleton with `## Why` / `## What Changes` TODO sections), and prints the final id + path.
51
- - If the derived id collides with an existing change, the CLI fails non-zero; suggest rephrasing the description or using `--force` to overwrite (rare for drafts).
44
+ - The CLI generates a legal kebab-case id, creates `llmanspec/changes/<id>/proposal.md` (a skeleton with `## Why` / `## What Changes` TODO sections), and prints the id + path.
45
+ - On id collision the CLI fails non-zero; suggest rephrasing or `--force` to overwrite (rare for drafts).
52
46
 
53
47
  ### 3) Announce and hand off
54
- - **MUST tell the user the derived id** (e.g. "Created draft change `<id>` at `llmanspec/changes/<id>/proposal.md`").
55
- - Suggest next steps:
56
- - Flesh out `proposal.md` (Why / What Changes / Capabilities / Impact) now or later.
57
- - When ready to act on it, run `llman-sdd-propose` to formalize (triage + tasks → `change start`/`attach` → Specs landing).
48
+ - **MUST tell the user the derived id** ("Created draft change `<id>` at `llmanspec/changes/<id>/proposal.md`").
49
+ - Suggest next steps: flesh out `proposal.md` (Why / What Changes / Capabilities / Impact); formalize with `llman-sdd-propose` when ready.
58
50
 
59
- > 💡 Draft captured → next: edit `proposal.md`, then `llman-sdd-propose` to formalize.
60
-
61
- > For command details run `llman-sdd <cmd> --help`; the CLI is the command reference — skills embed no command tables.
62
- > "Spec" here = a `.feature` file under this project's `llmanspec/specs/`; run `llman-sdd list --specs` or `llman-sdd show <capability>`.
51
+ {{ unit("skills/cli-footer") }}
63
52
 
64
53
  {{ unit("skills/ethics-governance") }}
@@ -1,78 +1,64 @@
1
1
  ---
2
2
  name: "llman-sdd-explore"
3
- description: "Enter llman SDD explore mode when the user wants to investigate, understand requirements, or think through a problem before implementing. Prohibits code writing. Use this when intent is unclear or the user wants analysis before action."
3
+ description: "Explore mode: investigate, clarify requirements, think through problems before acting. No code writing. Use when intent is unclear or analysis comes first."
4
4
  metadata:
5
5
  version: "{{ llman_version }}"
6
6
  ---
7
7
 
8
8
  # LLMAN SDD Explore
9
9
 
10
- Use this skill when the user wants to think through ideas, investigate problems, or clarify requirements **before** starting implementation.
10
+ Use this skill to think through ideas, investigate problems, or clarify requirements **before** implementation.
11
11
 
12
- **IMPORTANT: Explore mode is for thinking, not implementing.**
12
+ **Explore mode is for thinking, not implementing:**
13
13
  - You MAY read files, search code, and investigate the codebase.
14
- - You MAY create or update planning shell artifacts (proposal/design/tasks).
15
- - Live specs: **READ-ONLY** unless the change is already Branch-bound and you are on that branch; otherwise STOP and suggest `llman-sdd-propose` / `change start`.
16
- - You MUST NOT write application code or implement features in explore mode.
14
+ - You MAY create or update planning docs (proposal/design/tasks).
15
+ - `llmanspec/specs/**` is **READ-ONLY** — unless the change is already bound to a branch and you are on it; otherwise STOP and suggest `llman-sdd-propose` / `change start`.
16
+ - You MUST NOT write application code.
17
17
 
18
18
  ## Pipeline Position
19
19
 
20
20
  {{ unit("skills/git-native-flow-brief") }}
21
21
 
22
- ### Skill navigation (not the lifecycle; shows current skill only)
23
-
24
22
  ```mermaid
25
23
  flowchart LR
26
- explore["★ llman-sdd-explore ★<br/>Explore (you are here)"]
27
- explore --> propose["llman-sdd-propose<br/>Propose (Branch binding + Specs landing)"]
28
- propose --> apply["llman-sdd-apply<br/>Implement"]
29
- apply --> verify["llman-sdd-verify<br/>Verify"]
30
- verify --> archive["llman-sdd-archive<br/>Archive"]
24
+ explore["★ llman-sdd-explore"] --> propose["llman-sdd-propose"]
25
+ propose --> apply["llman-sdd-apply"]
26
+ apply --> verify["llman-sdd-verify"]
27
+ verify --> archive["llman-sdd-archive"]
31
28
 
32
29
  style explore fill:#fff3cd,stroke:#ffc107,stroke-width:3px
33
30
  ```
34
31
 
35
- > 📍 You are in the explore phase (thinking only) → standard path next: `llman-sdd-propose` (propose)
36
- > 📎 For small changes (no behavioral contract changes), go directly to `llman-sdd-quick` (quick path)
37
- > 🗺️ Skill navigation ≠ Git-native lifecycle
32
+ > 📍 You are in explore → next is usually `llman-sdd-propose`; small changes (no contract edits) go via `llman-sdd-quick`.
38
33
 
39
34
  ## Stance
40
- - Curious, not prescriptive
41
- - Grounded in the actual codebase
42
- - Visual when helpful (ASCII diagrams)
43
- - Willing to hold multiple options and tradeoffs
35
+ - Curious, not prescriptive; grounded in the actual codebase.
36
+ - Visual when helpful (ASCII diagrams); hold multiple options and tradeoffs.
44
37
 
45
38
  ## Suggested moves
46
- 1. Use `llman-sdd context --task "<task>" --paths "<files>"` to quickly locate relevant specs.
47
- - Read the `direct` spec files (these are the contracts you must understand).
48
- - If context is unavailable, rebuild with `llman-sdd index rebuild` (default `pageindex`, no model needed) and retry.
39
+ 1. Use `llman-sdd context --task "<task>" --paths "<files>"` to locate relevant specs; read the full text of the specs in its `direct` list (these are the contracts you must understand).
40
+ - Context unavailable → run `llman-sdd index check` first: stale/missing → `llman-sdd index rebuild` (default `pageindex`, no model needed) and retry; still unavailable on a fresh index (`LLMAN_SDD_INDEX_CHAT_MODEL` unset) → fall back to `llman-sdd list --specs` + reading `.feature` files directly — do not loop on rebuild.
49
41
  2. Clarify the goal and constraints (ask 1–3 questions).
50
- 3. **Grilling branch (optional, only when the user explicitly triggers)**: triggers on "deep-dig" / "grill" / "one at a time" / "nail it down". Walks the decision tree one question at a time:
51
- - **Ask one question at a time**, with your recommended answer, waiting for feedback before the next.
52
- - **Facts vs decisions**: look up anything verifiable by reading the capability `.feature`/code/running commands yourself — **don't ask** the user; only **decisions** (tradeoffs, preferences, scope boundaries) go to the user.
53
- - **Terminology sharpening**: when a term conflicts or is fuzzy, call it out immediately ("your spec defines 'X' as A, but you just said B — which is it?"); on resolution: if the change already has Branch binding and you are on the bound branch, update live `.feature` (Specs landing); otherwise record only in `proposal.md` — **never** edit live specs on the default branch. MUST NOT create a `CONTEXT.md` glossary as a second authority.
54
- - **Write decisions back**: resolved decisions go into the change's `proposal.md` "Open Questions" section (planning shell; OK briefly on the default branch).
55
- - **Completion criterion**: every pending decision is resolved or explicitly deferred. When not triggered, the default (ask 1–3 questions) behavior is unchanged.
42
+ 3. **Deep-dive Q&A branch (optional, only on explicit user trigger)**: triggers on "deep-dig" / "grill" / "one at a time" / "nail it down". Walk the decision tree one question at a time:
43
+ - Ask one question at a time, with your recommended answer; wait for feedback before the next.
44
+ - Facts vs decisions: verify anything checkable by reading the `.feature`/code/running commands yourself — **don't ask** the user; only decisions (tradeoffs, preferences, scope boundaries) go to the user.
45
+ - Terminology sharpening: when a term conflicts or is fuzzy, call it out immediately ("your spec defines 'X' as A, but you just said B — which is it?"); on resolution: if the change is branch-bound and you are on the bound branch, update the `.feature`; otherwise record only in `proposal.md` — never edit specs on the default branch. MUST NOT create a `CONTEXT.md` glossary as a second authority.
46
+ - Write decisions back: resolved decisions go into the change's `proposal.md` "Open Questions" section.
47
+ - Completion criterion: every pending decision is resolved or explicitly deferred. When not triggered, the default (ask 1–3 questions) behavior is unchanged.
56
48
  4. If a change id is relevant, read its artifacts under `llmanspec/changes/<id>/`.
57
- - When diagnosing validation errors, prefer `llman-sdd validate <spec> --strict --no-check` (fast mode, skips the potentially slow `bdd.run_command`); resolve structural gates first (Gherkin / `@req` linkage / dual-write / req_id uniqueness), then run full mode (`--check` or `cargo test --features bdd`). The `FAIL <item_type>/<id>` lines in the output pin down each failing item.
49
+ - When diagnosing validation errors, run `llman-sdd validate <spec> --strict` first for the structural gates (Gherkin / `@req` linkage / dual-write / req_id uniqueness); when `bdd.run_command` is configured, validate executes that harness by default (`--no-check` skips it). Failing items are pinned down in the default TOON output's `items[].issues[]`; `--output human` prints `FAIL <item_type>/<id>` lines.
58
50
  5. Explore options and tradeoffs (2–3 options).
59
- 6. Assess change scale (triage) to determine if full SDD is needed.
51
+ 6. Assess change scale to determine if full SDD is needed.
60
52
  7. When something crystallizes, offer to capture it (don't auto-write):
61
- - Scope / design / work items → planning shell (`proposal.md` / `design.md` / `tasks.md`)
62
- - Constraints / executable harness → **suggest** live `llmanspec/specs/**` (one `.feature` per capability); actual edits require Branch binding then Specs landing. If not bound yet in explore, record only in proposal — do not edit live specs.
63
-
64
- > Git-native: first `change start`/`attach` (Branch binding) to enter Full, then edit live `.feature` on the bound branch (Specs landing); no `change delta` / solidify / feature_delta.
53
+ - Scope / design / work items → planning docs (`proposal.md` / `design.md` / `tasks.md`)
54
+ - Constraints / executable harness → **suggest** `llmanspec/specs/**`; actual edits require a bound branch. If not bound yet, record only in proposal.
65
55
 
66
56
  ## Exiting explore mode
67
- When the user is ready to implement, choose based on change scale:
68
- - Behavioral contract change → `llman-sdd-propose` (create proposal artifacts)
69
- - Small change / no contract change → `llman-sdd-quick` (quick path)
70
- - `readyToImplement=true` → `llman-sdd-apply` (implement tasks)
57
+ - Behavioral contract change → `llman-sdd-propose`
58
+ - Small change / no contract change → `llman-sdd-quick`
59
+ - change already landed specs (`stage=full`, specs-landed gate green) → `llman-sdd-apply`
71
60
  If the user asks you to implement while in explore mode, STOP and remind them to exit explore mode first.
72
61
 
73
- > 💡 Explore done → next: `llman-sdd-propose` (propose) or `llman-sdd-quick` (quick path)
74
-
75
- > For command details run `llman-sdd <cmd> --help`; the CLI is the command reference — skills embed no command tables.
76
- > "Spec" here = a `.feature` file under this project's `llmanspec/specs/`; run `llman-sdd list --specs` or `llman-sdd show <capability>`.
62
+ {{ unit("skills/cli-footer") }}
77
63
 
78
64
  {{ unit("skills/structured-protocol") }}
@@ -1,38 +1,33 @@
1
1
  ---
2
2
  name: "llman-sdd-ff"
3
- description: "Fast-forward: create the planning shell then Branch binding + Specs landing in one pass. Never author under changes/<id>/specs/."
3
+ description: "Fast-forward the propose path in one pass: planning docs → bind branch → land specs."
4
4
  metadata:
5
5
  version: "{{ llman_version }}"
6
6
  ---
7
7
 
8
8
  # LLMAN SDD Fast-Forward (FF)
9
9
 
10
- Run the propose-equivalent path quickly: planning shell → Branch binding → Specs landing (through `readyToImplement=true`). This is **not** the old `changes/<id>/specs/` delta model.
10
+ Run the propose-equivalent path quickly: planning docs → bind branch → land specs (through the specs-landed gate). This is **not** the old `changes/<id>/specs/` delta model.
11
11
 
12
12
  ## Hard constraints
13
13
 
14
- - **Planning shell** only under `llmanspec/changes/<id>/` (proposal/design/tasks).
15
- - Live contracts only under bound-branch `llmanspec/specs/**` (Specs landing).
16
- - **Do not** create `llmanspec/changes/<id>/specs/` or `*.feature.delta.toon`.
17
- - Enter apply only when `readyToImplement=true`.
14
+ - Planning docs only under `llmanspec/changes/<id>/` (proposal/design/tasks); specs only under bound-branch `llmanspec/specs/**`.
15
+ - **Do not** create `llmanspec/changes/<id>/specs/`.
16
+ - Enter apply when `stage=full` and the specs-landed gate passes (or `needs_specs_change: false`); verify/finalize require `readyToImplement=true`.
18
17
 
19
18
  ## Steps
20
19
 
21
- 1. Ask the user for a short description, change id (or derive), impacted capability, and confirm the final id.
20
+ 1. Take a one-line description; derive the change id when not supplied and announce it (non-blocking, same rule as propose); identify the impacted capability.
22
21
  2. Ensure `llman-sdd init` has been run (`llmanspec/` exists).
23
22
  3. If `llmanspec/changes/<id>/` exists: ask fill-missing vs new id; do not overwrite without confirmation.
24
- 4. Create the **planning shell** (OK briefly on the default branch):
25
- - `llman-sdd change new <id>` (or hand-write) → flesh out `proposal.md`
26
- - `design.md` (if needed)
27
- - `tasks.md`
28
- 5. **Branch binding**: `llman-sdd change start <id>` (clean tree on default branch) or create a branch then `change attach <id>`.
29
- 6. **Specs landing**: on the bound branch, edit live `llmanspec/specs/<capability>.feature` (flat, or directory main file) and commit; or set `needs_specs_change: false` when there is no contract edit.
30
- 7. Validate: `llman-sdd validate <id> --strict --no-interactive`.
31
- 8. Confirm `readyToImplement=true` via `llman-sdd show <id> --json`, then suggest `llman-sdd-apply` (do not suggest apply before ready).
23
+ 4. Create the planning docs (OK briefly on the default branch): `llman-sdd change new <id>` (or hand-write) → flesh out `proposal.md` → `design.md` (if needed) → `tasks.md`.
24
+ 5. **Bind the branch**: `llman-sdd change start <id>` (clean tree on the default branch) or create a branch then `change attach <id>`.
25
+ 6. **Land specs**: on the bound branch, edit `llmanspec/specs/<capability>.feature` (flat, or directory main file) and commit; or set `needs_specs_change: false` when there is no contract edit.
26
+ 7. Validate: `llman-sdd validate <id> --strict`.
27
+ 8. Confirm the specs-landed gate is green via `llman-sdd show <id> --output json` (`specsLanded` / `needsSpecsChange`), then suggest `llman-sdd-apply` (do not suggest apply before landing).
32
28
 
33
29
  {{ unit("skills/git-native-flow-brief") }}
34
- > For command details run `llman-sdd <cmd> --help`; the CLI is the command reference — skills embed no command tables.
35
- > "Spec" here = a `.feature` file under this project's `llmanspec/specs/`; run `llman-sdd list --specs` or `llman-sdd show <capability>`.
30
+ {{ unit("skills/cli-footer") }}
36
31
  {{ unit("skills/validation-hints") }}
37
32
 
38
33
  {{ unit("skills/ethics-governance") }}
@@ -1,30 +1,17 @@
1
1
  ---
2
2
  name: "llman-sdd-graph"
3
- description: "Visualize llman SDD change dependency relationships as a mermaid graph. Use to understand blocking and depends_on relationships for planning or inspection. Auxiliary tool — not part of the main implementation pipeline."
3
+ description: "Visualize change dependencies (depends_on/blocks) as a mermaid graph. Auxiliary tool, usable at any stage."
4
4
  metadata:
5
5
  version: "{{ llman_version }}"
6
6
  ---
7
7
 
8
8
  # LLMAN SDD Dependency Graph
9
9
 
10
- Use this skill to visualize dependencies between changes.
11
-
12
- ## Pipeline Position
13
-
14
- ```mermaid
15
- flowchart LR
16
- pipeline["Main pipeline:<br/>propose → apply → verify → archive"]
17
- graph["📎 llman-sdd-graph<br/>Dependency visualization (utility)"]
18
- graph -.->|available at any stage| pipeline
19
-
20
- style graph fill:#e8f4e8,stroke:#28a745,stroke-width:2px
21
- ```
22
-
23
- > 📎 Utility tool, available at any pipeline stage. To propose → `llman-sdd-propose`. To implement → `llman-sdd-apply` only when `readyToImplement=true`.
10
+ Visualize dependencies between changes. Auxiliary tool, not part of the main pipeline (propose → apply → verify → archive); usable at any stage.
24
11
 
25
12
  ## Usage
26
13
 
27
- **Focus view (seed mode):** Show a specific change and its relationship neighborhood.
14
+ **Focus view (seed mode)** — a specific change and its neighborhood:
28
15
 
29
16
  ```bash
30
17
  llman-sdd graph <change-id> # the change + direct relationships (depth 1)
@@ -32,27 +19,28 @@ llman-sdd graph <change-id> --depth 3 # recurse 3 levels
32
19
  llman-sdd graph <change-id> --depth 0 # just the change itself
33
20
  ```
34
21
 
35
- Seed mode traverses three directions: upstream (depends_on), downstream (depended by), and blocks, automatically discovering active and archived changes.
22
+ Traverses three directions: upstream (depends_on), downstream (depended by), and blocks; auto-discovers active and archived changes.
36
23
 
37
- **Global view (scope mode):** Show all changes by scope.
24
+ **Global view (scope mode)** — scope nodes are roots expanded one level along `depends_on` (depth 1, default; avoids unbounded dependency chains); `--depth` constrains this mode too:
38
25
 
39
26
  ```bash
40
- llman-sdd graph # all active changes (default)
41
- llman-sdd graph --scope archived # all archived (completed) changes
42
- llman-sdd graph --scope all # everything
27
+ llman-sdd graph # active changes + direct deps (depth 1 default)
28
+ llman-sdd graph --scope archived # archived + direct deps
29
+ llman-sdd graph --scope all # everything + direct deps
30
+ llman-sdd graph --depth 0 # scope nodes only (no dependency targets)
31
+ llman-sdd graph --depth 3 # recurse 3 levels along dependency chains
43
32
  ```
44
33
 
45
34
  ## Output
46
35
 
47
- - Output is a mermaid flowchart to stdout, pipeable to a file or renderer:
36
+ - Mermaid flowchart to stdout, pipeable to a file or renderer:
48
37
  ```
49
38
  llman-sdd graph c50 > deps.mmd
50
39
  llman-sdd graph c50 --depth 2 | mmdc -i - -o deps.png
51
40
  ```
52
- - Archived (completed) changes are shown with "✓ done" suffix and green highlight.
53
- - When the graph contains disconnected groups, each group renders as an independent subgraph labeled "Active", "Done", or "Mixed".
41
+ - Archived changes show a "✓ done" suffix and green highlight; disconnected groups render as independent subgraphs labeled "Active" / "Done" / "Mixed".
54
42
 
55
- ## Proposal frontmatter format
43
+ ## Declaring dependencies (proposal frontmatter)
56
44
 
57
45
  ```yaml
58
46
  ---
@@ -61,14 +49,8 @@ depends_on:
61
49
  blocks:
62
50
  - blocked-change-id
63
51
  ---
64
-
65
- ## Why
66
- ...
67
52
  ```
68
53
 
69
- > 💡 This is just a utility — main flow: `llman-sdd-propose` (Branch binding + Specs landing) → `llman-sdd-apply` (requires `readyToImplement`) → `llman-sdd-verify` → `llman-sdd-archive`.
70
-
71
- > For command details run `llman-sdd <cmd> --help`; the CLI is the command reference — skills embed no command tables.
72
- > "Spec" here = a `.feature` file under this project's `llmanspec/specs/`; run `llman-sdd list --specs` or `llman-sdd show <capability>`.
54
+ {{ unit("skills/cli-footer") }}
73
55
 
74
56
  {{ unit("skills/ethics-governance") }}