shapeup-sdlc 1.6.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 (135) hide show
  1. package/.claude/settings.local.example.json +20 -0
  2. package/.claude-plugin/marketplace.json +16 -0
  3. package/.claude-plugin/plugin.json +18 -0
  4. package/.env.shapeup.example +14 -0
  5. package/AGENTS.md +133 -0
  6. package/LICENSE +21 -0
  7. package/README.md +362 -0
  8. package/SECURITY.md +72 -0
  9. package/bin/init.mjs +329 -0
  10. package/commands/build.md +14 -0
  11. package/commands/eval.md +15 -0
  12. package/commands/hammer.md +12 -0
  13. package/commands/orient.md +11 -0
  14. package/commands/qa.md +12 -0
  15. package/commands/retro.md +13 -0
  16. package/commands/scopes.md +14 -0
  17. package/commands/shape.md +12 -0
  18. package/commands/ship.md +53 -0
  19. package/commands/wire.md +11 -0
  20. package/hooks/anti-rationalization.mjs +244 -0
  21. package/hooks/compact-snapshot.mjs +47 -0
  22. package/hooks/gate-deadline.mjs +151 -0
  23. package/hooks/gate-intake.mjs +110 -0
  24. package/hooks/gate-l2.mjs +161 -0
  25. package/hooks/gate-zerowork.mjs +264 -0
  26. package/hooks/hooks.json +118 -0
  27. package/hooks/lib/decision.mjs +183 -0
  28. package/hooks/safety-spine.mjs +296 -0
  29. package/hooks/sandbox-guard.mjs +172 -0
  30. package/hooks/session-rehydrate.mjs +109 -0
  31. package/hooks/slop-cleaner.mjs +176 -0
  32. package/oracles/_shared.mjs +46 -0
  33. package/oracles/http-oracle.mjs +155 -0
  34. package/oracles/index.mjs +36 -0
  35. package/oracles/process-oracle.mjs +146 -0
  36. package/oracles/snapshot-oracle.mjs +119 -0
  37. package/oracles/test-oracle.mjs +138 -0
  38. package/package.json +49 -0
  39. package/skills/advisor-protocol/SKILL.md +171 -0
  40. package/skills/ba-pitch-analyzer/SKILL.md +175 -0
  41. package/skills/ba-pitch-analyzer/assets/templates/_index.tmpl.md +84 -0
  42. package/skills/ba-pitch-analyzer/assets/templates/api-feasibility.tmpl.md +65 -0
  43. package/skills/ba-pitch-analyzer/assets/templates/assess-report.tmpl.md +127 -0
  44. package/skills/ba-pitch-analyzer/assets/templates/contracts/be-service.contract.tmpl.md +62 -0
  45. package/skills/ba-pitch-analyzer/assets/templates/contracts/offline-storage.contract.tmpl.md +92 -0
  46. package/skills/ba-pitch-analyzer/assets/templates/contracts/third-party-api.contract.tmpl.md +66 -0
  47. package/skills/ba-pitch-analyzer/assets/templates/cross-context/context-map.tmpl.md +64 -0
  48. package/skills/ba-pitch-analyzer/assets/templates/cross-context/event-choreography.tmpl.md +77 -0
  49. package/skills/ba-pitch-analyzer/assets/templates/cross-context/migration-plan.tmpl.md +104 -0
  50. package/skills/ba-pitch-analyzer/assets/templates/cross-context/team-handoff.tmpl.md +79 -0
  51. package/skills/ba-pitch-analyzer/assets/templates/domain-model.tmpl.md +79 -0
  52. package/skills/ba-pitch-analyzer/assets/templates/feedback.tmpl.md +87 -0
  53. package/skills/ba-pitch-analyzer/assets/templates/integration.tmpl.md +64 -0
  54. package/skills/ba-pitch-analyzer/assets/templates/run-state.tmpl.md +77 -0
  55. package/skills/ba-pitch-analyzer/assets/templates/scope-summary.tmpl.md +105 -0
  56. package/skills/ba-pitch-analyzer/assets/templates/synthesis.tmpl.md +215 -0
  57. package/skills/ba-pitch-analyzer/assets/templates/task-board.tmpl.md +35 -0
  58. package/skills/ba-pitch-analyzer/assets/templates/task-spike.tmpl.md +86 -0
  59. package/skills/ba-pitch-analyzer/assets/templates/task.tmpl.md +84 -0
  60. package/skills/ba-pitch-analyzer/assets/templates/usecase.tmpl.md +105 -0
  61. package/skills/ba-pitch-analyzer/assets/templates/ux-behavior.tmpl.md +65 -0
  62. package/skills/ba-pitch-analyzer/references/contract-patterns.md +152 -0
  63. package/skills/ba-pitch-analyzer/references/ddd-patterns.md +173 -0
  64. package/skills/ba-pitch-analyzer/references/doc-schemas.md +275 -0
  65. package/skills/ba-pitch-analyzer/references/integration-analysis.md +152 -0
  66. package/skills/ba-pitch-analyzer/references/task-generation.md +623 -0
  67. package/skills/ba-pitch-analyzer/references/test-surface.md +102 -0
  68. package/skills/ba-pitch-analyzer/references/ux-behavior-patterns.md +269 -0
  69. package/skills/ba-pitch-analyzer/scripts/board-derive.mjs +241 -0
  70. package/skills/ba-pitch-analyzer/scripts/spec-lint.mjs +239 -0
  71. package/skills/coach/SKILL.md +202 -0
  72. package/skills/orient/SKILL.md +262 -0
  73. package/skills/qa-edge-hunter/SKILL.md +369 -0
  74. package/skills/scope-architect/SKILL.md +111 -0
  75. package/skills/scope-hammer/SKILL.md +186 -0
  76. package/skills/shapeup/SKILL.md +403 -0
  77. package/skills/shapeup/resources/breadboard-reflection.md +88 -0
  78. package/skills/shapeup/resources/breadboarding.md +334 -0
  79. package/skills/shapeup/resources/context-compaction.md +240 -0
  80. package/skills/shapeup/resources/framing-doc.md +92 -0
  81. package/skills/shapeup/resources/kickoff-doc.md +95 -0
  82. package/skills/shapeup/resources/shaping.md +194 -0
  83. package/skills/shapeup/resources/spike.md +86 -0
  84. package/skills/solution-architect/SKILL.md +129 -0
  85. package/skills/spec-evaluator/README.md +93 -0
  86. package/skills/spec-evaluator/SKILL.md +213 -0
  87. package/skills/spec-evaluator/references/anti-leniency.md +50 -0
  88. package/skills/spec-evaluator/references/dimension-contract.md +126 -0
  89. package/skills/spec-evaluator/references/dimensions/_registry.md +40 -0
  90. package/skills/spec-evaluator/references/dimensions/completeness.md +102 -0
  91. package/skills/spec-evaluator/references/dimensions/integration.md +129 -0
  92. package/skills/spec-evaluator/references/dimensions/performance.md +48 -0
  93. package/skills/spec-evaluator/references/dimensions/security.md +60 -0
  94. package/skills/spec-evaluator/references/dimensions/spec-conformance.md +134 -0
  95. package/skills/spec-evaluator/references/dimensions/tdd-surface.md +110 -0
  96. package/skills/spec-evaluator/references/dimensions/test-surface-conformance.md +100 -0
  97. package/skills/spec-evaluator/references/probing.md +177 -0
  98. package/skills/spec-evaluator/references/report-schema.md +101 -0
  99. package/skills/spec-evaluator/references/verdict-ledger.md +92 -0
  100. package/skills/spec-evaluator/scripts/verdict-ledger.mjs +166 -0
  101. package/skills/task-executor/SKILL.md +194 -0
  102. package/skills/tech-lead/README.md +71 -0
  103. package/skills/tech-lead/SKILL.md +459 -0
  104. package/skills/tech-lead/references/delegation.md +254 -0
  105. package/skills/tech-lead/references/gates.md +379 -0
  106. package/skills/tech-lead/references/invocation.md +45 -0
  107. package/skills/tech-lead/references/ledger-schema.md +214 -0
  108. package/skills/tech-lead/references/round-protocol.md +184 -0
  109. package/skills/tech-lead/references/state-model.md +66 -0
  110. package/skills/tech-lead/references/tiny-lane.md +52 -0
  111. package/skills/tech-lead/schemas/domain.schema.json +2294 -0
  112. package/skills/tech-lead/schemas/gate-answers.schema.json +92 -0
  113. package/skills/tech-lead/schemas/work-order.schema.json +21 -0
  114. package/skills/tech-lead/schemas/work-result.schema.json +40 -0
  115. package/skills/tech-lead/scripts/aegis-digest.mjs +124 -0
  116. package/skills/tech-lead/scripts/budget-check.mjs +156 -0
  117. package/skills/tech-lead/scripts/compile-order.mjs +518 -0
  118. package/skills/tech-lead/scripts/fit-check.mjs +196 -0
  119. package/skills/tech-lead/scripts/gate-answers.mjs +338 -0
  120. package/skills/tech-lead/scripts/ingest-result.mjs +270 -0
  121. package/skills/tech-lead/scripts/init-run.mjs +326 -0
  122. package/skills/tech-lead/scripts/lib/argv.mjs +224 -0
  123. package/skills/tech-lead/scripts/lib/contract-md.mjs +481 -0
  124. package/skills/tech-lead/scripts/lib/is-main.mjs +82 -0
  125. package/skills/tech-lead/scripts/lib/paths.mjs +278 -0
  126. package/skills/tech-lead/scripts/lib/ratchet-tree.mjs +112 -0
  127. package/skills/tech-lead/scripts/run-snapshot.mjs +269 -0
  128. package/skills/tech-lead/scripts/ship-report.mjs +275 -0
  129. package/skills/tech-lead/scripts/stats.mjs +423 -0
  130. package/skills/tech-lead/scripts/t0-verify.mjs +470 -0
  131. package/skills/tech-lead/scripts/trace-lint.mjs +367 -0
  132. package/skills/tech-lead/scripts/validate-envelope.mjs +283 -0
  133. package/skills/translator/README.md +66 -0
  134. package/skills/translator/SKILL.md +258 -0
  135. package/skills/translator/references/preservation-rules.md +102 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "_readme": "Tier C template (design spec addendum §F.2). Copy to .claude/settings.local.json and edit — that file is gitignored and merges over the committed .claude/settings.json team defaults. Every key under env is optional; omit what you don't want to override. GATE L0.5/L0.8 resolves: /ship flags > settings.local.json (this file) > settings.json (team) > skill-shipped defaults. Model keys degrade one tier down (never hard-fail) when unavailable on your plan (R2). Budget keys are the two-level circuit breaker (DD-9): round_budget is outer (build+eval cycles), attempt_budget is inner (per-scope T0 attempts).",
3
+ "env": {
4
+ "SHAPEUP_ORCH_MODEL": "opus",
5
+ "SHAPEUP_EXEC_MODEL": "sonnet",
6
+ "SHAPEUP_EVAL_MODEL": "sonnet",
7
+ "SHAPEUP_QA_MODEL": "sonnet",
8
+ "SHAPEUP_ROUND_BUDGET": "3",
9
+ "SHAPEUP_ATTEMPT_BUDGET": "5",
10
+ "SHAPEUP_DIGESTER_MODEL": "script"
11
+ },
12
+ "_permissions_readme": "The harness's pipeline scripts ship with the plugin and therefore live OUTSIDE your project. Under any permission mode short of bypassPermissions, running a script from outside the working directory needs approval — once per session interactively, and never in a headless run, where nobody is there to grant it. `npx shapeup-sdlc init` writes this block for you; it is reproduced here so you can see exactly what is being pre-approved. Scope is the harness's own deterministic, dependency-free, network-free scripts and nothing else — not a general Bash(node:*).",
13
+ "permissions": {
14
+ "allow": [
15
+ "Bash(node ${CLAUDE_PLUGIN_ROOT}/skills/tech-lead/scripts/:*)",
16
+ "Bash(node ${CLAUDE_PLUGIN_ROOT}/skills/ba-pitch-analyzer/scripts/:*)",
17
+ "Bash(node ${CLAUDE_PLUGIN_ROOT}/skills/spec-evaluator/scripts/:*)"
18
+ ]
19
+ }
20
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "nvptuoc-marketplace",
3
+ "owner": {
4
+ "name": "Liberty Nguyen",
5
+ "email": "nguyenvanphituoc.developer@gmail.com"
6
+ },
7
+ "description": "ShapeUp SDLC plugins for Claude Code.",
8
+ "plugins": [
9
+ {
10
+ "name": "shapeup-sdlc-plugin",
11
+ "source": ".",
12
+ "description": "Shape Up SDLC harness: shaping → intake → orient → scope-mapping → build → evaluate → QA, orchestrated by a tech-lead.",
13
+ "license": "MIT"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "shapeup-sdlc-plugin",
3
+ "displayName": "ShapeUp SDLC Plugin",
4
+ "version": "1.6.2",
5
+ "description": "Shape Up SDLC harness for Claude Code: shaping, intake, orient, scope-mapping, building (T0-verified, sandboxed, scope-contracted), evaluation and QA skills orchestrated by a tech-lead.",
6
+ "author": {
7
+ "name": "Liberty Nguyen",
8
+ "email": "nguyenvanphituoc.developer@gmail.com"
9
+ },
10
+ "homepage": "https://github.com/nguyenvanphituoc/shapeup-sdlc-plugin",
11
+ "repository": "https://github.com/nguyenvanphituoc/shapeup-sdlc-plugin",
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "claude-code",
15
+ "plugin",
16
+ "tooling"
17
+ ]
18
+ }
@@ -0,0 +1,14 @@
1
+ # Tier C template (design spec addendum §F.2). Copy to .env.shapeup.local and fill in real
2
+ # values — that file is gitignored and never committed. GATE L0 validates the merged config
3
+ # against this template's key set and fails fast with a per-key report if something required
4
+ # is missing.
5
+ #
6
+ # File AND keys are SHAPEUP_-namespaced on purpose: the harness's own config must never be
7
+ # confused with, or collide with, the target project's own .env / .env.local (which may
8
+ # already exist and already own DATABASE_URL, API keys, etc. for the app itself).
9
+ #
10
+ # Used by the T0 mechanical layer's DB probe (each scope contract's optional `db_probe`
11
+ # command, design spec §3.5) — set whatever connection string that probe command actually
12
+ # needs. Leave a key blank/absent if no scope in this project declares a db_probe.
13
+
14
+ SHAPEUP_T0_DATABASE_URL=
package/AGENTS.md ADDED
@@ -0,0 +1,133 @@
1
+ <!-- HARNESS_START -->
2
+ # Shape Up SDLC Local Harness
3
+
4
+ This project is scaffolded with the Shape Up SDLC Harness for coding agents.
5
+
6
+ ## mechanism instruction
7
+
8
+ The harness follows a **three-phase Shape Up SDLC loop** orchestrated by `/tech-lead`.
9
+
10
+ **The organising idea: every invariant that matters lives in the runtime, not in a prompt.**
11
+ Three consequences, in the order a reader should meet them:
12
+
13
+ 1. **Gates are enforced, not requested.** A `PreToolUse` hook
14
+ (`skills/tech-lead/scripts/validate-envelope.mjs`) hard-denies any worker dispatch whose
15
+ WorkOrder is missing or fails its schema — the malformed order never reaches a worker.
16
+ `hooks/sandbox-guard.mjs` denies every write outside the active scope's substrate, and
17
+ `hooks/gate-zerowork.mjs` blocks `Stop` on a run that left no receipt.
18
+ *Prevents: a worker acting on an order nobody compiled; a scope overwriting another's work.*
19
+ GATE L2 (`hooks/gate-l2.mjs`) is deliberately **advisory** — it reads the board from two
20
+ independent sources and warns when the once-per-round EVAL runs over unfinished tasks, but it
21
+ permits the call. The board is per-machine and the operator asked for the evaluation; see
22
+ `docs/design/adr/0001-consumer-file-organization.md` for why the denial was traded for a signal.
23
+ Sign-off itself is a file, not prose: `scripts/gate-answers.mjs` resolves each gate from a
24
+ schema-validated answer set (`ci` / `guarded` / `interactive`) and the orchestrator branches on
25
+ its exit code — 0 cross, 4 stop for the PO, 5 abort. Gates still emit their blocks and still
26
+ record a decision; what changes is that the decision's **source** is named in the ledger.
27
+ *Prevents: consent carried in a prompt paragraph, which gets paraphrased instead of acted on.*
28
+ 2. **Progress is derived, never claimed.** Hill phase comes only from T0/T1/seesaw artifacts on
29
+ disk, and the evaluator must cite a T0 artifact it re-hashes itself. *Prevents: a worker
30
+ asserting "done" with nothing behind it.*
31
+ And **starting** is itself a fact on disk: `scripts/init-run.mjs` writes
32
+ `.shapeup/<slug>/receipt.json` as the run's first tool call, so a session that dispatched
33
+ the orchestrator and left no receipt is blocked at `Stop` by `hooks/gate-zerowork.mjs`.
34
+ *Prevents: the orchestrator describing its own pipeline in future tense and stopping — measured
35
+ at 29% acceptance with 10 escaped defects while reading like a clean run.*
36
+ 3. **Parallel work cannot corrupt shared state.** Per-scope substrate write-whitelists are hook-
37
+ enforced, and exactly one script (`ingest-result.mjs`) performs every board/ledger/verdict
38
+ write. *Prevents: two executors rewriting the board, one's completions vanishing.*
39
+
40
+ Those three rest on one piece of plumbing — the **pure-skill architecture** (v1.0). The
41
+ orchestrator owns ALL pipeline management and talks to workers through two JSON envelopes: a
42
+ WorkOrder in (`compile-order.mjs`, schema-validated by a `validate-envelope.mjs` PreToolUse
43
+ hook) and a WorkResult out (applied by `ingest-result.mjs`). Worker skills contain craft only —
44
+ zero pipeline knowledge; everything they used to write into shared files they now return as data
45
+ (D6 closed: single-writer is mechanically true). Treat the envelope as an implementation detail:
46
+ it is what makes 1–3 mechanically true, and it should never be the first thing a user learns.
47
+
48
+ ### Phase 1 — Shaping (`/shapeup`)
49
+ 1. Set Boundaries → `/shapeup shaping`
50
+ 2. Find the Elements → `/shapeup breadboarding`
51
+ 3. Risks & Rabbit Holes → `/shapeup spike`
52
+ 4. Write the Pitch → `/generate-pitch` → `pitch.md`
53
+
54
+ ### Phase 2 — Betting (PO governance, no skill)
55
+ - PO decides at the Betting Table; rejected pitches loop back to raw idea.
56
+
57
+ ### Phase 3 — Building (orchestrated by `/tech-lead`)
58
+ | Step | Gate | Action |
59
+ |------|------|--------|
60
+ | Kick-off | ⏸ **L0** — Intake & Config (L0.8 model/budget matrix) | `/translator` if non-English |
61
+ | Orient (Scout) | ⏸ **L1a** — Orient Review | delegate → `/orient` |
62
+ | Wire (Reachability) | ⏸ **L1a.5** — Wiring Review ✚ | delegate → `/solution-architect` (`wire`): committed `wiring-map.md` — per-UC engine → seam → entry-point call site → affordance, against `project-profile.md` entry_point; front-loads the integration seam |
63
+ | Map Scopes | ⏸ **L1b** — Board Review (+ substrate disjointness via `spec-lint.mjs`) | delegate → `/ba-pitch-analyzer` (spec tree + board: UC + Invariants + Test Surface ★; `coverage` op writes the `requirements.md` registry ✚) then `/scope-architect` (scope contracts ✦ — sole writer). Traceability oracle `trace-lint.mjs` runs advisory ✚ |
64
+ | Build Vertically | ⏸ **L2** — Board 100% ✅ + T0-green ✦ | per dispatch: compile-order → `/task-executor` (--order) → ingest-result, T0-verified per attempt (fixtures + DB probe + seesaw ✦), sandboxed to each scope's substrate ✦ |
65
+ | EVAL (once per round) | ⏸ **L3** — Verdict | delegate → `/spec-evaluator` (--order; spec-conformance + test-surface-conformance ★; requires a T0 artifact citation on scoped specs ✦); refuted boxes/verdict ledger applied by ingest |
66
+ | FAIL → fix round r+1 | — | regression rule ★: bugs + full Test Surface of touched UC |
67
+
68
+ ✦ = v0.3.0 mechanisms, active only when the spec folder has scope contracts
69
+ (`shapeup/<slug>/scopes/*.md`); non-regression on older specs.
70
+ ✚ = spine v1.3 traceability mechanisms (covers-closure + reachability), active only when the
71
+ spine artifacts exist (`requirements.md`, `wiring-map.md`, `project-profile.md`); `trace-lint`
72
+ ships advisory (warn-only) and is promoted to a blocking gate only once `covers:` is populated.
73
+ Non-regression on older specs — every arm is skipped when its artifact is absent.
74
+
75
+ ### QA Edge Hunt (`/qa-edge-hunter`, post-PASS, pre-ship)
76
+ - **Q0** Preflight → **Q1** Charter (6 lenses − EVAL-covered) → **Hunt** (repro required, findings `~` → ledger) → report (no verdict, no score).
77
+ - Skip with `--no-qa`.
78
+
79
+ ### Ship & Triage
80
+ - **SHIP S.0 / GATE H** — delegated to `/scope-hammer`: census (QA findings + discovered ledger
81
+ + attempt-budget hammer proposals ✦) → baseline comparison (never vs. the ideal) → cut list;
82
+ TL/PO confirms, promotes only selected items.
83
+ - ⏸ **L4** Gate — Ship Sign-off (shows QA status ★).
84
+ - **RLHF (Coach Retro)** — Post-sprint feedback from L4 Gate is processed by `/coach`, which runs a categorization gate (GATE COACH-1 — asks the PO which skill each rule belongs to, never assumes) and files each rule under the responsible skill in `shapeup/knowledge-base/<skill>.md`. These files are **committed** (not the gitignored `.shapeup/` run-trace), so the whole team inherits them on `git pull`. The `/tech-lead` automatically invokes `/coach` when it receives human feedback during the Ship Gate. Coachable skills — each reads its own file at the top of its next run — are `/task-executor` (Phase 1), `/ba-pitch-analyzer` (Phase 1), and `/qa-edge-hunter` (Phase Q1). `/spec-evaluator` is deliberately not coachable (single-judge rule: the KB is guidance, never an invariant). Feedback whose root cause is the mechanism itself (a gate, hook, or skill-contract defect) is categorized `harness-defect` at GATE COACH-1 and filed to the committed defect register (`knowledge-base/harness-defects.md`) as a drafted raw idea for the Betting Table — read by no worker, never worker steering.
85
+ - Post-fix: `eval --single-pass` → `qa --recheck` (only re-probes promoted items ✦).
86
+ - Remaining `~` findings + new feedback → new raw idea (debt-free).
87
+
88
+ ### Discovered Tasks
89
+ All discovered tasks are funnelled into `.shapeup/<slug>/discovery/ledger.md` (Orient, task-executor P3.7, QA). A new invariant triggers `ba --tasks-only --from-discovered` which appends a `TS-INV-NN` row to the Test Surface ★.
90
+
91
+ ### Architectural Invariants
92
+ - **Single judge** — verdict belongs to `spec-evaluator`; QA has no verdict and no score.
93
+ - **EVAL exactly once per round** — QA sits after PASS, outside the loop.
94
+ - **Ledger = single source of truth** — all discovery flows write only to their own section.
95
+ - **QA is a level-up, not a gate** — `--no-qa` can skip it; circuit breaker outranks the Hunter.
96
+ - **Role separation** — Evaluator grades, task-executor fixes, QA discovers; no cross-role work.
97
+ - **Three-level circuit breaker ✦** — outer `round_budget` (build+eval cycles) nests an inner
98
+ per-scope `attempt_budget` (T0 attempts); an exhausted scope queues a GATE H proposal, it
99
+ never blocks the round. A third, opt-in `wall_clock_budget_s` breaker (`budget-check.mjs`,
100
+ enforced by `hooks/gate-deadline.mjs`) covers the axis the other two cannot see — both count
101
+ events, so neither notices a single round running for half an hour. Tripping it routes to
102
+ GATE H rather than killing the run: a run killed from outside ships nothing, a run that trips
103
+ its own breaker ships what is green.
104
+ - **Hill phase is mechanical, never self-reported ✦** — derived only from T0/T1/seesaw facts.
105
+ - **Envelope port (v1.0)** — every worker dispatch is WorkOrder in / WorkResult out; shared
106
+ state is written only by `ingest-result.mjs`; a malformed envelope is denied by hook before
107
+ it reaches a worker. Workers are stateless and pipeline-blind by construction.
108
+
109
+ ## Installed Skills
110
+
111
+ - **shapeup**: Run Shape Up workflows before writing code (S1-S4, B1-B5).
112
+ - **ba-pitch-analyzer**: The spec-analyzer — pitch → DDD spec tree + board, one craft with five order-selected operations (analyze | generate-board | reconcile | retrofit-surface | coverage); graph math and audits delegated to `board-derive.mjs`/`spec-lint.mjs`; the `coverage` op writes the SHARED requirement registry (`requirements.md`) for covers-closure; stateless pure worker.
113
+ - **scope-architect**: Sole writer of committed scope contracts (`scopes/*.md`) — import-graph slicing by flow, write-whitelist substrates, affordance manifests, fixtures; map-scopes | remap | split-scope operations.
114
+ - **solution-architect**: Sole writer of the committed wiring map (`wiring-map.md`) at gate L1a.5 — per-UC engine → seam → entry-point call site → player-visible affordance, resolved against `project-profile.md`; the reachability input `trace-lint.mjs` checks so no engine ships orphaned; `wire` operation; stateless pure worker.
115
+ - **task-executor**: Implement a work order's acceptance criteria exactly — WorkOrder in, code + WorkResult out; zero-memory, substrate-sandboxed, Layer 1/2/3 UI rules; never writes boards/ledgers/run-state.
116
+ - **spec-evaluator**: The single judge — evaluates the running app against the committed spec; verdict + refuted boxes return as data; requires a T0 artifact citation and grades UI affordance-only on scoped specs.
117
+ - **qa-edge-hunter**: Exploratory QA hunt.
118
+ - **translator**: Bilingual Vietnamese/English gate at intake.
119
+ - **tech-lead**: Orchestrate runs — envelope port (compile-order → dispatch → ingest-result), two-level circuit breaker, T0/seesaw-verified build rounds, mechanical hill derivation.
120
+ - **coach**: Ingests L4 feedback, asks the PO to categorize each rule (GATE COACH-1), and files it under the responsible skill in committed `shapeup/knowledge-base/<skill>.md` for team-shared, read-back continuous learning (RLHF).
121
+ - **advisor-protocol**: Adjudicates a worker's structured `ESCALATE` (design decision / spec ambiguity / substrate expansion) within a per-scope-per-round budget; persists answers to the committed round ledger.
122
+ - **scope-hammer**: GATE H — must-have census, baseline comparison, cut list + ship verdict; handles the normal stop and both circuit-breaker triggers.
123
+
124
+ ## Setup & Execution
125
+
126
+ - Envelope schemas ship inside the orchestrator skill: \`skills/tech-lead/schemas/\`; the pipeline scripts live beside their owning skill (\`skills/tech-lead/scripts/\`, \`skills/ba-pitch-analyzer/scripts/\`); orders/results live in \`.shapeup/<slug>/orders|results/\`
127
+ - **Run entry points** — \`init-run.mjs\` (GATE L0.1, opens the run and writes the receipt), \`gate-answers.mjs\` (resolves a gate from the answer set), \`budget-check.mjs\` (the deadline breaker). Because these ship WITH the plugin they live outside your project, so they need a one-time permission grant; \`npx shapeup-sdlc init\` writes it into \`.claude/settings.json\` (\`permissions.allow\`). Without it a headless run cannot take its first step — measured, 26 approval denials in one session.
128
+ - **Central domain registry** — \`skills/tech-lead/schemas/domain.schema.json\` defines every cross-boundary record type and payload field ONCE (annotated with tier/location/writer/readers, the \`x-erd\` relationship map, and the \`x-payload-by-worker\` table); the envelope schemas \`$ref\` it and no skill defines its own cross-boundary field
129
+ - **Two storage tiers (ADR-0001) — prose is the team's, structured data is the machine's.** COMMITTED \`shapeup/<slug>/\`: \`shaping/\`, \`spec/\`, \`scopes/*.md\`, \`wiring-map.md\`, \`project-profile.md\`, \`requirements.md\`, \`hill/*.yml\`, and \`REPORT.md\` (frozen once at GATE L4 — the only run evidence a teammate sees). GITIGNORED \`.shapeup/\`: the board, orders/results, \`t0/\`, \`evaluation/\`, \`qa/\`, \`working/\`, \`round-ledger.md\`, \`metrics/\`, \`gate-answers.json\`, \`safety-overrides.json\`, \`decisions.jsonl\`
130
+ - The three contracts are MARKDOWN on disk and JSON on the wire: frontmatter for scalars and \`[a, b]\` lists, a markdown table for the one array-of-objects field. \`skills/tech-lead/scripts/lib/contract-md.mjs\` is the only reader/writer of the file form; the envelope is unchanged
131
+ - Every generated path resolves through \`skills/tech-lead/scripts/lib/paths.mjs\` — never hard-code a storage root (structural test #45 enforces this)
132
+ - **Traceability spine (v1.3)** — the covers-closure + reachability oracle \`skills/tech-lead/scripts/trace-lint.mjs\` reads three committed SHARED artifacts: the requirement registry \`shapeup/<slug>/requirements.md\` (RequirementClause rows, written by \`ba-pitch-analyzer coverage\`), the wiring map \`shapeup/<slug>/wiring-map.md\` (written by \`solution-architect wire\`), and \`shapeup/<slug>/project-profile.md\` (archetype + entry_point, written by \`tech-lead\` at L0). It emits the LOCAL run-trace \`.shapeup/<slug>/trace/report.json\`; ships advisory, promoted to a gate only once \`covers:\` is populated
133
+ <!-- HARNESS_END -->
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OS Research
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,362 @@
1
+ # ShapeUp SDLC
2
+
3
+ **Shape Up for coding agents — with gates the agent can't talk its way past.**
4
+
5
+ [![CI](https://github.com/nguyenvanphituoc/shapeup-sdlc-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/nguyenvanphituoc/shapeup-sdlc-plugin/actions/workflows/ci.yml)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-black.svg)](LICENSE)
7
+ ![Claude Code plugin](https://img.shields.io/badge/Claude%20Code-plugin-6f42c1)
8
+
9
+ Your agent says it's done. It isn't. This is a [Claude Code](https://code.claude.com) plugin
10
+ that runs a full Shape Up lifecycle — idea → pitch → build → evaluate → ship — where the
11
+ important rules are enforced by the runtime instead of asked for in a prompt.
12
+
13
+ The ceremony is right-sized: `/ship` runs the full gated pipeline for real features, and
14
+ `/ship --tiny` runs a two-gate lane (orient → build → smoke-test → done) for the one-file
15
+ fixes where the gates would have nothing to say.
16
+
17
+ <p align="center">
18
+ <img src="docs/assets/demo-gate.svg" alt="Terminal recording: the agent tries to run EVAL with two tasks unfinished, and a PreToolUse hook denies the tool call outright." width="700">
19
+ </p>
20
+
21
+ <p align="center"><sub>
22
+ The denial text above is <b>verbatim stdout</b> from <code>hooks/gate-l2.mjs</code> —
23
+ <a href="tools/demo/record-demo.mjs">the recorder runs the real hook</a> and fails rather than
24
+ draw a picture. <a href="docs/assets/demo-gate.txt">Plain-text transcript.</a>
25
+ </sub></p>
26
+
27
+ ## What it does to your agent
28
+
29
+ Every framework in this category answers *"the agent ignored the spec"* with better prose.
30
+ This one answers it with a runtime. Three things are true of a run here that are not true of a
31
+ prompt-based harness:
32
+
33
+ **1. A worker cannot act on an order nobody compiled.** Every dispatch carries a schema-validated
34
+ WorkOrder, and a `PreToolUse` hook hard-denies the call when that order is missing or malformed —
35
+ the tool call never reaches the worker. The same layer denies any write outside the active scope's
36
+ file substrate, and blocks a session that dispatched the orchestrator and left no run receipt.
37
+ → *Prevents: an agent inventing its own brief, then reporting against it.*
38
+
39
+ (GATE L2, the board-green check before evaluation, is advisory: it warns when a round's evaluation
40
+ runs over unfinished tasks rather than denying it. The board is local to the machine running the
41
+ harness — see [ADR-0001](docs/design/adr/0001-consumer-file-organization.md).)
42
+
43
+ **2. Progress is measured, not claimed.** A scope counts as built only when `t0-verify` runs
44
+ its fixtures, a DB probe, and the seesaw, and writes an artifact to disk. The evaluator must
45
+ cite that artifact and re-hashes it itself; hill phase is derived from those facts, so no
46
+ worker can self-report confidence.
47
+ → *Prevents: "done" asserted with nothing behind it.*
48
+
49
+ **3. Parallel work can't corrupt shared state.** Each scope gets a write-whitelist of files
50
+ enforced by a hook, and one script performs every board/ledger/verdict write.
51
+ → *Prevents: two parallel executors both rewriting the board, and one's completions vanishing.*
52
+
53
+ Under the hood this rests on a typed worker envelope and a single-writer state layer. Those
54
+ are load-bearing plumbing, and you should not have to think about them to use the harness —
55
+ they are documented for [contributors](CONTRIBUTING.md), not for users.
56
+
57
+ > ### Just want the gate?
58
+ >
59
+ > The enforcement layer ships separately as the **[Anti-Lying Kit](plugins/anti-lying-kit/)** —
60
+ > three hooks, no methodology, installable *alongside* spec-kit, OpenSpec, or your own
61
+ > `tasks.md`. You should not have to adopt Shape Up to stop your agent claiming done.
62
+ >
63
+ > ```
64
+ > /plugin install anti-lying-kit@nvptuoc-marketplace
65
+ > ```
66
+
67
+ ## Quickstart
68
+
69
+ ```
70
+ /plugin marketplace add nguyenvanphituoc/shapeup-sdlc-plugin
71
+ /plugin install shapeup-sdlc-plugin@nvptuoc-marketplace
72
+ /ship "add dark mode to the settings screen"
73
+ ```
74
+
75
+ `/ship` walks the whole lifecycle and pauses at each gate for you. That's the whole quickstart.
76
+
77
+ Want to see a full run before installing anything? **[docs/quickstart.md](docs/quickstart.md)**
78
+ walks one small feature end to end — including the hook denying a premature eval, a FAIL round
79
+ with real evaluator output, and the fix that turns it green.
80
+
81
+ <sub>No prerequisites for non-UI work — a browser (`npx playwright install chromium`) is needed
82
+ only when a run actually reaches a `[ui]` acceptance criterion. Team installs, the scaffolding
83
+ installer (Claude Code / Antigravity / Codex), and troubleshooting are in
84
+ **[docs/install.md](docs/install.md)**; upgrading is **[docs/upgrading.md](docs/upgrading.md)**.</sub>
85
+
86
+ ## Agent support
87
+
88
+ The harness is written once and compiled to other agent CLIs (`npm run distribute` emits
89
+ `dist/`; the [scaffolding installer](docs/install.md#local-scaffolding) wires targets in one
90
+ run). The matrix is honest — the row that matters most does not travel:
91
+
92
+ | | Claude Code | Cursor | Antigravity | Codex |
93
+ |---|:---:|:---:|:---:|:---:|
94
+ | The 13 skills | ✅ plugin | ✅ `.mdc` rules (references inlined) | ✅ subagent defs + skill files | ✅ skill files |
95
+ | Slash commands | ✅ all 10 | ✅ VS Code/Cursor extension + rules | — | — |
96
+ | Pipeline scripts (`t0-verify`, `trace-lint`, oracles) | ✅ | ✅ plain Node, run from any CLI | ✅ | ✅ |
97
+ | **Hook-enforced gates** (deny on premature EVAL, substrate sandbox, safety spine) | ✅ | ❌ | ❌ | ❌ |
98
+ | Advisory Stop hooks | ✅ | ❌ | ❌ | ❌ |
99
+
100
+ Hooks are a per-CLI mechanism, so outside Claude Code the gates degrade from **enforced** to
101
+ **instructed** — the same honor system every other framework runs on everywhere. If the deny
102
+ hook is why you're here, that currently means Claude Code.
103
+
104
+ ## Glossary
105
+
106
+ This harness has its own vocabulary. Here is all of it, in plain English — you can read the
107
+ rest of this README after this table and nothing will be a surprise.
108
+
109
+ | Term | In plain English |
110
+ |---|---|
111
+ | **board** | The round's task list. "Green" means every task is done. The deny hook reads this. |
112
+ | **round** | One build → evaluate cycle. A FAIL verdict starts round *r+1*. |
113
+ | **T0** | The smoke test a scope must pass before it counts as built: its fixtures + a DB probe + the seesaw. Writes an artifact to disk that the evaluator must cite. |
114
+ | **seesaw** | The part of T0 that re-runs *other* scopes' fixtures — so a regression is never mistaken for progress. |
115
+ | **substrate** | The exact list of files one scope is allowed to write. A hook blocks anything outside it. |
116
+ | **scope contract** | The file defining one vertical slice: its substrate, its fixtures, its affordances. |
117
+ | **affordance** | The thing a user can actually click, type or call. UI is graded on affordances, not on looks. |
118
+ | **hill / hill phase** | How much of a scope is still *unknown* versus merely *unfinished*. Derived from T0 facts — never self-reported. |
119
+ | **gate (L0–L4)** | A numbered checkpoint in a run. Most pause for you; GATE L2 is the one enforced by a hook. |
120
+ | **covers-closure** | Every requirement clause has at least one task claiming to cover it. Nothing silently drops. |
121
+ | **wiring reachability** | Every engine has a call site reachable from the app's real entry point. Catches "built, but never wired up". |
122
+ | **discovery ledger** | The one file everything found mid-run gets written to, so nothing is lost between rounds. |
123
+
124
+ A longer version, including the internals, is in [docs/glossary.md](docs/glossary.md).
125
+
126
+ ## The workflow
127
+
128
+ The harness walks a pitch from idea to ship. The full annotated pipeline — the build round,
129
+ the gate walkthrough, the circuit breaker — is
130
+ [`docs/design/04-functional-design.md`](docs/design/04-functional-design.md), and the design
131
+ document as a whole starts at [`docs/design/`](docs/design/README.md). A simplified view:
132
+
133
+ ```mermaid
134
+ graph LR
135
+ A([Raw Idea]) --> S["Shaping<br>/shapeup"]
136
+ S --> P["Pitch"]
137
+ P --> BET{"Betting<br>(PO)"}
138
+ BET --> KO["Kick-off + Orient<br>/orient"]
139
+ KO --> WIRE["Wire<br>/solution-architect"]
140
+ WIRE --> MAP["Map Scopes<br>/ba-pitch-analyzer<br>+ /scope-architect"]
141
+ MAP --> BUILD["Build Vertically<br>/task-executor"]
142
+ BUILD --> EVAL["Evaluate<br>/spec-evaluator"]
143
+ EVAL -- FAIL --> BUILD
144
+ EVAL -- PASS --> QA["Edge Hunt<br>/qa-edge-hunter"]
145
+ QA --> SHIP["Triage + Ship<br>/scope-hammer"]
146
+ SHIP --> RETRO["Coach Retro<br>/coach"]
147
+ TL["/tech-lead orchestrates Orient → Ship"] -.-> KO
148
+
149
+ classDef plan fill:#e3f2fd,stroke:#1e88e5;
150
+ classDef build fill:#e8f5e9,stroke:#43a047;
151
+ classDef qa fill:#fce4ec,stroke:#c2185b;
152
+ class S,WIRE,MAP plan;
153
+ class KO,BUILD build;
154
+ class QA,EVAL qa;
155
+ ```
156
+
157
+ Since v1.3 the pipeline carries a **traceability spine**: `ba-pitch-analyzer`'s `coverage`
158
+ operation writes a requirement registry (`requirements.md`), `solution-architect` commits a
159
+ per-use-case wiring map (`wiring-map.md`, gate L1a.5) resolved against the L0
160
+ `project-profile.md`, and the covers-closure + reachability oracle
161
+ `skills/tech-lead/scripts/trace-lint.mjs` checks that no engine ships orphaned. It runs
162
+ advisory (warn-only) and is promoted to a blocking gate only once `covers:` is populated;
163
+ every arm is skipped when its artifact is absent, so older specs are unaffected.
164
+
165
+ ## What's included
166
+
167
+ ### Skills
168
+
169
+ | Phase | Skill | Version | What it does |
170
+ |-------|-------|---------|--------------|
171
+ | Shaping (1–4) | `shapeup` | — | Frame the problem, breadboard affordances, spike risks, write the pitch. Sub-commands: `full`, `shaping`, `spike`, `breadboarding`, `framing-doc`, `kickoff-doc`, `breadboard-reflection`. |
172
+ | Intake (GATE L0) | `translator` | — | Normalizes non-English intake (pitch/PRD/transcript) to faithful English before planning. The harness is English-only downstream. |
173
+ | Orient (7) | `orient` | — | Builder-led recon: reads the code, spikes the single riskiest area, emits a code-surface map, spike findings, discovered-task seed, and a hill signal. Writes no production code. |
174
+ | Wire (GATE L1a.5) | `solution-architect` | v1.1 | Sole writer of the committed wiring map (`wiring-map.md`): per-UC engine → integration seam → entry-point call site → player-visible affordance, resolved against `project-profile.md`. Front-loads the integration seam so no engine ships orphaned; the reachability input `trace-lint.mjs` checks. Operation: wire. |
175
+ | Map Scopes (8) | `ba-pitch-analyzer` | v4.0 | The spec-analyzer (pure worker). Decomposes a pitch into a linked DDD document tree (domain model → use cases → tasks) with BDD scenarios, a UC system flow, and a derived `## Test Surface`. One craft, five order-selected operations (analyze / generate-board / reconcile / retrofit-surface / coverage — the last writes the shared `requirements.md` registry for covers-closure); graph math + audits delegated to `board-derive.mjs`/`spec-lint.mjs`. |
176
+ | Map Scopes (8) | `scope-architect` | v1.0 | Sole writer of committed, write-whitelisted scope contracts (`scopes/*.md`): import-graph slicing by flow, substrates, affordance manifests, fixtures. Operations: map-scopes / remap / split-scope. |
177
+ | Build (9) | `task-executor` | v2.0 | Pure worker: work order in → code out. Assumption scan, minimum-code/surgical-change discipline, Layer 1/2/3 UI rules, substrate-sandboxed, zero-memory. Never writes boards/ledgers/run-state. |
178
+ | Evaluate (GATE L3) | `spec-evaluator` | v1.0 | The single judge (pure worker). Verifies spec-conformance, TDD surface, and integration against the running app — skeptical, files `file:line` bugs, runs exactly once per build round. Requires a T0 artifact citation, grades UI affordance-only; verdict + refuted boxes return as data. |
179
+ | QA (post-PASS) | `qa-edge-hunter` | v1.1 | Exploratory edge hunt on the running app through six fixed lenses, charting edges *outside* what the evaluator probed. Findings go to the ledger as `~`; never blocks ship. |
180
+ | Advisor (mid-build) | `advisor-protocol` | v0.1 | Adjudicates a worker's structured `ESCALATE` (design decision / spec ambiguity / substrate expansion) within a per-scope-per-round budget; persists answers to the committed round ledger so they survive a zero-memory reset. |
181
+ | Stop (11) | `scope-hammer` | v0.1 | GATE H: must-have census → baseline comparison (never vs. the ideal) → cut list + ship verdict. Handles the normal stop and both circuit-breaker triggers. |
182
+ | Retro (post-L4) | `coach` | — | RLHF for the harness: turns raw PO/TL feedback at Ship Sign-off into per-skill guidelines under committed `shapeup/knowledge-base/<skill>.md`, read back by `task-executor` / `ba-pitch-analyzer` / `qa-edge-hunter` on their next run. GATE COACH-1 asks the PO which skill owns each rule — never assumes; mechanism defects are filed to the harness-defect register instead. |
183
+ | Orchestrator | `tech-lead` | v1.0 | Owns the run end-to-end: PLAN once → BUILD all tasks → EVAL once per round, looping on FAIL. Three-level circuit breaker (rounds / T0 attempts / wall clock), T0/seesaw-verified build rounds, mechanical hill derivation. Sole writer of run-state. |
184
+
185
+ ### Commands
186
+
187
+ `/ship` runs the whole lifecycle; the phase commands run one step each, so the pipeline is
188
+ learnable from `/`-completion alone.
189
+
190
+ | Command | Phase | Description |
191
+ |---------|-------|-------------|
192
+ | `/ship` | all | Run the full harness on a pitch (interactive gates by default; `--auto`, `--unattended`). |
193
+ | `/shape` | 1 | Shape a raw idea into a pitch: boundaries → breadboard → spike → `pitch.md`. |
194
+ | `/orient` | 7 | Builder-led recon; spikes the riskiest area, writes no production code. |
195
+ | `/wire` | L1a.5 | Write the wiring map — engine → seam → entry-point call site, per use case. |
196
+ | `/scopes` | 8 | Spec tree + board (`ba-pitch-analyzer`), then scope contracts (`scope-architect`). |
197
+ | `/build` | 9 | Implement one task's acceptance criteria exactly. |
198
+ | `/eval` | L3 | The single judge. Round mode is hook-gated — see the demo above. |
199
+ | `/qa` | post-PASS | Exploratory edge hunt; findings never block ship. |
200
+ | `/hammer` | H | Must-have census, baseline comparison, cut list + ship verdict. |
201
+ | `/retro` | post-L4 | File ship-gate feedback into the per-skill knowledge base. |
202
+
203
+ ### Agents
204
+
205
+ | Agent | Description |
206
+ |-------|-------------|
207
+ | `reviewer` | Independent correctness/security code reviewer (returns findings, never edits). |
208
+
209
+ ### Hooks
210
+
211
+ Nine Node hooks. What each one reads and what it can deny:
212
+
213
+ - `SessionStart` — prints a load confirmation so you know the plugin is active; on
214
+ `startup|compact|resume|clear`, `hooks/session-rehydrate.mjs` additionally injects the mid-run
215
+ `RunSnapshot` hint ("trust the files, not the summary") when a harness run is in flight. On a
216
+ cold `startup` it leads with the stronger sentence — *a run is already open; resume it, do not
217
+ re-open it* — because that is the failure a fresh session actually makes. Silent when no run is
218
+ in flight, which is the ordinary case.
219
+ - `PreToolUse` (matcher `Skill`) — **`hooks/gate-l2.mjs` hard-blocks the once-per-round EVAL
220
+ delegation while the task board isn't fully green.** This is the gate in the demo above.
221
+ - `PreToolUse` (matcher `Skill`) — **`hooks/gate-intake.mjs` denies a `tech-lead` dispatch that
222
+ carries no pitch, no spec folder, and no requirement text.** Measured on the SDD harness
223
+ benchmark: when the requirement text was dropped on the hand-off and only a flag survived, the
224
+ run printed the gate list, built nothing, and scored 29% against a hidden acceptance suite while
225
+ looking like a success (n=3, zero variance). An orchestrator with no spec now fails loudly
226
+ instead of narrating.
227
+ - `PreToolUse` (matcher `Skill`) — **`hooks/gate-deadline.mjs` denies a `task-executor` dispatch
228
+ once the run's opt-in wall-clock budget is spent**, routing to GATE H instead. `spec-evaluator`,
229
+ `scope-hammer`, `qa-edge-hunter` and `advisor-protocol` stay reachable — a run past its deadline
230
+ must still be able to judge, hammer and close. Off unless a budget is configured.
231
+ - `PreToolUse` (matcher `Bash|Read|Write|Edit|MultiEdit`) — `hooks/safety-spine.mjs` denies
232
+ destructive commands (`rm -rf` on unrecoverable targets, force-push/push-to-main,
233
+ `git reset --hard`, `DROP TABLE`) and secret-file reads. Machine guard, not pipeline guard;
234
+ escape hatch is the human-authored `.shapeup/safety-overrides.json`.
235
+ - `PreToolUse` (matcher `Edit|Write|MultiEdit`) — `hooks/sandbox-guard.mjs` blocks writes
236
+ outside the active scope's substrate whitelist (no-op unless scope contracts exist).
237
+ - `PreToolUse` (matcher `Skill|Agent`) — `skills/tech-lead/scripts/validate-envelope.mjs`
238
+ denies any worker dispatch whose order file is missing or schema-invalid.
239
+ - `Stop` — **`hooks/gate-zerowork.mjs` blocks a session that dispatched the orchestrator and
240
+ left no run receipt.** The one blocking `Stop` hook, and the narrowest: its predicate is
241
+ mechanical — orchestrator dispatched AND no `.shapeup/<slug>/receipt.json` — so it never
242
+ judges quality, it reports that no work exists to judge. It exists because the benchmark caught
243
+ this harness describing its own pipeline instead of running it (Haiku 4.5, n=5, zero variance,
244
+ 29% acceptance) while both existing guards structurally could not see it: one is scoped to an
245
+ active run, and a run that never started leaves no files; the other matches past-tense
246
+ completion claims, and narration is future-tense. Fails open on everything ambiguous, and
247
+ `stop_hook_active` caps it at one block per stop chain.
248
+ - `Stop` — two **advisory, never-blocking** hooks (`hooks/anti-rationalization.mjs` flags
249
+ completion claims the board/T0 facts contradict — including a future-tense promise left as the
250
+ session's last word; `hooks/slop-cleaner.mjs` flags TODO/`console.log`/commented-out-code
251
+ leftovers in the session's diff). They emit at most a `systemMessage` — "QA is a level-up, not
252
+ a gate."
253
+ - `PreCompact` — `hooks/compact-snapshot.mjs` persists the mid-run `RunSnapshot` to
254
+ `.shapeup/<slug>/run-snapshot.json` before the conversation is compacted.
255
+
256
+ No hook makes a network request, none has dependencies, and all are plain, readable `.mjs`
257
+ files. **[SECURITY.md](SECURITY.md)** states what each hook reads, what it can deny, and what
258
+ it never does — as claims written to be falsified, with the grep to check them.
259
+
260
+ > A project-local `/gap-scan` command (navigator→driver gap tracking) lives under
261
+ > `.claude/commands/` for this repo's own use. It is **not** bundled in the distributed
262
+ > plugin.
263
+
264
+ ## Architecture invariants
265
+
266
+ These hold across the harness and are the reason it stays predictable:
267
+
268
+ - **One judge only** — the verdict belongs to `spec-evaluator`. QA has no verdict and no score.
269
+ - **EVAL exactly once per round** — QA is not a second evaluation pass; it runs after PASS, outside the loop.
270
+ - **Ledger is the single source of truth** — orient, task-executor, and QA all write to `discovery/ledger.md`.
271
+ - **QA is a level-up, not a gate** — `--no-qa` skips it; the circuit breaker outranks the hunter; findings default to `~`.
272
+ - **Role separation** — evaluator grades, task-executor fixes, QA discovers; no one does another's job.
273
+ - **Three-level circuit breaker** — an outer `round_budget` (build+eval cycles) nests an inner
274
+ per-scope `attempt_budget` (T0 attempts); an exhausted scope queues a GATE H proposal instead
275
+ of blocking the round. An opt-in third breaker bounds the **wall clock**, because the other two
276
+ count events and neither can notice a single round running for half an hour — tripping it routes
277
+ to GATE H, so a run out of time ships what is green instead of being killed and shipping nothing.
278
+ - **Hill phase is mechanical, never self-reported** — derived only from T0/T1/seesaw facts, closing
279
+ the self-reported-confidence risk outright.
280
+ - **One writer per shared file** — every board/ledger/verdict write goes through
281
+ `ingest-result.mjs`; workers return data and never touch shared state.
282
+ - **Traceability is oracle-checked, opt-in** — `trace-lint.mjs` verifies covers-closure and
283
+ wiring reachability from the committed spine artifacts; it ships advisory (warn-only) and every
284
+ arm is skipped when its artifact is absent, so older specs are non-regressed.
285
+
286
+ ## Known rough edges
287
+
288
+ Stated plainly, because you will hit them:
289
+
290
+ - **The `--tiny` lane is young.** It right-sizes the ceremony (two gates instead of eight) but
291
+ keeps the T0 verification floor; its fit-check heuristics will need tuning against real use.
292
+ - **Only half the trigger-eval story is measured.** Skill *discrimination* is:
293
+ **0 false activations across 75 cross-skill hard negatives** (Haiku 4.5, 2026-07-26 — the
294
+ thirteen descriptions do not steal each other's work). *Activation* rate is measured but
295
+ confounded and deliberately not quoted as a headline: 38 of 74 positive cases point at a
296
+ referent ("coach **this feedback**") the probe never supplies, so a model that names the right
297
+ skill and asks for the missing input scores as a miss. Method, per-skill numbers, and the fix
298
+ are in [evals/README.md](evals/README.md) — the harness ships a CI test that *fails* if
299
+ fabricated results appear, and three earlier baselines were discarded rather than published.
300
+
301
+ Contributions to any of these are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md).
302
+
303
+ ## Develop
304
+
305
+ ```bash
306
+ npm test # structural tests
307
+ npm run demo # re-record the demo asset from the real hook
308
+ claude plugin validate . --strict # the same check CI runs
309
+ claude --plugin-dir . # load this working copy without installing
310
+ ```
311
+
312
+ ## Layout
313
+
314
+ ```
315
+ .claude-plugin/
316
+ plugin.json # plugin manifest
317
+ marketplace.json # marketplace listing (points at this repo)
318
+ skills/<name>/SKILL.md # the 13 harness skills (+ references/ and assets/)
319
+ skills/tech-lead/scripts|schemas/ # orchestrator pipeline: init-run, gate-answers,
320
+ # budget-check, compile-order, ingest-result, validate-envelope,
321
+ # t0-verify, trace-lint, aegis-digest, run-snapshot,
322
+ # stats + envelope and gate-answer schemas
323
+ skills/ba-pitch-analyzer/scripts/ # planner mechanics: board-derive, spec-lint
324
+ skills/spec-evaluator/scripts/ # verdict-ledger (reference impl of the flip/confidence grammar)
325
+ commands/*.md # slash commands (/ship + the 9 phase commands)
326
+ agents/*.md # subagents (reviewer)
327
+ hooks/ # hooks.json + safety-spine, gate-l2, gate-intake, gate-deadline,
328
+ # sandbox-guard (PreToolUse),
329
+ # gate-zerowork (Stop, blocking), anti-rationalization, slop-cleaner (Stop, advisory),
330
+ # compact-snapshot (PreCompact), session-rehydrate (SessionStart)
331
+ scripts/install-harness.sh, migrate.sh # stable public entrypoints (fresh install / update)
332
+ tools/demo/record-demo.mjs # regenerates docs/assets/demo-gate.svg
333
+ scripts/shapeup-sdlc/ # dev/CI tooling: lib/, migrations/, oracles/,
334
+ # trigger-eval.mjs, distribute.js
335
+ docs/install.md, upgrading.md, glossary.md
336
+ docs/design/ # the design document (pipeline, gates, circuit breaker, ERD)
337
+ docs/internal/launch/ # directory-submission copy
338
+ .github/workflows/ # CI + release
339
+ ```
340
+
341
+ ## Release
342
+
343
+ 1. Bump `version` in `.claude-plugin/plugin.json`.
344
+ 2. Update `CHANGELOG.md`.
345
+ 3. Tag and push: `git tag v1.3.1 && git push origin v1.3.1`.
346
+
347
+ The release workflow validates the plugin, checks the tag matches the manifest version,
348
+ and publishes a GitHub release.
349
+
350
+ ## Credits
351
+
352
+ - The `shapeup` skill (shaping, breadboarding, spike, framing/kickoff docs) is inspired by and
353
+ reuses material from [rjs/shaping-skills](https://github.com/rjs/shaping-skills) by Ryan Singer.
354
+ - The Shape Up methodology is from [*Shape Up*](https://basecamp.com/shapeup) by Basecamp.
355
+
356
+ This project carries Shape Up's *building* apparatus — appetite, hill charts, the scope hammer,
357
+ "QA is for the edges", comparing against baseline rather than the ideal — into a mechanized
358
+ loop. The shaping half is Ryan Singer's work, gratefully used.
359
+
360
+ ## License
361
+
362
+ MIT — see [LICENSE](LICENSE).