cclaw-cli 0.5.5 → 0.5.7
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/examples.js +77 -51
- package/dist/content/skills.js +1 -1
- package/dist/content/stage-schema.js +100 -79
- package/dist/content/templates.js +52 -34
- package/package.json +1 -1
package/dist/content/examples.js
CHANGED
|
@@ -1,74 +1,94 @@
|
|
|
1
1
|
const STAGE_EXAMPLES = {
|
|
2
|
-
brainstorm: `###
|
|
2
|
+
brainstorm: `### Context
|
|
3
3
|
|
|
4
|
-
- **
|
|
5
|
-
- **
|
|
4
|
+
- **Project state:** Monorepo with CI pipeline using custom release scripts. Release checks are scattered across shell scripts with no shared validation logic.
|
|
5
|
+
- **Relevant existing code/patterns:** \`scripts/pre-publish.sh\` does metadata checks. \`src/release/\` has partial validation helpers.
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Problem
|
|
8
8
|
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
9
|
+
- **What we're solving:** release checks are fragile and inconsistent between CI and local runs. Invalid metadata sometimes reaches npm publish.
|
|
10
|
+
- **Success criteria:** invalid release preconditions are caught before publish with explicit operator feedback, in both CI and local workflows.
|
|
11
|
+
- **Constraints:** no new runtime dependencies; must work within existing CI pipeline structure.
|
|
11
12
|
|
|
12
|
-
###
|
|
13
|
+
### Clarifying Questions
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
| # | Question | Answer | Decision impact |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| 1 | If release metadata is invalid, should we block publishing hard or only warn? | Block hard. | Validation becomes a mandatory gate — no warning-only fallback. |
|
|
18
|
+
| 2 | Should the validation logic live in a reusable module or stay as shell scripts? | Reusable module. | Architecture: shared TypeScript module imported by CI and local tooling, not duplicated shell scripts. |
|
|
19
|
+
| 3 | For v1, prioritize rapid delivery or maximum configurability? | Rapid delivery. | Minimal deterministic validation surface; defer plugin/config system to v2. |
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
**A2:** "Keep runtime dependencies unchanged."
|
|
21
|
+
### Approaches
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
| Approach | Architecture | Trade-offs | Recommendation |
|
|
24
|
+
| --- | --- | --- | --- |
|
|
25
|
+
| A: Reusable validation module | Shared TS module with typed validators, imported by CI scripts and local CLI. Existing \`pre-publish.sh\` calls the module. | Medium upfront effort, high reuse. Requires test coverage for the module. | **Recommended** — best balance of reuse and delivery speed. |
|
|
26
|
+
| B: Hardened shell scripts | Keep existing script approach, add stricter checks and error messages. | Lowest effort. Weak reuse, CI/local divergence risk grows over time. | Viable fallback if TS module is blocked. |
|
|
27
|
+
| C: Full release framework | New release orchestrator with plugin system, config files, rollback commands. | Maximum flexibility. High risk, delivery delay, over-engineered for current needs. | Not recommended for v1. |
|
|
23
28
|
|
|
24
|
-
###
|
|
29
|
+
### Selected Direction
|
|
25
30
|
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
31
|
+
- **Approach:** A — Reusable validation module
|
|
32
|
+
- **Rationale:** shared TS module gives consistent behavior in CI and local, avoids script duplication, and stays within the no-new-dependency constraint.
|
|
33
|
+
- **Approval:** approved
|
|
28
34
|
|
|
29
|
-
###
|
|
35
|
+
### Design
|
|
30
36
|
|
|
31
|
-
**
|
|
32
|
-
**
|
|
37
|
+
- **Architecture:** single \`release-validator\` module in \`src/release/\` exporting typed check functions. CI script and local CLI both import and run the same checks.
|
|
38
|
+
- **Key components:** \`validateMetadata()\`, \`validateChangelog()\`, \`validateVersion()\` — each returns a typed result with error details. A \`runAll()\` orchestrator runs checks and exits non-zero on any failure.
|
|
39
|
+
- **Data flow:** package.json + CHANGELOG.md → validator module → structured result → CI/CLI renders human-readable report.
|
|
33
40
|
|
|
34
|
-
|
|
41
|
+
### Assumptions and Open Questions
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
- **Assumptions:** CI remains the primary execution path; existing release metadata files remain the source of truth; v1 prioritizes determinism over customization.
|
|
44
|
+
- **Open questions:** What exact rollback sequence for failed publish? Should status output include machine-readable JSON alongside markdown?
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
| --- | --- | --- | --- | --- |
|
|
40
|
-
| Script-only checks | Lowest implementation cost | Weak reuse and long-term maintainability | Low | Useful fallback, not preferred |
|
|
41
|
-
| Reusable validation module | Reusable across CI and local runs | Slightly higher upfront design effort | Medium | **Recommended** |
|
|
42
|
-
| Full release framework rewrite | Highest long-term flexibility | High risk and delivery delay | High | Not recommended for v1 |
|
|
46
|
+
### Notes for the next stage
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
Carry the no-new-dependency constraint and hard-block behavior directly into scope in/out boundaries.`,
|
|
49
|
+
scope: `### Scope contract
|
|
45
50
|
|
|
46
|
-
|
|
51
|
+
**Mode selected:** SELECTIVE EXPANSION
|
|
52
|
+
**Default heuristic used:** feature enhancement -> selective
|
|
53
|
+
**Mode-specific analysis result:** hold-scope baseline accepted first; one expansion accepted (degraded-state UX), one deferred (real-time channel upgrade).
|
|
47
54
|
|
|
48
|
-
###
|
|
55
|
+
### Prime Directives (applied)
|
|
49
56
|
|
|
50
|
-
-
|
|
51
|
-
-
|
|
57
|
+
- Zero silent failures: every delivery failure maps to a visible degraded state.
|
|
58
|
+
- Named error surfaces: stream disconnect, auth drift, and publisher timeout are explicit.
|
|
59
|
+
- Four-path data flow mapped: happy, nil payload, empty payload, upstream publish error.
|
|
60
|
+
- Interaction edge cases in scope: double-open panel, reconnect after sleep, stale tab state.
|
|
61
|
+
- Observability in scope: stream error counter, publish-to-visible lag metric, and alert threshold.
|
|
52
62
|
|
|
53
|
-
###
|
|
63
|
+
### Premise challenge result
|
|
54
64
|
|
|
55
|
-
-
|
|
56
|
-
- Existing release metadata files remain the source of truth.
|
|
57
|
-
- v1 prioritizes deterministic behavior over broad customization.
|
|
65
|
+
The original premise (“add notifications”) was reframed to **“ensure users know when an action requires follow-up”**, which expands the solution space beyond toast spam to include durable inbox items, empty states, and recovery paths when delivery fails.
|
|
58
66
|
|
|
59
|
-
###
|
|
67
|
+
### Dream State Mapping
|
|
60
68
|
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
| Stage | Statement |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| **CURRENT STATE** | Users miss time-sensitive follow-ups because alerts are ephemeral and not recoverable. |
|
|
72
|
+
| **THIS PLAN** | Introduce durable in-app feed + live updates + explicit degraded mode fallback. |
|
|
73
|
+
| **12-MONTH IDEAL** | Unified notification center with reliable multi-channel fan-out and user-level routing preferences. |
|
|
74
|
+
| **Alignment verdict** | Aligned: this scope builds the durability foundation without prematurely committing to channel expansion. |
|
|
63
75
|
|
|
64
|
-
###
|
|
76
|
+
### Implementation Alternatives
|
|
65
77
|
|
|
66
|
-
|
|
67
|
-
|
|
78
|
+
| Option | Summary | Effort (S/M/L/XL) | Risk | Pros | Cons | Reuses |
|
|
79
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
80
|
+
| **A (minimum viable)** | Polling-only feed with no live stream | S | Low | Fastest ship, low infra risk | Weaker UX, delayed visibility | Existing REST snapshot endpoint |
|
|
81
|
+
| **B (recommended)** | SSE live updates + REST fallback snapshot | M | Med | Better timeliness, graceful degradation | Requires reconnect handling | Existing event publisher + REST path |
|
|
82
|
+
| **C (ideal architecture)** | Event bus + WebSocket channel + feed projection | XL | High | Strong long-term scalability | Overbuilt for current demand | Partial reuse of publisher only |
|
|
68
83
|
|
|
69
|
-
|
|
84
|
+
### Temporal Interrogation
|
|
70
85
|
|
|
71
|
-
|
|
86
|
+
| Time slice | Likely decision pressure | Lock now or defer? | Reason |
|
|
87
|
+
| --- | --- | --- | --- |
|
|
88
|
+
| **HOUR 1 (foundations)** | Canonical event schema and dedupe key policy | **Lock now** | Prevent downstream rework in storage and UI merge behavior |
|
|
89
|
+
| **HOUR 2-3 (core logic)** | Retry/backoff semantics for stream loss | **Lock now** | Impacts both backend signaling and client state machine |
|
|
90
|
+
| **HOUR 4-5 (integration)** | Handling gaps between snapshot and stream cursor | **Lock now** | Prevent silent data loss during reconnect windows |
|
|
91
|
+
| **HOUR 6+ (polish/tests)** | Banner copy tone and polling cadence tuning | **Defer** | Safe to iterate after baseline reliability is proven |
|
|
72
92
|
|
|
73
93
|
### In scope / out of scope / deferred
|
|
74
94
|
|
|
@@ -78,22 +98,28 @@ Carry fixed trade-off decisions directly into scope in/out boundaries and deferr
|
|
|
78
98
|
| **Out of scope** | Email/SMS/push providers; marketing campaigns; per-user notification preferences beyond on/off |
|
|
79
99
|
| **Deferred** | WebSocket channel; rich media attachments in notifications; full-text search across historical events |
|
|
80
100
|
|
|
101
|
+
### Discretion Areas
|
|
102
|
+
|
|
103
|
+
- Client-side badge rendering strategy (optimistic vs server-confirmed) is implementation discretion.
|
|
104
|
+
- Polling fallback backoff curve is implementation discretion if degraded-state UX remains explicit.
|
|
105
|
+
|
|
81
106
|
### Error & Rescue Registry (sample entry)
|
|
82
107
|
|
|
83
108
|
| Capability | Failure mode | Detection | Fallback |
|
|
84
109
|
| --- | --- | --- | --- |
|
|
85
110
|
| Event delivery | SSE connection drops mid-session | Client \`EventSource\` error event + heartbeat timeout | Fall back to REST polling every 30s until SSE reconnect succeeds; show subtle “live updates paused” banner |
|
|
86
111
|
|
|
87
|
-
###
|
|
112
|
+
### Completion Dashboard
|
|
88
113
|
|
|
89
|
-
-
|
|
90
|
-
-
|
|
114
|
+
- Checklist findings: 9/9 complete (complex path)
|
|
115
|
+
- Resolved decisions count: 7
|
|
116
|
+
- Unresolved decisions: None
|
|
91
117
|
|
|
92
|
-
###
|
|
118
|
+
### Scope Summary
|
|
93
119
|
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
120
|
+
- Accepted scope: durable feed + SSE + explicit degraded UX.
|
|
121
|
+
- Deferred: WebSocket channel and rich-media/search enhancements.
|
|
122
|
+
- Explicitly excluded: outbound channels and marketing workflows for v1.`,
|
|
97
123
|
design: `### Search Before Building (sample result)
|
|
98
124
|
|
|
99
125
|
| Layer | Label | What to reuse first |
|
package/dist/content/skills.js
CHANGED
|
@@ -24,7 +24,7 @@ function reviewSectionsBlock(stage) {
|
|
|
24
24
|
const sections = schema.reviewSections.map((sec) => {
|
|
25
25
|
const points = sec.evaluationPoints.map((p) => `- ${p}`).join("\n");
|
|
26
26
|
const stop = sec.stopGate
|
|
27
|
-
? "\n\n**STOP.**
|
|
27
|
+
? "\n\n**STOP.** Present the most important question from this section to the user, even if your recommendation is clear. If no issues are found, state your assessment in one sentence and ask the user to confirm before moving on. If issues exist, present them ONE AT A TIME: describe the problem concretely, present 2-3 options, state your recommendation, and explain WHY."
|
|
28
28
|
: "";
|
|
29
29
|
return `### ${sec.title}\n\nEvaluate:\n${points}${stop}`;
|
|
30
30
|
}).join("\n\n");
|
|
@@ -22,9 +22,9 @@ const BRAINSTORM = {
|
|
|
22
22
|
stage: "brainstorm",
|
|
23
23
|
skillFolder: "brainstorming",
|
|
24
24
|
skillName: "brainstorming",
|
|
25
|
-
skillDescription: "Design-first stage.
|
|
25
|
+
skillDescription: "Design-first stage. Explore context, understand intent through collaborative dialogue, propose distinct approaches, and lock an approved direction before scope/design work.",
|
|
26
26
|
hardGate: "Do NOT invoke implementation skills, write code, scaffold projects, or mutate product behavior until a concrete direction is approved by the user.",
|
|
27
|
-
purpose: "Turn an initial idea into an approved direction through
|
|
27
|
+
purpose: "Turn an initial idea into an approved design direction through natural collaborative dialogue — understanding the problem before proposing solutions.",
|
|
28
28
|
whenToUse: [
|
|
29
29
|
"Starting a new feature or behavior change",
|
|
30
30
|
"Requirements are ambiguous or trade-offs are unclear",
|
|
@@ -36,52 +36,51 @@ const BRAINSTORM = {
|
|
|
36
36
|
"The task is retrospective only (post-ship audit with no new solution choices)"
|
|
37
37
|
],
|
|
38
38
|
checklist: [
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
39
|
+
"**Explore project context** — check files, docs, recent commits to understand what already exists.",
|
|
40
|
+
"**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.",
|
|
41
|
+
"**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.",
|
|
42
|
+
"**Propose 2-3 architecturally distinct approaches** — with real trade-offs and your recommendation. Lead with the recommended option and explain why.",
|
|
43
|
+
"**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.",
|
|
44
|
+
"**Write artifact** to `.cclaw/artifacts/01-brainstorm.md`.",
|
|
45
|
+
"**Self-review** — scan for placeholders/TODOs, check internal consistency, verify scope is focused, resolve any ambiguity.",
|
|
46
|
+
"**User reviews artifact** — ask the user to review the written artifact and explicitly approve or request changes.",
|
|
47
|
+
"**Handoff** — only then complete stage and point to `/cc-next`."
|
|
48
48
|
],
|
|
49
49
|
interactionProtocol: [
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"Ask exactly one
|
|
53
|
-
"After
|
|
54
|
-
"
|
|
50
|
+
"Explore what exists before asking what to build — check project files first.",
|
|
51
|
+
"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.",
|
|
52
|
+
"Ask exactly one question per turn. Prefer multiple choice. No bundled questions.",
|
|
53
|
+
"After 2-3 questions, summarize your emerging understanding before continuing so the user can correct course early.",
|
|
54
|
+
"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.",
|
|
55
|
+
"Present design in sections scaled to their complexity — a few sentences for simple aspects, detailed for nuanced ones. Get approval after each section.",
|
|
56
|
+
"When proposing approaches, lead with your recommendation and explain why.",
|
|
55
57
|
"State explicitly what is being approved when requesting approval.",
|
|
56
|
-
"Run a brief
|
|
58
|
+
"Run a brief self-review (placeholders, contradictions, scope, ambiguity) before presenting the artifact.",
|
|
57
59
|
"**STOP.** Wait for explicit user approval after writing the artifact. Do NOT auto-advance."
|
|
58
60
|
],
|
|
59
61
|
process: [
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
62
|
+
"Explore project context: check files, docs, recent activity.",
|
|
63
|
+
"Assess scope: flag if request is too broad, help decompose first.",
|
|
64
|
+
"Ask clarifying questions one at a time — focus on purpose, constraints, success criteria.",
|
|
65
|
+
"Propose 2-3 architecturally distinct approaches with trade-offs and a recommendation.",
|
|
66
|
+
"Present design sections incrementally, get approval after each.",
|
|
67
|
+
"Write approved direction to `.cclaw/artifacts/01-brainstorm.md`.",
|
|
68
|
+
"Self-review: placeholder scan, internal consistency, scope check, ambiguity check.",
|
|
69
|
+
"Request explicit user approval of the artifact.",
|
|
68
70
|
"Handoff to scope only after approval is explicit."
|
|
69
71
|
],
|
|
70
72
|
requiredGates: [
|
|
71
|
-
{ id: "
|
|
72
|
-
{ id: "
|
|
73
|
-
{ id: "
|
|
74
|
-
{ id: "brainstorm_round3_tradeoff_decisions", description: "Round 3 forcing questions locked explicit trade-off priorities and assumptions." },
|
|
75
|
-
{ id: "brainstorm_options_compared", description: "Multiple solution approaches were compared with real trade-offs and a recommendation." },
|
|
73
|
+
{ id: "brainstorm_context_explored", description: "Project context (files, docs, existing patterns) was checked before asking questions." },
|
|
74
|
+
{ id: "brainstorm_idea_understood", description: "Agent and user share the same understanding of the problem, constraints, and success criteria." },
|
|
75
|
+
{ id: "brainstorm_approaches_compared", description: "2-3 architecturally distinct approaches were compared with real trade-offs and a recommendation." },
|
|
76
76
|
{ id: "brainstorm_direction_approved", description: "User approved a concrete direction and what exactly was approved is stated." },
|
|
77
77
|
{ id: "brainstorm_artifact_reviewed", description: "User reviewed the written brainstorm artifact and confirmed readiness." }
|
|
78
78
|
],
|
|
79
79
|
requiredEvidence: [
|
|
80
80
|
"Artifact written to `.cclaw/artifacts/01-brainstorm.md`.",
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"Approaches and recommendation are recorded with explicit trade-offs.",
|
|
81
|
+
"Project context was explored (files, docs, or recent activity referenced).",
|
|
82
|
+
"Clarifying questions and their answers are captured.",
|
|
83
|
+
"2-3 approaches with trade-offs and recommendation are recorded.",
|
|
85
84
|
"Approved direction and approval marker are present.",
|
|
86
85
|
"Assumptions and open questions are captured (or explicitly marked as none)."
|
|
87
86
|
],
|
|
@@ -99,7 +98,7 @@ const BRAINSTORM = {
|
|
|
99
98
|
blockers: [
|
|
100
99
|
"no explicit approval",
|
|
101
100
|
"critical ambiguity unresolved",
|
|
102
|
-
"
|
|
101
|
+
"project context not explored"
|
|
103
102
|
],
|
|
104
103
|
exitCriteria: [
|
|
105
104
|
"approved design direction documented",
|
|
@@ -108,58 +107,59 @@ const BRAINSTORM = {
|
|
|
108
107
|
"artifact reviewed by user"
|
|
109
108
|
],
|
|
110
109
|
antiPatterns: [
|
|
111
|
-
"
|
|
112
|
-
"Asking
|
|
113
|
-
"
|
|
110
|
+
"Asking questions without exploring existing project context first",
|
|
111
|
+
"Asking bundled or purely informational questions that don't change decisions",
|
|
112
|
+
"Proposing cosmetic option variants instead of architecturally distinct approaches",
|
|
114
113
|
"Jumping directly into implementation",
|
|
115
114
|
"Requesting approval without stating what decision is being approved"
|
|
116
115
|
],
|
|
117
116
|
rationalizations: [
|
|
118
|
-
{ claim: "
|
|
119
|
-
{ claim: "Any question is useful context.", reality: "Only
|
|
120
|
-
{ claim: "
|
|
117
|
+
{ claim: "I already know what to build, so exploration is unnecessary.", reality: "Checking files and context catches wrong assumptions that waste hours later." },
|
|
118
|
+
{ claim: "Any question is useful context.", reality: "Only questions whose answers change what we build improve the design." },
|
|
119
|
+
{ claim: "Two options that differ only in tooling count as distinct approaches.", reality: "Distinct means different architecture, not different libraries for the same approach." }
|
|
121
120
|
],
|
|
122
121
|
redFlags: [
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
122
|
+
"No project context exploration before questions",
|
|
123
|
+
"Questions that only gather preferences without design impact",
|
|
124
|
+
"Options that are variants of one approach, not distinct alternatives",
|
|
126
125
|
"Approval requested without explicit decision context"
|
|
127
126
|
],
|
|
128
127
|
policyNeedles: [
|
|
129
|
-
"
|
|
130
|
-
"One
|
|
131
|
-
"
|
|
132
|
-
"Multiple approaches with trade-offs",
|
|
128
|
+
"Explore project context",
|
|
129
|
+
"One question at a time",
|
|
130
|
+
"2-3 architecturally distinct approaches",
|
|
133
131
|
"State what is being approved",
|
|
132
|
+
"Self-review before handoff",
|
|
134
133
|
"Do NOT implement, scaffold, or modify behavior"
|
|
135
134
|
],
|
|
136
135
|
artifactFile: "01-brainstorm.md",
|
|
137
136
|
next: "scope",
|
|
138
137
|
cognitivePatterns: [
|
|
139
|
-
{ name: "
|
|
140
|
-
{ name: "
|
|
141
|
-
{ name: "
|
|
142
|
-
{ name: "
|
|
138
|
+
{ name: "Context Before Questions", description: "Understand what exists before asking what to build." },
|
|
139
|
+
{ name: "Depth Matches Complexity", description: "Brief design for simple tasks, thorough exploration for complex ones." },
|
|
140
|
+
{ name: "Diverge Then Commit", description: "Explore multiple architecturally distinct options first, commit only after explicit approval." },
|
|
141
|
+
{ name: "Question Quality Over Quantity", description: "Each question should change what we build, not just gather trivia." },
|
|
142
|
+
{ name: "Know When To Move On", description: "Stop asking when problem, constraints, and success criteria are clear enough to compare approaches." }
|
|
143
143
|
],
|
|
144
144
|
reviewSections: [],
|
|
145
145
|
completionStatus: ["DONE", "DONE_WITH_CONCERNS", "BLOCKED"],
|
|
146
146
|
crossStageTrace: {
|
|
147
147
|
readsFrom: [],
|
|
148
148
|
writesTo: [".cclaw/artifacts/01-brainstorm.md"],
|
|
149
|
-
traceabilityRule: "Scope and design decisions must trace back to
|
|
149
|
+
traceabilityRule: "Scope and design decisions must trace back to explored context and approved brainstorm direction."
|
|
150
150
|
},
|
|
151
151
|
artifactValidation: [
|
|
152
|
-
{ section: "
|
|
153
|
-
{ section: "
|
|
154
|
-
{ section: "
|
|
155
|
-
{ section: "
|
|
156
|
-
{ section: "
|
|
157
|
-
{ section: "
|
|
152
|
+
{ section: "Context", required: true, validationRule: "Must reference project state and relevant existing code or patterns." },
|
|
153
|
+
{ section: "Problem", required: true, validationRule: "Must define what we're solving, success criteria, and constraints." },
|
|
154
|
+
{ section: "Clarifying Questions", required: true, validationRule: "Must capture question, answer, and decision impact for each clarifying question." },
|
|
155
|
+
{ section: "Approaches", required: true, validationRule: "Must compare 2-3 architecturally distinct options with real trade-offs and recommendation." },
|
|
156
|
+
{ section: "Selected Direction", required: true, validationRule: "Must include the selected approach, rationale, and explicit approval marker." },
|
|
157
|
+
{ section: "Design", required: true, validationRule: "Must cover architecture, key components, and data flow scaled to complexity." },
|
|
158
158
|
{ section: "Assumptions and Open Questions", required: true, validationRule: "Must capture unresolved assumptions/open questions, or explicitly state none." }
|
|
159
159
|
],
|
|
160
160
|
namedAntiPattern: {
|
|
161
|
-
title: "This Is Too Simple To
|
|
162
|
-
description: "
|
|
161
|
+
title: "This Is Too Simple To Need A Design",
|
|
162
|
+
description: "Every project goes through this process. Simple projects are where unexamined assumptions cause the most wasted work. The design can be short, but you MUST present it and get approval."
|
|
163
163
|
}
|
|
164
164
|
};
|
|
165
165
|
// ---------------------------------------------------------------------------
|
|
@@ -183,18 +183,23 @@ const SCOPE = {
|
|
|
183
183
|
"The work is a pure implementation or debugging pass within existing scope"
|
|
184
184
|
],
|
|
185
185
|
checklist: [
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"
|
|
190
|
-
"
|
|
191
|
-
"
|
|
192
|
-
"
|
|
193
|
-
"
|
|
186
|
+
"**Assess complexity** — Read the brainstorm artifact. If project is simple (single component, clear architecture, personal/prototype), run light-touch scope: mode selection, 3-5 key in/out boundaries, deferred items. Skip Dream State Mapping and Temporal Interrogation. If project is complex (multi-component, team delivery, production), run the full checklist.",
|
|
187
|
+
"**Prime Directives** — Zero silent failures. For each in-scope capability, name concrete failure modes, the exact error surface, and trace all four data-flow paths (happy, nil, empty, upstream error). Include interaction edge cases (double-click, navigate-away, stale state), observability commitments, and explicit deferred-item logging.",
|
|
188
|
+
"**Premise Challenge** — Is this the right problem? What if we do nothing? What are we optimizing for?",
|
|
189
|
+
"**Existing Code Leverage** — Search for existing solutions before deciding to build new.",
|
|
190
|
+
"**Dream State Mapping** — (complex projects only) describe the ideal state 12 months out using `CURRENT STATE -> THIS PLAN -> 12-MONTH IDEAL`, then verify this scope moves toward that target.",
|
|
191
|
+
"**Implementation Alternatives** — Produce 2-3 distinct approaches. For each: Name, Summary, Effort (S/M/L/XL), Risk (Low/Med/High), 2-3 Pros, 2-3 Cons, and explicit Reuses. One option must be minimal viable, one must be ideal architecture.",
|
|
192
|
+
"**Temporal Interrogation** — (complex projects only) simulate implementation timeline: HOUR 1 foundations, HOUR 2-3 core logic, HOUR 4-5 integration surprises, HOUR 6+ polish/tests. Decide what must be locked now vs safely deferred.",
|
|
193
|
+
"**Mode Selection** — Present expand/selective/hold/reduce with recommendation and default heuristic: greenfield -> expand, feature enhancement -> selective, bugfix/hotfix/refactor -> hold, broad blast radius (>15 files or multi-team impact) -> reduce.",
|
|
194
|
+
"**Mode-Specific Analysis** — After mode is selected, run the matching analysis: EXPAND (10x and delight opportunities), SELECTIVE (hold-scope rigor then cherry-picked expansions), HOLD (minimum-change-set hardening), REDUCE (ruthless cuts and follow-up split).",
|
|
195
|
+
"**Error and Rescue Registry** — For each capability: what breaks, how detected, what fallback."
|
|
194
196
|
],
|
|
195
197
|
interactionProtocol: [
|
|
196
|
-
"For scope mode selection: use the Decision Protocol — present expand/selective/hold/reduce as labeled options with trade-offs and mark one as (recommended). 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.",
|
|
198
|
+
"For scope mode selection: use the Decision Protocol — present expand/selective/hold/reduce as labeled options with trade-offs and mark one as (recommended). Base your recommendation on default heuristics: greenfield -> expand, enhancement -> selective, bugfix/hotfix/refactor -> hold, broad blast radius -> reduce. 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.",
|
|
199
|
+
"Walk through the scope checklist interactively. Each checklist item that surfaces a decision should be presented to the user as a question, not as a monologue. Do not dump all items at once.",
|
|
197
200
|
"Challenge premise and verify the problem framing before anything else.",
|
|
201
|
+
"Take a position on every scope decision. Avoid hedging phrases like 'this could work' or 'there are many ways'; state your recommendation and one concrete condition that would change it.",
|
|
202
|
+
"Use pushback patterns when framing is weak: vague scope -> force a specific user/problem, platform vision -> force a narrowest viable wedge, social proof -> demand behavioral evidence.",
|
|
198
203
|
"Present one structural scope issue at a time for decision. Do NOT batch. Use structured options for each scope boundary question.",
|
|
199
204
|
"Record explicit in-scope and out-of-scope contract.",
|
|
200
205
|
"Once the user accepts or rejects a recommendation, commit fully. Do not re-argue.",
|
|
@@ -203,25 +208,29 @@ const SCOPE = {
|
|
|
203
208
|
],
|
|
204
209
|
process: [
|
|
205
210
|
"Run premise challenge and existing-solution leverage check.",
|
|
206
|
-
"Produce 2-3 scope alternatives (minimum viable
|
|
211
|
+
"Produce 2-3 scope alternatives in a structured format (Name, Summary, Effort, Risk, Pros, Cons, Reuses) with minimum viable and ideal architecture options included.",
|
|
207
212
|
"Choose scope mode with user approval.",
|
|
213
|
+
"Run mode-specific analysis that matches the selected scope mode.",
|
|
208
214
|
"Walk through scope review sections one at a time.",
|
|
209
|
-
"Write explicit scope contract and deferred items.",
|
|
210
|
-
"Produce scope summary
|
|
215
|
+
"Write explicit scope contract, discretion areas, and deferred items.",
|
|
216
|
+
"Produce scope summary plus completion dashboard (checklist findings, number of resolved decisions, unresolved items or `None`)."
|
|
211
217
|
],
|
|
212
218
|
requiredGates: [
|
|
213
219
|
{ id: "scope_premise_challenged", description: "Problem framing and assumptions were challenged." },
|
|
214
|
-
{ id: "scope_alternatives_produced", description: "At least 2 implementation alternatives with effort/risk
|
|
220
|
+
{ id: "scope_alternatives_produced", description: "At least 2 implementation alternatives were evaluated with explicit effort/risk and reuse fields." },
|
|
215
221
|
{ id: "scope_mode_selected", description: "One scope mode was explicitly selected." },
|
|
216
222
|
{ id: "scope_contract_written", description: "In-scope/out-of-scope contract is documented." },
|
|
223
|
+
{ id: "scope_discretion_documented", description: "Discretion areas are documented (or explicitly marked as none)." },
|
|
217
224
|
{ id: "scope_user_approved", description: "User approved the final scope direction." }
|
|
218
225
|
],
|
|
219
226
|
requiredEvidence: [
|
|
220
227
|
"Artifact written to `.cclaw/artifacts/02-scope.md`.",
|
|
221
228
|
"In-scope and out-of-scope lists are explicit.",
|
|
229
|
+
"Discretion areas are explicit (or marked as `None`).",
|
|
222
230
|
"Selected mode and rationale are documented.",
|
|
223
231
|
"Premise challenge findings documented.",
|
|
224
|
-
"Deferred items list with one-line rationale for each."
|
|
232
|
+
"Deferred items list with one-line rationale for each.",
|
|
233
|
+
"Completion dashboard lists checklist findings, decision count, and unresolved items (or `None`)."
|
|
225
234
|
],
|
|
226
235
|
inputs: ["brainstorm artifact", "timeline constraints", "product priorities"],
|
|
227
236
|
requiredContext: [
|
|
@@ -229,22 +238,27 @@ const SCOPE = {
|
|
|
229
238
|
"existing capabilities and reusable components",
|
|
230
239
|
"delivery deadlines and risk tolerance"
|
|
231
240
|
],
|
|
232
|
-
outputs: ["scope mode decision", "scope contract", "deferred scope list", "scope summary"],
|
|
241
|
+
outputs: ["scope mode decision", "scope contract", "discretion areas list", "deferred scope list", "scope summary", "scope completion dashboard"],
|
|
233
242
|
blockers: [
|
|
234
243
|
"scope mode not selected",
|
|
235
244
|
"in/out boundaries ambiguous",
|
|
245
|
+
"discretion areas undefined",
|
|
236
246
|
"critical premise disagreement unresolved"
|
|
237
247
|
],
|
|
238
248
|
exitCriteria: [
|
|
239
249
|
"scope contract approved by user",
|
|
250
|
+
"discretion areas recorded explicitly",
|
|
240
251
|
"required gates marked satisfied",
|
|
241
252
|
"deferred list recorded explicitly",
|
|
253
|
+
"completion dashboard produced",
|
|
242
254
|
"scope summary produced"
|
|
243
255
|
],
|
|
244
256
|
antiPatterns: [
|
|
245
257
|
"Scope silently expanded during discussion",
|
|
246
258
|
"No explicit out-of-scope section",
|
|
247
259
|
"Premise accepted without challenge",
|
|
260
|
+
"Sycophantic agreement without evidence-based pushback",
|
|
261
|
+
"Hedged recommendations that avoid taking a position",
|
|
248
262
|
"Batching multiple scope issues into one question",
|
|
249
263
|
"Re-arguing for smaller scope after user rejects reduction"
|
|
250
264
|
],
|
|
@@ -252,19 +266,23 @@ const SCOPE = {
|
|
|
252
266
|
{ claim: "Scope can be finalized during implementation.", reality: "Late scope decisions create architecture churn and missed deadlines." },
|
|
253
267
|
{ claim: "Mode selection is unnecessary overhead.", reality: "Mode selection makes trade-offs explicit and prevents silent drift." },
|
|
254
268
|
{ claim: "Out-of-scope is obvious.", reality: "Unwritten exclusions return later as hidden requirements." },
|
|
255
|
-
{ claim: "We do not need alternatives for a clear request.", reality: "Even clear requests benefit from a minimal-viable vs ideal comparison." }
|
|
269
|
+
{ claim: "We do not need alternatives for a clear request.", reality: "Even clear requests benefit from a minimal-viable vs ideal comparison." },
|
|
270
|
+
{ claim: "Pushback risks sounding confrontational, so I should stay neutral.", reality: "Respectful pushback catches framing errors before they become expensive implementation mistakes." }
|
|
256
271
|
],
|
|
257
272
|
redFlags: [
|
|
258
273
|
"No selected mode in artifact",
|
|
274
|
+
"Mode selected without heuristic justification",
|
|
275
|
+
"No discretion section (or explicit `None`) in artifact",
|
|
259
276
|
"No deferred/not-in-scope section",
|
|
260
277
|
"No user approval marker",
|
|
261
278
|
"Premise challenge missing or superficial",
|
|
262
279
|
"No implementation alternatives evaluated"
|
|
263
280
|
],
|
|
264
|
-
policyNeedles: ["Scope mode", "In Scope", "Out of Scope", "NOT in scope", "Premise Challenge"],
|
|
281
|
+
policyNeedles: ["Scope mode", "In Scope", "Out of Scope", "Discretion Areas", "NOT in scope", "Premise Challenge"],
|
|
265
282
|
artifactFile: "02-scope.md",
|
|
266
283
|
next: "design",
|
|
267
284
|
cognitivePatterns: [
|
|
285
|
+
{ name: "Depth Matches Complexity", description: "Scale each section to project complexity: concise for simple prototypes, deep for production systems." },
|
|
268
286
|
{ name: "Classification Instinct", description: "Categorize every decision by reversibility x magnitude. Most things are two-way doors — move fast. Only slow down for irreversible + high-magnitude decisions." },
|
|
269
287
|
{ name: "Inversion Reflex", description: "For every 'how do we win?' also ask 'what would make us fail?' Map failure modes before committing to scope." },
|
|
270
288
|
{ name: "Focus as Subtraction", description: "Primary value-add is what to NOT do. Default: do fewer things, better. Every feature must earn its place." },
|
|
@@ -330,12 +348,15 @@ const SCOPE = {
|
|
|
330
348
|
traceabilityRule: "Every scope boundary must be traceable to a brainstorm decision. Every downstream design choice must stay within the scope contract."
|
|
331
349
|
},
|
|
332
350
|
artifactValidation: [
|
|
333
|
-
{ section: "Prime Directives", required: true, validationRule: "
|
|
351
|
+
{ section: "Prime Directives", required: true, validationRule: "For each scoped capability: named failure modes, explicit error surface, four data-flow paths, interaction edge cases, observability expectations, and deferred-item handling." },
|
|
334
352
|
{ section: "Premise Challenge", required: true, validationRule: "Must contain explicit answers to: right problem? direct path? what if nothing?" },
|
|
353
|
+
{ section: "Implementation Alternatives", required: true, validationRule: "2-3 options with Name, Summary, Effort, Risk, Pros, Cons, and Reuses. Must include minimal viable and ideal architecture options." },
|
|
335
354
|
{ section: "Scope Mode", required: true, validationRule: "Must state selected mode and rationale with default heuristic justification." },
|
|
336
355
|
{ section: "In Scope / Out of Scope", required: true, validationRule: "Two separate explicit lists. Out-of-scope must not be empty." },
|
|
356
|
+
{ section: "Discretion Areas", required: true, validationRule: "Explicit list of implementer decision zones, or 'None' if scope is fully locked." },
|
|
337
357
|
{ section: "Deferred Items", required: true, validationRule: "Each item has one-line rationale. If empty, state 'None' explicitly." },
|
|
338
358
|
{ section: "Error & Rescue Registry", required: true, validationRule: "Each scoped capability has: failure mode, detection method, fallback decision." },
|
|
359
|
+
{ section: "Completion Dashboard", required: true, validationRule: "Lists checklist findings, count of resolved decisions, and unresolved decisions (or 'None')." },
|
|
339
360
|
{ section: "Scope Summary", required: true, validationRule: "Clean summary: mode, strongest challenges, recommended path, accepted scope, deferred, excluded." }
|
|
340
361
|
],
|
|
341
362
|
namedAntiPattern: {
|
|
@@ -3,46 +3,35 @@ import { orderedStageSchemas } from "./stage-schema.js";
|
|
|
3
3
|
export const ARTIFACT_TEMPLATES = {
|
|
4
4
|
"01-brainstorm.md": `# Brainstorm Artifact
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
- **What is fixed now:**
|
|
18
|
-
- **What is still unknown:**
|
|
19
|
-
|
|
20
|
-
### Round 2 grounding
|
|
21
|
-
- **What is fixed now:**
|
|
22
|
-
- **What is still unknown:**
|
|
23
|
-
|
|
24
|
-
### Round 3 grounding
|
|
25
|
-
- **What is fixed now:**
|
|
26
|
-
- **What is still unknown:**
|
|
27
|
-
|
|
28
|
-
## Forcing Questions Log
|
|
29
|
-
| Round | Question | User answer | Decision impact |
|
|
6
|
+
## Context
|
|
7
|
+
- **Project state:**
|
|
8
|
+
- **Relevant existing code/patterns:**
|
|
9
|
+
|
|
10
|
+
## Problem
|
|
11
|
+
- **What we're solving:**
|
|
12
|
+
- **Success criteria:**
|
|
13
|
+
- **Constraints:**
|
|
14
|
+
|
|
15
|
+
## Clarifying Questions
|
|
16
|
+
| # | Question | Answer | Decision impact |
|
|
30
17
|
|---|---|---|---|
|
|
31
|
-
|
|
|
32
|
-
| 2 | | | |
|
|
33
|
-
| 3 | | | |
|
|
18
|
+
| 1 | | | |
|
|
34
19
|
|
|
35
|
-
##
|
|
36
|
-
|
|
|
20
|
+
## Approaches
|
|
21
|
+
| Approach | Architecture | Trade-offs | Recommendation |
|
|
37
22
|
|---|---|---|---|
|
|
38
23
|
| A | | | |
|
|
39
24
|
| B | | | |
|
|
40
25
|
|
|
41
|
-
##
|
|
42
|
-
- **
|
|
43
|
-
- **
|
|
44
|
-
- **
|
|
45
|
-
|
|
26
|
+
## Selected Direction
|
|
27
|
+
- **Approach:**
|
|
28
|
+
- **Rationale:**
|
|
29
|
+
- **Approval:** pending
|
|
30
|
+
|
|
31
|
+
## Design
|
|
32
|
+
- **Architecture:**
|
|
33
|
+
- **Key components:**
|
|
34
|
+
- **Data flow:**
|
|
46
35
|
|
|
47
36
|
## Assumptions and Open Questions
|
|
48
37
|
- **Assumptions:**
|
|
@@ -60,6 +49,27 @@ export const ARTIFACT_TEMPLATES = {
|
|
|
60
49
|
- Why this path?
|
|
61
50
|
- What if we do nothing?
|
|
62
51
|
|
|
52
|
+
## Dream State Mapping
|
|
53
|
+
- CURRENT STATE:
|
|
54
|
+
- THIS PLAN:
|
|
55
|
+
- 12-MONTH IDEAL:
|
|
56
|
+
- Alignment verdict:
|
|
57
|
+
|
|
58
|
+
## Implementation Alternatives
|
|
59
|
+
| Option | Summary | Effort (S/M/L/XL) | Risk (Low/Med/High) | Pros | Cons | Reuses |
|
|
60
|
+
|---|---|---|---|---|---|---|
|
|
61
|
+
| A (minimum viable) | | | | | | |
|
|
62
|
+
| B (ideal architecture) | | | | | | |
|
|
63
|
+
| C (optional) | | | | | | |
|
|
64
|
+
|
|
65
|
+
## Temporal Interrogation
|
|
66
|
+
| Time slice | Likely decision pressure | Lock now or defer? | Reason |
|
|
67
|
+
|---|---|---|---|
|
|
68
|
+
| HOUR 1 (foundations) | | | |
|
|
69
|
+
| HOUR 2-3 (core logic) | | | |
|
|
70
|
+
| HOUR 4-5 (integration) | | | |
|
|
71
|
+
| HOUR 6+ (polish/tests) | | | |
|
|
72
|
+
|
|
63
73
|
## Scope Mode
|
|
64
74
|
- [ ] expand
|
|
65
75
|
- [ ] selective
|
|
@@ -74,6 +84,9 @@ export const ARTIFACT_TEMPLATES = {
|
|
|
74
84
|
### Out of Scope
|
|
75
85
|
-
|
|
76
86
|
|
|
87
|
+
## Discretion Areas
|
|
88
|
+
- (or \`None\`)
|
|
89
|
+
|
|
77
90
|
## Deferred Items
|
|
78
91
|
| Item | Rationale |
|
|
79
92
|
|---|---|
|
|
@@ -84,6 +97,11 @@ export const ARTIFACT_TEMPLATES = {
|
|
|
84
97
|
|---|---|---|---|
|
|
85
98
|
| | | | |
|
|
86
99
|
|
|
100
|
+
## Completion Dashboard
|
|
101
|
+
- Checklist findings:
|
|
102
|
+
- Resolved decisions count:
|
|
103
|
+
- Unresolved decisions (or \`None\`):
|
|
104
|
+
|
|
87
105
|
## Scope Summary
|
|
88
106
|
- Selected mode:
|
|
89
107
|
- Accepted scope:
|