@warnyin/sdlc 0.1.2 → 0.2.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 (83) hide show
  1. package/CHANGELOG.md +53 -19
  2. package/LICENSE +21 -21
  3. package/README.md +83 -74
  4. package/bin/cli.mjs +98 -30
  5. package/bin/detect.mjs +51 -0
  6. package/bin/multiselect.mjs +147 -0
  7. package/bin/ui.mjs +78 -0
  8. package/lib/caps.mjs +45 -45
  9. package/lib/config.mjs +41 -41
  10. package/lib/delta.mjs +160 -160
  11. package/lib/frontmatter.mjs +59 -59
  12. package/lib/glob.mjs +29 -29
  13. package/lib/manifest.mjs +99 -99
  14. package/lib/observe.mjs +174 -174
  15. package/lib/settings-merge.mjs +63 -63
  16. package/lib/usage.mjs +46 -46
  17. package/lib/validate.mjs +186 -186
  18. package/package.json +42 -42
  19. package/payload/adapters/agents-md.md +8 -8
  20. package/payload/adapters/claude/agents/sdlc-architect.md +12 -12
  21. package/payload/adapters/claude/agents/sdlc-builder.md +14 -14
  22. package/payload/adapters/claude/agents/sdlc-contractor.md +13 -13
  23. package/payload/adapters/claude/agents/sdlc-evaluator.md +13 -13
  24. package/payload/adapters/claude/agents/sdlc-learner.md +16 -16
  25. package/payload/adapters/claude/agents/sdlc-ops.md +11 -11
  26. package/payload/adapters/claude/agents/sdlc-quality.md +13 -13
  27. package/payload/adapters/claude/agents/sdlc-security.md +12 -12
  28. package/payload/adapters/claude/commands/sdlc/auto.md +5 -5
  29. package/payload/adapters/claude/commands/sdlc/build.md +5 -5
  30. package/payload/adapters/claude/commands/sdlc/contract.md +5 -5
  31. package/payload/adapters/claude/commands/sdlc/converge.md +5 -5
  32. package/payload/adapters/claude/commands/sdlc/design.md +5 -5
  33. package/payload/adapters/claude/commands/sdlc/init.md +4 -4
  34. package/payload/adapters/claude/commands/sdlc/new.md +5 -5
  35. package/payload/adapters/claude/commands/sdlc/next.md +4 -4
  36. package/payload/adapters/claude/commands/sdlc/observe.md +4 -4
  37. package/payload/adapters/claude/commands/sdlc/review.md +5 -5
  38. package/payload/adapters/claude/commands/sdlc/ship.md +5 -5
  39. package/payload/adapters/claude/commands/sdlc/steer.md +4 -4
  40. package/payload/adapters/claude/commands/sdlc/verify.md +5 -5
  41. package/payload/adapters/claude/skills/contract-writing/SKILL.md +26 -26
  42. package/payload/adapters/claude/skills/delta-spec-format/SKILL.md +33 -33
  43. package/payload/adapters/claude/skills/sdlc-conventions/SKILL.md +26 -26
  44. package/payload/adapters/cline.md +8 -8
  45. package/payload/adapters/copilot.md +8 -8
  46. package/payload/adapters/cursor.mdc +7 -7
  47. package/payload/adapters/gemini.md +8 -8
  48. package/payload/adapters/windsurf.md +4 -4
  49. package/payload/hooks/_shared.mjs +154 -154
  50. package/payload/hooks/guard-writes.mjs +83 -83
  51. package/payload/hooks/inject-context.mjs +55 -55
  52. package/payload/hooks/journal.mjs +58 -58
  53. package/payload/hooks/session-summary.mjs +50 -50
  54. package/payload/hooks/validate-artifact.mjs +80 -80
  55. package/payload/playbook/README.md +30 -30
  56. package/payload/playbook/auto.md +21 -21
  57. package/payload/playbook/build.md +23 -23
  58. package/payload/playbook/context.md +26 -26
  59. package/payload/playbook/contract.md +23 -23
  60. package/payload/playbook/converge.md +19 -19
  61. package/payload/playbook/design.md +20 -20
  62. package/payload/playbook/init.md +22 -22
  63. package/payload/playbook/new.md +22 -22
  64. package/payload/playbook/next.md +12 -12
  65. package/payload/playbook/observe.md +20 -20
  66. package/payload/playbook/principles.md +28 -28
  67. package/payload/playbook/review.md +17 -17
  68. package/payload/playbook/routing.md +19 -19
  69. package/payload/playbook/rules-card.md +16 -16
  70. package/payload/playbook/ship.md +24 -24
  71. package/payload/playbook/steer.md +21 -21
  72. package/payload/playbook/verify.md +24 -24
  73. package/payload/templates/change-deep.md +29 -29
  74. package/payload/templates/change-standard.md +28 -28
  75. package/payload/templates/change-vibe.md +19 -19
  76. package/payload/templates/config.yaml +8 -8
  77. package/payload/templates/constitution.md +14 -14
  78. package/payload/templates/contract-evals.md +9 -9
  79. package/payload/templates/contract-tests.md +9 -9
  80. package/payload/templates/harness.md +33 -33
  81. package/payload/templates/spec.md +14 -14
  82. package/payload/templates/steering.md +9 -9
  83. package/scripts/validate.mjs +47 -47
@@ -1,26 +1,26 @@
1
- # Context engineering
2
-
3
- Six context types: instructions, knowledge, memory, examples, tools, guardrails.
4
- The design decision is WHERE each lives: static (always loaded, expensive) vs
5
- dynamic (loaded on demand, cheap). That boundary is versioned code, reviewed in PRs.
6
-
7
- ## Static (injected every session by the SessionStart hook, hard cap 60 lines total)
8
- - `sdlc/context/constitution.md` (≤30) — hard rules + stack facts only.
9
- - `sdlc/context/steering/*.md` with `inclusion: always` — should be rare.
10
- - One pointer line to the active change.
11
-
12
- ## Dynamic (loaded only when needed)
13
- - `inclusion: paths` steering — the PostToolUse hook emits a POINTER when an edited
14
- file matches `pathMatch`; you then read the file. Pointers cost ~1 line, not 40.
15
- - `inclusion: manual` — read only when a playbook or user names it.
16
- - `inclusion: agent` — subagents load it themselves; the main loop never pays for it.
17
- - Living specs — read the `## Purpose` header first; open the full spec only for
18
- capabilities your change touches.
19
- - Playbooks — each command reads exactly one playbook file.
20
-
21
- ## Budget rules
22
- - Always-budget (constitution + always-steering) ≤ 60 lines. Validator-enforced.
23
- - Adding an always rule requires removing one, or demoting something to `paths`.
24
- - `/sdlc:observe` reports steering that never fires — expire or demote it.
25
- - A `compact` event in the journal means context overflowed: treat as a defect,
26
- find the resident artifact that caused it.
1
+ # Context engineering
2
+
3
+ Six context types: instructions, knowledge, memory, examples, tools, guardrails.
4
+ The design decision is WHERE each lives: static (always loaded, expensive) vs
5
+ dynamic (loaded on demand, cheap). That boundary is versioned code, reviewed in PRs.
6
+
7
+ ## Static (injected every session by the SessionStart hook, hard cap 60 lines total)
8
+ - `sdlc/context/constitution.md` (≤30) — hard rules + stack facts only.
9
+ - `sdlc/context/steering/*.md` with `inclusion: always` — should be rare.
10
+ - One pointer line to the active change.
11
+
12
+ ## Dynamic (loaded only when needed)
13
+ - `inclusion: paths` steering — the PostToolUse hook emits a POINTER when an edited
14
+ file matches `pathMatch`; you then read the file. Pointers cost ~1 line, not 40.
15
+ - `inclusion: manual` — read only when a playbook or user names it.
16
+ - `inclusion: agent` — subagents load it themselves; the main loop never pays for it.
17
+ - Living specs — read the `## Purpose` header first; open the full spec only for
18
+ capabilities your change touches.
19
+ - Playbooks — each command reads exactly one playbook file.
20
+
21
+ ## Budget rules
22
+ - Always-budget (constitution + always-steering) ≤ 60 lines. Validator-enforced.
23
+ - Adding an always rule requires removing one, or demoting something to `paths`.
24
+ - `/sdlc:observe` reports steering that never fires — expire or demote it.
25
+ - A `compact` event in the journal means context overflowed: treat as a defect,
26
+ find the resident artifact that caused it.
@@ -1,23 +1,23 @@
1
- # /sdlc:contract <id> — tests + evals before code
2
-
3
- The contract IS the handshake. Nothing in `## Tasks` may be implemented while
4
- status is `new`.
5
-
6
- 1. From the Delta scenarios, write `contract/tests.md` (≤60 lines): one row per
7
- behavior — Given/When/Then, kind, mapped requirement. List what is explicitly
8
- out of scope and why.
9
- 2. Deep tier (standard optional): write `contract/evals.md` (≤40 lines) — the
10
- trajectory + quality rubric the sdlc-evaluator will score.
11
- 3. Generate failing tests: delegate to the `sdlc-contractor` agent (cheap tier)
12
- with ONLY tests.md + the delta + the project's test conventions. Run the test
13
- command from `sdlc/harness.md` — every new test must FAIL (red) now; a test
14
- that passes before implementation tests nothing.
15
- 4. Adversarial check instead of human approval: ask the `sdlc-quality` agent to
16
- attack the contract — uncovered scenarios, untestable rows, missing edge
17
- cases vs the delta. Fix findings; one round is usually enough, two max.
18
- 5. `npx @warnyin/sdlc validate <id>` clean → set frontmatter `status: contracted`
19
- and `node sdlc/.hooks/journal.mjs note contract tests=<n>`.
20
-
21
- Escalate only if the delta itself turns out ambiguous (back to /sdlc:new step 5).
22
-
23
- Next: /sdlc:build.
1
+ # /sdlc:contract <id> — tests + evals before code
2
+
3
+ The contract IS the handshake. Nothing in `## Tasks` may be implemented while
4
+ status is `new`.
5
+
6
+ 1. From the Delta scenarios, write `contract/tests.md` (≤60 lines): one row per
7
+ behavior — Given/When/Then, kind, mapped requirement. List what is explicitly
8
+ out of scope and why.
9
+ 2. Deep tier (standard optional): write `contract/evals.md` (≤40 lines) — the
10
+ trajectory + quality rubric the sdlc-evaluator will score.
11
+ 3. Generate failing tests: delegate to the `sdlc-contractor` agent (cheap tier)
12
+ with ONLY tests.md + the delta + the project's test conventions. Run the test
13
+ command from `sdlc/harness.md` — every new test must FAIL (red) now; a test
14
+ that passes before implementation tests nothing.
15
+ 4. Adversarial check instead of human approval: ask the `sdlc-quality` agent to
16
+ attack the contract — uncovered scenarios, untestable rows, missing edge
17
+ cases vs the delta. Fix findings; one round is usually enough, two max.
18
+ 5. `npx @warnyin/sdlc validate <id>` clean → set frontmatter `status: contracted`
19
+ and `node sdlc/.hooks/journal.mjs note contract tests=<n>`.
20
+
21
+ Escalate only if the delta itself turns out ambiguous (back to /sdlc:new step 5).
22
+
23
+ Next: /sdlc:build.
@@ -1,19 +1,19 @@
1
- # /sdlc:converge [capability] — spec ↔ code drift (Maintenance)
2
-
3
- Living specs are only useful while they are true. Converge closes the gap.
4
-
5
- 1. Scope: the named capability, or the ones `/sdlc:observe` flagged.
6
- 2. For each requirement in `sdlc/specs/<capability>/spec.md`, check the code
7
- actually behaves that way (read the relevant code; run targeted tests where
8
- cheap). Three outcomes per requirement:
9
- - **true** — nothing to do.
10
- - **code drifted** — behavior no longer matches the spec.
11
- - **spec stale** — the spec describes behavior nobody wants anymore.
12
- 3. Report the diff table in chat (requirement · outcome · evidence file:line).
13
- 4. For every drift/stale finding the user wants fixed, open ONE change via
14
- /sdlc:new whose Delta uses MODIFIED/REMOVED against the exact requirement
15
- names — converge itself NEVER edits specs or code directly.
16
- 5. If a recent rule/playbook edit correlates with worse flywheel metrics
17
- (observe shows it), propose the revert here as a change too.
18
-
19
- Read-only except for creating proposed change folders.
1
+ # /sdlc:converge [capability] — spec ↔ code drift (Maintenance)
2
+
3
+ Living specs are only useful while they are true. Converge closes the gap.
4
+
5
+ 1. Scope: the named capability, or the ones `/sdlc:observe` flagged.
6
+ 2. For each requirement in `sdlc/specs/<capability>/spec.md`, check the code
7
+ actually behaves that way (read the relevant code; run targeted tests where
8
+ cheap). Three outcomes per requirement:
9
+ - **true** — nothing to do.
10
+ - **code drifted** — behavior no longer matches the spec.
11
+ - **spec stale** — the spec describes behavior nobody wants anymore.
12
+ 3. Report the diff table in chat (requirement · outcome · evidence file:line).
13
+ 4. For every drift/stale finding the user wants fixed, open ONE change via
14
+ /sdlc:new whose Delta uses MODIFIED/REMOVED against the exact requirement
15
+ names — converge itself NEVER edits specs or code directly.
16
+ 5. If a recent rule/playbook edit correlates with worse flywheel metrics
17
+ (observe shows it), propose the revert here as a change too.
18
+
19
+ Read-only except for creating proposed change folders.
@@ -1,20 +1,20 @@
1
- # /sdlc:design <id> — decisions & trade-offs (deep tier, or on signal)
2
-
3
- Run only when: tier is deep, OR the change needs an architectural decision
4
- (new dependency, schema change, cross-capability contract). Otherwise skip —
5
- an empty Design section is garbage.
6
-
7
- 1. Read `change.md`, the full spec of every touched capability, and any steering
8
- whose scope matches. Nothing else by default.
9
- 2. Gather in parallel, judge serially: fan out read-only subagents for research
10
- (one per question: prior art in this repo, external constraint, data shape).
11
- The DECISION is made in the main loop — never delegated, never parallel.
12
- 3. Fill `## Design` with decision lines only:
13
- `- decision: <what> · alternatives: <a/b> · because: <why>`
14
- Never restate the delta. Respect the tier cap (deep total ≤150).
15
- 4. Escalate to the human ONLY for decisions listed in
16
- `sdlc/harness.md § Autonomy policy` (irreversible or hard-floor). Everything
17
- else: decide, record, move on.
18
- 5. `npx @warnyin/sdlc validate <id>`.
19
-
20
- Next: /sdlc:contract.
1
+ # /sdlc:design <id> — decisions & trade-offs (deep tier, or on signal)
2
+
3
+ Run only when: tier is deep, OR the change needs an architectural decision
4
+ (new dependency, schema change, cross-capability contract). Otherwise skip —
5
+ an empty Design section is garbage.
6
+
7
+ 1. Read `change.md`, the full spec of every touched capability, and any steering
8
+ whose scope matches. Nothing else by default.
9
+ 2. Gather in parallel, judge serially: fan out read-only subagents for research
10
+ (one per question: prior art in this repo, external constraint, data shape).
11
+ The DECISION is made in the main loop — never delegated, never parallel.
12
+ 3. Fill `## Design` with decision lines only:
13
+ `- decision: <what> · alternatives: <a/b> · because: <why>`
14
+ Never restate the delta. Respect the tier cap (deep total ≤150).
15
+ 4. Escalate to the human ONLY for decisions listed in
16
+ `sdlc/harness.md § Autonomy policy` (irreversible or hard-floor). Everything
17
+ else: decide, record, move on.
18
+ 5. `npx @warnyin/sdlc validate <id>`.
19
+
20
+ Next: /sdlc:contract.
@@ -1,22 +1,22 @@
1
- # /sdlc:init — configure the harness (run once per project)
2
-
3
- The only planned blocking human gate in the framework: the human approves the
4
- policy the AI will then drive under.
5
-
6
- 1. Read `sdlc/config.yaml`, the repo README, manifest files (package.json etc.),
7
- and skim the top-level structure. Do NOT deep-read the codebase.
8
- 2. Interview the user briefly (≤6 questions): what the project is, hard rules the
9
- agent must never break, test command, risk areas (security/payments/data-loss),
10
- and how autonomous shipping should be (adjusts `## Autonomy policy`).
11
- 3. Open the gate: `node sdlc/.hooks/journal.mjs open-steer`, then write:
12
- - `sdlc/context/constitution.md` — replace template placeholders; ≤30 lines;
13
- SHALL/SHALL NOT rules only, stack facts ≤3 lines.
14
- - `sdlc/harness.md` — fill tools, test command, sandbox notes; adjust the
15
- routing, triage, and Autonomy policy tables to this project.
16
- - 0–3 steering seeds in `sdlc/context/steering/` for areas with real
17
- conventions (prefer `inclusion: paths`; `always` needs strong justification).
18
- 4. Run `npx @warnyin/sdlc validate` — fix every error.
19
- 5. Show the user constitution + harness verbatim; iterate until approved.
20
- 6. Close the gate: `node sdlc/.hooks/journal.mjs close`.
21
-
22
- Output: approved constitution + harness. No change folder is created here.
1
+ # /sdlc:init — configure the harness (run once per project)
2
+
3
+ The only planned blocking human gate in the framework: the human approves the
4
+ policy the AI will then drive under.
5
+
6
+ 1. Read `sdlc/config.yaml`, the repo README, manifest files (package.json etc.),
7
+ and skim the top-level structure. Do NOT deep-read the codebase.
8
+ 2. Interview the user briefly (≤6 questions): what the project is, hard rules the
9
+ agent must never break, test command, risk areas (security/payments/data-loss),
10
+ and how autonomous shipping should be (adjusts `## Autonomy policy`).
11
+ 3. Open the gate: `node sdlc/.hooks/journal.mjs open-steer`, then write:
12
+ - `sdlc/context/constitution.md` — replace template placeholders; ≤30 lines;
13
+ SHALL/SHALL NOT rules only, stack facts ≤3 lines.
14
+ - `sdlc/harness.md` — fill tools, test command, sandbox notes; adjust the
15
+ routing, triage, and Autonomy policy tables to this project.
16
+ - 0–3 steering seeds in `sdlc/context/steering/` for areas with real
17
+ conventions (prefer `inclusion: paths`; `always` needs strong justification).
18
+ 4. Run `npx @warnyin/sdlc validate` — fix every error.
19
+ 5. Show the user constitution + harness verbatim; iterate until approved.
20
+ 6. Close the gate: `node sdlc/.hooks/journal.mjs close`.
21
+
22
+ Output: approved constitution + harness. No change folder is created here.
@@ -1,22 +1,22 @@
1
- # /sdlc:new <title> — open a change (Requirements)
2
-
3
- 1. Triage the tier with `sdlc/harness.md § Tier triage`. Hard-floor surface
4
- (security, payments, data-loss, irreversible) forces `deep` — no override
5
- without an explicit user instruction (record it in Assumptions).
6
- 2. Create `sdlc/changes/<kebab-id>/change.md` from the tier's template at
7
- `sdlc/.playbook/templates/change-{vibe|standard|deep}.md` — copy the
8
- structure exactly, respect the cap comment.
9
- 3. Ground the delta: grep `## Purpose` of every `sdlc/specs/*/spec.md`; open the
10
- FULL spec only for capabilities this change touches. Name each `## Delta:`
11
- after an existing capability, or a new kebab-case capability.
12
- 4. Write Why (≤5 lines, no solutioning) and the Delta requirements
13
- (`ADDED/MODIFIED/REMOVED Requirement` + WHEN/THEN scenarios — grammar in the
14
- delta-spec-format skill). Then Tasks with `[P]` and `[tier:x]` markers.
15
- 5. Ambiguity policy (AI-driven): make the safest assumption and record it under
16
- `## Assumptions` with why it is safe. Use `[NEEDS CLARIFICATION: q]` ONLY for
17
- facts you cannot obtain or safely assume — then ask the user those questions
18
- now, in one batch, and resolve every marker.
19
- 6. `node sdlc/.hooks/journal.mjs set-active <id>` then
20
- `npx @warnyin/sdlc validate <id>` — fix errors. Status stays `new`.
21
-
22
- Next: deep tier or risky decision → /sdlc:design; otherwise /sdlc:contract.
1
+ # /sdlc:new <title> — open a change (Requirements)
2
+
3
+ 1. Triage the tier with `sdlc/harness.md § Tier triage`. Hard-floor surface
4
+ (security, payments, data-loss, irreversible) forces `deep` — no override
5
+ without an explicit user instruction (record it in Assumptions).
6
+ 2. Create `sdlc/changes/<kebab-id>/change.md` from the tier's template at
7
+ `sdlc/.playbook/templates/change-{vibe|standard|deep}.md` — copy the
8
+ structure exactly, respect the cap comment.
9
+ 3. Ground the delta: grep `## Purpose` of every `sdlc/specs/*/spec.md`; open the
10
+ FULL spec only for capabilities this change touches. Name each `## Delta:`
11
+ after an existing capability, or a new kebab-case capability.
12
+ 4. Write Why (≤5 lines, no solutioning) and the Delta requirements
13
+ (`ADDED/MODIFIED/REMOVED Requirement` + WHEN/THEN scenarios — grammar in the
14
+ delta-spec-format skill). Then Tasks with `[P]` and `[tier:x]` markers.
15
+ 5. Ambiguity policy (AI-driven): make the safest assumption and record it under
16
+ `## Assumptions` with why it is safe. Use `[NEEDS CLARIFICATION: q]` ONLY for
17
+ facts you cannot obtain or safely assume — then ask the user those questions
18
+ now, in one batch, and resolve every marker.
19
+ 6. `node sdlc/.hooks/journal.mjs set-active <id>` then
20
+ `npx @warnyin/sdlc validate <id>` — fix errors. Status stays `new`.
21
+
22
+ Next: deep tier or risky decision → /sdlc:design; otherwise /sdlc:contract.
@@ -1,12 +1,12 @@
1
- # /sdlc:next — where am I, what now (read-only)
2
-
3
- 1. Run `npx @warnyin/sdlc status`.
4
- 2. For each active change map status → next command:
5
- - `new` + markers unresolved → resolve questions (playbook new.md §5)
6
- - `new` (clean) → /sdlc:design (deep/signal) or /sdlc:contract
7
- - `contracted` → /sdlc:build
8
- - `building` → /sdlc:build (finish open tasks)
9
- - `verified` → /sdlc:review (if signals) or /sdlc:ship
10
- 3. If nothing is active: suggest /sdlc:new, or /sdlc:observe if archived changes
11
- have unread digests.
12
- 4. Answer in ≤5 lines. Create or modify nothing.
1
+ # /sdlc:next — where am I, what now (read-only)
2
+
3
+ 1. Run `npx @warnyin/sdlc status`.
4
+ 2. For each active change map status → next command:
5
+ - `new` + markers unresolved → resolve questions (playbook new.md §5)
6
+ - `new` (clean) → /sdlc:design (deep/signal) or /sdlc:contract
7
+ - `contracted` → /sdlc:build
8
+ - `building` → /sdlc:build (finish open tasks)
9
+ - `verified` → /sdlc:review (if signals) or /sdlc:ship
10
+ 3. If nothing is active: suggest /sdlc:new, or /sdlc:observe if archived changes
11
+ have unread digests.
12
+ 4. Answer in ≤5 lines. Create or modify nothing.
@@ -1,20 +1,20 @@
1
- # /sdlc:observe — cost, flow, and drift report
2
-
3
- 1. Run `npx @warnyin/sdlc observe --json` and render it for the human. Do not
4
- recompute anything the CLI already computed.
5
- 2. Report, in this order (skip empty sections):
6
- - **Pending digests** — archived changes whose digest the human has not been
7
- shown yet (learner proposals awaiting a decision).
8
- - **Cost** — tokens/cost per active + recent change; retry waste (tokens spent
9
- after the first verify fail).
10
- - **Flow** — lead time per shipped change and per-phase breakdown (created →
11
- contracted → built → verified → shipped timestamps from the journal);
12
- AI-time vs wait-time; first-pass success trend.
13
- - **Residency** — always-loaded lines vs the 60 budget.
14
- - **Drift flags** — steering never hit by a pointer, rules never triggering a
15
- guard event, `compact` events (context overflow = a defect), specs touched
16
- by many changes (converge candidates).
17
- 3. For each flag, offer the one-line fix (`/sdlc:steer` demotion, `/sdlc:converge`
18
- on a capability, cap adjustment) — recommend, never auto-apply here.
19
-
20
- Read-only: this command changes nothing.
1
+ # /sdlc:observe — cost, flow, and drift report
2
+
3
+ 1. Run `npx @warnyin/sdlc observe --json` and render it for the human. Do not
4
+ recompute anything the CLI already computed.
5
+ 2. Report, in this order (skip empty sections):
6
+ - **Pending digests** — archived changes whose digest the human has not been
7
+ shown yet (learner proposals awaiting a decision).
8
+ - **Cost** — tokens/cost per active + recent change; retry waste (tokens spent
9
+ after the first verify fail).
10
+ - **Flow** — lead time per shipped change and per-phase breakdown (created →
11
+ contracted → built → verified → shipped timestamps from the journal);
12
+ AI-time vs wait-time; first-pass success trend.
13
+ - **Residency** — always-loaded lines vs the 60 budget.
14
+ - **Drift flags** — steering never hit by a pointer, rules never triggering a
15
+ guard event, `compact` events (context overflow = a defect), specs touched
16
+ by many changes (converge candidates).
17
+ 3. For each flag, offer the one-line fix (`/sdlc:steer` demotion, `/sdlc:converge`
18
+ on a capability, cap adjustment) — recommend, never auto-apply here.
19
+
20
+ Read-only: this command changes nothing.
@@ -1,28 +1,28 @@
1
- # Principles
2
-
3
- ## Factory model
4
- Your output is the system that produces code — specs, contracts, gates, feedback loops,
5
- guardrails — not the code itself. Give agents success criteria, not step-by-step
6
- instructions, then let them iterate. Humans set policy once (`/sdlc:init`) and read
7
- ship digests asynchronously; they are interrupted only by policy-listed exceptions.
8
-
9
- ## Economics (CapEx / OpEx)
10
- Configuration (constitution, harness, steering, contracts) is CapEx: paid once, reviewed
11
- like code. Every resident line of context is OpEx paid in every turn. Therefore:
12
- - Every mandatory artifact has a stated reason and a line cap (see template comments).
13
- - No artifact may restate another; deltas are merged mechanically, never re-narrated.
14
- - Retry loops are the expensive failure mode — contracts up front buy first-pass success.
15
-
16
- ## Anti-garbage rules
17
- - Optional artifacts (design section, evals for standard tier) exist only on signal.
18
- - If a section would be empty, delete the section — never keep placeholder prose.
19
- - The learner may only ADD an always-loaded rule by displacing an old one (fixed budget).
20
- - Machine data (journals, state, learning stats) never lives in prose files.
21
-
22
- ## Verification stance
23
- Tests verify the deterministic; evals verify trajectory and quality. Both are written
24
- before code — together they are the contract with the AI. "Seems to work" is not a gate.
25
-
26
- ## Minimalism
27
- Prefer: do nothing → stdlib → existing dependency → smallest new code. Never cut:
28
- trust-boundary validation, data-loss handling, security controls, the contract itself.
1
+ # Principles
2
+
3
+ ## Factory model
4
+ Your output is the system that produces code — specs, contracts, gates, feedback loops,
5
+ guardrails — not the code itself. Give agents success criteria, not step-by-step
6
+ instructions, then let them iterate. Humans set policy once (`/sdlc:init`) and read
7
+ ship digests asynchronously; they are interrupted only by policy-listed exceptions.
8
+
9
+ ## Economics (CapEx / OpEx)
10
+ Configuration (constitution, harness, steering, contracts) is CapEx: paid once, reviewed
11
+ like code. Every resident line of context is OpEx paid in every turn. Therefore:
12
+ - Every mandatory artifact has a stated reason and a line cap (see template comments).
13
+ - No artifact may restate another; deltas are merged mechanically, never re-narrated.
14
+ - Retry loops are the expensive failure mode — contracts up front buy first-pass success.
15
+
16
+ ## Anti-garbage rules
17
+ - Optional artifacts (design section, evals for standard tier) exist only on signal.
18
+ - If a section would be empty, delete the section — never keep placeholder prose.
19
+ - The learner may only ADD an always-loaded rule by displacing an old one (fixed budget).
20
+ - Machine data (journals, state, learning stats) never lives in prose files.
21
+
22
+ ## Verification stance
23
+ Tests verify the deterministic; evals verify trajectory and quality. Both are written
24
+ before code — together they are the contract with the AI. "Seems to work" is not a gate.
25
+
26
+ ## Minimalism
27
+ Prefer: do nothing → stdlib → existing dependency → smallest new code. Never cut:
28
+ trust-boundary validation, data-loss handling, security controls, the contract itself.
@@ -1,17 +1,17 @@
1
- # /sdlc:review <id> — agent panel (signal-triggered)
2
-
3
- Run when: tier deep, OR the diff touches auth/payments/data handling, OR >10
4
- files changed. Otherwise skip silently — a ceremonial review is garbage.
5
-
6
- 1. Fan out in parallel, all read-only, each with the diff + change.md only:
7
- - `sdlc-architect` (deepest): design integrity, coupling, contract drift.
8
- - `sdlc-security` (balanced): injection, authz, secrets, unsafe deps.
9
- - `sdlc-quality` (cheap): contract coverage gaps, edge cases, dead code.
10
- - `sdlc-ops` (cheap): config, migrations, rollback, observability impact.
11
- 2. Merge findings in the main loop. Classify: blocker | improvement | note.
12
- 3. Blockers → append as fix tasks and route back to /sdlc:build (counts toward
13
- the same 3-round budget as verify). Improvements: apply if ≤5 min each,
14
- otherwise record one line in the change for the digest.
15
- 4. `node sdlc/.hooks/journal.mjs note review blockers=<n>`.
16
-
17
- Pass condition: zero open blockers. Next: /sdlc:ship.
1
+ # /sdlc:review <id> — agent panel (signal-triggered)
2
+
3
+ Run when: tier deep, OR the diff touches auth/payments/data handling, OR >10
4
+ files changed. Otherwise skip silently — a ceremonial review is garbage.
5
+
6
+ 1. Fan out in parallel, all read-only, each with the diff + change.md only:
7
+ - `sdlc-architect` (deepest): design integrity, coupling, contract drift.
8
+ - `sdlc-security` (balanced): injection, authz, secrets, unsafe deps.
9
+ - `sdlc-quality` (cheap): contract coverage gaps, edge cases, dead code.
10
+ - `sdlc-ops` (cheap): config, migrations, rollback, observability impact.
11
+ 2. Merge findings in the main loop. Classify: blocker | improvement | note.
12
+ 3. Blockers → append as fix tasks and route back to /sdlc:build (counts toward
13
+ the same 3-round budget as verify). Improvements: apply if ≤5 min each,
14
+ otherwise record one line in the change for the digest.
15
+ 4. `node sdlc/.hooks/journal.mjs note review blockers=<n>`.
16
+
17
+ Pass condition: zero open blockers. Next: /sdlc:ship.
@@ -1,19 +1,19 @@
1
- # Model routing
2
-
3
- Generic tiers only — the harness adapter maps them to real models
4
- (Claude Code agents: cheap→haiku, balanced→sonnet, deepest→opus).
5
-
6
- | Task kind | Tier | Why |
7
- |---|---|---|
8
- | requirements shaping, architecture, deep design | deepest | judgment-heavy, small volume |
9
- | standard implementation (sdlc-builder) | balanced | quality/cost sweet spot |
10
- | test generation (sdlc-contractor) | cheap | mechanical from the contract table |
11
- | eval judging (sdlc-evaluator) | cheap | rubric scoring, high volume |
12
- | review panel passes | cheap–balanced | parallel, bounded scope |
13
- | learning distillation (sdlc-learner) | cheap | summarization over journals |
14
-
15
- Rules:
16
- - Task lines in change.md may carry `[tier:cheap|balanced|deepest]`; default = balanced.
17
- - Never send a mechanical task to deepest "to be safe" — that is the waste the
18
- routing table exists to prevent.
19
- - Escalate one tier only after a concrete failure at the current tier (journal it).
1
+ # Model routing
2
+
3
+ Generic tiers only — the harness adapter maps them to real models
4
+ (Claude Code agents: cheap→haiku, balanced→sonnet, deepest→opus).
5
+
6
+ | Task kind | Tier | Why |
7
+ |---|---|---|
8
+ | requirements shaping, architecture, deep design | deepest | judgment-heavy, small volume |
9
+ | standard implementation (sdlc-builder) | balanced | quality/cost sweet spot |
10
+ | test generation (sdlc-contractor) | cheap | mechanical from the contract table |
11
+ | eval judging (sdlc-evaluator) | cheap | rubric scoring, high volume |
12
+ | review panel passes | cheap–balanced | parallel, bounded scope |
13
+ | learning distillation (sdlc-learner) | cheap | summarization over journals |
14
+
15
+ Rules:
16
+ - Task lines in change.md may carry `[tier:cheap|balanced|deepest]`; default = balanced.
17
+ - Never send a mechanical task to deepest "to be safe" — that is the waste the
18
+ routing table exists to prevent.
19
+ - Escalate one tier only after a concrete failure at the current tier (journal it).
@@ -1,16 +1,16 @@
1
- # sdlc rules card
2
- <!-- ≤40 lines · embedded verbatim in non-Claude tool adapters; Claude gets the same rules enforced by hooks. -->
3
-
4
- - Work flows through `sdlc/changes/<id>/change.md`: new → [design] → contract → build → verify → [review] → ship.
5
- - NEVER edit `sdlc/specs/**` or `sdlc/changes/archive/**` by hand. Living specs change only
6
- via a change's `## Delta:` section, merged by `npx @warnyin/sdlc archive <id>` at ship.
7
- - NEVER hand-edit `journal.ndjson` or `sdlc/.state/**` — they are machine-owned.
8
- - Write tests + evals (`contract/`) BEFORE code. No implementation while status is `new`.
9
- - Ambiguity: make the safest assumption and record it under `## Assumptions`; use
10
- `[NEEDS CLARIFICATION: q]` only for facts you cannot obtain — resolve all before contract.
11
- - Respect line caps written in each template comment; run `npx @warnyin/sdlc validate <id>`
12
- before claiming any gate passed — a red validator means the gate did NOT pass.
13
- - Constitution edits go through /sdlc:steer only; always-loaded context ≤ 60 lines total.
14
- - Verify = real test run + eval rubric. Max 3 fix rounds, then escalate to the human.
15
- - Hard-floor (security, payments, data-loss, irreversible): tier = deep, human approves ship.
16
- - Before editing an area, read any steering file whose `pathMatch` covers it.
1
+ # sdlc rules card
2
+ <!-- ≤40 lines · embedded verbatim in non-Claude tool adapters; Claude gets the same rules enforced by hooks. -->
3
+
4
+ - Work flows through `sdlc/changes/<id>/change.md`: new → [design] → contract → build → verify → [review] → ship.
5
+ - NEVER edit `sdlc/specs/**` or `sdlc/changes/archive/**` by hand. Living specs change only
6
+ via a change's `## Delta:` section, merged by `npx @warnyin/sdlc archive <id>` at ship.
7
+ - NEVER hand-edit `journal.ndjson` or `sdlc/.state/**` — they are machine-owned.
8
+ - Write tests + evals (`contract/`) BEFORE code. No implementation while status is `new`.
9
+ - Ambiguity: make the safest assumption and record it under `## Assumptions`; use
10
+ `[NEEDS CLARIFICATION: q]` only for facts you cannot obtain — resolve all before contract.
11
+ - Respect line caps written in each template comment; run `npx @warnyin/sdlc validate <id>`
12
+ before claiming any gate passed — a red validator means the gate did NOT pass.
13
+ - Constitution edits go through /sdlc:steer only; always-loaded context ≤ 60 lines total.
14
+ - Verify = real test run + eval rubric. Max 3 fix rounds, then escalate to the human.
15
+ - Hard-floor (security, payments, data-loss, irreversible): tier = deep, human approves ship.
16
+ - Before editing an area, read any steering file whose `pathMatch` covers it.
@@ -1,24 +1,24 @@
1
- # /sdlc:ship <id> — merge, archive, learn, digest
2
-
3
- Precondition: `status: verified` (+ review passed when it ran).
4
-
5
- 1. **Policy check** (`sdlc/harness.md § Autonomy policy`): if this change is NOT
6
- auto-shippable (deep/hard-floor), show the human a 5-line summary (why, delta
7
- heads, verify result, cost so far) and wait for approval. Otherwise proceed.
8
- 2. Open the gate and archive mechanically:
9
- `node sdlc/.hooks/journal.mjs open-ship <id>`
10
- `npx @warnyin/sdlc archive <id>`
11
- (validates --strict, merges every Delta into `sdlc/specs/`, promotes evals,
12
- stamps `status: shipped`, moves the folder to `changes/archive/<date>-<id>/`).
13
- 3. **Learn** — delegate to `sdlc-learner` (cheap) with the archived change.md +
14
- its journal.ndjson. It proposes ≤3 items: add-rule (with evidence pointer) /
15
- expire-or-demote (rule or steering that never fired) / harness tweak.
16
- Apply reductions and demotions immediately (they always save tokens).
17
- Additions to always-loaded context are NOT applied — list them in the digest.
18
- 4. **Digest** — write `sdlc/changes/archive/<date>-<id>/digest.md` (≤15 lines):
19
- what shipped, spec deltas merged, assumptions made, verify rounds, tokens/cost
20
- (from journal `session` events), learner proposals awaiting the human.
21
- 5. Close the gate: `node sdlc/.hooks/journal.mjs close`. Tell the user in one
22
- line: shipped + where the digest is.
23
-
24
- The digest is the async human touchpoint — reviewable and revertible later.
1
+ # /sdlc:ship <id> — merge, archive, learn, digest
2
+
3
+ Precondition: `status: verified` (+ review passed when it ran).
4
+
5
+ 1. **Policy check** (`sdlc/harness.md § Autonomy policy`): if this change is NOT
6
+ auto-shippable (deep/hard-floor), show the human a 5-line summary (why, delta
7
+ heads, verify result, cost so far) and wait for approval. Otherwise proceed.
8
+ 2. Open the gate and archive mechanically:
9
+ `node sdlc/.hooks/journal.mjs open-ship <id>`
10
+ `npx @warnyin/sdlc archive <id>`
11
+ (validates --strict, merges every Delta into `sdlc/specs/`, promotes evals,
12
+ stamps `status: shipped`, moves the folder to `changes/archive/<date>-<id>/`).
13
+ 3. **Learn** — delegate to `sdlc-learner` (cheap) with the archived change.md +
14
+ its journal.ndjson. It proposes ≤3 items: add-rule (with evidence pointer) /
15
+ expire-or-demote (rule or steering that never fired) / harness tweak.
16
+ Apply reductions and demotions immediately (they always save tokens).
17
+ Additions to always-loaded context are NOT applied — list them in the digest.
18
+ 4. **Digest** — write `sdlc/changes/archive/<date>-<id>/digest.md` (≤15 lines):
19
+ what shipped, spec deltas merged, assumptions made, verify rounds, tokens/cost
20
+ (from journal `session` events), learner proposals awaiting the human.
21
+ 5. Close the gate: `node sdlc/.hooks/journal.mjs close`. Tell the user in one
22
+ line: shipped + where the digest is.
23
+
24
+ The digest is the async human touchpoint — reviewable and revertible later.
@@ -1,21 +1,21 @@
1
- # /sdlc:steer — manage the static/dynamic boundary
2
-
3
- The ONLY sanctioned way to edit always-loaded context.
4
-
5
- 1. `node sdlc/.hooks/journal.mjs open-steer`
6
- 2. Apply the requested edits:
7
- - New knowledge → a steering file with the LEAST resident inclusion mode that
8
- works: `agent` > `manual` > `paths` > `always` (always needs justification).
9
- - Constitution edits: SHALL/SHALL NOT lines only. If the always-budget
10
- (60 lines) would overflow, something must be demoted or deleted first —
11
- name the displaced line explicitly.
12
- 3. Hygiene pass (do it every time, it is 30 seconds):
13
- - `/sdlc:observe` data — steering never pointer-hit across the last N changes
14
- → propose demote (`paths`→`manual`) or delete.
15
- - Rules with no guard/journal evidence of ever mattering → propose expiry.
16
- - Apply what the user agrees to (reductions may be applied without asking).
17
- 4. `npx @warnyin/sdlc validate` — the always-budget check must be green.
18
- 5. `node sdlc/.hooks/journal.mjs close`
19
-
20
- Learning direction is one-way by design: content flows from always → paths →
21
- manual → deleted as evidence accumulates. Getting leaner is the success metric.
1
+ # /sdlc:steer — manage the static/dynamic boundary
2
+
3
+ The ONLY sanctioned way to edit always-loaded context.
4
+
5
+ 1. `node sdlc/.hooks/journal.mjs open-steer`
6
+ 2. Apply the requested edits:
7
+ - New knowledge → a steering file with the LEAST resident inclusion mode that
8
+ works: `agent` > `manual` > `paths` > `always` (always needs justification).
9
+ - Constitution edits: SHALL/SHALL NOT lines only. If the always-budget
10
+ (60 lines) would overflow, something must be demoted or deleted first —
11
+ name the displaced line explicitly.
12
+ 3. Hygiene pass (do it every time, it is 30 seconds):
13
+ - `/sdlc:observe` data — steering never pointer-hit across the last N changes
14
+ → propose demote (`paths`→`manual`) or delete.
15
+ - Rules with no guard/journal evidence of ever mattering → propose expiry.
16
+ - Apply what the user agrees to (reductions may be applied without asking).
17
+ 4. `npx @warnyin/sdlc validate` — the always-budget check must be green.
18
+ 5. `node sdlc/.hooks/journal.mjs close`
19
+
20
+ Learning direction is one-way by design: content flows from always → paths →
21
+ manual → deleted as evidence accumulates. Getting leaner is the success metric.