cclaw-cli 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/content/stage-schema.d.ts +2 -92
- package/dist/content/stage-schema.js +7 -1341
- package/dist/content/stages/brainstorm.d.ts +2 -0
- package/dist/content/stages/brainstorm.js +136 -0
- package/dist/content/stages/design.d.ts +2 -0
- package/dist/content/stages/design.js +215 -0
- package/dist/content/stages/index.d.ts +8 -0
- package/dist/content/stages/index.js +11 -0
- package/dist/content/stages/plan.d.ts +2 -0
- package/dist/content/stages/plan.js +146 -0
- package/dist/content/stages/review.d.ts +2 -0
- package/dist/content/stages/review.js +197 -0
- package/dist/content/stages/schema-types.d.ts +94 -0
- package/dist/content/stages/schema-types.js +1 -0
- package/dist/content/stages/scope.d.ts +2 -0
- package/dist/content/stages/scope.js +188 -0
- package/dist/content/stages/ship.d.ts +2 -0
- package/dist/content/stages/ship.js +142 -0
- package/dist/content/stages/spec.d.ts +2 -0
- package/dist/content/stages/spec.js +136 -0
- package/dist/content/stages/tdd.d.ts +2 -0
- package/dist/content/stages/tdd.js +184 -0
- package/package.json +1 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// BRAINSTORM — reference: superpowers brainstorming
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
export const BRAINSTORM = {
|
|
5
|
+
stage: "brainstorm",
|
|
6
|
+
skillFolder: "brainstorming",
|
|
7
|
+
skillName: "brainstorming",
|
|
8
|
+
skillDescription: "Design-first stage. Explore context, understand intent through collaborative dialogue, propose distinct approaches, and lock an approved direction before scope/design work.",
|
|
9
|
+
hardGate: "Do NOT invoke implementation skills, write code, scaffold projects, or mutate product behavior until a concrete direction is approved by the user.",
|
|
10
|
+
ironLaw: "NO ARTIFACT IS COMPLETE WITHOUT AN EXPLICITLY APPROVED DIRECTION — SILENCE IS NOT APPROVAL.",
|
|
11
|
+
purpose: "Turn an initial idea into an approved design direction through natural collaborative dialogue — understanding the problem before proposing solutions.",
|
|
12
|
+
whenToUse: [
|
|
13
|
+
"Starting a new feature or behavior change",
|
|
14
|
+
"Requirements are ambiguous or trade-offs are unclear",
|
|
15
|
+
"Before any implementation-stage command or architecture commitment"
|
|
16
|
+
],
|
|
17
|
+
whenNotToUse: [
|
|
18
|
+
"A valid approved direction already exists and only execution remains",
|
|
19
|
+
"The request is a pure release/finalization action with no new product decisions",
|
|
20
|
+
"The task is retrospective only (post-ship audit with no new solution choices)"
|
|
21
|
+
],
|
|
22
|
+
checklist: [
|
|
23
|
+
"**Explore project context** — check files, docs, recent commits to understand what already exists.",
|
|
24
|
+
"**Assess scope** — if the request covers multiple independent subsystems, flag it and help decompose before deep-diving. Each sub-project gets its own brainstorm cycle.",
|
|
25
|
+
"**Ask clarifying questions** — one at a time, understand purpose, constraints, and success criteria. Prefer multiple choice when possible. Each question should change what we build, not just gather trivia.",
|
|
26
|
+
"**Propose 2-3 architecturally distinct approaches** — with real trade-offs and your recommendation. Lead with the recommended option and explain why.",
|
|
27
|
+
"**Present design by sections** — scale each section to its complexity. Ask after each section whether it looks right so far. Cover: architecture, key components, data flow.",
|
|
28
|
+
"**Write artifact** to `.cclaw/artifacts/01-brainstorm.md`.",
|
|
29
|
+
"**Self-review** — scan for placeholders/TODOs, check internal consistency, verify scope is focused, resolve any ambiguity.",
|
|
30
|
+
"**User reviews artifact** — ask the user to review the written artifact and explicitly approve or request changes.",
|
|
31
|
+
"**Handoff** — only then complete stage and point to `/cc-next`."
|
|
32
|
+
],
|
|
33
|
+
interactionProtocol: [
|
|
34
|
+
"Explore what exists before asking what to build — check project files first.",
|
|
35
|
+
"If the idea is vague or could mean many different things, your FIRST question narrows to a specific kind of project. Do not ask detail questions until the project type is clear.",
|
|
36
|
+
"Ask exactly one question per turn. Prefer multiple choice. No bundled questions.",
|
|
37
|
+
"After 2-3 questions, summarize your emerging understanding before continuing so the user can correct course early.",
|
|
38
|
+
"Each question should change a concrete design decision. Litmus test: if the two most likely answers do not lead to different architectures, make the choice yourself and state it.",
|
|
39
|
+
"Present design in sections scaled to their complexity — a few sentences for simple aspects, detailed for nuanced ones. Get approval after each section.",
|
|
40
|
+
"When proposing approaches, lead with your recommendation and explain why.",
|
|
41
|
+
"State explicitly what is being approved when requesting approval.",
|
|
42
|
+
"Run a brief self-review (placeholders, contradictions, scope, ambiguity) before presenting the artifact.",
|
|
43
|
+
"**STOP.** Wait for explicit user approval after writing the artifact. Do NOT auto-advance."
|
|
44
|
+
],
|
|
45
|
+
process: [
|
|
46
|
+
"Explore project context: check files, docs, recent activity.",
|
|
47
|
+
"Assess scope: flag if request is too broad, help decompose first.",
|
|
48
|
+
"Ask clarifying questions one at a time — focus on purpose, constraints, success criteria.",
|
|
49
|
+
"Propose 2-3 architecturally distinct approaches with trade-offs and a recommendation.",
|
|
50
|
+
"Present design sections incrementally, get approval after each.",
|
|
51
|
+
"Write approved direction to `.cclaw/artifacts/01-brainstorm.md`.",
|
|
52
|
+
"Self-review: placeholder scan, internal consistency, scope check, ambiguity check.",
|
|
53
|
+
"Request explicit user approval of the artifact.",
|
|
54
|
+
"Handoff to scope only after approval is explicit."
|
|
55
|
+
],
|
|
56
|
+
requiredGates: [
|
|
57
|
+
{ id: "brainstorm_context_explored", description: "Project context (files, docs, existing patterns) was checked before asking questions." },
|
|
58
|
+
{ id: "brainstorm_idea_understood", description: "Agent and user share the same understanding of the problem, constraints, and success criteria." },
|
|
59
|
+
{ id: "brainstorm_approaches_compared", description: "2-3 architecturally distinct approaches were compared with real trade-offs and a recommendation." },
|
|
60
|
+
{ id: "brainstorm_direction_approved", description: "User approved a concrete direction and what exactly was approved is stated." },
|
|
61
|
+
{ id: "brainstorm_artifact_reviewed", description: "User reviewed the written brainstorm artifact and confirmed readiness." }
|
|
62
|
+
],
|
|
63
|
+
requiredEvidence: [
|
|
64
|
+
"Artifact written to `.cclaw/artifacts/01-brainstorm.md`.",
|
|
65
|
+
"Project context was explored (files, docs, or recent activity referenced).",
|
|
66
|
+
"Clarifying questions and their answers are captured.",
|
|
67
|
+
"2-3 approaches with trade-offs and recommendation are recorded.",
|
|
68
|
+
"Approved direction and approval marker are present.",
|
|
69
|
+
"Assumptions and open questions are captured (or explicitly marked as none)."
|
|
70
|
+
],
|
|
71
|
+
inputs: ["problem statement", "constraints", "success criteria"],
|
|
72
|
+
requiredContext: [
|
|
73
|
+
"existing project context and patterns",
|
|
74
|
+
"current behavior of affected area",
|
|
75
|
+
"business and delivery constraints"
|
|
76
|
+
],
|
|
77
|
+
researchPlaybooks: [
|
|
78
|
+
"research/repo-scan.md",
|
|
79
|
+
"research/learnings-lookup.md"
|
|
80
|
+
],
|
|
81
|
+
outputs: [
|
|
82
|
+
"approved design direction",
|
|
83
|
+
"alternatives with trade-offs",
|
|
84
|
+
"brainstorm artifact"
|
|
85
|
+
],
|
|
86
|
+
blockers: [
|
|
87
|
+
"no explicit approval",
|
|
88
|
+
"critical ambiguity unresolved",
|
|
89
|
+
"project context not explored"
|
|
90
|
+
],
|
|
91
|
+
exitCriteria: [
|
|
92
|
+
"approved design direction documented",
|
|
93
|
+
"required gates marked satisfied",
|
|
94
|
+
"no implementation action taken",
|
|
95
|
+
"artifact reviewed by user"
|
|
96
|
+
],
|
|
97
|
+
antiPatterns: [
|
|
98
|
+
"Asking questions without exploring existing project context first",
|
|
99
|
+
"Asking bundled or purely informational questions that don't change decisions",
|
|
100
|
+
"Proposing cosmetic option variants instead of architecturally distinct approaches",
|
|
101
|
+
"Jumping directly into implementation",
|
|
102
|
+
"Requesting approval without stating what decision is being approved"
|
|
103
|
+
],
|
|
104
|
+
redFlags: [
|
|
105
|
+
"No project context exploration before questions",
|
|
106
|
+
"Questions that only gather preferences without design impact",
|
|
107
|
+
"Options that are variants of one approach, not distinct alternatives",
|
|
108
|
+
"Approval requested without explicit decision context"
|
|
109
|
+
],
|
|
110
|
+
policyNeedles: [
|
|
111
|
+
"Explore project context",
|
|
112
|
+
"One question at a time",
|
|
113
|
+
"2-3 architecturally distinct approaches",
|
|
114
|
+
"State what is being approved",
|
|
115
|
+
"Self-review before handoff",
|
|
116
|
+
"Do NOT implement, scaffold, or modify behavior"
|
|
117
|
+
],
|
|
118
|
+
artifactFile: "01-brainstorm.md",
|
|
119
|
+
next: "scope",
|
|
120
|
+
reviewSections: [],
|
|
121
|
+
completionStatus: ["DONE", "DONE_WITH_CONCERNS", "BLOCKED"],
|
|
122
|
+
crossStageTrace: {
|
|
123
|
+
readsFrom: [],
|
|
124
|
+
writesTo: [".cclaw/artifacts/01-brainstorm.md"],
|
|
125
|
+
traceabilityRule: "Scope and design decisions must trace back to explored context and approved brainstorm direction."
|
|
126
|
+
},
|
|
127
|
+
artifactValidation: [
|
|
128
|
+
{ section: "Context", required: true, validationRule: "Must reference project state and relevant existing code or patterns." },
|
|
129
|
+
{ section: "Problem", required: true, validationRule: "Must define what we're solving, success criteria, and constraints." },
|
|
130
|
+
{ section: "Clarifying Questions", required: true, validationRule: "Must capture question, answer, and decision impact for each clarifying question." },
|
|
131
|
+
{ section: "Approaches", required: true, validationRule: "Must compare 2-3 architecturally distinct options with real trade-offs and recommendation." },
|
|
132
|
+
{ section: "Selected Direction", required: true, validationRule: "Must include the selected approach, rationale, and explicit approval marker." },
|
|
133
|
+
{ section: "Design", required: true, validationRule: "Must cover architecture, key components, and data flow scaled to complexity." },
|
|
134
|
+
{ section: "Assumptions and Open Questions", required: true, validationRule: "Must capture unresolved assumptions/open questions, or explicitly state none." }
|
|
135
|
+
]
|
|
136
|
+
};
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// DESIGN — reference: gstack Eng review
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
export const DESIGN = {
|
|
5
|
+
stage: "design",
|
|
6
|
+
skillFolder: "engineering-design-lock",
|
|
7
|
+
skillName: "engineering-design-lock",
|
|
8
|
+
skillDescription: "Engineering lock-in stage. Build a concrete technical spine before spec and planning, with section-by-section interactive review.",
|
|
9
|
+
hardGate: "Do NOT write implementation code. This stage produces design decisions and architecture documents only. No code changes, no scaffolding, no test files.",
|
|
10
|
+
ironLaw: "NO DESIGN DECISION WITHOUT A LABELED DIAGRAM, A REJECTED ALTERNATIVE, AND A NAMED FAILURE MODE.",
|
|
11
|
+
purpose: "Lock architecture, data flow, failure modes, and test/performance expectations through rigorous interactive review.",
|
|
12
|
+
whenToUse: [
|
|
13
|
+
"After scope contract approval",
|
|
14
|
+
"Before writing final spec and execution plan",
|
|
15
|
+
"When architecture risks need explicit treatment"
|
|
16
|
+
],
|
|
17
|
+
whenNotToUse: [
|
|
18
|
+
"Scope mode and boundaries are still unresolved",
|
|
19
|
+
"The change is docs-only or metadata-only with no architecture impact",
|
|
20
|
+
"Implementation has already started and requires review instead of design lock"
|
|
21
|
+
],
|
|
22
|
+
checklist: [
|
|
23
|
+
"Trivial-Change Escape Hatch — If scope artifact shows ≤3 files, zero new interfaces, and no cross-module data flow, skip full review sections. Produce a mini-design: one paragraph of rationale, list of changed files, one risk to watch. Proceed to spec.",
|
|
24
|
+
"Design Doc Check — read existing design docs, scope artifact, brainstorm artifact. If a design doc exists that covers this area, check for 'Supersedes:' and use the latest. Use upstream artifacts as source of truth.",
|
|
25
|
+
"Codebase Investigation — Before any design decision, read the actual code in the blast radius. List every file that will be touched, its current responsibilities, and existing patterns (error handling, naming, test style). Design must conform to discovered patterns, not impose new ones without justification.",
|
|
26
|
+
"Step 0: Scope Challenge — what existing code solves sub-problems? Minimum change set? Complexity check: 8+ files or 2+ new services = complexity smell → flag for possible scope reduction.",
|
|
27
|
+
"Search Before Building — For each technical choice (library, pattern, architecture), search for existing solutions. Label findings: Layer 1 (exact match), Layer 2 (partial match, needs adaptation), Layer 3 (inspiration only), EUREKA (unexpected perfect solution). Default to existing before custom.",
|
|
28
|
+
"Architecture Review — system design, component boundaries, data flow, scaling, security architecture. For each new codepath: one realistic production failure scenario. **Mandatory:** produce at least one architecture diagram (ASCII, Mermaid, or tool-generated) showing component boundaries and data flow direction. Apply the **Visual Communication rules** (see below) — an unlabeled or generic diagram is worse than no diagram, because it pretends to encode decisions it does not.",
|
|
29
|
+
"Code Quality Review — code organization, DRY violations, error handling patterns, over/under-engineering assessment.",
|
|
30
|
+
"Test Review — diagram every new flow, data path, error path. For each: what test type covers it? Does one exist? What is the gap? Produce test plan artifact.",
|
|
31
|
+
"Performance Review — N+1 queries, memory concerns, caching opportunities, slow code paths. What breaks at 10x load? At 100x?",
|
|
32
|
+
"Parallelization Strategy — If multiple independent modules, produce dependency table: which can be built in parallel? Where are conflict risks? Flag shared-state modules.",
|
|
33
|
+
"Unresolved Decisions — List any design decisions that could not be resolved in this session. For each: what information is missing? Who can provide it? What is the default if no answer comes?",
|
|
34
|
+
"Distribution Check — If the plan creates new artifact types (packages, CLI tools, configs), document the build/publish story. How does it reach the user?",
|
|
35
|
+
"Deferred Items Cross-Reference — Collect every item explicitly deferred during design review. Each must appear in the Unresolved Decisions table or in the upstream scope artifact's deferred list. No deferred item may exist only in conversation — it must be written down."
|
|
36
|
+
],
|
|
37
|
+
interactionProtocol: [
|
|
38
|
+
"Review architecture decisions section-by-section.",
|
|
39
|
+
"For EACH issue found in a review section, present it ONE AT A TIME. Do NOT batch multiple issues.",
|
|
40
|
+
"For each issue: use the Decision Protocol — describe concretely with file/line references, present labeled options (A/B/C) with trade-offs, effort estimate (S/M/L/XL), risk level (Low/Med/High), and mark one as (recommended). Do NOT use a numeric Completeness rubric; recommend the option that best covers architecture, data-flow, failure-modes, test, and perf review concerns for the issue with the lowest risk. If AskQuestion/AskUserQuestion is available, send exactly ONE question per call, validate fields against runtime schema, and on schema error immediately fall back to plain-text question instead of retrying guessed payloads.",
|
|
41
|
+
"Only proceed to the next review section after ALL issues in the current section are resolved.",
|
|
42
|
+
"If a section has no issues, say 'No issues found' and move on.",
|
|
43
|
+
"Do not skip failure-mode mapping.",
|
|
44
|
+
"For design baseline approval: present the full baseline. **STOP.** Do NOT proceed until user explicitly approves the design.",
|
|
45
|
+
"Take a firm position on every recommendation. Do NOT hedge with 'it depends' or 'you could do either'. State your opinion, then justify it.",
|
|
46
|
+
"Use pushback patterns for weak framing: if the user says 'it's just a small change', respond with 'small changes to shared interfaces have outsized blast radius — let's map it'. If 'we'll refactor later', respond with 'later never comes — show me the refactor ticket or do it now'.",
|
|
47
|
+
"When the user's proposed architecture is suboptimal, say so directly. Offer the alternative with concrete trade-offs, do not bury criticism in praise.",
|
|
48
|
+
"When encountering ambiguity, classify it before acting: (A) ask user for missing info, (B) enumerate interpretations and pick one with justification, (C) propose hypothesis with validation path. Do NOT silently resolve ambiguity."
|
|
49
|
+
],
|
|
50
|
+
process: [
|
|
51
|
+
"Read upstream artifacts (brainstorm, scope).",
|
|
52
|
+
"Investigate codebase: read files in blast radius, catalogue current patterns and responsibilities.",
|
|
53
|
+
"Run Step 0 scope challenge: existing code leverage, minimum change set, complexity check.",
|
|
54
|
+
"Walk through each review section interactively.",
|
|
55
|
+
"Define architecture boundaries and ownership.",
|
|
56
|
+
"Describe data flow and state transitions with edge paths.",
|
|
57
|
+
"Map failure modes and recovery strategy.",
|
|
58
|
+
"Define test coverage strategy and performance budget.",
|
|
59
|
+
"Produce required outputs: NOT-in-scope section, What-already-exists section, diagrams, failure mode table.",
|
|
60
|
+
"Produce completion dashboard: list every review section with status (clear / issues-found-resolved / issues-open), count of decisions made, and list of unresolved items.",
|
|
61
|
+
"Write design lock artifact for downstream spec/plan."
|
|
62
|
+
],
|
|
63
|
+
requiredGates: [
|
|
64
|
+
{ id: "design_codebase_investigated", description: "Blast-radius files read and current patterns catalogued." },
|
|
65
|
+
{ id: "design_scope_challenge_done", description: "Step 0 scope challenge completed with existing-code mapping." },
|
|
66
|
+
{ id: "design_architecture_locked", description: "Architecture boundaries are explicit and approved." },
|
|
67
|
+
{ id: "design_data_flow_mapped", description: "Data/state flow includes edge-case paths." },
|
|
68
|
+
{ id: "design_failure_modes_mapped", description: "Failure modes and mitigations are documented." },
|
|
69
|
+
{ id: "design_test_and_perf_defined", description: "Test strategy and performance budget are defined." }
|
|
70
|
+
],
|
|
71
|
+
requiredEvidence: [
|
|
72
|
+
"Artifact written to `.cclaw/artifacts/03-design.md`.",
|
|
73
|
+
"Failure-mode table exists with mitigations.",
|
|
74
|
+
"Test strategy includes unit/integration/e2e expectations.",
|
|
75
|
+
"NOT-in-scope section produced.",
|
|
76
|
+
"What-already-exists section produced.",
|
|
77
|
+
"Completion dashboard lists every review section status, decision count, and unresolved items (or 'None')."
|
|
78
|
+
],
|
|
79
|
+
inputs: ["scope contract", "system constraints", "non-functional requirements"],
|
|
80
|
+
requiredContext: [
|
|
81
|
+
"existing architecture and boundaries",
|
|
82
|
+
"operational constraints",
|
|
83
|
+
"security and reliability expectations"
|
|
84
|
+
],
|
|
85
|
+
researchPlaybooks: [
|
|
86
|
+
"research/framework-docs-lookup.md",
|
|
87
|
+
"research/best-practices-lookup.md"
|
|
88
|
+
],
|
|
89
|
+
outputs: [
|
|
90
|
+
"architecture lock",
|
|
91
|
+
"risk and failure map",
|
|
92
|
+
"test and performance baseline",
|
|
93
|
+
"NOT-in-scope section",
|
|
94
|
+
"What-already-exists section",
|
|
95
|
+
"design completion dashboard"
|
|
96
|
+
],
|
|
97
|
+
blockers: [
|
|
98
|
+
"architecture ambiguity remains",
|
|
99
|
+
"failure modes not mapped",
|
|
100
|
+
"test/performance targets missing"
|
|
101
|
+
],
|
|
102
|
+
exitCriteria: [
|
|
103
|
+
"design baseline approved",
|
|
104
|
+
"all review sections completed",
|
|
105
|
+
"required gates marked satisfied",
|
|
106
|
+
"completion dashboard present with all review-section statuses",
|
|
107
|
+
"artifact complete for spec handoff"
|
|
108
|
+
],
|
|
109
|
+
antiPatterns: [
|
|
110
|
+
"Architecture deferred to implementation phase",
|
|
111
|
+
"Missing data-flow edge cases",
|
|
112
|
+
"No performance budget for critical path",
|
|
113
|
+
"Batching multiple design issues into one question",
|
|
114
|
+
"Skipping review sections because plan seems simple",
|
|
115
|
+
"Agreeing with user's architecture choice without evaluating alternatives",
|
|
116
|
+
"Hedging every recommendation with 'it depends' instead of taking a position"
|
|
117
|
+
],
|
|
118
|
+
redFlags: [
|
|
119
|
+
"No explicit architecture boundary section",
|
|
120
|
+
"No failure recovery strategy",
|
|
121
|
+
"No defined test/perf baseline",
|
|
122
|
+
"Review sections skipped or condensed",
|
|
123
|
+
"No NOT-in-scope output section",
|
|
124
|
+
"No What-already-exists output section",
|
|
125
|
+
"Design decisions made without reading the actual code first"
|
|
126
|
+
],
|
|
127
|
+
policyNeedles: [
|
|
128
|
+
"Architecture",
|
|
129
|
+
"Data Flow",
|
|
130
|
+
"Failure Modes and Mitigation",
|
|
131
|
+
"Performance Budget",
|
|
132
|
+
"One issue at a time"
|
|
133
|
+
],
|
|
134
|
+
artifactFile: "03-design.md",
|
|
135
|
+
next: "spec",
|
|
136
|
+
reviewSections: [
|
|
137
|
+
{
|
|
138
|
+
title: "Architecture Review",
|
|
139
|
+
evaluationPoints: [
|
|
140
|
+
"System design and component boundaries",
|
|
141
|
+
"Dependency graph and coupling concerns",
|
|
142
|
+
"Data flow patterns and potential bottlenecks",
|
|
143
|
+
"Scaling characteristics and single points of failure",
|
|
144
|
+
"Security architecture (auth, data access, API boundaries)",
|
|
145
|
+
"For each new codepath: one realistic production failure scenario"
|
|
146
|
+
],
|
|
147
|
+
stopGate: true
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
title: "Code Quality Review",
|
|
151
|
+
evaluationPoints: [
|
|
152
|
+
"Code organization and module structure",
|
|
153
|
+
"DRY violations — flag aggressively",
|
|
154
|
+
"Error handling patterns and missing edge cases",
|
|
155
|
+
"Over-engineered or under-engineered areas",
|
|
156
|
+
"Existing diagrams in touched files — still accurate?"
|
|
157
|
+
],
|
|
158
|
+
stopGate: true
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
title: "Test Review",
|
|
162
|
+
evaluationPoints: [
|
|
163
|
+
"Diagram every new UX flow, data flow, codepath, background job, integration, error path",
|
|
164
|
+
"For each: what type of test covers it? Does one exist? What is the gap?",
|
|
165
|
+
"Coverage expectations: unit, integration, e2e split"
|
|
166
|
+
],
|
|
167
|
+
stopGate: true
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
title: "Performance Review",
|
|
171
|
+
evaluationPoints: [
|
|
172
|
+
"N+1 queries and database access patterns",
|
|
173
|
+
"Memory-usage concerns",
|
|
174
|
+
"Caching opportunities",
|
|
175
|
+
"Slow or high-complexity code paths",
|
|
176
|
+
"What breaks at 10x load? At 100x?"
|
|
177
|
+
],
|
|
178
|
+
stopGate: true
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
title: "Distribution & Delivery Review",
|
|
182
|
+
evaluationPoints: [
|
|
183
|
+
"If new artifact types are created (packages, CLI, configs): is the build/publish story documented?",
|
|
184
|
+
"Are there new dependencies that need version pinning?",
|
|
185
|
+
"Does the change affect existing consumers (APIs, shared modules)?",
|
|
186
|
+
"Is backwards compatibility maintained or is a migration needed?"
|
|
187
|
+
],
|
|
188
|
+
stopGate: false
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
completionStatus: ["DONE", "DONE_WITH_CONCERNS", "BLOCKED"],
|
|
192
|
+
crossStageTrace: {
|
|
193
|
+
readsFrom: [".cclaw/artifacts/01-brainstorm.md", ".cclaw/artifacts/02-scope.md"],
|
|
194
|
+
writesTo: [".cclaw/artifacts/03-design.md"],
|
|
195
|
+
traceabilityRule: "Every architecture decision must trace to a scope boundary. Every downstream spec requirement must trace to a design decision."
|
|
196
|
+
},
|
|
197
|
+
artifactValidation: [
|
|
198
|
+
{ section: "Codebase Investigation", required: true, validationRule: "Must list blast-radius files with current responsibilities and discovered patterns." },
|
|
199
|
+
{ section: "Search Before Building", required: true, validationRule: "For each technical choice: Layer 1 (exact match), Layer 2 (partial match), Layer 3 (inspiration), EUREKA labels with reuse-first default." },
|
|
200
|
+
{ section: "Architecture Boundaries", required: true, validationRule: "Must list component boundaries with ownership." },
|
|
201
|
+
{ section: "Architecture Diagram", required: true, validationRule: "At least one diagram (ASCII, Mermaid, or image) showing component boundaries and data flow direction. Diagram must: (1) label every node with a concrete component name (no generic 'Service A/B'), (2) label every arrow with the action or message (no unlabeled arrows), (3) mark direction of data flow explicitly, (4) distinguish synchronous from asynchronous edges (e.g. solid vs dashed, or `sync:` / `async:` prefix), (5) show at least one failure edge or degraded-mode branch when the system has one." },
|
|
202
|
+
{ section: "Data Flow", required: true, validationRule: "Must include happy path, nil input, empty input, upstream error paths." },
|
|
203
|
+
{ section: "Failure Mode Table", required: true, validationRule: "Each failure mode has: trigger, detection, mitigation, user impact." },
|
|
204
|
+
{ section: "Test Strategy", required: true, validationRule: "Must define unit/integration/e2e expectations with coverage targets." },
|
|
205
|
+
{ section: "Performance Budget", required: true, validationRule: "For each critical path: metric name, target threshold, and measurement method." },
|
|
206
|
+
{ section: "What Already Exists", required: true, validationRule: "For each sub-problem: existing code/library found (Layer 1-3/EUREKA label), reuse decision, and adaptation needed." },
|
|
207
|
+
{ section: "NOT in scope", required: true, validationRule: "Work considered and explicitly deferred with one-line rationale." },
|
|
208
|
+
{ section: "Parallelization Strategy", required: false, validationRule: "If multi-module: dependency table, parallel lanes, conflict flags." },
|
|
209
|
+
{ section: "Unresolved Decisions", required: false, validationRule: "If any: what info is missing, who provides it, default if unanswered." },
|
|
210
|
+
{ section: "Interface Contracts", required: false, validationRule: "If present: for each module boundary list produces (outputs) and consumes (inputs) with data types." },
|
|
211
|
+
{ section: "Patterns to Mirror", required: false, validationRule: "If present: list discovered codebase patterns to follow, with file references and rationale for each." },
|
|
212
|
+
{ section: "Completion Dashboard", required: true, validationRule: "Lists every review section with status (clear / issues-found-resolved / issues-open), decision count, and unresolved items (or 'None')." }
|
|
213
|
+
],
|
|
214
|
+
trivialOverrideSections: ["Architecture Boundaries", "NOT in scope", "Completion Dashboard"]
|
|
215
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { BRAINSTORM } from "./brainstorm.js";
|
|
2
|
+
export { SCOPE } from "./scope.js";
|
|
3
|
+
export { DESIGN } from "./design.js";
|
|
4
|
+
export { SPEC } from "./spec.js";
|
|
5
|
+
export { PLAN } from "./plan.js";
|
|
6
|
+
export { TDD } from "./tdd.js";
|
|
7
|
+
export { REVIEW } from "./review.js";
|
|
8
|
+
export { SHIP } from "./ship.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Barrel for per-stage StageSchemaInput constants. Keep this file lean — it
|
|
2
|
+
// should be a pure re-export surface so stage-schema.ts can import all stages
|
|
3
|
+
// via a single `import { ... } from "./stages/index.js"`.
|
|
4
|
+
export { BRAINSTORM } from "./brainstorm.js";
|
|
5
|
+
export { SCOPE } from "./scope.js";
|
|
6
|
+
export { DESIGN } from "./design.js";
|
|
7
|
+
export { SPEC } from "./spec.js";
|
|
8
|
+
export { PLAN } from "./plan.js";
|
|
9
|
+
export { TDD } from "./tdd.js";
|
|
10
|
+
export { REVIEW } from "./review.js";
|
|
11
|
+
export { SHIP } from "./ship.js";
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// PLAN
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
export const PLAN = {
|
|
5
|
+
stage: "plan",
|
|
6
|
+
skillFolder: "planning-and-task-breakdown",
|
|
7
|
+
skillName: "planning-and-task-breakdown",
|
|
8
|
+
skillDescription: "Execution planning stage with strict confirmation gate before implementation.",
|
|
9
|
+
hardGate: "Do NOT write code or tests. Planning only. This stage produces a task graph and execution order. WAIT_FOR_CONFIRM before any handoff to implementation.",
|
|
10
|
+
ironLaw: "EVERY TASK IS 2–5 MINUTES, FULLY SPELLED OUT, AND CARRIES A STABLE ID — NO PLACEHOLDERS, NO ‘ETC.’.",
|
|
11
|
+
purpose: "Create small executable tasks with dependencies and pause for explicit user confirmation.",
|
|
12
|
+
whenToUse: [
|
|
13
|
+
"After spec approval",
|
|
14
|
+
"Before writing tests or implementation",
|
|
15
|
+
"When delivery path and dependency order are needed"
|
|
16
|
+
],
|
|
17
|
+
whenNotToUse: [
|
|
18
|
+
"Specification is unapproved or lacks measurable acceptance criteria",
|
|
19
|
+
"Execution is already in TDD stage with active slice evidence",
|
|
20
|
+
"The request is only release packaging with no task decomposition needed"
|
|
21
|
+
],
|
|
22
|
+
checklist: [
|
|
23
|
+
"Read upstream — load spec, design, and scope artifacts. Cross-reference acceptance criteria.",
|
|
24
|
+
"Build dependency graph — identify task ordering, parallel opportunities, and blocking dependencies.",
|
|
25
|
+
"Group tasks into dependency waves — wave N+1 cannot start until wave N has verification evidence.",
|
|
26
|
+
"Slice into vertical tasks — each task targets 2-5 minutes, produces one testable outcome, and touches one coherent area.",
|
|
27
|
+
"Attach verification — every task has an acceptance criterion mapping and a concrete verification command.",
|
|
28
|
+
"Define checkpoints — mark points where progress should be validated before continuing.",
|
|
29
|
+
"WAIT_FOR_CONFIRM — write plan artifact and explicitly pause. **STOP.** Do NOT proceed until user confirms. Then update `flow-state.json` and tell user to run `/cc-next`."
|
|
30
|
+
],
|
|
31
|
+
interactionProtocol: [
|
|
32
|
+
"Plan in read-only mode relative to implementation.",
|
|
33
|
+
"Split work into small vertical slices (target 2-5 minute tasks).",
|
|
34
|
+
"Publish explicit dependency waves with entry and exit checks for each wave.",
|
|
35
|
+
"Attach verification step to every task.",
|
|
36
|
+
"Enforce WAIT_FOR_CONFIRM: present the plan summary with options (A) Approve / (B) Revise / (C) Reject.",
|
|
37
|
+
"**STOP.** Do NOT proceed until user explicitly approves. Then update `flow-state.json` and tell user to run `/cc-next`."
|
|
38
|
+
],
|
|
39
|
+
process: [
|
|
40
|
+
"Build dependency graph and ordered slices.",
|
|
41
|
+
"Group slices into execution waves and define gate criteria per wave.",
|
|
42
|
+
"Define each task with acceptance mapping and verification commands.",
|
|
43
|
+
"Record checkpoints and blockers.",
|
|
44
|
+
"Write plan artifact and pause at WAIT_FOR_CONFIRM."
|
|
45
|
+
],
|
|
46
|
+
requiredGates: [
|
|
47
|
+
{ id: "plan_tasks_sliced_2_5_min", description: "Tasks are small, executable slices." },
|
|
48
|
+
{ id: "plan_dependency_graph_written", description: "Dependency graph and order are explicit." },
|
|
49
|
+
{ id: "plan_dependency_waves_defined", description: "Tasks are grouped into executable waves with gate checks." },
|
|
50
|
+
{ id: "plan_verification_steps_defined", description: "Each task has verification guidance." },
|
|
51
|
+
{ id: "plan_acceptance_mapped", description: "Each task maps to a spec acceptance criterion." },
|
|
52
|
+
{ id: "plan_wait_for_confirm", description: "Execution blocked until explicit user confirmation." }
|
|
53
|
+
],
|
|
54
|
+
requiredEvidence: [
|
|
55
|
+
"Artifact written to `.cclaw/artifacts/05-plan.md`.",
|
|
56
|
+
"Task list includes acceptance mapping.",
|
|
57
|
+
"Dependency graph documented.",
|
|
58
|
+
"Dependency waves documented with wave-by-wave verification gates.",
|
|
59
|
+
"WAIT_FOR_CONFIRM status recorded."
|
|
60
|
+
],
|
|
61
|
+
inputs: ["approved spec", "codebase context", "delivery constraints"],
|
|
62
|
+
requiredContext: [
|
|
63
|
+
"spec acceptance criteria",
|
|
64
|
+
"current architecture",
|
|
65
|
+
"known technical debt and dependencies"
|
|
66
|
+
],
|
|
67
|
+
outputs: ["task graph", "dependency wave plan", "ordered plan", "explicit confirmation checkpoint"],
|
|
68
|
+
blockers: [
|
|
69
|
+
"tasks too broad",
|
|
70
|
+
"dependency uncertainty unresolved",
|
|
71
|
+
"wave boundaries are unclear",
|
|
72
|
+
"no explicit confirmation"
|
|
73
|
+
],
|
|
74
|
+
exitCriteria: [
|
|
75
|
+
"plan quality gates complete",
|
|
76
|
+
"WAIT_FOR_CONFIRM present and unresolved until user approves",
|
|
77
|
+
"artifact ready for TDD execution",
|
|
78
|
+
"acceptance mapping complete"
|
|
79
|
+
],
|
|
80
|
+
antiPatterns: [
|
|
81
|
+
"Horizontal decomposition without end-to-end slices",
|
|
82
|
+
"Tasks without verification steps",
|
|
83
|
+
"Starting execution before approval",
|
|
84
|
+
"Tasks that touch multiple unrelated areas"
|
|
85
|
+
],
|
|
86
|
+
redFlags: [
|
|
87
|
+
"No dependency graph",
|
|
88
|
+
"No WAIT_FOR_CONFIRM marker",
|
|
89
|
+
"No explicit dependency waves",
|
|
90
|
+
"Tasks exceed one coherent outcome",
|
|
91
|
+
"No acceptance mapping"
|
|
92
|
+
],
|
|
93
|
+
policyNeedles: ["WAIT_FOR_CONFIRM", "Task Graph", "Dependency Waves", "Acceptance Mapping", "verification steps"],
|
|
94
|
+
artifactFile: "05-plan.md",
|
|
95
|
+
next: "tdd",
|
|
96
|
+
reviewSections: [
|
|
97
|
+
{
|
|
98
|
+
title: "Task Decomposition Audit",
|
|
99
|
+
evaluationPoints: [
|
|
100
|
+
"Does every task target a single coherent area (vertical slice)?",
|
|
101
|
+
"Can each task be completed in 2-5 minutes?",
|
|
102
|
+
"Does every task have an acceptance criterion link and verification command?",
|
|
103
|
+
"Are there tasks that touch multiple unrelated areas?",
|
|
104
|
+
"Would a new engineer understand and start each task within two minutes?"
|
|
105
|
+
],
|
|
106
|
+
stopGate: true
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
title: "Wave Completeness Audit",
|
|
110
|
+
evaluationPoints: [
|
|
111
|
+
"Does every task belong to exactly one wave?",
|
|
112
|
+
"Does each wave have a verification gate?",
|
|
113
|
+
"Are wave dependencies explicit and acyclic?",
|
|
114
|
+
"Is the acceptance mapping complete — every spec criterion covered?",
|
|
115
|
+
"Are there hidden dependencies between tasks in different waves?"
|
|
116
|
+
],
|
|
117
|
+
stopGate: true
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
title: "Five-Minute Budget + No-Placeholders Audit",
|
|
121
|
+
evaluationPoints: [
|
|
122
|
+
"Does every task carry an explicit minutes estimate (e.g. `[~3m]`) and does every estimate fit the 2-to-5-minute budget? Estimates >5 minutes must be split.",
|
|
123
|
+
"Are all file paths, test commands, and verification commands copy-pasteable as written — no `TODO`, `TBD`, `FIXME`, `<fill-in>`, `<your-*-here>`, `xxx`, or ellipsis standing in for omitted args?",
|
|
124
|
+
"Does every acceptance-criterion reference resolve to a real R# / AC-### in the spec (not a blank link)?",
|
|
125
|
+
"If an estimate is genuinely uncertain (first-time integration, unfamiliar library), is the uncertainty named explicitly and scheduled as a spike task in wave 0, rather than hidden behind a large estimate?"
|
|
126
|
+
],
|
|
127
|
+
stopGate: true
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
completionStatus: ["DONE", "DONE_WITH_CONCERNS", "BLOCKED"],
|
|
131
|
+
crossStageTrace: {
|
|
132
|
+
readsFrom: [".cclaw/artifacts/04-spec.md", ".cclaw/artifacts/03-design.md", ".cclaw/artifacts/02-scope.md"],
|
|
133
|
+
writesTo: [".cclaw/artifacts/05-plan.md"],
|
|
134
|
+
traceabilityRule: "Every task must trace to a spec acceptance criterion. Every downstream RED test must trace to a plan task."
|
|
135
|
+
},
|
|
136
|
+
artifactValidation: [
|
|
137
|
+
{ section: "Dependency Graph", required: true, validationRule: "Ordering and parallel opportunities explicit. No circular dependencies." },
|
|
138
|
+
{ section: "Dependency Waves", required: true, validationRule: "Every task belongs to a wave. Each wave has an exit gate and dependency statement." },
|
|
139
|
+
{ section: "Task List", required: true, validationRule: "Each task row includes ID, description, acceptance criterion, verification command, and effort estimate (S/M/L). Every task must also carry a minutes estimate within the 2-5 minute budget." },
|
|
140
|
+
{ section: "Acceptance Mapping", required: true, validationRule: "Every spec criterion is covered by at least one task." },
|
|
141
|
+
{ section: "Risk Assessment", required: false, validationRule: "If present: per-task or per-wave risk identification with likelihood, impact, and mitigation strategy." },
|
|
142
|
+
{ section: "Boundary Map", required: false, validationRule: "If present: per-wave or per-task interface contracts listing what each task produces (exports) and consumes (imports) from other tasks." },
|
|
143
|
+
{ section: "WAIT_FOR_CONFIRM", required: true, validationRule: "Explicit marker present. Status: pending until user approves." },
|
|
144
|
+
{ section: "No-Placeholder Scan", required: false, validationRule: "If present: confirmation that a text scan for `TODO`, `TBD`, `FIXME`, `<fill-in>`, `<your-*-here>`, `xxx`, or bare ellipses has zero hits in the task list. A placeholder is a deferred decision masquerading as a plan." }
|
|
145
|
+
]
|
|
146
|
+
};
|