cclaw-cli 0.51.24 → 0.51.25
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/README.md +135 -414
- package/dist/artifact-linter.js +10 -6
- package/dist/config.d.ts +1 -1
- package/dist/config.js +28 -3
- package/dist/content/core-agents.d.ts +110 -0
- package/dist/content/core-agents.js +235 -3
- package/dist/content/examples.js +8 -5
- package/dist/content/next-command.js +10 -6
- package/dist/content/reference-patterns.d.ts +18 -0
- package/dist/content/reference-patterns.js +391 -0
- package/dist/content/skills.js +39 -34
- package/dist/content/stage-common-guidance.js +19 -3
- package/dist/content/stage-schema.d.ts +12 -0
- package/dist/content/stage-schema.js +184 -28
- package/dist/content/stages/_lint-metadata/index.js +3 -2
- package/dist/content/stages/brainstorm.js +7 -3
- package/dist/content/stages/design.js +12 -3
- package/dist/content/stages/review.js +7 -5
- package/dist/content/stages/schema-types.d.ts +9 -2
- package/dist/content/stages/scope.js +8 -2
- package/dist/content/stages/ship.js +3 -2
- package/dist/content/stages/tdd.js +18 -13
- package/dist/content/start-command.js +3 -2
- package/dist/content/status-command.js +9 -4
- package/dist/content/subagents.js +281 -39
- package/dist/content/templates.js +64 -3
- package/dist/delegation.d.ts +2 -0
- package/dist/delegation.js +27 -6
- package/dist/doctor.js +47 -5
- package/dist/gate-evidence.js +25 -2
- package/dist/install.js +2 -9
- package/dist/internal/advance-stage.js +179 -26
- package/dist/run-persistence.js +21 -3
- package/dist/tdd-verification-evidence.d.ts +17 -0
- package/dist/tdd-verification-evidence.js +43 -0
- package/dist/types.d.ts +10 -0
- package/package.json +1 -1
package/dist/content/examples.js
CHANGED
|
@@ -490,7 +490,7 @@ const GOOD_BAD_EXAMPLES = {
|
|
|
490
490
|
},
|
|
491
491
|
{
|
|
492
492
|
label: "Scope change trace",
|
|
493
|
-
good: "Scope delta at 2026-04-15: user asked to add per-user mute preferences. Decision: moved from Out-of-scope → In-scope; acknowledged cost (≈1 day, +1 schema migration); risk: touches settings surface. Recorded in
|
|
493
|
+
good: "Scope delta at 2026-04-15: user asked to add per-user mute preferences. Decision: moved from Out-of-scope → In-scope; acknowledged cost (≈1 day, +1 schema migration); risk: touches settings surface. Recorded in \`.cclaw/artifacts/03-design-<slug>.md#scope-trace\`. Requires re-running scope review before design lock.",
|
|
494
494
|
bad: "Added mute preferences to scope.",
|
|
495
495
|
lesson: "Scope changes silently are how projects drift. Every in↔out move needs a timestamp, a cost estimate, and a link to the next review it invalidates."
|
|
496
496
|
}
|
|
@@ -676,12 +676,13 @@ function exampleSummaryBullets(stage) {
|
|
|
676
676
|
const STAGE_EXAMPLE_SECTION_HEADINGS = {
|
|
677
677
|
brainstorm: [
|
|
678
678
|
"Problem Decision Record (product or technical-maintenance framing)",
|
|
679
|
-
"
|
|
679
|
+
"Reference Pattern Candidates and approaches with trade-offs",
|
|
680
680
|
"Recommended direction + open questions",
|
|
681
681
|
"Clarification log and decision record"
|
|
682
682
|
],
|
|
683
683
|
scope: [
|
|
684
684
|
"In-scope / out-of-scope / deferred lists with concrete capabilities",
|
|
685
|
+
"Reference Pattern Registry with accepted/rejected/deferred dispositions",
|
|
685
686
|
"Requirements table with stable R# IDs",
|
|
686
687
|
"Boundary stress-tests and non-negotiables",
|
|
687
688
|
"Decision record for premise challenges"
|
|
@@ -689,6 +690,7 @@ const STAGE_EXAMPLE_SECTION_HEADINGS = {
|
|
|
689
690
|
design: [
|
|
690
691
|
"Blast-radius file list",
|
|
691
692
|
"Mandatory architecture diagram (Mermaid)",
|
|
693
|
+
"Reference-Grade Contracts for mirrored patterns",
|
|
692
694
|
"Failure-mode table with detection + mitigation",
|
|
693
695
|
"Test strategy + performance budget",
|
|
694
696
|
"Completion dashboard + unresolved decisions"
|
|
@@ -706,7 +708,7 @@ const STAGE_EXAMPLE_SECTION_HEADINGS = {
|
|
|
706
708
|
"No-Placeholder scan row + WAIT_FOR_CONFIRM marker"
|
|
707
709
|
],
|
|
708
710
|
tdd: [
|
|
709
|
-
"RED evidence per slice (failing test output)",
|
|
711
|
+
"RED evidence per vertical slice (failing test output)",
|
|
710
712
|
"Acceptance mapping per slice",
|
|
711
713
|
"GREEN evidence (full-suite pass)",
|
|
712
714
|
"REFACTOR notes with behavior-preservation confirmation",
|
|
@@ -716,10 +718,11 @@ const STAGE_EXAMPLE_SECTION_HEADINGS = {
|
|
|
716
718
|
"Spec-compliance findings (Layer 1)",
|
|
717
719
|
"Code-quality findings (Layer 2)",
|
|
718
720
|
"Severity, evidence, and status per finding",
|
|
719
|
-
"
|
|
721
|
+
"Victory Detector-backed go / no-go verdict"
|
|
720
722
|
],
|
|
721
723
|
ship: [
|
|
722
724
|
"Release checklist (version, changelog, tag, artifacts)",
|
|
725
|
+
"Victory Detector: valid review, fresh preflight, rollback, finalization enum",
|
|
723
726
|
"Rollback plan with trigger, steps, verification",
|
|
724
727
|
"Runbook (how to verify the release post-deploy)",
|
|
725
728
|
"Sign-off block"
|
|
@@ -732,7 +735,7 @@ const DOMAIN_LABELS = {
|
|
|
732
735
|
"data-pipeline": "Data pipeline / ETL"
|
|
733
736
|
};
|
|
734
737
|
export const RESEARCH_FLEET_USAGE_EXAMPLE = [
|
|
735
|
-
"Before drafting
|
|
738
|
+
"Before drafting `.cclaw/artifacts/03-design-<slug>.md`, run `research/research-fleet.md` once and",
|
|
736
739
|
"capture all four lenses in `.cclaw/artifacts/02a-research.md`.",
|
|
737
740
|
"Dispatch semantics by harness: Claude/OpenCode/Codex = native subagents;",
|
|
738
741
|
"Cursor = generic-dispatch Task mapping; role-switch only as degraded fallback.",
|
|
@@ -76,7 +76,7 @@ ${conversationLanguagePolicyMarkdown()}
|
|
|
76
76
|
|
|
77
77
|
1. Read **\`${flowPath}\`**. If missing → **BLOCKED** (state missing).
|
|
78
78
|
2. Parse JSON. Capture \`currentStage\` and \`stageGateCatalog[currentStage]\`.
|
|
79
|
-
3. If \`staleStages[currentStage]\` exists, do not advance automatically.
|
|
79
|
+
3. If \`staleStages[currentStage]\` exists, do not advance automatically. Report the stale marker reason/rewindId, re-run the stage artifact work, then clear only the current stage marker with \`cclaw internal rewind --ack <currentStage>\`.
|
|
80
80
|
4. Read **\`${reconciliationNoticesPath}\`** when present. If it contains entries for \`activeRunId + currentStage\` and the listed gate is still blocked in \`stageGateCatalog[currentStage].blocked\`, emit a structured warning before any stage-advance decision.
|
|
81
81
|
5. Let \`G\` = \`requiredGates\` for **\`currentStage\`** from the stage schema.
|
|
82
82
|
6. Let \`catalog\` = \`stageGateCatalog[currentStage]\` from flow state.
|
|
@@ -85,7 +85,7 @@ ${conversationLanguagePolicyMarkdown()}
|
|
|
85
85
|
9. If \`M\` is non-empty, inspect **\`${delegationPath}\`**. Treat as satisfied only if each mandatory agent is **completed** or **waived**.
|
|
86
86
|
10. For each satisfied mandatory delegation row, verify \`evidenceRefs\` is a non-empty array (unless status is \`waived\` with rationale). Missing evidenceRefs means delegation is unresolved.
|
|
87
87
|
11. If any mandatory delegation is missing and no waiver exists: **STOP** and ask the user whether to dispatch now or waive with rationale. Do not mark gates passed while delegation is unresolved.
|
|
88
|
-
12. If \`currentStage === "review"\` and \`catalog.blocked\` includes \`review_criticals_resolved\`, treat this as a hard remediation branch: recommend \`cclaw internal rewind tdd "review_blocked_by_critical
|
|
88
|
+
12. If \`currentStage === "review"\` and \`catalog.blocked\` includes \`review_criticals_resolved\`, treat this as a hard remediation branch: recommend the managed command \`cclaw internal rewind tdd "review_blocked_by_critical <finding-ids>"\`, and do not attempt to advance toward ship. After TDD rework, require \`cclaw internal rewind --ack tdd\` before continuing.
|
|
89
89
|
|
|
90
90
|
### Path A: Current stage is NOT complete (any gate unmet or delegation missing)
|
|
91
91
|
|
|
@@ -186,11 +186,13 @@ ${conversationLanguagePolicyMarkdown()}
|
|
|
186
186
|
Default output should be compact, like OMC/OMX operator surfaces:
|
|
187
187
|
|
|
188
188
|
\`\`\`
|
|
189
|
-
|
|
189
|
+
Current: <currentStage or closeout.shipSubstate> (<track>)
|
|
190
|
+
Stage: <currentStage>
|
|
190
191
|
Gates: <passed>/<required> passed, <blocked> blocked
|
|
191
192
|
Delegations: <done>/<mandatory> done
|
|
192
|
-
|
|
193
|
+
Blocked by: <none | gate/delegation/reconciliation/stale/TDD/review ids>
|
|
193
194
|
Next: <exact next action, usually /cc-next or one named remediation>
|
|
195
|
+
Evidence needed: <artifact/test/review/delegation evidence required to unblock>
|
|
194
196
|
\`\`\`
|
|
195
197
|
|
|
196
198
|
Only expand beyond this when blocked, when asking a structured question, or when
|
|
@@ -214,7 +216,7 @@ Do **not** mark gates satisfied from memory alone. Cite **artifact evidence** (p
|
|
|
214
216
|
|
|
215
217
|
1. Open **\`${flowPath}\`**.
|
|
216
218
|
2. Record \`currentStage\` and \`stageGateCatalog[currentStage]\`.
|
|
217
|
-
3. If \`staleStages[currentStage]\` exists, re-run the stage and clear marker via \`cclaw internal rewind --ack <currentStage>\` before advancing.
|
|
219
|
+
3. If \`staleStages[currentStage]\` exists, show the marker reason/rewindId, re-run the stage, and clear only the current marker via \`cclaw internal rewind --ack <currentStage>\` before advancing.
|
|
218
220
|
4. If the file is missing or invalid JSON → **BLOCKED** (report and stop).
|
|
219
221
|
5. Read \`${reconciliationNoticesPath}\` when present. For entries matching \`activeRunId + currentStage\` whose gate is still in \`stageGateCatalog[currentStage].blocked\`, show a warning with gate id + reason before proceeding.
|
|
220
222
|
|
|
@@ -242,7 +244,9 @@ Execute the stage protocol. The stage skill handles interaction, STOP points, ga
|
|
|
242
244
|
|
|
243
245
|
${ralphLoopContractSnippet()}
|
|
244
246
|
|
|
245
|
-
Special-case for review: if \`review_criticals_resolved\` is in \`blocked\`, route to rework instead of looping review forever
|
|
247
|
+
Special-case for review: if \`review_criticals_resolved\` is in \`blocked\`, route to rework instead of looping review forever - recommend \`cclaw internal rewind tdd "review_blocked_by_critical <finding-ids>"\`, then \`cclaw internal rewind --ack tdd\` after TDD rework.
|
|
248
|
+
|
|
249
|
+
Special-case for TDD blockers: when \`06-tdd.md\` records \`NO_SOURCE_CONTEXT\`, \`NO_TEST_SURFACE\`, \`NO_IMPLEMENTABLE_SLICE\`, \`RED_NOT_EXPRESSIBLE\`, or \`NO_VCS_MODE\`, keep status BLOCKED and print \`Current\`, \`Blocked by\`, \`Next\`, and \`Evidence needed\` instead of retrying speculative RED/GREEN work.
|
|
246
250
|
|
|
247
251
|
**Path B — stage IS complete (all gates met, all delegations done):**
|
|
248
252
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FlowStage } from "../types.js";
|
|
2
|
+
export interface ReferencePatternContract {
|
|
3
|
+
stage: FlowStage;
|
|
4
|
+
guidance: string[];
|
|
5
|
+
artifactSections: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface ReferencePattern {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
intent: string;
|
|
11
|
+
useWhen: string;
|
|
12
|
+
policyNeedles: string[];
|
|
13
|
+
contracts: ReferencePatternContract[];
|
|
14
|
+
}
|
|
15
|
+
export declare const REFERENCE_PATTERNS: ReferencePattern[];
|
|
16
|
+
export declare function referencePatternsForStage(stage: FlowStage): ReferencePattern[];
|
|
17
|
+
export declare function referencePatternContractsForStage(stage: FlowStage): ReferencePatternContract[];
|
|
18
|
+
export declare function referencePatternPolicyNeedles(stage: FlowStage): string[];
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
export const REFERENCE_PATTERNS = [
|
|
2
|
+
{
|
|
3
|
+
id: "socraticode_context_readiness",
|
|
4
|
+
title: "Context Readiness",
|
|
5
|
+
intent: "Do not draft from memory. Start once the agent can name upstream artifacts, discovered code patterns, template shape, and open blockers.",
|
|
6
|
+
useWhen: "Every stage before writing or validating an artifact.",
|
|
7
|
+
policyNeedles: ["Context Readiness", "upstream freshness", "template shape"],
|
|
8
|
+
contracts: [
|
|
9
|
+
{
|
|
10
|
+
stage: "brainstorm",
|
|
11
|
+
guidance: [
|
|
12
|
+
"Capture discovered project context before asking approval questions.",
|
|
13
|
+
"Separate observed facts from assumptions and open blockers."
|
|
14
|
+
],
|
|
15
|
+
artifactSections: ["Context", "Discovered context"]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
stage: "scope",
|
|
19
|
+
guidance: [
|
|
20
|
+
"Name which brainstorm decisions are fresh enough to carry forward.",
|
|
21
|
+
"If upstream decisions are stale or missing, stop for re-scope instead of inventing boundaries."
|
|
22
|
+
],
|
|
23
|
+
artifactSections: ["Upstream Handoff", "Scope Contract"]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
stage: "design",
|
|
27
|
+
guidance: [
|
|
28
|
+
"Read blast-radius code before locking architecture.",
|
|
29
|
+
"Use reference patterns as examples to adapt, not authority to copy."
|
|
30
|
+
],
|
|
31
|
+
artifactSections: ["Codebase Investigation", "Reference-Grade Contracts"]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
stage: "tdd",
|
|
35
|
+
guidance: [
|
|
36
|
+
"Discover tests and affected contracts before opening a RED vertical slice.",
|
|
37
|
+
"Map the slice to the active source item before editing production code."
|
|
38
|
+
],
|
|
39
|
+
artifactSections: ["Test Discovery", "System-Wide Impact Check", "Acceptance Mapping"]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
stage: "review",
|
|
43
|
+
guidance: [
|
|
44
|
+
"Review only after current diff, test evidence, and source-item coverage are known.",
|
|
45
|
+
"A no-finding verdict still needs inspected-surface evidence."
|
|
46
|
+
],
|
|
47
|
+
artifactSections: ["Review Evidence Scope", "Completeness Snapshot"]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
stage: "ship",
|
|
51
|
+
guidance: [
|
|
52
|
+
"Ship only after fresh preflight, rollback trigger, and finalization mode are explicit.",
|
|
53
|
+
"Treat stale review or missing rollback evidence as a blocker, not a concern."
|
|
54
|
+
],
|
|
55
|
+
artifactSections: ["Preflight Results", "Rollback Plan", "Finalization"]
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "addy_reference_grade_contracts",
|
|
61
|
+
title: "Reference-Grade Contracts",
|
|
62
|
+
intent: "Promote good examples into explicit contracts: source, invariant, adaptation, rejection boundary, and verification signal.",
|
|
63
|
+
useWhen: "Brainstorm, scope, and design need reusable patterns without copying unrelated behavior.",
|
|
64
|
+
policyNeedles: ["Reference Pattern Registry", "Reference-Grade Contracts", "accepted/rejected reference ideas"],
|
|
65
|
+
contracts: [
|
|
66
|
+
{
|
|
67
|
+
stage: "brainstorm",
|
|
68
|
+
guidance: [
|
|
69
|
+
"Record which reference patterns informed each option and which were rejected.",
|
|
70
|
+
"A challenger must name the reference idea that makes it meaningfully higher-upside."
|
|
71
|
+
],
|
|
72
|
+
artifactSections: ["Reference Pattern Candidates", "Approaches"]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
stage: "scope",
|
|
76
|
+
guidance: [
|
|
77
|
+
"Lock accepted, rejected, and deferred reference ideas as scope boundaries.",
|
|
78
|
+
"Do not let a reference expand scope unless the user explicitly opts in."
|
|
79
|
+
],
|
|
80
|
+
artifactSections: ["Reference Pattern Registry", "Scope Contract"]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
stage: "design",
|
|
84
|
+
guidance: [
|
|
85
|
+
"For every mirrored pattern, name source, invariant, adaptation, and verification evidence.",
|
|
86
|
+
"If a reference conflicts with local architecture, reject it and document the revival signal."
|
|
87
|
+
],
|
|
88
|
+
artifactSections: ["Reference-Grade Contracts", "Patterns to Mirror", "Rejected Alternatives"]
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: "evanflow_coder_overseer",
|
|
94
|
+
title: "Coder / Overseer Split",
|
|
95
|
+
intent: "Keep implementation and validation context isolated: coders edit bounded slices, overseers read only, and integration overseers validate shared touchpoints.",
|
|
96
|
+
useWhen: "TDD, review, and parallel worker orchestration need safe independent implementation with fresh verification.",
|
|
97
|
+
policyNeedles: ["coder/overseer", "integration overseer", "non-overlap checks"],
|
|
98
|
+
contracts: [
|
|
99
|
+
{
|
|
100
|
+
stage: "plan",
|
|
101
|
+
guidance: [
|
|
102
|
+
"Executable packets name file ownership, shared interfaces, expected failing test, passing command, and stop conditions.",
|
|
103
|
+
"Parallel writers are allowed only after non-overlap checks for files, shared interfaces, migrations/config, and baseline cleanliness."
|
|
104
|
+
],
|
|
105
|
+
artifactSections: ["Task List", "Dependency Batches", "Execution Posture"]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
stage: "tdd",
|
|
109
|
+
guidance: [
|
|
110
|
+
"Coder edits only the assigned slice after RED evidence; read-only overseer validates spec fit and assertion quality.",
|
|
111
|
+
"When 3+ independent packets run, use an integration overseer for named touchpoints and integration tests."
|
|
112
|
+
],
|
|
113
|
+
artifactSections: ["Execution Posture", "Per-Slice Review", "Verification Ladder"]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
stage: "review",
|
|
117
|
+
guidance: [
|
|
118
|
+
"Layered reviewers reconcile findings by source tag, confidence, owner, and verification requirement.",
|
|
119
|
+
"Do not accept implementer self-review as overseer evidence."
|
|
120
|
+
],
|
|
121
|
+
artifactSections: ["Review Evidence Scope", "Review Findings Contract"]
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: "superpowers_executable_packet",
|
|
127
|
+
title: "Executable Packet",
|
|
128
|
+
intent: "Plan tasks as self-contained packets with acceptance mapping, expected RED failure, GREEN command, allowed files, and stop conditions.",
|
|
129
|
+
useWhen: "Plan and TDD need work items a fresh agent can execute without hidden parent context.",
|
|
130
|
+
policyNeedles: ["executable packet", "expected failing test", "stop condition"],
|
|
131
|
+
contracts: [
|
|
132
|
+
{
|
|
133
|
+
stage: "plan",
|
|
134
|
+
guidance: [
|
|
135
|
+
"Each task is copy-paste ready for a worker and includes acceptance criteria, file boundaries, expected failing test, passing command, and stop conditions.",
|
|
136
|
+
"Tasks that depend on shared interfaces or migration/config files are serialized unless an integration contract exists."
|
|
137
|
+
],
|
|
138
|
+
artifactSections: ["Task List", "Dependency Batches", "Execution Posture"]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
stage: "tdd",
|
|
142
|
+
guidance: [
|
|
143
|
+
"Open one packet as one vertical slice; do not mix unrelated packet evidence.",
|
|
144
|
+
"Close packet only when RED, GREEN, REFACTOR, and verification evidence align."
|
|
145
|
+
],
|
|
146
|
+
artifactSections: ["Acceptance Mapping", "RED Evidence", "GREEN Evidence", "REFACTOR Notes"]
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: "gstack_question_tuning",
|
|
152
|
+
title: "Question Tuning",
|
|
153
|
+
intent: "Ask only decision-changing questions, auto-assume low-risk two-way doors, and stop on one-way-door decisions.",
|
|
154
|
+
useWhen: "Brainstorm/scope/spec interactions could drift into broad interrogation instead of useful approval gates.",
|
|
155
|
+
policyNeedles: ["one decision-changing question", "two-way door", "one-way door"],
|
|
156
|
+
contracts: [
|
|
157
|
+
{
|
|
158
|
+
stage: "brainstorm",
|
|
159
|
+
guidance: [
|
|
160
|
+
"Ask one decision-changing question at a time and record impact only when it changes direction or blocks progress.",
|
|
161
|
+
"Continue on low-risk defaults; stop on scope, architecture, security, data loss, public API, migration, auth/pricing, or approval uncertainty."
|
|
162
|
+
],
|
|
163
|
+
artifactSections: ["Sharpening Questions", "Selected Direction"]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
stage: "scope",
|
|
167
|
+
guidance: [
|
|
168
|
+
"Present labeled scope moves with one recommendation; wait for user opt-in before treating a mode as selected.",
|
|
169
|
+
"Record what signal would change the recommendation."
|
|
170
|
+
],
|
|
171
|
+
artifactSections: ["Scope Mode", "Scope Contract"]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
stage: "spec",
|
|
175
|
+
guidance: [
|
|
176
|
+
"Chunk acceptance criteria for approval and stop on assumptions with irreversible impact.",
|
|
177
|
+
"Rewrite vague criteria before asking the user to approve."
|
|
178
|
+
],
|
|
179
|
+
artifactSections: ["Acceptance Criteria", "Assumptions Before Finalization", "Approval"]
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: "evanflow_vertical_slice_tdd",
|
|
185
|
+
title: "Vertical-Slice TDD",
|
|
186
|
+
intent: "Execute behavior end-to-end in one reviewable slice instead of collecting unrelated test or implementation fragments.",
|
|
187
|
+
useWhen: "TDD and review need to prove a source item moved from RED to GREEN with traceable behavior evidence.",
|
|
188
|
+
policyNeedles: ["vertical slice", "RED vertical slice", "slice victory detector"],
|
|
189
|
+
contracts: [
|
|
190
|
+
{
|
|
191
|
+
stage: "tdd",
|
|
192
|
+
guidance: [
|
|
193
|
+
"One vertical slice is one source item plus one or more ACs, tests, implementation, refactor notes, and verification evidence.",
|
|
194
|
+
"Do not open a second vertical slice while RED evidence or regression repair remains open for the current slice."
|
|
195
|
+
],
|
|
196
|
+
artifactSections: ["Execution Posture", "RED Evidence", "GREEN Evidence", "Verification Ladder"]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
stage: "review",
|
|
200
|
+
guidance: [
|
|
201
|
+
"Review source-item coverage by vertical slice, not by file count alone.",
|
|
202
|
+
"A slice is review-ready only when RED, GREEN, REFACTOR, and verification evidence all line up."
|
|
203
|
+
],
|
|
204
|
+
artifactSections: ["Completeness Snapshot", "Trace Matrix Check"]
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
id: "superclaude_confidence_gates",
|
|
210
|
+
title: "Confidence Gates",
|
|
211
|
+
intent: "Require source verification before execution and a fresh self-check before completion claims.",
|
|
212
|
+
useWhen: "Stage work could proceed from memory, duplicate an existing implementation, or close with stale evidence.",
|
|
213
|
+
policyNeedles: ["pre-execution confidence", "post-implementation self-check", "source verification"],
|
|
214
|
+
contracts: [
|
|
215
|
+
{
|
|
216
|
+
stage: "design",
|
|
217
|
+
guidance: [
|
|
218
|
+
"Before locking architecture, verify duplicate implementation risk, architecture fit, docs/source truth, and root-cause confidence.",
|
|
219
|
+
"If confidence is low, stop for investigation instead of adding fallback layers."
|
|
220
|
+
],
|
|
221
|
+
artifactSections: ["Codebase Investigation", "Architecture Confidence"]
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
stage: "review",
|
|
225
|
+
guidance: [
|
|
226
|
+
"Review requirements met, assumptions verified, tests passing, and evidence freshness before any PASS verdict.",
|
|
227
|
+
"Separate verified facts from implementer claims."
|
|
228
|
+
],
|
|
229
|
+
artifactSections: ["Review Readiness Snapshot", "Final Verdict"]
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
id: "oh_my_worker_lifecycle",
|
|
235
|
+
title: "Worker Lifecycle Evidence",
|
|
236
|
+
intent: "Make asynchronous or delegated work inspectable through state, dispatch, evidence refs, and stale-worker handling.",
|
|
237
|
+
useWhen: "Stages schedule subagents, role-switch work, or generic dispatch and need auditable completion evidence.",
|
|
238
|
+
policyNeedles: ["dispatch lifecycle", "stale worker", "strict worker JSON schema"],
|
|
239
|
+
contracts: [
|
|
240
|
+
{
|
|
241
|
+
stage: "plan",
|
|
242
|
+
guidance: [
|
|
243
|
+
"Plan only bounded worker packets with clear file ownership, stop conditions, and evidence expectations.",
|
|
244
|
+
"Name any dispatch or concurrency governor before workers start."
|
|
245
|
+
],
|
|
246
|
+
artifactSections: ["Task List", "Dependency Batches", "Execution Posture"]
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
stage: "tdd",
|
|
250
|
+
guidance: [
|
|
251
|
+
"Every scheduled worker needs a terminal return with evidence refs or an explicit blocker route.",
|
|
252
|
+
"A stale worker blocks completion until resolved, failed, or structurally waived."
|
|
253
|
+
],
|
|
254
|
+
artifactSections: ["Execution Posture", "Verification Ladder", "Per-Slice Review"]
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
stage: "review",
|
|
258
|
+
guidance: [
|
|
259
|
+
"Synthesize reviewer returns by status, source tag, evidence refs, and unresolved blockers.",
|
|
260
|
+
"Do not treat missing worker output as a clean review."
|
|
261
|
+
],
|
|
262
|
+
artifactSections: ["Review Evidence Scope", "Review Findings Contract"]
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
id: "gsd_hard_stop_routing",
|
|
268
|
+
title: "Hard-Stop Routing",
|
|
269
|
+
intent: "Advance only when unresolved checkpoints, stale handoffs, and verification debt are cleared or routed explicitly.",
|
|
270
|
+
useWhen: "A stage wants to continue despite missing gates, stale rewind markers, or uncertain next command state.",
|
|
271
|
+
policyNeedles: ["hard-stop next routing", "goal-backward verification", "operator line"],
|
|
272
|
+
contracts: [
|
|
273
|
+
{
|
|
274
|
+
stage: "tdd",
|
|
275
|
+
guidance: [
|
|
276
|
+
"Start from the outcome that must be true, then verify source, tests, artifact wiring, and gate evidence from that goal backward.",
|
|
277
|
+
"If source/test preflight blocks execution, route to the managed blocker taxonomy instead of fabricating RED evidence."
|
|
278
|
+
],
|
|
279
|
+
artifactSections: ["TDD Blocker Taxonomy", "Verification Ladder"]
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
stage: "ship",
|
|
283
|
+
guidance: [
|
|
284
|
+
"Block ship on unresolved checkpoints, stale handoffs, or verification debt.",
|
|
285
|
+
"Report the compact operator line: stage, scope, validation issues, recovery state, and next action."
|
|
286
|
+
],
|
|
287
|
+
artifactSections: ["Preflight Results", "Completion Status", "Handoff"]
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
id: "everyinc_delegation_preflight",
|
|
293
|
+
title: "Delegation Preflight",
|
|
294
|
+
intent: "Use delegation only when support, consent, baseline, non-overlap, batch size, and fallback mode are known.",
|
|
295
|
+
useWhen: "A controller is about to fan out implementation or review work across multiple specialists.",
|
|
296
|
+
policyNeedles: ["delegation preflight", "non-overlapping files", "layered review synthesis"],
|
|
297
|
+
contracts: [
|
|
298
|
+
{
|
|
299
|
+
stage: "plan",
|
|
300
|
+
guidance: [
|
|
301
|
+
"Before parallel writers, verify support, user consent when needed, baseline cleanliness, non-overlapping files, batch size, and fallback mode.",
|
|
302
|
+
"Shared interfaces, migrations, config, and generated surfaces need an integration contract or serial execution."
|
|
303
|
+
],
|
|
304
|
+
artifactSections: ["Dependency Batches", "Execution Posture"]
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
stage: "review",
|
|
308
|
+
guidance: [
|
|
309
|
+
"Dedupe layered reviewer findings with confidence, owner, and verification requirement.",
|
|
310
|
+
"Keep user-facing synthesis separate from raw worker returns."
|
|
311
|
+
],
|
|
312
|
+
artifactSections: ["Layered Review Synthesis", "Review Findings Contract"]
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: "ecc_worktree_control_plane",
|
|
318
|
+
title: "Worktree Control Plane",
|
|
319
|
+
intent: "Treat isolated worker state, handoff files, and orchestration snapshots as recoverable control-plane data rather than chat memory.",
|
|
320
|
+
useWhen: "Parallel or resumable work needs clear seed paths, state files, handoffs, and cleanup visibility.",
|
|
321
|
+
policyNeedles: ["worktree control plane", "handoff files", "orchestration snapshot"],
|
|
322
|
+
contracts: [
|
|
323
|
+
{
|
|
324
|
+
stage: "plan",
|
|
325
|
+
guidance: [
|
|
326
|
+
"Name seed paths, worker handoff expectations, and integration touchpoints before isolated work begins.",
|
|
327
|
+
"Cap ad-hoc teams and require agreement/conflict synthesis for any multi-agent result."
|
|
328
|
+
],
|
|
329
|
+
artifactSections: ["Task List", "Dependency Batches", "Execution Posture"]
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
stage: "ship",
|
|
333
|
+
guidance: [
|
|
334
|
+
"Confirm handoffs, cleanup, and orchestration state are captured before archive or closeout.",
|
|
335
|
+
"Do not rely on chat transcript alone for recoverability."
|
|
336
|
+
],
|
|
337
|
+
artifactSections: ["Handoff", "Completion Status"]
|
|
338
|
+
}
|
|
339
|
+
]
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
id: "walkinglabs_victory_detector",
|
|
343
|
+
title: "Iterate / Victory Detector",
|
|
344
|
+
intent: "Iterate while evidence is missing; stop only when the stage-specific victory detector is satisfied or a real blocker is named.",
|
|
345
|
+
useWhen: "Content-only closeout wording for review and ship readiness.",
|
|
346
|
+
policyNeedles: ["Victory Detector", "iterate until evidence", "fresh evidence"],
|
|
347
|
+
contracts: [
|
|
348
|
+
{
|
|
349
|
+
stage: "review",
|
|
350
|
+
guidance: [
|
|
351
|
+
"Victory Detector: Layer 1, Layer 2, security sweep, structured findings, and trace evidence are complete with no unresolved criticals unless verdict is BLOCKED.",
|
|
352
|
+
"If the detector fails, iterate findings or route back to TDD; do not say LGTM."
|
|
353
|
+
],
|
|
354
|
+
artifactSections: ["Review Readiness Snapshot", "Final Verdict"]
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
stage: "ship",
|
|
358
|
+
guidance: [
|
|
359
|
+
"Victory Detector: valid review verdict, fresh preflight, rollback trigger/steps, selected finalization enum, and execution result are present.",
|
|
360
|
+
"If any detector field is stale or missing, keep status BLOCKED."
|
|
361
|
+
],
|
|
362
|
+
artifactSections: ["Preflight Results", "Rollback Plan", "Finalization", "Completion Status"]
|
|
363
|
+
}
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
];
|
|
367
|
+
export function referencePatternsForStage(stage) {
|
|
368
|
+
return REFERENCE_PATTERNS.filter((pattern) => pattern.contracts.some((contract) => contract.stage === stage));
|
|
369
|
+
}
|
|
370
|
+
export function referencePatternContractsForStage(stage) {
|
|
371
|
+
return REFERENCE_PATTERNS.flatMap((pattern) => pattern.contracts
|
|
372
|
+
.filter((contract) => contract.stage === stage)
|
|
373
|
+
.map((contract) => ({
|
|
374
|
+
...contract,
|
|
375
|
+
guidance: [...contract.guidance],
|
|
376
|
+
artifactSections: [...contract.artifactSections]
|
|
377
|
+
})));
|
|
378
|
+
}
|
|
379
|
+
export function referencePatternPolicyNeedles(stage) {
|
|
380
|
+
const needles = [];
|
|
381
|
+
const seen = new Set();
|
|
382
|
+
for (const pattern of referencePatternsForStage(stage)) {
|
|
383
|
+
for (const needle of pattern.policyNeedles) {
|
|
384
|
+
if (seen.has(needle))
|
|
385
|
+
continue;
|
|
386
|
+
seen.add(needle);
|
|
387
|
+
needles.push(needle);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return needles;
|
|
391
|
+
}
|