@llman-sdd/core 0.1.0 → 0.1.2

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 (62) hide show
  1. package/package.json +7 -2
  2. package/templates/en/agents-root-stub.md +9 -0
  3. package/templates/en/llmanspec-agents-stub.md +6 -0
  4. package/templates/en/skills/llman-sdd-apply-cycle.md +75 -0
  5. package/templates/en/skills/llman-sdd-apply.md +126 -0
  6. package/templates/en/skills/llman-sdd-arch-review.md +65 -0
  7. package/templates/en/skills/llman-sdd-archive.md +85 -0
  8. package/templates/en/skills/llman-sdd-continue.md +41 -0
  9. package/templates/en/skills/llman-sdd-draft.md +64 -0
  10. package/templates/en/skills/llman-sdd-explore.md +78 -0
  11. package/templates/en/skills/llman-sdd-ff.md +38 -0
  12. package/templates/en/skills/llman-sdd-graph.md +74 -0
  13. package/templates/en/skills/llman-sdd-onboard.md +34 -0
  14. package/templates/en/skills/llman-sdd-propose.md +120 -0
  15. package/templates/en/skills/llman-sdd-quick.md +56 -0
  16. package/templates/en/skills/llman-sdd-research.md +46 -0
  17. package/templates/en/skills/llman-sdd-show.md +24 -0
  18. package/templates/en/skills/llman-sdd-specs-compact.md +66 -0
  19. package/templates/en/skills/llman-sdd-validate.md +32 -0
  20. package/templates/en/skills/llman-sdd-verify.md +96 -0
  21. package/templates/en/skills/llman-sdd-wayfinder.md +87 -0
  22. package/templates/en/units/migrate-prompt.md +28 -0
  23. package/templates/en/units/skills/ethics-governance.md +6 -0
  24. package/templates/en/units/skills/git-native-flow-brief.md +9 -0
  25. package/templates/en/units/skills/git-native-flow.md +40 -0
  26. package/templates/en/units/skills/human-readable-summary.md +10 -0
  27. package/templates/en/units/skills/stage-guard.md +17 -0
  28. package/templates/en/units/skills/structured-protocol.md +27 -0
  29. package/templates/en/units/skills/validation-hints.md +24 -0
  30. package/templates/en/units/spec/feature-contract.md +29 -0
  31. package/templates/en/units/workflow/archive-freeze-guidance.md +6 -0
  32. package/templates/shared/review.html +45 -0
  33. package/templates/zh-Hans/agents-root-stub.md +9 -0
  34. package/templates/zh-Hans/llmanspec-agents-stub.md +6 -0
  35. package/templates/zh-Hans/skills/llman-sdd-apply-cycle.md +75 -0
  36. package/templates/zh-Hans/skills/llman-sdd-apply.md +126 -0
  37. package/templates/zh-Hans/skills/llman-sdd-arch-review.md +65 -0
  38. package/templates/zh-Hans/skills/llman-sdd-archive.md +85 -0
  39. package/templates/zh-Hans/skills/llman-sdd-continue.md +41 -0
  40. package/templates/zh-Hans/skills/llman-sdd-draft.md +64 -0
  41. package/templates/zh-Hans/skills/llman-sdd-explore.md +78 -0
  42. package/templates/zh-Hans/skills/llman-sdd-ff.md +38 -0
  43. package/templates/zh-Hans/skills/llman-sdd-graph.md +74 -0
  44. package/templates/zh-Hans/skills/llman-sdd-onboard.md +34 -0
  45. package/templates/zh-Hans/skills/llman-sdd-propose.md +119 -0
  46. package/templates/zh-Hans/skills/llman-sdd-quick.md +56 -0
  47. package/templates/zh-Hans/skills/llman-sdd-research.md +46 -0
  48. package/templates/zh-Hans/skills/llman-sdd-show.md +24 -0
  49. package/templates/zh-Hans/skills/llman-sdd-specs-compact.md +66 -0
  50. package/templates/zh-Hans/skills/llman-sdd-validate.md +32 -0
  51. package/templates/zh-Hans/skills/llman-sdd-verify.md +96 -0
  52. package/templates/zh-Hans/skills/llman-sdd-wayfinder.md +87 -0
  53. package/templates/zh-Hans/units/migrate-prompt.md +28 -0
  54. package/templates/zh-Hans/units/skills/ethics-governance.md +6 -0
  55. package/templates/zh-Hans/units/skills/git-native-flow-brief.md +9 -0
  56. package/templates/zh-Hans/units/skills/git-native-flow.md +40 -0
  57. package/templates/zh-Hans/units/skills/human-readable-summary.md +10 -0
  58. package/templates/zh-Hans/units/skills/stage-guard.md +17 -0
  59. package/templates/zh-Hans/units/skills/structured-protocol.md +27 -0
  60. package/templates/zh-Hans/units/skills/validation-hints.md +24 -0
  61. package/templates/zh-Hans/units/spec/feature-contract.md +29 -0
  62. package/templates/zh-Hans/units/workflow/archive-freeze-guidance.md +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llman-sdd/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Pure domain logic for llman-sdd (config, gherkin specs, validation, templates)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -9,7 +9,8 @@
9
9
  "directory": "packages/core"
10
10
  },
11
11
  "files": [
12
- "src"
12
+ "src",
13
+ "templates"
13
14
  ],
14
15
  "type": "module",
15
16
  "exports": {
@@ -23,6 +24,10 @@
23
24
  "typecheck": "bun run --cwd ../.. typecheck"
24
25
  },
25
26
  "dependencies": {
27
+ "7z-wasm": "^1.2.0",
28
+ "@cucumber/gherkin": "^42.0.1",
29
+ "@cucumber/messages": "^34.2.1",
30
+ "nunjucks": "^3.2.4",
26
31
  "yaml": "^2.9.1",
27
32
  "zod": "^4.6.5"
28
33
  },
@@ -0,0 +1,9 @@
1
+ # LLMAN Spec-Driven Development
2
+
3
+ This project uses llman SDD. Read `llmanspec/config.yaml` for SDD command behavior configuration, and `llmanspec/AGENTS.md` for additional project-specific rules.
4
+
5
+ ## SDD Pipeline
6
+
7
+ Use `/llman-sdd-explore` to get started, then follow the pipeline: `/llman-sdd-propose` → `/llman-sdd-apply` → `/llman-sdd-verify` → `/llman-sdd-archive`.
8
+
9
+ Keep this managed block so `llman sdd init --update` can refresh it.
@@ -0,0 +1,6 @@
1
+ # llmanspec AGENTS.md
2
+
3
+ This file is referenced by the root `AGENTS.md` managed block. Use it to add
4
+ project-specific rules, context, or conventions that you want AI agents to follow.
5
+
6
+ <!-- Add your rules below this line -->
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: "llman-sdd-apply-cycle"
3
+ description: "Single closed-loop for one change: gate→implement→test→validate→verify→archive→commit. Manual trigger only. Agent MUST NOT auto-invoke."
4
+ metadata:
5
+ version: "{{ llman_version }}"
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # LLMAN SDD Apply Cycle
10
+
11
+ End-to-end closed loop for one change (manual). Requires Branch binding and `readyToImplement=true`.
12
+
13
+ **Manual trigger only**: `/skill:llman-sdd-apply-cycle <change-id>`
14
+
15
+ ## Workflow
16
+
17
+ ### 0) Gate + status
18
+ ```bash
19
+ llman sdd show <change-id> --json --type change
20
+ ```
21
+ > Stage gate: decide from `stage` / `readyToImplement` in `llman sdd show <id> --json --type change`; full decision table lives in llman-sdd-apply.
22
+
23
+ - Must be on the bound non-default branch.
24
+ - If `readyToImplement` is not true → STOP (finish Specs landing or `needs_specs_change: false`); **do not** finalize yet.
25
+ - Track progress via `tasks.md` checkboxes (or `llman sdd list` task counts); still read `tasks.md`, proposal/design, and live `llmanspec/specs/**` on the bound branch (SSOT).
26
+
27
+ ### 1) Loop: implement → test
28
+ For each incomplete task:
29
+ 1. Implement per task + live specs (minimal diff)
30
+ 2. Run `tasks[].test` if present
31
+ 3. On failure, fix and retry (same self-repair budget as `llman-sdd-apply`: cap 8 rounds)
32
+ 4. Check off `tasks.md` as `[x]`
33
+
34
+ ### 2) Validate
35
+ ```bash
36
+ llman sdd validate <change-id> --strict --no-interactive
37
+ ```
38
+ On failure, fix and retry (same self-repair budget as `llman-sdd-apply`: cap 8 rounds).
39
+
40
+ ### 3) Verify (recommended)
41
+ Prefer `llman-sdd-verify` (or equivalent dual-axis self-check). CRITICAL → STOP; do not archive.
42
+
43
+ ### 4) Archive
44
+ ```bash
45
+ llman sdd change finalize <change-id>
46
+ ```
47
+ (dirty tree OK; auto merge (squash default) + docs rename + **auto commit** `archive(sdd): <change-id>` in one process. `--no-commit` skips the auto commit for manual/CI histories — then commit with `git add -A && git commit -m "archive(sdd): <change-id>"`.)
48
+
49
+ `change checkpoint` is removed; the plain `change archive` command stays as a fallback (no checkpointed field required).
50
+
51
+ ### 5) Commit (see step 4)
52
+ Finalize already auto-committed unless `--no-commit` was passed.
53
+
54
+ ### 6) Optional cleanup
55
+ ```bash
56
+ git branch -D <feature-branch> # after squash the branch is no longer an ancestor of main; -d gets refused
57
+ ```
58
+ push / hosting PR only when the user explicitly asks.
59
+
60
+ ## Hard constraints
61
+ - **Never ask** "should I continue" unless blocked.
62
+ - **Never switch** changes until this one is archived and committed.
63
+ - **Retry cap**: self-repair follows `llman-sdd-apply`'s 8-round budget (including the diagnose escalation path).
64
+ - **Do not** author `changes/<id>/specs/` or use `change delta`.
65
+ - **No default push/PR**.
66
+
67
+ ## Ethics Governance
68
+ - `ethics.risk_level`: medium
69
+ - `ethics.prohibited_actions`: implement/archive without `readyToImplement`, switching changes early, writing `changes/<id>/specs/`, commit without validation, default push/PR
70
+ - `ethics.required_evidence`: `readyToImplement=true`, validate --strict pass, all tasks checked, finalize/archive success
71
+ - `ethics.refusal_contract`: after 3 gate/validation failures, report blocker; do not force-archive
72
+ - `ethics.escalation_policy`: if changing SDD workflow specs/templates, pause for user confirm before archive
73
+
74
+ > For command details run `llman sdd <cmd> --help`; the CLI is the command reference — skills embed no command tables.
75
+ > "Spec" here = a `.feature` file under this project's `llmanspec/specs/`; run `llman sdd list --specs` or `llman sdd show <capability>`.
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: "llman-sdd-apply"
3
+ description: "Implement tasks from an llman SDD change in a closed loop — write code, run tests, self-heal on failures until all gates pass. Use when a change is proposed and ready to implement. Updates tasks.md checkboxes and runs validation."
4
+ metadata:
5
+ version: "{{ llman_version }}"
6
+ ---
7
+
8
+ # LLMAN SDD Apply
9
+
10
+ Implement all tasks in `llmanspec/changes/<id>/tasks.md` **in one closed loop**:
11
+ Implement code → Add tests/acceptance → Run gates → Self-heal on failures → Report results when all pass.
12
+ Unless there is a clear blocker, **DO NOT stop halfway to ask "should I continue?"**
13
+
14
+ ## Pipeline Position
15
+
16
+ {{ unit("skills/git-native-flow-brief") }}
17
+
18
+ ### Skill navigation (not the lifecycle; shows current skill only)
19
+
20
+ ```mermaid
21
+ flowchart LR
22
+ propose["llman-sdd-propose<br/>Propose"] --> apply
23
+ apply["★ llman-sdd-apply ★<br/>Implement (readyToImplement)"]
24
+ apply --> verify["llman-sdd-verify<br/>Verify"]
25
+ verify --> archive["llman-sdd-archive<br/>Archive"]
26
+
27
+ style apply fill:#fff3cd,stroke:#ffc107,stroke-width:3px
28
+ ```
29
+
30
+ > 📍 You are at Git-native **H (apply)** in the full lifecycle diagram: Specs-landed (or `needs_specs_change: false`) and `readyToImplement=true` required first → next: `llman-sdd-verify`
31
+
32
+ ## Hard Constraints
33
+
34
+ - **SSOT-driven**: `proposal.md` / `design.md` / `tasks.md` and live `llmanspec/specs/**` on the feature branch are the single source of truth; every MUST/SHALL in specs must be fulfilled.
35
+ - **Scope-locked**: Only implement what's in the current change; don't fix "unrelated issues" on the side.
36
+ - **Minimal changes**: Keep changes minimal and strictly scoped to current tasks.
37
+ - **No guessing**: If requirements are unclear, or specs contradict reality, STOP and report — don't assume behavior.
38
+ - **No legacy compatibility layers**: If a change requires new behavior, upgrade all call sites directly, unless tasks/proposal explicitly require compatibility.
39
+ - **Don't ask "should I continue?"**: Execute to loop closure unless you hit an unresolvable blocker.
40
+ - **Close-out**: this skill's closed loop ends by suggesting `llman-sdd-verify`; finalize/archive is handled by `llman-sdd-archive` (do not finalize inside the self-healing loop).
41
+
42
+ ## Commit Policy
43
+
44
+ - **Commits on the change branch are free** (no mid-flight archive point; `change finalize` needs no clean tree): segment by task or milestone when it helps review, or keep the working tree dirty and let finalize make ONE close commit — both are first-class. `change checkpoint` no longer exists (calling it exits non-zero and points to finalize), so there is no mid-flight "archive point" to maintain; `change finalize` handles both shapes (it does NOT require a clean tree).
45
+ - **Default close-out**: after all tasks pass gates and verify is green, `llman sdd change finalize <id>` auto-commits `archive(sdd): <change-id>` (uncommitted impl diff + frontmatter + archive rename in one commit). Do not run finalize inside the apply loop. `--no-commit` skips the auto commit (manual/CI histories; pre-commit-hook conflicts).
46
+ - **Blocker interrupt**: when you must STOP on a blocker, make ONE work-in-progress commit (e.g. `wip(sdd): <change-id> <summary>`) to preserve the state, then report.
47
+
48
+ ## Steps
49
+
50
+ ### 0) Preflight (required)
51
+ - Read and obey: `llmanspec/config.yaml`, `AGENTS.md` (if present).
52
+ - `git status --porcelain`:
53
+ - If working tree is dirty and changes don't belong to the current change: `git stash push -u -m "llman-sdd-apply autopilot backup"`.
54
+ - Run `llman sdd validate --all --strict --no-interactive`:
55
+ - If it fails for reasons unrelated to the current change, stop and report (inconsistent artifacts prevent SSOT-driven implementation).
56
+ - **Check spec valid_scope integrity**: use `llman sdd list --specs --json` to list all specs, then for each spec verify every path in its `valid_scope` exists on disk. If any scope file/directory is missing, stop and suggest updating the spec (remove the deleted path from `valid_scope`).
57
+
58
+ ### 1) Select change id and check prerequisites
59
+ - If a change id is provided, use it directly.
60
+ - Otherwise infer from context; if ambiguous, run `llman sdd list --json` and let user pick.
61
+ - Always announce: "Using change: <id>" and how to override.
62
+ - Confirm you are on the non-default feature branch bound via `llman sdd change start <id>` or `change attach <id>` (`--force` only to rebind). Specs/features on the branch are SSOT — do not author under `changes/<id>/specs/`.
63
+ {{ unit("skills/stage-guard") }}
64
+ - Use `llman sdd context --task "<goal from proposal>" --paths "<scope from specs>"` to get relevant specs.
65
+ - If context is unavailable, run `llman sdd index rebuild` and retry.
66
+
67
+ ### 2) Read SSOT artifacts
68
+ You must read through:
69
+ - `llmanspec/changes/<id>/proposal.md`
70
+ - `llmanspec/changes/<id>/design.md` (if present)
71
+ - `llmanspec/changes/<id>/tasks.md`
72
+ - Live specs on the feature branch: `llmanspec/specs/**` (`<capability>.feature`) — this is SSOT
73
+
74
+ Extract hard constraints from proposal.md and design.md decisions. Convert tasks.md into a minimal executable step sequence (preserving original order).
75
+
76
+ ### 3) Show status
77
+ - Progress: "N/M tasks complete"
78
+ - Next 1–3 unchecked tasks (brief overview)
79
+
80
+ ### 4) Implement tasks one by one (closed-loop execution)
81
+ For each unchecked task:
82
+ 1. **Implement**: strictly per task description + specs requirements, keep changes minimal.
83
+ 2. **Update checkbox immediately** after completion: `- [ ]` → `- [x]`.
84
+ 3. If task is unclear, you hit a blocker, or specs/design don't match reality → STOP and report the blocker, don't assume.
85
+
86
+ > 💡 Previous phase `llman-sdd-propose` (generated tasks); after this phase → `llman-sdd-verify` (verify)
87
+
88
+ ### 5) Verification and self-healing loop (run after each task or batch)
89
+ Run project gate commands (adapt to the actual project):
90
+ - Relevant test suite: `just test` or `cargo test --all`
91
+ - Format/lint: `just check` or `just lint` + `just fmt`
92
+ - Git-native: stay on the bound feature branch; edit live `llmanspec/specs/<capability>.feature` (flat, or directory `llmanspec/specs/<capability>/` main file; rules `@human`, acceptance `@executable`) as needed; run `llman sdd validate --specs` after spec edits; commit on the branch freely (segmented or leave dirty for finalize). Do not use `change delta` / solidify / feature_delta; `change checkpoint` is removed.
93
+ - SDD validation: `llman sdd validate <id> --strict --no-interactive`
94
+
95
+ **On failure → enter self-healing loop (don't ask "should I continue?"):**
96
+ 1. Parse failure cause (test failure / lint / format / validation error).
97
+ 2. **Decide if it's a hard-to-locate bug** (cause unclear / intermittent flake / regression not obvious at a glance):
98
+ - **Not hard-to-locate** (clear lint/format/compile/validation error): apply a minimum fix (don't expand scope); re-run the "minimum failure repro command" first, then re-run all gates.
99
+ - **Hard-to-locate bug → escalate to the diagnose sub-flow**:
100
+ 1. **First build a command that reproduces the failure** (fast, deterministic, agent-runnable, and goes red on *this* bug) — one that drives the real bug path and asserts the user's exact symptom. **MUST NOT start hypothesizing before such a command exists** (staring at code and guessing is the failure this prevents).
101
+ 2. Run it, confirm red → minimize the repro (cut inputs/calls/config/data one at a time, keep only what's load-bearing).
102
+ 3. Generate **3–5 ranked hypotheses**, each falsifiable ("if X is the cause, changing Y makes the bug disappear").
103
+ 4. Verify one variable at a time; fix once the root cause is found.
104
+ 5. If there's no correct seam for a regression test, note the architectural gap (hand off to `llman-sdd-arch-review`; when that skill is not enabled via `extra_skills`, write the gap into this change's `proposal.md` Further Notes section or `design.md`, and MUST NOT break the loop over it).
105
+ 3. Re-run the "minimum failure repro command" first, then re-run all gates.
106
+ 4. Log as one self-healing round: `Round N: failure → fix → re-run → pass/fail`.
107
+
108
+ **Self-healing cap: 8 rounds**; exceeding this is a blocker: stop and output a blocker report (last failing command + output summary + what you tried).
109
+
110
+ **Human review checkpoint (after each task batch passes the gates)**: once a batch is green, before starting the next batch or producing the completion report, run `llman sdd review`:
111
+
112
+ - Exit code zero → continue.
113
+ - Non-zero exit = CRITICAL findings: STOP, fix, re-run review; MUST NOT enter the next batch or emit the completion report with CRITICAL findings open.
114
+
115
+ ### 6) Completion report
116
+ After all tasks complete + all gates green, output a structured report (see Output Contract below).
117
+ Then suggest running `llman-sdd-verify` for the verification phase.
118
+
119
+ > 💡 Implementation done → next: `llman-sdd-verify` (verify)
120
+
121
+ > For command details run `llman sdd <cmd> --help`; the CLI is the command reference — skills embed no command tables.
122
+ > "Spec" here = a `.feature` file under this project's `llmanspec/specs/`; run `llman sdd list --specs` or `llman sdd show <capability>`.
123
+
124
+ {{ unit("skills/validation-hints") }}
125
+
126
+ {{ unit("skills/structured-protocol") }}
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: "llman-sdd-arch-review"
3
+ description: "Scan codebase for shallow modules (interface nearly equals implementation) and surface deepening candidates. Use when the user wants an architecture review, seeks module deepening opportunities, or wants to improve testability and AI-navigability."
4
+ metadata:
5
+ version: "{{ llman_version }}"
6
+ ---
7
+
8
+ # LLMAN SDD Architecture Review
9
+
10
+ Scan the codebase for architectural friction and surface **deepening opportunities** — refactors that turn shallow modules (interface nearly equals implementation) into deep ones (lots of behaviour behind a small interface). The aim is testability and AI-navigability.
11
+
12
+ ## Pipeline position
13
+
14
+ Auxiliary tool, not part of the main pipeline (explore→propose→apply→verify→archive). Usable at any stage; commonly triggered during explore to surface improvement candidates.
15
+
16
+ > 📍 Standalone optional skill; does not replace any pipeline stage.
17
+
18
+ ## Design vocabulary
19
+
20
+ A set of words about module shape, used to articulate "where it's worth changing". MUST NOT substitute "component" / "service" / "API" / "boundary" (they are broader, less precise):
21
+
22
+ - **Module** — anything with an interface and an implementation (function/class/package/cross-layer slice).
23
+ - **Interface** — everything a caller must know to use it correctly: type signature, plus invariants, ordering constraints, error modes, performance characteristics.
24
+ - **Depth** — the amount of behaviour behind the interface. **Deep** = lots of behaviour behind a small interface; **shallow** = interface nearly as complex as the implementation (the caller saves nothing).
25
+ - **Seam** — a place where you can swap the implementation without editing call sites (where the interface lives). In llman, seam = the public boundary driven by `*.feature` GWT steps.
26
+ - **Leverage** — what callers get from depth: more capability per unit of interface learned.
27
+ - **Locality** — what maintainers get from depth: changes/bugs/knowledge/verification concentrate in one place.
28
+
29
+ ## Steps
30
+
31
+ ### 1. Explore (scope first, YAGNI)
32
+ - If the user named a direction (module/subsystem/pain point), accept it; skip inference.
33
+ - Otherwise walk `git log --oneline` for hot spots (files/areas that keep coming up).
34
+ - Prefer reading live `<capability>.feature` (single-track SSOT) and `design.md` (existing ADRs); MUST NOT create a `CONTEXT.md`.
35
+ - Use the Agent tool (`subagent_type=Explore`) to walk the codebase, noting friction:
36
+ - Does understanding one concept require bouncing between many small modules?
37
+ - Where are modules **shallow** (interface nearly as complex as the implementation)?
38
+ - Where are pure functions extracted only for testability, but real bugs hide in how they're called (no locality)?
39
+ - Which parts are untested or hard to test through their current interface?
40
+
41
+ ### 2. Present candidates
42
+ For each candidate:
43
+ - **Files** — which files/modules are involved.
44
+ - **Problem** — why the current architecture causes friction (use depth/leverage/locality).
45
+ - **Solution** — plain-English description of what would change.
46
+ - **Benefits** — locality and leverage improvements; how tests get better.
47
+ - **Recommendation strength** — `Strong` / `Worth exploring` / `Speculative`.
48
+
49
+ **Deletion test**: for any suspected-shallow module, imagine deleting it — does complexity vanish (it's just a pass-through, no value) or reappear across N call sites (it's actually earning its keep)? "Reappears" is the signal you want.
50
+
51
+ **ADR conflicts**: if a candidate contradicts an existing `design.md` decision, surface it only when the friction is real enough to warrant reopening, and mark it in the candidate.
52
+
53
+ ### 3. Grilling (after the user picks a candidate)
54
+ Run `llman-sdd-explore`'s **grilling branch** (trigger "deep-dig") to walk the decision tree — constraints, dependencies, the deepened module's shape, what sits behind the seam, which tests survive.
55
+
56
+ - A deepened module uses a concept not in the capability `.feature`? → update live `.feature` **only** if the change already has Branch binding and you are on the bound branch (Specs landing); otherwise STOP and route to `llman-sdd-propose` / `change start` — **never** edit live specs on the default branch.
57
+ - User rejects the candidate with a load-bearing reason? → offer an ADR only when "hard to reverse + surprising without context + real trade-off" all hold; record in `design.md`.
58
+
59
+ ## Output
60
+ Candidate list (text; optional HTML report written to OS temp dir, not the repo) + the grilling decision record after the user picks one (write back to proposal; contract edits only via Specs landing into live `.feature`).
61
+
62
+ > For command details run `llman sdd <cmd> --help`; the CLI is the command reference — skills embed no command tables.
63
+ > "Spec" here = a `.feature` file under this project's `llmanspec/specs/`; run `llman sdd list --specs` or `llman sdd show <capability>`.
64
+
65
+ {{ unit("skills/structured-protocol") }}
@@ -0,0 +1,85 @@
1
+ ---
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."
4
+ metadata:
5
+ version: "{{ llman_version }}"
6
+ ---
7
+
8
+ # LLMAN SDD Archive
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.
11
+
12
+ ## Pipeline Position
13
+
14
+ ```mermaid
15
+ flowchart LR
16
+ verify["llman-sdd-verify<br/>Verify"] --> archive
17
+ archive["★ llman-sdd-archive ★<br/>Archive (you are here)"]
18
+
19
+ style archive fill:#fff3cd,stroke:#ffc107,stroke-width:3px
20
+ ```
21
+
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.
24
+
25
+ ## Hard Constraints
26
+
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.
30
+ - **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.
32
+
33
+ ## Steps
34
+
35
+ ### 0) Preflight
36
+ - `git status --porcelain`: confirm working tree changes belong to completed changes.
37
+ - If unexpected changes exist, handle them (stash or report).
38
+
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.
43
+
44
+ ### 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.
48
+ - 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):
58
+ ```text
59
+ 1. Implement live specs + code (working tree may stay dirty; commits on the branch are free — segmented or none)
60
+ 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
62
+ ```
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).
65
+
66
+ ### 3) Full validation
67
+ - After all archives complete: `llman sdd validate --all --strict --no-interactive`.
68
+ - Confirm post-archive spec artifacts are consistent.
69
+
70
+ ### 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`.
77
+
78
+ {{ unit("workflow/archive-freeze-guidance") }}
79
+
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>`.
82
+
83
+ {{ unit("skills/validation-hints") }}
84
+
85
+ {{ unit("skills/structured-protocol") }}
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: "llman-sdd-continue"
3
+ description: "Continue an existing llman SDD change by creating the next artifact."
4
+ metadata:
5
+ version: "{{ llman_version }}"
6
+ ---
7
+
8
+ # LLMAN SDD Continue
9
+
10
+ Use this skill to continue an existing change and create the next missing artifact.
11
+
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):
20
+ 1) `proposal.md`
21
+ 2) `design.md` (only if design tradeoffs matter)
22
+ 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)
35
+
36
+ {{ 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>`.
39
+ {{ unit("skills/validation-hints") }}
40
+
41
+ {{ unit("skills/structured-protocol") }}
@@ -0,0 +1,64 @@
1
+ ---
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."
4
+ metadata:
5
+ version: "{{ llman_version }}"
6
+ ---
7
+
8
+ # LLMAN SDD Draft
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.
11
+
12
+ ## Pipeline Position
13
+
14
+ ```mermaid
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"]
20
+
21
+ style draft fill:#fff3cd,stroke:#ffc107,stroke-width:3px
22
+ ```
23
+
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
27
+
28
+ ## Hard Constraints
29
+
30
+ - **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.
35
+
36
+ ## Steps
37
+
38
+ ### 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.
41
+
42
+ ### 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.
45
+
46
+ ### 2) Create the draft shell
47
+ ```bash
48
+ llman sdd change new --from "<user description>"
49
+ ```
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).
52
+
53
+ ### 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).
58
+
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>`.
63
+
64
+ {{ unit("skills/ethics-governance") }}
@@ -0,0 +1,78 @@
1
+ ---
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."
4
+ metadata:
5
+ version: "{{ llman_version }}"
6
+ ---
7
+
8
+ # LLMAN SDD Explore
9
+
10
+ Use this skill when the user wants to think through ideas, investigate problems, or clarify requirements **before** starting implementation.
11
+
12
+ **IMPORTANT: Explore mode is for thinking, not implementing.**
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.
17
+
18
+ ## Pipeline Position
19
+
20
+ {{ unit("skills/git-native-flow-brief") }}
21
+
22
+ ### Skill navigation (not the lifecycle; shows current skill only)
23
+
24
+ ```mermaid
25
+ 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"]
31
+
32
+ style explore fill:#fff3cd,stroke:#ffc107,stroke-width:3px
33
+ ```
34
+
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
38
+
39
+ ## 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
44
+
45
+ ## 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.
49
+ 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.
56
+ 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.
58
+ 5. Explore options and tradeoffs (2–3 options).
59
+ 6. Assess change scale (triage) to determine if full SDD is needed.
60
+ 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.
65
+
66
+ ## 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)
71
+ If the user asks you to implement while in explore mode, STOP and remind them to exit explore mode first.
72
+
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>`.
77
+
78
+ {{ unit("skills/structured-protocol") }}
@@ -0,0 +1,38 @@
1
+ ---
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/."
4
+ metadata:
5
+ version: "{{ llman_version }}"
6
+ ---
7
+
8
+ # LLMAN SDD Fast-Forward (FF)
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.
11
+
12
+ ## Hard constraints
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`.
18
+
19
+ ## Steps
20
+
21
+ 1. Ask the user for a short description, change id (or derive), impacted capability, and confirm the final id.
22
+ 2. Ensure `llman sdd init` has been run (`llmanspec/` exists).
23
+ 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).
32
+
33
+ {{ 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>`.
36
+ {{ unit("skills/validation-hints") }}
37
+
38
+ {{ unit("skills/ethics-governance") }}