cclaw-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +100 -0
  3. package/dist/cli.d.ts +10 -0
  4. package/dist/cli.js +101 -0
  5. package/dist/config.d.ts +5 -0
  6. package/dist/config.js +70 -0
  7. package/dist/constants.d.ts +12 -0
  8. package/dist/constants.js +50 -0
  9. package/dist/content/agents.d.ts +39 -0
  10. package/dist/content/agents.js +244 -0
  11. package/dist/content/autoplan.d.ts +7 -0
  12. package/dist/content/autoplan.js +297 -0
  13. package/dist/content/contracts.d.ts +2 -0
  14. package/dist/content/contracts.js +50 -0
  15. package/dist/content/examples.d.ts +2 -0
  16. package/dist/content/examples.js +327 -0
  17. package/dist/content/hooks.d.ts +16 -0
  18. package/dist/content/hooks.js +753 -0
  19. package/dist/content/learnings.d.ts +5 -0
  20. package/dist/content/learnings.js +265 -0
  21. package/dist/content/meta-skill.d.ts +10 -0
  22. package/dist/content/meta-skill.js +137 -0
  23. package/dist/content/observe.d.ts +21 -0
  24. package/dist/content/observe.js +1110 -0
  25. package/dist/content/session-hooks.d.ts +7 -0
  26. package/dist/content/session-hooks.js +137 -0
  27. package/dist/content/skills.d.ts +3 -0
  28. package/dist/content/skills.js +257 -0
  29. package/dist/content/stage-schema.d.ts +78 -0
  30. package/dist/content/stage-schema.js +1453 -0
  31. package/dist/content/subagents.d.ts +13 -0
  32. package/dist/content/subagents.js +616 -0
  33. package/dist/content/templates.d.ts +3 -0
  34. package/dist/content/templates.js +272 -0
  35. package/dist/content/utility-skills.d.ts +12 -0
  36. package/dist/content/utility-skills.js +467 -0
  37. package/dist/doctor.d.ts +7 -0
  38. package/dist/doctor.js +610 -0
  39. package/dist/flow-state.d.ts +19 -0
  40. package/dist/flow-state.js +41 -0
  41. package/dist/fs-utils.d.ts +5 -0
  42. package/dist/fs-utils.js +28 -0
  43. package/dist/gitignore.d.ts +3 -0
  44. package/dist/gitignore.js +43 -0
  45. package/dist/harness-adapters.d.ts +12 -0
  46. package/dist/harness-adapters.js +175 -0
  47. package/dist/install.d.ts +9 -0
  48. package/dist/install.js +562 -0
  49. package/dist/learnings-summarizer.d.ts +25 -0
  50. package/dist/learnings-summarizer.js +201 -0
  51. package/dist/logger.d.ts +3 -0
  52. package/dist/logger.js +6 -0
  53. package/dist/policy.d.ts +6 -0
  54. package/dist/policy.js +179 -0
  55. package/dist/runs.d.ts +18 -0
  56. package/dist/runs.js +446 -0
  57. package/dist/types.d.ts +19 -0
  58. package/dist/types.js +12 -0
  59. package/package.json +47 -0
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Session guidelines content for Cclaw.
3
+ * Describes recommended behavior at session boundaries.
4
+ * Pure markdown generation — no runtime logic.
5
+ */
6
+ export declare function sessionHooksSkillMarkdown(): string;
7
+ export declare function sessionHooksAgentsMdBlock(): string;
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Session guidelines content for Cclaw.
3
+ * Describes recommended behavior at session boundaries.
4
+ * Pure markdown generation — no runtime logic.
5
+ */
6
+ export function sessionHooksSkillMarkdown() {
7
+ return `---
8
+ name: session
9
+ description: "Session boundary guidelines: what to do when a session starts, ends, or reaches a stop condition."
10
+ ---
11
+
12
+ # Session Guidelines
13
+
14
+ ## Overview
15
+
16
+ This skill defines recommended behavior at **session boundaries** — start, stop, and resume. These guidelines help agents maintain continuity, avoid losing context, and enforce quality gates at natural breakpoints.
17
+
18
+ These are prompt-discipline guidelines that complement the real hooks cclaw generates. The hooks handle automatic context injection at session start/stop; these guidelines cover manual steps the agent should follow.
19
+
20
+ ## HARD-GATE
21
+
22
+ **Never end a session with uncommitted or untested changes.** If you must stop, create a checkpoint first.
23
+
24
+ ## Session Start Protocol
25
+
26
+ When a new session begins in any harness:
27
+
28
+ 1. **Read flow state:** Load \`.cclaw/state/flow-state.json\` to find the current stage and completed stages.
29
+ 2. **Load learnings:** Run \`tail -n 20 .cclaw/learnings.jsonl 2>/dev/null\` and surface the top 3 highest-confidence entries (see learnings skill for dedup/decay).
30
+ 3. **Check for in-progress work:** If the last stage is incomplete, remind the user and offer to resume.
31
+ 4. **Load suggestion memory:** Read \`.cclaw/state/suggestion-memory.json\` and honor \`enabled=false\` opt-out.
32
+ 5. **Read AGENTS.md:** The cclaw block contains routing and rules — follow them.
33
+
34
+ ### What to show the user at session start
35
+
36
+ \`\`\`
37
+ Cclaw flow state: [current stage] ([N] of 9 stages completed)
38
+ Top learnings: [key1] (confidence N), [key2] (confidence N), [key3] (confidence N)
39
+ Next action: /cc-[stage] to continue, or describe what you'd like to do.
40
+ \`\`\`
41
+
42
+ ## Session Stop Protocol
43
+
44
+ Before ending a session or when context is full:
45
+
46
+ 1. **Verify no pending changes:** All modified files must be either committed or explicitly reverted.
47
+ 2. **Update flow state:** Mark the current stage as its actual status (DONE / DONE_WITH_CONCERNS / BLOCKED).
48
+ 3. **Write learnings:** If any insight from this session would save 5+ minutes next time, append to \`.cclaw/learnings.jsonl\`.
49
+ 4. **Create checkpoint:** Write a brief status note to the current artifact or as a comment in flow-state.json.
50
+
51
+ ### Stop conditions (agent must halt and report)
52
+
53
+ - Repeated verification failure (3+ attempts at the same check)
54
+ - Unclear requirements that block progress
55
+ - Security concern discovered that needs human review
56
+ - Context window approaching limit — compact or hand off
57
+
58
+ ## Session Resume Protocol
59
+
60
+ When resuming work after a break:
61
+
62
+ 1. Re-read \`.cclaw/state/flow-state.json\` (may have changed externally).
63
+ 2. Re-read the current stage's artifact to verify it matches your last checkpoint.
64
+ 3. Re-load top learnings.
65
+ 4. Continue from the last incomplete step — do not restart the stage.
66
+
67
+ ## Proactive Suggestion Memory
68
+
69
+ Cclaw can emit short stage-specific reminders at session start to reduce misses.
70
+
71
+ - State file: \`.cclaw/state/suggestion-memory.json\`
72
+ - Default: \`enabled: true\`
73
+ - Persistent opt-out: set \`enabled: false\` and keep the file in repo-local state
74
+ - Optional per-stage mute: add stage names to \`mutedStages\`
75
+
76
+ Example:
77
+
78
+ \`\`\`json
79
+ {
80
+ "enabled": false,
81
+ "mutedStages": ["plan"],
82
+ "lastSuggestedStage": "review",
83
+ "lastSuggestedAt": "2026-04-11T14:30:00Z"
84
+ }
85
+ \`\`\`
86
+
87
+ ## Checkpoint Format
88
+
89
+ When creating a checkpoint at session boundaries:
90
+
91
+ \`\`\`json
92
+ {
93
+ "stage": "build",
94
+ "status": "in_progress",
95
+ "lastCompletedStep": "GREEN for task T2",
96
+ "remainingSteps": ["REFACTOR T2", "RED T3", "GREEN T3", "REFACTOR T3"],
97
+ "blockers": [],
98
+ "timestamp": "2026-04-11T14:30:00Z"
99
+ }
100
+ \`\`\`
101
+
102
+ ## Context Management
103
+
104
+ When approaching context limits:
105
+
106
+ 1. **Prefer subagents** for deep investigation (results return as summary, not full context).
107
+ 2. **Compact strategically** — at logical breakpoints (after a stage completes), not mid-task.
108
+ 3. **Never compact during:** active debugging, mid-refactor, or while holding uncommitted changes.
109
+ 4. **After compaction:** re-read flow state and current artifact before continuing.
110
+
111
+ ## Common Rationalizations
112
+
113
+ | Rationalization | Reality |
114
+ |---|---|
115
+ | "I'll remember where I was" | Context is lost between sessions. Write it down. |
116
+ | "This is almost done, no need for checkpoint" | "Almost done" is the most dangerous state — changes are half-applied. |
117
+ | "The tests will tell me the state" | Tests tell you pass/fail, not intent or remaining work. |
118
+
119
+ ## Red Flags
120
+
121
+ - Ending a session with modified but uncommitted files
122
+ - No flow state update after completing work
123
+ - Restarting a stage from scratch instead of resuming from checkpoint
124
+ - Ignoring learnings from prior sessions
125
+ `;
126
+ }
127
+ export function sessionHooksAgentsMdBlock() {
128
+ return `### Session Guidelines
129
+
130
+ Session boundary behavior (real hooks inject context automatically; guidelines cover manual steps):
131
+ - **Start:** Hooks inject flow state + top learnings. Check for in-progress work, show status.
132
+ - **Stop:** Hooks remind about checkpoint. Verify no pending changes, update flow state, write learnings.
133
+ - **Resume:** Re-read state, verify artifact, re-load learnings, continue from last step.
134
+
135
+ Skill: \`.cclaw/skills/session/SKILL.md\`
136
+ `;
137
+ }
@@ -0,0 +1,3 @@
1
+ import type { FlowStage } from "../types.js";
2
+ export declare function stageSkillFolder(stage: FlowStage): string;
3
+ export declare function stageSkillMarkdown(stage: FlowStage): string;
@@ -0,0 +1,257 @@
1
+ import { stageExamples } from "./examples.js";
2
+ import { selfImprovementBlock } from "./learnings.js";
3
+ import { nextCclawCommand, stageAutoSubagentDispatch, stageSchema } from "./stage-schema.js";
4
+ function artifactFileName(artifactPath) {
5
+ const parts = artifactPath.split("/");
6
+ return parts[parts.length - 1] ?? artifactPath;
7
+ }
8
+ function rationalizationTable(stage) {
9
+ const schema = stageSchema(stage);
10
+ return `| Rationalization | Reality |
11
+ |---|---|
12
+ ${schema.rationalizations.map((e) => `| ${e.claim} | ${e.reality} |`).join("\n")}`;
13
+ }
14
+ function cognitivePatternsList(stage) {
15
+ const schema = stageSchema(stage);
16
+ if (schema.cognitivePatterns.length === 0)
17
+ return "";
18
+ const items = schema.cognitivePatterns
19
+ .map((p, i) => `${i + 1}. **${p.name}** — ${p.description}`)
20
+ .join("\n");
21
+ return `## Cognitive Patterns\n\nThese are thinking instincts, not a checklist. Let them shape your perspective throughout the stage.\n\n${items}\n`;
22
+ }
23
+ function reviewSectionsBlock(stage) {
24
+ const schema = stageSchema(stage);
25
+ if (schema.reviewSections.length === 0)
26
+ return "";
27
+ const sections = schema.reviewSections.map((sec) => {
28
+ const points = sec.evaluationPoints.map((p) => `- ${p}`).join("\n");
29
+ const stop = sec.stopGate
30
+ ? "\n\n**STOP.** For each issue found in this section, present it ONE AT A TIME. Describe the problem concretely, present 2-3 options, state your recommendation, and explain WHY. Only proceed to the next section after ALL issues in this section are resolved."
31
+ : "";
32
+ return `### ${sec.title}\n\nEvaluate:\n${points}${stop}`;
33
+ }).join("\n\n");
34
+ return `## Review Sections\n\n**Anti-skip rule:** Never condense, abbreviate, or skip any review section. If a section genuinely has zero findings, say "No issues found" and move on — but you must evaluate it.\n\n${sections}\n`;
35
+ }
36
+ function crossStageTraceBlock(stage) {
37
+ const trace = stageSchema(stage).crossStageTrace;
38
+ const reads = trace.readsFrom.length > 0
39
+ ? trace.readsFrom.map((r) => `- ${r}`).join("\n")
40
+ : "- (first stage — no upstream artifacts)";
41
+ const writes = trace.writesTo.length > 0
42
+ ? trace.writesTo.map((w) => `- ${w}`).join("\n")
43
+ : "- (final stage — no downstream artifacts)";
44
+ return `## Cross-Stage Traceability\n\n**Reads from:**\n${reads}\n\n**Writes to:**\n${writes}\n\n**Rule:** ${trace.traceabilityRule}\n`;
45
+ }
46
+ function artifactValidationBlock(stage) {
47
+ const validations = stageSchema(stage).artifactValidation;
48
+ if (validations.length === 0)
49
+ return "";
50
+ const rows = validations.map((v) => {
51
+ const req = v.required ? "REQUIRED" : "optional";
52
+ return `| ${v.section} | ${req} | ${v.validationRule} |`;
53
+ }).join("\n");
54
+ return `## Artifact Validation\n\n| Section | Status | Validation Rule |\n|---|---|---|\n${rows}\n`;
55
+ }
56
+ function completionStatusBlock(stage) {
57
+ const statuses = stageSchema(stage).completionStatus;
58
+ const items = statuses.map((s) => `- **${s}**`).join("\n");
59
+ return `## Completion Status\n\nWhen this stage ends, report one of:\n${items}\n`;
60
+ }
61
+ function namedAntiPatternBlock(stage) {
62
+ const nap = stageSchema(stage).namedAntiPattern;
63
+ if (!nap)
64
+ return "";
65
+ return `## Anti-Pattern: "${nap.title}"\n\n${nap.description}\n`;
66
+ }
67
+ function decisionRecordBlock(stage) {
68
+ const fmt = stageSchema(stage).decisionRecordFormat;
69
+ if (!fmt)
70
+ return "";
71
+ return `## Decision Record Template\n\nUse this format for every non-trivial architecture or scope decision made during this stage:\n\n\`\`\`\n${fmt}\n\`\`\`\n`;
72
+ }
73
+ function contextLoadingBlock(stage) {
74
+ const trace = stageSchema(stage).crossStageTrace;
75
+ const readLines = trace.readsFrom.length > 0
76
+ ? trace.readsFrom
77
+ .map((value) => {
78
+ const fileName = artifactFileName(value);
79
+ return `- Canonical: \`.cclaw/runs/<activeRunId>/artifacts/${fileName}\` (fallback: \`${value}\`)`;
80
+ })
81
+ .join("\n")
82
+ : "- (first stage — no upstream artifacts)";
83
+ return `## Context Loading
84
+
85
+ Before starting stage execution:
86
+ 1. Read \`.cclaw/state/flow-state.json\` and capture \`activeRunId\`.
87
+ 2. Resolve canonical run artifact root: \`.cclaw/runs/<activeRunId>/artifacts/\`.
88
+ 3. Load upstream artifacts required by this stage:
89
+ ${readLines}
90
+ 4. If canonical run artifact is missing, fallback to the \`.cclaw/artifacts/\` mirror and record that fallback.
91
+ `;
92
+ }
93
+ function autoSubagentDispatchBlock(stage) {
94
+ const rules = stageAutoSubagentDispatch(stage);
95
+ if (rules.length === 0)
96
+ return "";
97
+ const rows = rules
98
+ .map((rule) => {
99
+ const userGate = rule.requiresUserGate ? "required" : "not required";
100
+ return `| ${rule.agent} | ${rule.mode} | ${rule.when} | ${rule.purpose} | ${userGate} |`;
101
+ })
102
+ .join("\n");
103
+ return `## Automatic Subagent Dispatch
104
+
105
+ Machine-only work should be delegated to specialist agents automatically according to the matrix below.
106
+
107
+ | Agent | Mode | When | Purpose | User Gate |
108
+ |---|---|---|---|---|
109
+ ${rows}
110
+
111
+ **Gate rule:** user interaction is required only for approval/override decisions. Do not ask the user to manually trigger machine-only specialist checks.
112
+ `;
113
+ }
114
+ const VERIFICATION_STAGES = ["build", "review", "ship"];
115
+ function verificationBlock(stage) {
116
+ if (!VERIFICATION_STAGES.includes(stage))
117
+ return "";
118
+ return `## Verification Before Completion
119
+
120
+ **Iron law:** Do not claim this stage is complete without fresh verification evidence from THIS message.
121
+
122
+ ### Gate Function
123
+ For every completion claim, follow this sequence:
124
+ 1. **Identify** the verification command (test suite, build, lint, type-check).
125
+ 2. **Run** the full command — not a subset, not a cached result.
126
+ 3. **Read** the complete output — do not summarize without reading.
127
+ 4. **Verify** the output matches the expected success state.
128
+ 5. **Only then** make the completion claim with the evidence.
129
+
130
+ ### Evidence Requirements
131
+ | Claim | Requires | NOT Sufficient |
132
+ |---|---|---|
133
+ | "Tests pass" | Fresh test run output showing all pass | "I believe tests pass" or prior run |
134
+ | "Build succeeds" | Fresh build output with exit code 0 | "Should build fine" |
135
+ | "No lint errors" | Fresh linter output | "I didn't introduce any" |
136
+ | "Bug is fixed" | Regression test: remove fix → fails, restore → passes | "The fix looks correct" |
137
+
138
+ ### Forbidden Language
139
+ Do not use these phrases before verification:
140
+ - "Everything works," "All good," "Done," "Successfully completed"
141
+ - "Should be fine," "I'm confident that," "This will work"
142
+ - "Tests should pass," "The build should succeed"
143
+
144
+ ### Regression Test Pattern
145
+ When fixing a bug:
146
+ 1. Write a test that reproduces the bug → verify it **fails**.
147
+ 2. Apply the fix → verify the test **passes**.
148
+ 3. Revert the fix → verify the test **fails again**.
149
+ 4. Restore the fix → verify the full suite passes.
150
+ `;
151
+ }
152
+ export function stageSkillFolder(stage) {
153
+ return stageSchema(stage).skillFolder;
154
+ }
155
+ function quickStartBlock(stage) {
156
+ const schema = stageSchema(stage);
157
+ const nextCommand = nextCclawCommand(stage);
158
+ const topGates = schema.requiredGates.slice(0, 3).map((g) => `\`${g.id}\``).join(", ");
159
+ return `## Quick Start (minimum compliance)
160
+
161
+ > **Even if you read nothing else, do these 3 things:**
162
+ > 1. Obey the HARD-GATE below — violating it invalidates the entire stage.
163
+ > 2. Complete every checklist step in order and write the artifact to \`.cclaw/artifacts/${schema.artifactFile}\` (canonical run copy: \`.cclaw/runs/<activeRunId>/artifacts/${schema.artifactFile}\`).
164
+ > 3. Do not claim completion without satisfying gates: ${topGates}${schema.requiredGates.length > 3 ? ` (+${schema.requiredGates.length - 3} more)` : ""}.
165
+ >
166
+ > **Next command after this stage:** ${nextCommand}
167
+ `;
168
+ }
169
+ export function stageSkillMarkdown(stage) {
170
+ const schema = stageSchema(stage);
171
+ const nextCommand = nextCclawCommand(stage);
172
+ const gateList = schema.requiredGates
173
+ .map((g) => `- \`${g.id}\` — ${g.description}`)
174
+ .join("\n");
175
+ const evidenceList = schema.requiredEvidence
176
+ .map((e) => `- [ ] ${e}`)
177
+ .join("\n");
178
+ const checklistItems = schema.checklist
179
+ .map((item, i) => `${i + 1}. ${item}`)
180
+ .join("\n");
181
+ return `---
182
+ name: ${schema.skillName}
183
+ description: "${schema.skillDescription}"
184
+ ---
185
+
186
+ # ${schema.skillName}
187
+
188
+ ${quickStartBlock(stage)}
189
+ ## Overview
190
+ ${schema.purpose}
191
+
192
+ ## When to Use
193
+ ${schema.whenToUse.map((item) => `- ${item}`).join("\n")}
194
+
195
+ ## Inputs
196
+ ${schema.inputs.length > 0 ? schema.inputs.map((item) => `- ${item}`).join("\n") : "- (first stage — no required inputs)"}
197
+
198
+ ## Required Context
199
+ ${schema.requiredContext.length > 0 ? schema.requiredContext.map((item) => `- ${item}`).join("\n") : "- None beyond this skill"}
200
+
201
+ ${contextLoadingBlock(stage)}
202
+ ${autoSubagentDispatchBlock(stage)}
203
+ ## Outputs
204
+ ${schema.outputs.map((item) => `- ${item}`).join("\n")}
205
+
206
+ ## HARD-GATE
207
+ ${schema.hardGate}
208
+
209
+ ## Checklist
210
+
211
+ You MUST complete these steps in order:
212
+
213
+ ${checklistItems}
214
+
215
+ ${stageExamples(stage)}
216
+ ${namedAntiPatternBlock(stage)}
217
+ ${cognitivePatternsList(stage)}
218
+ ## Interaction Protocol
219
+ ${schema.interactionProtocol.map((item, i) => `${i + 1}. ${item}`).join("\n")}
220
+
221
+ ## Required Gates
222
+ ${gateList}
223
+
224
+ ## Required Evidence
225
+ ${evidenceList}
226
+
227
+ ## Process
228
+ ${schema.process.map((item, i) => `${i + 1}. ${item}`).join("\n")}
229
+
230
+ ${reviewSectionsBlock(stage)}
231
+ ${verificationBlock(stage)}
232
+ ${crossStageTraceBlock(stage)}
233
+ ${artifactValidationBlock(stage)}
234
+ ${decisionRecordBlock(stage)}
235
+ ## Common Rationalizations
236
+ ${rationalizationTable(stage)}
237
+
238
+ ## Blockers
239
+ ${schema.blockers.length > 0 ? schema.blockers.map((item) => `- ${item}`).join("\n") : "- None — stage can always proceed"}
240
+
241
+ ## Anti-Patterns
242
+ ${schema.antiPatterns.map((item) => `- ${item}`).join("\n")}
243
+
244
+ ## Red Flags
245
+ ${schema.redFlags.map((item) => `- ${item}`).join("\n")}
246
+
247
+ ${completionStatusBlock(stage)}
248
+ ## Verification
249
+ ${schema.exitCriteria.map((item) => `- [ ] ${item}`).join("\n")}
250
+
251
+ ${selfImprovementBlock(stage)}
252
+ ## Handoff
253
+ - Next command: ${nextCommand}
254
+ - Required artifact: \`.cclaw/artifacts/${schema.artifactFile}\` (canonical: \`.cclaw/runs/<activeRunId>/artifacts/${schema.artifactFile}\`)
255
+ - Stage stays blocked if any required gate is unsatisfied
256
+ `;
257
+ }
@@ -0,0 +1,78 @@
1
+ import type { FlowStage, TransitionRule } from "../types.js";
2
+ export interface StageGate {
3
+ id: string;
4
+ description: string;
5
+ }
6
+ export interface StageRationalization {
7
+ claim: string;
8
+ reality: string;
9
+ }
10
+ export interface CognitivePattern {
11
+ name: string;
12
+ description: string;
13
+ }
14
+ export interface ReviewSection {
15
+ title: string;
16
+ evaluationPoints: string[];
17
+ stopGate: boolean;
18
+ }
19
+ export interface CrossStageTrace {
20
+ readsFrom: string[];
21
+ writesTo: string[];
22
+ traceabilityRule: string;
23
+ }
24
+ export interface ArtifactValidation {
25
+ section: string;
26
+ required: boolean;
27
+ validationRule: string;
28
+ }
29
+ export interface StageAutoSubagentDispatch {
30
+ agent: "planner" | "spec-reviewer" | "code-reviewer" | "security-reviewer" | "test-author" | "doc-updater";
31
+ mode: "mandatory" | "proactive";
32
+ when: string;
33
+ purpose: string;
34
+ requiresUserGate: boolean;
35
+ }
36
+ export interface NamedAntiPattern {
37
+ title: string;
38
+ description: string;
39
+ }
40
+ export interface StageSchema {
41
+ stage: FlowStage;
42
+ skillFolder: string;
43
+ skillName: string;
44
+ skillDescription: string;
45
+ hardGate: string;
46
+ purpose: string;
47
+ whenToUse: string[];
48
+ interactionProtocol: string[];
49
+ process: string[];
50
+ requiredGates: StageGate[];
51
+ requiredEvidence: string[];
52
+ inputs: string[];
53
+ requiredContext: string[];
54
+ outputs: string[];
55
+ blockers: string[];
56
+ exitCriteria: string[];
57
+ antiPatterns: string[];
58
+ rationalizations: StageRationalization[];
59
+ redFlags: string[];
60
+ policyNeedles: string[];
61
+ artifactFile: string;
62
+ next: FlowStage | "done";
63
+ checklist: string[];
64
+ cognitivePatterns: CognitivePattern[];
65
+ reviewSections: ReviewSection[];
66
+ completionStatus: string[];
67
+ crossStageTrace: CrossStageTrace;
68
+ artifactValidation: ArtifactValidation[];
69
+ namedAntiPattern?: NamedAntiPattern;
70
+ decisionRecordFormat?: string;
71
+ }
72
+ export declare function stageSchema(stage: FlowStage): StageSchema;
73
+ export declare function orderedStageSchemas(): StageSchema[];
74
+ export declare function stageGateIds(stage: FlowStage): string[];
75
+ export declare function nextCclawCommand(stage: FlowStage): string;
76
+ export declare function buildTransitionRules(): TransitionRule[];
77
+ export declare function stagePolicyNeedles(stage: FlowStage): string[];
78
+ export declare function stageAutoSubagentDispatch(stage: FlowStage): StageAutoSubagentDispatch[];