@static-var/keystone 0.1.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.
@@ -0,0 +1,239 @@
1
+ # Keystone Breakdown Module
2
+
3
+ ## Core principle
4
+ Breakdown turns a goal into sequenced, reviewable vertical slices of work.
5
+
6
+ A good breakdown makes implementation easier because every slice has a visible result, clear constraints, and a verification path. It makes review easier because reviewers can compare changes against stated goals, requirements, risks, and acceptance checks.
7
+
8
+ Breakdown is planning, not execution. A plan is not proof; only inspected changes, tests, demos, or other evidence prove completion.
9
+
10
+ ## Load when
11
+ Use this module when the user asks to:
12
+
13
+ - break down a feature, fix, refactor, migration, tool, system, or project
14
+ - produce milestones, implementation steps, tickets, issues, vertical slices, or phases
15
+ - decide sequencing, dependencies, iterations, scope cuts, or parallelization
16
+ - turn an ambiguous goal into implementable work
17
+ - prepare work for coding agents, reviewers, or subagents
18
+ - plan greenfield architecture before implementation
19
+ - split a large task into reviewable chunks without exposing `/plan`
20
+
21
+ Also load when implementation is requested but the goal is broad enough that coding immediately would hide major product, architecture, or sequencing decisions.
22
+
23
+ ## Not for
24
+ Do not use Breakdown for:
25
+
26
+ - implementation, file edits, refactors, migrations, or generated code
27
+ - debugging a known failure; use `debug` first, then return to Breakdown if a repair plan is needed
28
+ - research-only tasks; use `research` first when facts are missing
29
+ - copy/design shaping as the primary work; use `shape` first when output is prose, UX, or design direction
30
+ - final verification, release readiness, or completion claims; use `review`, `health`, or `ship`
31
+ - renaming this module to `plan`, creating `/plan`, or exposing the internal planner name as a public command
32
+
33
+ ## Outcome contract
34
+ A Breakdown output must include:
35
+
36
+ 1. Goal: the intended outcome in one or two sentences.
37
+ 2. Context inspected: files, docs, requirements, or assumptions used.
38
+ 3. Requirements inventory: critical requirements, non-functional requirements, good-to-haves, constraints, and open questions.
39
+ 4. Stack and architecture context: current or proposed technologies, boundaries, integrations, and limitations.
40
+ 5. Iteration layering: iteration 1, iteration 2, iteration 3, etc., with explicit scope cuts.
41
+ 6. Vertical slices: ordered work items that each deliver an end-to-end outcome.
42
+ 7. Verification gates: how each slice can be tested, reviewed, or demonstrated.
43
+ 8. Risks and dependencies: what can block, invalidate, or reorder the work.
44
+ 9. Handoff: recommended next primary module and any subagent/reasoning suggestions.
45
+
46
+ If information is missing, state the assumption or ask the smallest set of questions required to avoid a bad plan.
47
+
48
+ ## Modes
49
+
50
+ ### Feature breakdown
51
+ Use for new capabilities in an existing product. Focus on the user/operator goal, existing entry points, data paths, APIs, UI surfaces, tests, deployment constraints, and the smallest end-to-end slice that proves the feature path. Add progressive enrichment after the core loop works. Avoid horizontal buckets like "database", "backend", "frontend", and "tests" unless they are nested inside a vertical slice.
52
+
53
+ ### Greenfield architecture breakdown
54
+ Use for new projects, tools, services, apps, packages, or substantial standalone systems. Start architecture-first: name the primary users, runtime, language, framework, hosting, storage, auth, observability, CI, packaging constraints, system boundaries, and integration points. Iteration 1 should prove the architecture can run, test, deploy, and support one meaningful vertical path, not merely create folders.
55
+
56
+ ### Refactor/migration breakdown
57
+ Use when behavior should remain stable while internals change. Focus on the current behavior contract, compatibility expectations, affected surfaces, consumers, migration seams, adapters, flags, dual-run paths, rollback strategy, observability, and characterization tests. Prefer strangler-style or seam-first slices over broad rewrites.
58
+
59
+ ### Subagent-parallel breakdown
60
+ Use when independent workstreams can proceed safely in isolated workspaces. Build the dependency graph before delegation. Name shared files, interfaces, merge-risk hotspots, subagent roles, reasoning levels, context packets, expected artifacts, integration order, and review checkpoints. Only parallelize slices that can be verified independently or integrated behind a clear contract.
61
+
62
+ ## Process
63
+
64
+ 1. Identify the goal.
65
+ - Restate the desired end state, not just the requested activity.
66
+ - Identify who benefits and what observable change proves value.
67
+ - If the goal is unclear and cannot be inferred from context, ask one focused question.
68
+ 2. Inspect before asking broad questions.
69
+ - Read relevant files, docs, issues, architecture notes, tests, package manifests, and existing modules when available.
70
+ - Use `research` for unfamiliar libraries, external constraints, or repository-wide discovery.
71
+ - Ask clarifying questions only when inspection cannot resolve a decision that materially changes the breakdown.
72
+ 3. Build the requirements inventory.
73
+ - Separate critical requirements from non-functional requirements and good-to-haves.
74
+ - Capture explicit user constraints, protected files, deadlines, compatibility needs, and review expectations.
75
+ - Mark assumptions and unknowns instead of silently inventing requirements.
76
+ 4. Identify stack and constraints.
77
+ - Note languages, frameworks, package managers, deployment targets, test tooling, persistence, auth, APIs, and platform limits.
78
+ - For greenfield work, propose architecture choices only after naming tradeoffs and constraints.
79
+ - For existing systems, prefer the established stack unless the goal requires a change.
80
+ 5. Choose iteration layers.
81
+ - Define iteration 1 as the smallest coherent outcome that proves the path.
82
+ - Define later iterations as progressively richer outcomes, not random leftovers.
83
+ - Make explicit what is intentionally deferred.
84
+ 6. Slice vertically.
85
+ - Each slice should cross needed layers to produce a reviewable result.
86
+ - Include data/model/API/UI/test/docs work inside the slice when needed for that result.
87
+ - Avoid phase plans that finish entire subsystems before any end-to-end value appears.
88
+ 7. Add verification gates.
89
+ - Give each slice an acceptance check, test command, manual review path, or demo criterion.
90
+ - Include regression checks for migrations and refactors.
91
+ - State when review should happen and what reviewers should inspect.
92
+ 8. Prepare the handoff.
93
+ - Recommend the next Keystone module.
94
+ - Identify subagent opportunities, required context, and reasoning level.
95
+ - Call out risks, dependencies, and open questions that should block implementation if unresolved.
96
+
97
+ ## Requirements inventory
98
+ Use this inventory before sequencing work:
99
+
100
+ - Goal: what outcome the user wants.
101
+ - Critical requirements: must be true or the work fails.
102
+ - Non-functional requirements: performance, security, reliability, accessibility, privacy, maintainability, observability, compatibility, cost, release, and operational concerns.
103
+ - Good-to-haves: valuable but deferrable enhancements.
104
+ - Constraints: protected files, APIs, tech stack, deadlines, repo conventions, deployment targets, team/process limits.
105
+ - Current state: what exists now, with file/source references when available.
106
+ - Unknowns: decisions or facts still unresolved.
107
+ - Assumptions: temporary beliefs used to proceed.
108
+
109
+ When requirements conflict, surface the conflict before writing slices.
110
+
111
+ ## Iteration layering
112
+ Iteration layers should describe increasing confidence and capability:
113
+
114
+ - Iteration 1: skeleton or core path. One thin, end-to-end result that validates the architecture, integration point, or user journey.
115
+ - Iteration 2: completeness and resilience. Add common cases, validation, error states, compatibility, and tests around the proven path.
116
+ - Iteration 3: polish and scale. Add edge cases, performance, accessibility, observability, docs, migration cleanup, and nice-to-haves.
117
+ - Later iterations: optional expansion, hardening, automation, or product refinements.
118
+
119
+ For greenfield projects, iteration 1 must include a runnable or executable foundation plus one meaningful vertical path. For migrations, iteration 1 should establish safety: characterization checks, seams, adapters, or observability before broad movement.
120
+
121
+ ## Task quality bar
122
+ Each task or slice must have:
123
+
124
+ - a name that describes the delivered outcome
125
+ - user/operator/developer value
126
+ - inputs and dependencies
127
+ - files or areas likely involved, when known
128
+ - exact acceptance criteria
129
+ - verification method
130
+ - rollback or safety note when risk is non-trivial
131
+ - review focus: what a reviewer should inspect
132
+
133
+ A weak task says "build backend" or "add tests". A strong slice says "Persist saved searches end-to-end behind the existing search UI, with API validation, storage migration, and regression coverage for loading saved searches."
134
+
135
+ ## Subagents and reasoning
136
+ Default reasoning: `high`.
137
+
138
+ Use subagents when planning benefits from independent context gathering, critique, or parallel workstream design:
139
+
140
+ - researcher subagents for separate code areas, external APIs, or prior art
141
+ - architecture reviewer subagents for greenfield foundations and migrations
142
+ - risk reviewer subagents for security, data loss, compatibility, or release plans
143
+ - worker subagents only after slices are independent and interfaces are stable
144
+
145
+ For each proposed subagent, specify role, reasoning level, context packet, expected output artifact, files or areas off limits, and integration/review checkpoint. Do not use subagents to bypass ambiguity. Resolve shared interfaces and sequencing first.
146
+
147
+ ## Hard rules
148
+
149
+ - No implementation under Breakdown.
150
+ - No file mutation unless the user explicitly requested a planning artifact and the artifact itself is in scope.
151
+ - Do not rename `breakdown` to `plan`.
152
+ - Do not expose `/plan`.
153
+ - Do not claim the plan proves completion.
154
+ - Do not skip goal identification.
155
+ - Do not ask broad clarifying questions before inspecting available context.
156
+ - Do not produce horizontal-only plans.
157
+ - Do not hide assumptions, unresolved questions, or conflicts.
158
+ - Do not route risky plans directly to `build` without verification gates and review points.
159
+
160
+ ## Failure modes
161
+
162
+ - Activity plan: lists actions but never states the outcome.
163
+ - Horizontal buckets: separates backend/frontend/tests so no slice is independently valuable.
164
+ - Big-bang architecture: designs everything before proving one runnable path.
165
+ - Faux certainty: treats assumptions as facts.
166
+ - Question spam: asks what inspection could answer.
167
+ - Implementation leak: starts coding, editing files, or choosing exact code structure beyond planning needs.
168
+ - Review-hostile output: lacks acceptance criteria, test commands, or reviewer focus.
169
+ - Parallelism theater: delegates coupled workstreams that collide on shared files or undefined interfaces.
170
+ - Plan-as-proof: reports success because a plan exists.
171
+
172
+ ## Output format
173
+ Use this structure unless the user requested a different planning artifact:
174
+
175
+ ```markdown
176
+ # Breakdown: <goal>
177
+
178
+ ## Goal
179
+ <one or two sentences describing the desired outcome>
180
+
181
+ ## Context inspected
182
+ - <files, docs, issues, sources, or "none available">
183
+
184
+ ## Requirements inventory
185
+ ### Critical requirements
186
+ - <must-have>
187
+
188
+ ### Non-functional requirements
189
+ - <quality/operational constraint>
190
+
191
+ ### Good-to-haves
192
+ - <deferrable enhancement>
193
+
194
+ ### Stack and architecture context
195
+ - Stack: <technologies, frameworks, platforms, deployment targets>
196
+ - Boundaries: <modules, layers, services, UI/data/domain seams>
197
+ - Integrations: <APIs, persistence, queues, auth, payment, external systems>
198
+ - Limitations and constraints: <protected files, compatibility, process, deadline, cost, operational limits>
199
+
200
+ ### Unknowns and assumptions
201
+ - Unknown: <question that matters>
202
+ - Assumption: <assumption used for this breakdown>
203
+
204
+ ## Iteration layering
205
+ ### Iteration 1: <core path / architecture skeleton / safety seam>
206
+ - Outcome: <reviewable result>
207
+ - Scope: <included>
208
+ - Deferred: <not included>
209
+
210
+ ### Iteration 2: <complete common cases>
211
+ - Outcome: <reviewable result>
212
+ - Scope: <included>
213
+ - Deferred: <not included>
214
+
215
+ ### Iteration 3: <hardening / polish / scale>
216
+ - Outcome: <reviewable result>
217
+ - Scope: <included>
218
+ - Deferred: <not included>
219
+
220
+ ## Vertical slices
221
+ 1. <slice name>
222
+ - Value: <who benefits and how>
223
+ - Work: <end-to-end changes at a planning level>
224
+ - Dependencies: <prior slices or decisions>
225
+ - Acceptance: <observable completion criteria>
226
+ - Verification: <test/review/demo method>
227
+ - Review focus: <what reviewers should inspect>
228
+
229
+ ## Risks and dependencies
230
+ - <risk, impact, mitigation>
231
+
232
+ ## Subagent opportunities
233
+ - <role, reasoning, context packet, expected artifact>
234
+
235
+ ## Handoff
236
+ Next module: `<research|build|debug|review|health|ship|shape>` because <reason>.
237
+ ```
238
+
239
+ Keep the output detailed enough to guide implementation and review, but short enough that each slice remains actionable.
@@ -0,0 +1,284 @@
1
+ # Keystone Build Module
2
+
3
+ ## Core principle
4
+
5
+ Build changes through evidence, not vibes: isolate first, specify the next observable behavior, prove the test can fail, make the smallest correct change, then refactor without changing behavior.
6
+
7
+ Build is the mutation module. It may edit scoped project artifacts after the isolation gate passes, but it does not decide that work is shipped. Completion means "implemented with proof and ready for review/ship," not finalized.
8
+
9
+ ## Load when
10
+
11
+ Use Build when the user asks to:
12
+
13
+ - implement, create, edit, or wire behavior
14
+ - add a feature, screen, endpoint, command, migration, or integration
15
+ - refactor existing code while preserving behavior
16
+ - change architecture, module boundaries, interfaces, or contracts
17
+ - apply an approved plan from `breakdown`
18
+ - delegate independent implementation work to subagents/workers
19
+ - make focused content or configuration changes that require mutation
20
+
21
+ ## Not for
22
+
23
+ Do not use Build for:
24
+
25
+ - routing unclear work: use `router`
26
+ - researching unknowns without mutation: use `research`
27
+ - shaping requirements or acceptance criteria: use `shape`
28
+ - decomposing large work before implementation: use `breakdown`
29
+ - diagnosing a failure whose cause is unknown: use `debug`
30
+ - reviewing completed changes: use `review`
31
+ - releasing, merging, publishing, or finalizing: use `ship`
32
+
33
+ ## Outcome contract
34
+
35
+ Before Build exits, it must be able to report:
36
+
37
+ - isolation was checked before the first mutation via `gates/isolation.md`
38
+ - the exact user scope and protected files were respected
39
+ - the intended behavior or refactor invariant is stated plainly
40
+ - tests, examples, or checks prove the change, or gaps are explicitly disclosed
41
+ - red-capable tests were used for behavior changes whenever practical
42
+ - delegated work, if any, was verified by the parent before acceptance
43
+
44
+ Build must not claim work is done because code "looks right." Proof is required before completion claims.
45
+
46
+ ## Modes
47
+
48
+ ### TDD feature build
49
+
50
+ Use when adding or changing observable behavior.
51
+
52
+ Contract:
53
+
54
+ - define one behavior slice at a time
55
+ - write or identify the smallest test/check that should fail before the change
56
+ - run it and confirm the failure is meaningful, not caused by setup noise
57
+ - implement the smallest code that makes it pass
58
+ - run the focused check again
59
+ - run relevant regression checks
60
+ - refactor only while checks stay green
61
+
62
+ Prefer tests that exercise real behavior over tests that only verify mocks, implementation details, or snapshots. If a failing test cannot be created, state why and use the strongest available proof.
63
+
64
+ TDD exceptions are rare but real. When a red-capable automated test is impractical, state the reason before editing and write an alternative proof plan. Acceptable cases include documentation-only edits, generated files, one-off migrations where rollback is the proof, external systems unavailable in the environment, exploratory spikes that will be thrown away, or emergency config changes. The alternative proof plan must name the observable check, manual verification, diff review, sample input/output, dry run, or rollback validation that will replace red/green.
65
+
66
+ ### Refactor
67
+
68
+ Use when preserving behavior while improving structure, names, duplication, readability, or boundaries.
69
+
70
+ Contract:
71
+
72
+ - name the behavior that must not change
73
+ - find existing tests or add characterization tests before edits when coverage is weak
74
+ - make small mechanical changes first
75
+ - keep public contracts stable unless the user requested a contract change
76
+ - run regression checks before and after meaningful refactor steps
77
+ - stop if behavior questions appear; route back to `shape` or `debug` as needed
78
+
79
+ A characterization test captures what the current system does before you change structure. It is not a claim that current behavior is ideal; it is a tripwire that prevents accidental behavior changes while refactoring. Write it around externally visible behavior, important edge cases, or bug-compatible outputs that must stay stable until the user approves a behavior change.
80
+
81
+ Concise example: before extracting invoice total formatting, add a test that `renderInvoiceSummary({ subtotal: 1000, discount: 125, currency: "USD" })` still returns `"Subtotal $10.00 · Discount $1.25 · Total $8.75"`; then refactor behind that externally visible output.
82
+
83
+ Refactoring is not a license to redesign everything nearby.
84
+
85
+ ### Architecture-sensitive build
86
+
87
+ Use when the change affects boundaries, state management, cross-module dependencies, platform conventions, or long-lived maintainability.
88
+
89
+ Contract:
90
+
91
+ - identify the domain shape before choosing architecture
92
+ - choose the lightest architecture that fits the problem
93
+ - define contracts/interfaces where they reduce coupling or clarify ownership
94
+ - keep domain rules separate from transport, UI, persistence, and framework glue
95
+ - use patterns only when they remove real pressure, not to decorate simple code
96
+ - validate that the result is pleasant for developers to read, understand, maintain, and look at
97
+
98
+ SOLID is a pressure-test, not dogma:
99
+
100
+ - **SRP:** Can this unit change for one clear reason, or are unrelated policies bundled together?
101
+ - **OCP:** Can the next known variation be added without editing fragile existing logic, or is a simpler edit safer for now?
102
+ - **LSP:** Can substitutes honor the same contract without surprising callers?
103
+ - **ISP:** Are callers forced to depend on methods, fields, events, or permissions they do not use?
104
+ - **DIP:** Do high-level policies depend on stable abstractions at real boundaries, or are abstractions hiding one local call?
105
+
106
+ Examples of appropriate taste:
107
+
108
+ - mobile UI may use MVVM/MVI when state, events, and rendering need separation
109
+ - clean architecture may fit when domain rules must survive UI, database, or API changes
110
+ - SOLID and design patterns are justified only when they relieve current pressure
111
+
112
+ ### Delegated/parallel build
113
+
114
+ Use when two or more implementation slices are independent enough to proceed without shared mutable state or ambiguous ownership.
115
+
116
+ Contract:
117
+
118
+ - split by outcome, not by vague activity
119
+ - pass each worker a narrow scope, files or directories, constraints, and completion criteria
120
+ - define contracts/interfaces before parallel work begins when slices must meet
121
+ - state what must not be edited
122
+ - require each worker to report files changed, checks run, and risks
123
+ - verify delegated work yourself before integrating or claiming completion
124
+ - reconcile overlaps deliberately; do not let workers race on the same files
125
+
126
+ Do not delegate fuzzy architecture judgment without a concrete interface or decision boundary.
127
+
128
+ Concise subagent brief template:
129
+
130
+ ```markdown
131
+ Goal: one observable outcome
132
+ Scope: allowed files/directories
133
+ Do not edit: protected files/behaviors
134
+ Contract: interfaces, invariants, data shape, or acceptance criteria
135
+ Proof: required tests/checks/manual verification
136
+ Report: files changed, verification output, risks/gaps
137
+ ```
138
+
139
+ ## Process
140
+
141
+ 1. Confirm scope.
142
+ - Restate the requested mutation in one sentence.
143
+ - Identify protected files and out-of-scope behavior.
144
+ - If scope is unsafe or ambiguous, ask one focused question or route to `shape`.
145
+
146
+ 2. Pass isolation before mutation.
147
+ - Load/check `gates/isolation.md`.
148
+ - Know the workspace, branch/worktree state, and dirty files.
149
+ - Stop if unrelated changes could be overwritten.
150
+
151
+ 3. Choose the mode.
152
+
153
+ 4. Define the next outcome.
154
+ - Write the smallest observable behavior, invariant, or contract.
155
+ - Avoid "make it better" as an implementation target.
156
+
157
+ 5. Establish proof before code.
158
+ - For behavior changes, create or identify a red-capable test/check.
159
+ - Run the focused check and confirm the failure would pass only for the intended change.
160
+ - For refactors, establish characterization or regression coverage.
161
+ - If proof is impossible in the environment, record the limitation before editing and use an alternative proof plan.
162
+
163
+ 6. Implement the smallest correct slice.
164
+ - Edit only files in scope.
165
+ - Keep changes narrow and reversible.
166
+ - Prefer clear names and direct control flow.
167
+ - Do not invent broad architecture to satisfy a small behavior.
168
+
169
+ 7. Green.
170
+ - Run the focused test/check.
171
+ - If it fails unexpectedly, use `debug`; do not stack guesses.
172
+
173
+ 8. Refactor.
174
+ - Remove duplication introduced by the slice.
175
+ - Improve readability without broadening behavior.
176
+ - Keep tests green after cleanup.
177
+
178
+ 9. Regression check.
179
+ - Run the most focused relevant suite available.
180
+ - Never replace verification with a summary.
181
+
182
+ 10. Early smell check.
183
+ - Stop and simplify if the diff introduces god functions, vague `manager`/`helper` names, hidden control flow, stringly APIs, layer violations, or speculative interfaces.
184
+
185
+ 11. Architecture pressure-test.
186
+ - For architecture-sensitive changes, answer the SOLID questions and remove abstractions that do not survive them.
187
+
188
+ 12. Handoff.
189
+ - Summarize changed files and behavior.
190
+ - Include commands run and results.
191
+ - Disclose unverified areas.
192
+ - Recommend `review` or `ship` as the next module when appropriate.
193
+
194
+ ## Architecture taste checklist
195
+
196
+ Use this checklist before accepting the design:
197
+
198
+ - Does the architecture match the domain complexity rather than the agent's desire to sound senior?
199
+ - Is each module/class/function responsible for one understandable thing?
200
+ - Are domain concepts named in the user's language?
201
+ - Are interfaces/contracts placed at real boundaries, not between every pair of functions?
202
+ - Is state ownership explicit?
203
+ - Are side effects isolated enough to test meaningful behavior?
204
+ - Would a developer know where to add the next similar behavior?
205
+ - Is the simplest path also readable, or has simplicity become cleverness?
206
+ - Is duplication removed only after the repeated concept is real?
207
+ - Are patterns such as Strategy, Repository, Adapter, Observer, MVVM, MVI, or Clean Architecture justified by current pressure?
208
+ - Does the diff pass the SOLID pressure-test questions without adding dogmatic ceremony?
209
+ - Does the diff avoid god functions, vague managers/helpers, hidden control flow, stringly APIs, layer violations, and speculative interfaces?
210
+
211
+ ## Subagents and reasoning
212
+
213
+ Default reasoning: `medium`.
214
+
215
+ Escalate to `high` when:
216
+
217
+ - architecture boundaries are being changed
218
+ - tests are failing for unclear reasons
219
+ - multiple agents must coordinate through contracts
220
+ - data loss, security, billing, release, or migration risk exists
221
+ - the user asks for broad refactoring or platform-specific architecture judgment
222
+
223
+ Use subagents/workers when:
224
+
225
+ - slices can be verified independently
226
+ - files do not overlap, or ownership is explicitly assigned
227
+ - exploration can happen without mutation
228
+
229
+ A delegation brief must include:
230
+
231
+ - goal/outcome
232
+ - allowed files or directories
233
+ - forbidden files or behaviors
234
+ - relevant interfaces/contracts
235
+ - expected tests/checks
236
+ - report format for files changed, verification, and risks/gaps
237
+
238
+ Verify delegated work by:
239
+
240
+ - reading the diff, not just the report
241
+ - running or reviewing the reported checks
242
+ - checking contract compatibility between slices
243
+ - rejecting broad edits, invented abstractions, or unproved claims
244
+
245
+ ## Hard rules
246
+
247
+ - Build must pass `gates/isolation.md` before the first mutation.
248
+ - Build must not ship, merge, publish, release, or finalize work.
249
+ - Do not edit files outside the user's scope.
250
+ - Do not claim completion without proof or explicit disclosure of missing proof.
251
+ - Do not skip red/green/refactor for behavior changes unless there is a stated, practical reason and alternative proof plan.
252
+ - Do not use subagents as a way to avoid understanding the result.
253
+ - Do not introduce architecture that the current domain pressure does not justify.
254
+
255
+ ## Failure modes
256
+
257
+ Watch for these and correct course:
258
+
259
+ - **Green-only development:** tests are added after implementation and never proven red.
260
+ - **Mock theater:** tests prove mocks were called, not that behavior works.
261
+ - **Scope creep:** nearby cleanup, README edits, scripts, or unrelated modules change without request.
262
+ - **Invented architecture:** factories, managers, providers, repositories, or layers appear without pressure.
263
+ - **Shallow abstraction:** a wrapper hides one call site and makes the code harder to follow.
264
+ - **Brittle hack:** timing sleeps, magic constants, global state, or special cases mask the real issue.
265
+ - **God function:** one routine owns validation, orchestration, persistence, formatting, and error policy.
266
+ - **Vague names:** `manager`, `helper`, `util`, or `common` hide responsibility instead of naming it.
267
+ - **Hidden control flow:** callbacks, observers, magic registration, or framework hooks make execution hard to trace without clear benefit.
268
+ - **Stringly API:** strings encode commands, states, fields, or permissions that should be typed, enumerated, or centralized.
269
+ - **Layer violation:** UI, transport, persistence, or framework code reaches across boundaries into another layer's policy.
270
+ - **Speculative interface:** abstraction exists for imagined future variants, not current pressure.
271
+ - **Ambiguous delegation:** workers receive goals like "improve this" without contracts or boundaries.
272
+ - **Unverified handoff:** delegated changes are accepted from a summary alone.
273
+ - **Finalization leak:** Build says work is shipped, merged, or ready for users instead of ready for review/ship.
274
+
275
+ ## Output format
276
+
277
+ When handing back from Build, respond with:
278
+
279
+ - `Summary`: what changed, in bullets
280
+ - `Files changed`: exact paths
281
+ - `Verification`: commands/checks run and results
282
+ - `Delegation`: subagents used, contracts passed, and how their work was verified; or `none`
283
+ - `Risks / gaps`: anything unverified, deferred, or worth reviewing
284
+ - `Next`: usually `review` or `ship`, never a claim that Build finalized the work