@llman-sdd/core 0.3.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/src/archive/freeze.ts +86 -18
- package/src/archive/frozenCard.ts +105 -0
- package/src/archive/sevenzip.ts +15 -13
- package/src/change/closeOutHarness.ts +29 -0
- package/src/change/collect.ts +140 -0
- package/src/change/frontmatter.ts +48 -6
- package/src/change/id.ts +2 -6
- package/src/change/lifecycle.ts +285 -86
- package/src/change/nextId.ts +63 -2
- package/src/change/resolve.ts +2 -2
- package/src/change/tasks.ts +59 -0
- package/src/config/changeId.ts +14 -12
- package/src/config/load.ts +14 -0
- package/src/config/schema.ts +4 -41
- package/src/config/surface.ts +6 -36
- package/src/context/indexStore.ts +7 -3
- package/src/context/retrieve.ts +8 -10
- package/src/context/tree.ts +28 -24
- package/src/git/spawnGit.ts +90 -2
- package/src/index.ts +81 -54
- package/src/init/defaultConfig.ts +1 -5
- package/src/init/init.ts +19 -4
- package/src/ports.ts +1 -7
- package/src/project/migrateNotes.ts +104 -0
- package/src/render/machine.ts +30 -0
- package/src/report/collect.ts +11 -127
- package/src/report/graph/analysis.ts +152 -0
- package/src/report/graph/deps.ts +30 -0
- package/src/report/graph/graphData.ts +53 -0
- package/src/report/graph/nodes.ts +130 -0
- package/src/report/graph/render.ts +83 -0
- package/src/report/graph/types.ts +47 -0
- package/src/report/graph.ts +9 -381
- package/src/report/show.ts +20 -22
- package/src/report/specHelpers.ts +45 -22
- package/src/report/specs.ts +23 -25
- package/src/review/review.ts +45 -30
- package/src/spec/authoring.ts +147 -71
- package/src/spec/ir.ts +43 -15
- package/src/spec/keywords.ts +147 -0
- package/src/spec/migrateNative.ts +201 -0
- package/src/spec/parser.ts +95 -83
- package/src/spec/reqRegistry.ts +31 -15
- package/src/templates/embedded.ts +10 -16
- package/src/templates/engine.ts +10 -5
- package/src/templates/locale.ts +1 -1
- package/src/templates/skills.ts +4 -5
- package/src/validation/changeCheck.ts +128 -105
- package/src/validation/harness.ts +161 -0
- package/src/validation/staleness.ts +9 -5
- package/src/validation/validate.ts +60 -88
- package/templates/en/skills/llman-sdd-apply-cycle.md +20 -28
- package/templates/en/skills/llman-sdd-apply.md +58 -76
- package/templates/en/skills/llman-sdd-arch-review.md +12 -19
- package/templates/en/skills/llman-sdd-archive.md +27 -42
- package/templates/en/skills/llman-sdd-continue.md +17 -24
- package/templates/en/skills/llman-sdd-draft.md +17 -28
- package/templates/en/skills/llman-sdd-explore.md +29 -43
- package/templates/en/skills/llman-sdd-ff.md +12 -17
- package/templates/en/skills/llman-sdd-graph.md +14 -32
- package/templates/en/skills/llman-sdd-propose.md +48 -63
- package/templates/en/skills/llman-sdd-quick.md +12 -27
- package/templates/en/skills/llman-sdd-research.md +13 -24
- package/templates/en/skills/llman-sdd-specs-compact.md +14 -39
- package/templates/en/skills/llman-sdd-validate.md +11 -15
- package/templates/en/skills/llman-sdd-verify.md +23 -44
- package/templates/en/skills/llman-sdd-wayfinder.md +18 -22
- package/templates/en/units/skills/cli-footer.md +2 -0
- package/templates/en/units/skills/git-native-flow-brief.md +7 -6
- package/templates/en/units/skills/git-native-flow.md +21 -11
- package/templates/en/units/skills/human-readable-summary.md +2 -3
- package/templates/en/units/skills/stage-guard.md +7 -7
- package/templates/en/units/skills/structured-protocol.md +5 -8
- package/templates/en/units/skills/validation-hints.md +10 -14
- package/templates/en/units/spec/feature-contract.md +27 -16
- package/templates/en/units/workflow/archive-freeze-guidance.md +6 -3
- package/templates/zh-Hans/skills/llman-sdd-apply-cycle.md +23 -31
- package/templates/zh-Hans/skills/llman-sdd-apply.md +63 -81
- package/templates/zh-Hans/skills/llman-sdd-arch-review.md +21 -28
- package/templates/zh-Hans/skills/llman-sdd-archive.md +29 -44
- package/templates/zh-Hans/skills/llman-sdd-continue.md +17 -24
- package/templates/zh-Hans/skills/llman-sdd-draft.md +18 -29
- package/templates/zh-Hans/skills/llman-sdd-explore.md +34 -48
- package/templates/zh-Hans/skills/llman-sdd-ff.md +13 -18
- package/templates/zh-Hans/skills/llman-sdd-graph.md +16 -34
- package/templates/zh-Hans/skills/llman-sdd-propose.md +51 -65
- package/templates/zh-Hans/skills/llman-sdd-quick.md +15 -30
- package/templates/zh-Hans/skills/llman-sdd-research.md +17 -28
- package/templates/zh-Hans/skills/llman-sdd-specs-compact.md +15 -40
- package/templates/zh-Hans/skills/llman-sdd-validate.md +11 -15
- package/templates/zh-Hans/skills/llman-sdd-verify.md +26 -47
- package/templates/zh-Hans/skills/llman-sdd-wayfinder.md +25 -29
- package/templates/zh-Hans/units/skills/cli-footer.md +2 -0
- package/templates/zh-Hans/units/skills/git-native-flow-brief.md +7 -6
- package/templates/zh-Hans/units/skills/git-native-flow.md +22 -12
- package/templates/zh-Hans/units/skills/human-readable-summary.md +4 -5
- package/templates/zh-Hans/units/skills/stage-guard.md +9 -9
- package/templates/zh-Hans/units/skills/structured-protocol.md +5 -8
- package/templates/zh-Hans/units/skills/validation-hints.md +10 -14
- package/templates/zh-Hans/units/spec/feature-contract.md +25 -16
- package/templates/zh-Hans/units/workflow/archive-freeze-guidance.md +6 -2
- package/templates/en/skills/llman-sdd-onboard.md +0 -34
- package/templates/en/skills/llman-sdd-show.md +0 -24
- package/templates/en/units/migrate-prompt.md +0 -28
- package/templates/zh-Hans/skills/llman-sdd-onboard.md +0 -34
- package/templates/zh-Hans/skills/llman-sdd-show.md +0 -24
- package/templates/zh-Hans/units/migrate-prompt.md +0 -28
|
@@ -1,125 +1,107 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "llman-sdd-apply"
|
|
3
|
-
description: "Implement
|
|
3
|
+
description: "Implement a proposed change's tasks in a closed loop: code → test → self-heal → all gates green. Enter after propose, once specs are landed."
|
|
4
4
|
metadata:
|
|
5
5
|
version: "{{ llman_version }}"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# LLMAN SDD Apply
|
|
9
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?"**
|
|
10
|
+
Implement all tasks in `llmanspec/changes/<id>/tasks.md` **in one closed loop**: implement → add tests/acceptance → run gates → self-heal and re-run on failure → report when all pass. Unless there is a clear blocker, **do not stop halfway to ask "should I continue?"**
|
|
13
11
|
|
|
14
12
|
## Pipeline Position
|
|
15
13
|
|
|
16
14
|
{{ unit("skills/git-native-flow-brief") }}
|
|
17
15
|
|
|
18
|
-
### Skill navigation (not the lifecycle; shows current skill only)
|
|
19
|
-
|
|
20
16
|
```mermaid
|
|
21
17
|
flowchart LR
|
|
22
|
-
propose["llman-sdd-propose
|
|
23
|
-
apply["
|
|
24
|
-
|
|
25
|
-
verify --> archive["llman-sdd-archive<br/>Archive"]
|
|
18
|
+
propose["llman-sdd-propose"] --> apply["★ llman-sdd-apply"]
|
|
19
|
+
apply --> verify["llman-sdd-verify"]
|
|
20
|
+
verify --> archive["llman-sdd-archive"]
|
|
26
21
|
|
|
27
22
|
style apply fill:#fff3cd,stroke:#ffc107,stroke-width:3px
|
|
28
23
|
```
|
|
29
24
|
|
|
30
|
-
> 📍
|
|
25
|
+
> 📍 Entry requires the specs-landed gate green (or `needs_specs_change: false`); `readyToImplement=true` (all gates green) is the completion signal that closes this loop → next `llman-sdd-verify`.
|
|
31
26
|
|
|
32
27
|
## Hard Constraints
|
|
33
28
|
|
|
34
|
-
- **
|
|
35
|
-
- **Scope-locked**:
|
|
36
|
-
- **
|
|
37
|
-
- **No
|
|
38
|
-
- **
|
|
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).
|
|
29
|
+
- **Single-source-of-truth driven**: `proposal.md` / `design.md` / `tasks.md` and `llmanspec/specs/**` on the branch; every MUST/SHALL in specs must be fulfilled.
|
|
30
|
+
- **Scope-locked**: only implement the current change's scope; never fix "unrelated issues" on the side; keep changes minimal.
|
|
31
|
+
- **No guessing**: unclear requirements or specs contradicting reality → STOP and report; don't assume.
|
|
32
|
+
- **No legacy compatibility layers**: if the change requires new behavior, upgrade all call sites directly, unless tasks/proposal explicitly require compatibility.
|
|
33
|
+
- **Close-out**: this loop ends by suggesting `llman-sdd-verify`; finalize/archive belongs to `llman-sdd-archive` (do not finalize inside the self-healing loop).
|
|
41
34
|
|
|
42
35
|
## Commit Policy
|
|
43
36
|
|
|
44
|
-
- **Commits on the change branch are free** (
|
|
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
|
|
46
|
-
- **Blocker interrupt**: when you must STOP on a blocker, make ONE
|
|
37
|
+
- **Commits on the change branch are free** (`change finalize` needs no clean tree): segment by task/milestone, or keep the tree dirty and let finalize make one close commit — both are first-class.
|
|
38
|
+
- **Default close-out**: after all tasks pass gates and verify is green, `llman-sdd change finalize <id>` auto-commits `archive(sdd): <change-id>` (uncommitted diff + frontmatter + 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).
|
|
39
|
+
- **Blocker interrupt**: when you must STOP on a blocker, make ONE WIP commit (e.g. `wip(sdd): <change-id> <summary>`) to preserve the state, then report.
|
|
47
40
|
|
|
48
41
|
## Steps
|
|
49
42
|
|
|
50
43
|
### 0) Preflight (required)
|
|
51
|
-
- Read and obey
|
|
52
|
-
- `git status --porcelain`:
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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/`.
|
|
44
|
+
- Read and obey `llmanspec/config.yaml`, `AGENTS.md` (if present).
|
|
45
|
+
- `git status --porcelain`: if the tree is dirty with changes not belonging to this change → `git stash push -u -m "llman-sdd-apply autopilot backup"` first.
|
|
46
|
+
- `llman-sdd validate --all --strict`: if it fails for reasons unrelated to this change → stop and report (inconsistent artifacts prevent source-of-truth-driven implementation).
|
|
47
|
+
- **Check spec valid_scope integrity**: `llman-sdd list --specs --json` lists all specs; for each, verify every `valid_scope` path exists on disk. On missing paths → stop and suggest updating the spec (remove the deleted path).
|
|
48
|
+
|
|
49
|
+
### 1) Select the change id and check prerequisites
|
|
50
|
+
- If provided, use it; otherwise infer from context, and if ambiguous run `llman-sdd list --json` and let the user pick. Always announce "Using change: <id>" and how to override.
|
|
51
|
+
- Confirm you are on the non-default branch bound via `llman-sdd change start <id>` or `change attach <id>` (`--force` only to rebind). Specs on the branch are the single source of truth — do not author under `changes/<id>/specs/`.
|
|
63
52
|
{{ unit("skills/stage-guard") }}
|
|
64
53
|
- Use `llman-sdd context --task "<goal from proposal>" --paths "<scope from specs>"` to get relevant specs.
|
|
65
|
-
-
|
|
54
|
+
- Context unavailable → run `llman-sdd index check` first: stale/missing → `llman-sdd index rebuild` 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.
|
|
66
55
|
|
|
67
|
-
### 2) Read
|
|
68
|
-
|
|
69
|
-
- `llmanspec/
|
|
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
|
|
56
|
+
### 2) Read the source-of-truth artifacts
|
|
57
|
+
- `llmanspec/changes/<id>/proposal.md`, `design.md` (if present), `tasks.md`
|
|
58
|
+
- `llmanspec/specs/**` (`<capability>.feature`) on the branch
|
|
73
59
|
|
|
74
|
-
|
|
60
|
+
Distill proposal/design decisions into a list of inviolable hard constraints; convert tasks.md into a minimal executable step sequence (preserving original order).
|
|
75
61
|
|
|
76
62
|
### 3) Show status
|
|
77
|
-
- Progress
|
|
78
|
-
- Next 1–3 unchecked tasks (brief overview)
|
|
63
|
+
- Progress "N/M tasks complete" + a brief look at the next 1–3 unchecked tasks.
|
|
79
64
|
|
|
80
|
-
### 4) Implement tasks one by one (closed
|
|
65
|
+
### 4) Implement tasks one by one (closed loop)
|
|
81
66
|
For each unchecked task:
|
|
82
|
-
1. **Implement**: strictly per task description + specs
|
|
83
|
-
2. **
|
|
84
|
-
3.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
67
|
+
1. **Implement**: strictly per task description + specs, minimal changes.
|
|
68
|
+
2. **Check the box immediately** after completion: `- [ ]` → `- [x]`. **Close-out is not a task**: `change finalize` / `change archive` are pipeline steps and MUST NOT appear in tasks.md — if one is listed (e.g. "close-out — finalize"), remove it (the close-out task gate requires every task checked).
|
|
69
|
+
3. **Edit, then verify — serially**: verification MUST run after edits land on disk; MUST NOT put edits and tests/validation in the same parallel tool-call batch (the check may read stale files and report a false failure or a false pass).
|
|
70
|
+
4. Task unclear, blocker hit, or specs/design contradict reality → STOP and report; don't assume.
|
|
71
|
+
|
|
72
|
+
### 5) Verification and self-healing loop (after each task or batch)
|
|
73
|
+
Run the project gates as appropriate:
|
|
74
|
+
- Test suite: `just test` or `cargo test --all`; format/lint: `just check` or `just lint` + `just fmt`
|
|
75
|
+
- Edit `llmanspec/specs/<capability>.feature` on the branch as needed (flat or directory main file; canonical native layout: `@req:<id>` on the `规则:` block header, nested `场景:` as executable examples); run `llman-sdd validate --specs` after spec edits; commit on the branch freely.
|
|
76
|
+
- SDD validation: `llman-sdd validate <id> --strict`
|
|
77
|
+
|
|
78
|
+
**Gate evidence**:
|
|
79
|
+
- Close-out runs the configured `bdd.run_command`, so do not run that command again just before close-out; the skip line printed by `--no-check` is not a pass.
|
|
80
|
+
- Gate verdicts MUST come from the real harness: MUST NOT obtain a "pass" via `--no-check`; on harness failure, find the root cause first (leaked env vars, nested-invocation guards, wrong cwd …) — MUST NOT label it an "inherent/self-referential property" and bypass it.
|
|
81
|
+
- Before/after criteria (counts, baselines) MUST be measured on the change branch (against the freshly computed merge-base); a value measured on the default branch is usually trivially the baseline and proves nothing.
|
|
82
|
+
- Refactors and bulk replacements: MUST compare the test count before and after; all-green gates with fewer tests is a failure.
|
|
83
|
+
|
|
84
|
+
**On failure → self-heal (don't ask "should I continue?"):**
|
|
85
|
+
1. Parse the failure cause (test / lint / format / validation).
|
|
86
|
+
2. Decide if it's a hard-to-locate bug (cause unclear / intermittent flake / regression not obvious at a glance):
|
|
87
|
+
- **Not hard-to-locate** (clear lint/format/compile/validation error): apply a minimal fix (don't expand scope); re-run the minimum failure-repro command first, then all gates.
|
|
88
|
+
- **Hard-to-locate → escalate to the diagnose sub-flow**:
|
|
100
89
|
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
90
|
2. Run it, confirm red → minimize the repro (cut inputs/calls/config/data one at a time, keep only what's load-bearing).
|
|
102
91
|
3. Generate **3–5 ranked hypotheses**, each falsifiable ("if X is the cause, changing Y makes the bug disappear").
|
|
103
92
|
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
|
|
105
|
-
3. Re-run the
|
|
106
|
-
4. Log
|
|
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).
|
|
93
|
+
5. If there's no correct seam for a regression test, note the architectural gap (hand off to `llman-sdd-arch-review`; when not enabled, write the gap into this change's `proposal.md` Further Notes section or `design.md`, and MUST NOT break the loop over it).
|
|
94
|
+
3. Re-run the minimum failure-repro command first, then all gates.
|
|
95
|
+
4. Log one self-healing round: `Round N: failure → fix → re-run → pass/fail`.
|
|
109
96
|
|
|
110
|
-
**
|
|
97
|
+
**Self-healing cap: 8 rounds**; exceeding it is a blocker: stop and output a blocker report (last failing command + output summary + what you tried).
|
|
111
98
|
|
|
112
|
-
-
|
|
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.
|
|
99
|
+
**Human review gate (after each task batch passes the gates)**: before starting the next batch or emitting the completion report, run `llman-sdd review`: exit code zero → continue; non-zero = CRITICAL findings → STOP, fix, re-run review; MUST NOT enter the next batch or emit the completion report with CRITICAL findings open.
|
|
114
100
|
|
|
115
101
|
### 6) Completion report
|
|
116
|
-
After all tasks complete + all gates green, output a structured report (see Output Contract
|
|
117
|
-
Then suggest running `llman-sdd-verify` for the verification phase.
|
|
118
|
-
|
|
119
|
-
> 💡 Implementation done → next: `llman-sdd-verify` (verify)
|
|
102
|
+
After all tasks complete + all gates green, output a structured report (see Output Contract), then suggest `llman-sdd-verify`.
|
|
120
103
|
|
|
121
|
-
|
|
122
|
-
> "Spec" here = a `.feature` file under this project's `llmanspec/specs/`; run `llman-sdd list --specs` or `llman-sdd show <capability>`.
|
|
104
|
+
{{ unit("skills/cli-footer") }}
|
|
123
105
|
|
|
124
106
|
{{ unit("skills/validation-hints") }}
|
|
125
107
|
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "llman-sdd-arch-review"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Architecture review: scan for shallow modules (interface ≈ implementation) and surface deepening candidates to improve testability and AI-navigability."
|
|
4
4
|
metadata:
|
|
5
5
|
version: "{{ llman_version }}"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# LLMAN SDD Architecture Review
|
|
9
9
|
|
|
10
|
-
Scan the codebase for architectural friction and surface **deepening opportunities** —
|
|
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.
|
|
10
|
+
Scan the codebase for architectural friction and surface **deepening opportunities** — turning shallow modules (interface ≈ implementation) into deep ones (lots of behavior behind a small interface). The aim is testability and AI-navigability. Auxiliary tool, not part of the main pipeline; usable at any stage, commonly triggered during explore.
|
|
17
11
|
|
|
18
12
|
## Design vocabulary
|
|
19
13
|
|
|
20
|
-
|
|
14
|
+
Words about module shape; MUST NOT substitute "component" / "service" / "API" / "boundary" (broader, less precise):
|
|
21
15
|
|
|
22
16
|
- **Module** — anything with an interface and an implementation (function/class/package/cross-layer slice).
|
|
23
17
|
- **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
|
|
18
|
+
- **Depth** — the amount of behavior behind the interface. **Deep** = lots of behavior behind a small interface; **shallow** = interface nearly as complex as the implementation (the caller saves nothing). This skill turns shallow into deep.
|
|
25
19
|
- **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
20
|
- **Leverage** — what callers get from depth: more capability per unit of interface learned.
|
|
27
21
|
- **Locality** — what maintainers get from depth: changes/bugs/knowledge/verification concentrate in one place.
|
|
@@ -31,10 +25,10 @@ A set of words about module shape, used to articulate "where it's worth changing
|
|
|
31
25
|
### 1. Explore (scope first, YAGNI)
|
|
32
26
|
- If the user named a direction (module/subsystem/pain point), accept it; skip inference.
|
|
33
27
|
- Otherwise walk `git log --oneline` for hot spots (files/areas that keep coming up).
|
|
34
|
-
- Prefer reading
|
|
28
|
+
- Prefer reading `<capability>.feature` (the single source of truth) and `design.md` (existing ADRs); MUST NOT create a `CONTEXT.md`.
|
|
35
29
|
- Use the Agent tool (`subagent_type=Explore`) to walk the codebase, noting friction:
|
|
36
30
|
- Does understanding one concept require bouncing between many small modules?
|
|
37
|
-
- Where are modules **shallow** (interface
|
|
31
|
+
- Where are modules **shallow** (interface ≈ implementation complexity, callers save nothing)?
|
|
38
32
|
- Where are pure functions extracted only for testability, but real bugs hide in how they're called (no locality)?
|
|
39
33
|
- Which parts are untested or hard to test through their current interface?
|
|
40
34
|
|
|
@@ -46,20 +40,19 @@ For each candidate:
|
|
|
46
40
|
- **Benefits** — locality and leverage improvements; how tests get better.
|
|
47
41
|
- **Recommendation strength** — `Strong` / `Worth exploring` / `Speculative`.
|
|
48
42
|
|
|
49
|
-
**Deletion test**: for any suspected-shallow module, imagine deleting it — does complexity vanish (it's just a pass-through
|
|
43
|
+
**Deletion test**: for any suspected-shallow module, imagine deleting it — does complexity vanish (it's just a pass-through) or reappear across N call sites (it's actually earning its keep)? "Reappears" is the signal you want.
|
|
50
44
|
|
|
51
45
|
**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
46
|
|
|
53
|
-
### 3.
|
|
54
|
-
Run `llman-sdd-explore`'s **
|
|
47
|
+
### 3. Deep-dive Q&A (after the user picks a candidate)
|
|
48
|
+
Run `llman-sdd-explore`'s **deep-dive Q&A 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
49
|
|
|
56
|
-
-
|
|
50
|
+
- The deepened module uses a concept not in the `.feature`? → update the `.feature` **only** if the change is branch-bound and you are on the bound branch; otherwise STOP and route to `llman-sdd-propose` / `change start` — **never** edit specs on the default branch.
|
|
57
51
|
- 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
52
|
|
|
59
53
|
## Output
|
|
60
|
-
Candidate list (text; optional HTML report written to OS temp dir, not the repo) + the
|
|
54
|
+
Candidate list (text; optional HTML report written to the OS temp dir, not the repo) + the deep-dive decision record after the user picks one (write back to the proposal; contract edits only after landing on the bound branch into the `.feature`).
|
|
61
55
|
|
|
62
|
-
|
|
63
|
-
> "Spec" here = a `.feature` file under this project's `llmanspec/specs/`; run `llman-sdd list --specs` or `llman-sdd show <capability>`.
|
|
56
|
+
{{ unit("skills/cli-footer") }}
|
|
64
57
|
|
|
65
58
|
{{ unit("skills/structured-protocol") }}
|
|
@@ -1,84 +1,69 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "llman-sdd-archive"
|
|
3
|
-
description: "Archive completed
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
- **
|
|
28
|
-
-
|
|
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**:
|
|
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
|
|
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
|
|
40
|
-
- Determine
|
|
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
|
|
46
|
-
- Validate
|
|
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
|
-
|
|
51
|
-
-
|
|
52
|
-
- **
|
|
53
|
-
- **
|
|
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
|
|
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
|
|
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
|
|
64
|
-
- **Fallback: plain `change archive <id>`** — same merge + rename
|
|
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
|
|
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
|
|
72
|
-
- Optional: `git branch -D <feature>` after the merge
|
|
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
|
|
74
|
-
- **Archived `depends_on`**: archive renames the change dir to `archive/YYYY-MM-DD-<id
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
10
|
+
Continue an existing change and create the next missing artifact.
|
|
11
11
|
|
|
12
12
|
## Steps
|
|
13
|
-
1. Identify the change id:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
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
|
|
24
|
-
5) Edit
|
|
25
|
-
4. Create exactly ONE missing artifact (or one
|
|
26
|
-
- Do NOT
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
- `
|
|
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
|
-
|
|
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: "
|
|
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
|
|
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
|
|
17
|
-
propose --> apply["llman-sdd-apply
|
|
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
|
-
> 📍
|
|
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**:
|
|
32
|
-
- **MUST NOT
|
|
33
|
-
- **Scope boundary**: if the description clearly involves MUST/SHALL
|
|
34
|
-
- **Frontmatter has a fixed schema**:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
51
|
-
-
|
|
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** (
|
|
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
|
-
|
|
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") }}
|