cclaw-cli 0.49.0 → 0.51.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.
- package/README.md +54 -82
- package/dist/artifact-linter.d.ts +4 -0
- package/dist/artifact-linter.js +24 -3
- package/dist/cli.d.ts +1 -19
- package/dist/cli.js +49 -491
- package/dist/constants.d.ts +2 -13
- package/dist/constants.js +1 -43
- package/dist/content/closeout-guidance.d.ts +14 -0
- package/dist/content/closeout-guidance.js +42 -0
- package/dist/content/core-agents.js +51 -9
- package/dist/content/decision-protocol.d.ts +12 -0
- package/dist/content/decision-protocol.js +20 -0
- package/dist/content/diff-command.d.ts +1 -2
- package/dist/content/diff-command.js +8 -94
- package/dist/content/examples.d.ts +4 -10
- package/dist/content/examples.js +10 -20
- package/dist/content/hook-events.js +2 -2
- package/dist/content/hook-inline-snippets.d.ts +5 -2
- package/dist/content/hook-inline-snippets.js +33 -1
- package/dist/content/hook-manifest.d.ts +3 -4
- package/dist/content/hook-manifest.js +11 -12
- package/dist/content/hooks.js +2 -0
- package/dist/content/ideate-command.d.ts +2 -0
- package/dist/content/ideate-command.js +31 -25
- package/dist/content/iron-laws.d.ts +5 -5
- package/dist/content/iron-laws.js +5 -5
- package/dist/content/learnings.d.ts +3 -4
- package/dist/content/learnings.js +24 -50
- package/dist/content/meta-skill.js +31 -21
- package/dist/content/next-command.js +38 -38
- package/dist/content/node-hooks.js +17 -343
- package/dist/content/opencode-plugin.js +2 -100
- package/dist/content/research-playbooks.js +14 -14
- package/dist/content/review-loop.d.ts +2 -0
- package/dist/content/review-loop.js +8 -0
- package/dist/content/session-hooks.js +14 -46
- package/dist/content/skills.d.ts +0 -5
- package/dist/content/skills.js +53 -128
- package/dist/content/stage-common-guidance.d.ts +0 -1
- package/dist/content/stage-common-guidance.js +15 -14
- package/dist/content/stage-schema.d.ts +26 -1
- package/dist/content/stage-schema.js +121 -40
- package/dist/content/stages/_lint-metadata/index.js +9 -15
- package/dist/content/stages/brainstorm.js +22 -43
- package/dist/content/stages/design.js +37 -57
- package/dist/content/stages/plan.js +22 -13
- package/dist/content/stages/review.js +24 -27
- package/dist/content/stages/scope.js +34 -46
- package/dist/content/stages/ship.js +7 -4
- package/dist/content/stages/spec.js +20 -9
- package/dist/content/stages/tdd.js +64 -44
- package/dist/content/start-command.js +10 -12
- package/dist/content/status-command.d.ts +2 -7
- package/dist/content/status-command.js +19 -146
- package/dist/content/subagents.d.ts +0 -5
- package/dist/content/subagents.js +47 -28
- package/dist/content/templates.d.ts +1 -1
- package/dist/content/templates.js +126 -135
- package/dist/content/track-render-context.d.ts +17 -0
- package/dist/content/track-render-context.js +44 -0
- package/dist/content/tree-command.d.ts +1 -2
- package/dist/content/tree-command.js +4 -87
- package/dist/content/utility-skills.d.ts +2 -29
- package/dist/content/utility-skills.js +2 -1534
- package/dist/content/view-command.js +29 -11
- package/dist/delegation.d.ts +1 -1
- package/dist/delegation.js +5 -15
- package/dist/doctor-registry.js +20 -21
- package/dist/doctor.js +88 -344
- package/dist/flow-state.d.ts +3 -0
- package/dist/flow-state.js +2 -0
- package/dist/harness-adapters.d.ts +1 -1
- package/dist/harness-adapters.js +48 -57
- package/dist/install.js +128 -358
- package/dist/internal/advance-stage.js +3 -9
- package/dist/internal/compound-readiness.d.ts +1 -1
- package/dist/internal/compound-readiness.js +1 -1
- package/dist/internal/tdd-loop-status.d.ts +1 -1
- package/dist/internal/tdd-loop-status.js +1 -1
- package/dist/knowledge-store.d.ts +16 -10
- package/dist/knowledge-store.js +51 -15
- package/dist/policy.js +16 -105
- package/dist/run-archive.d.ts +4 -6
- package/dist/run-archive.js +15 -20
- package/dist/run-persistence.d.ts +2 -2
- package/dist/run-persistence.js +3 -9
- package/package.json +1 -2
- package/dist/content/archive-command.d.ts +0 -2
- package/dist/content/archive-command.js +0 -124
- package/dist/content/compound-command.d.ts +0 -5
- package/dist/content/compound-command.js +0 -193
- package/dist/content/contexts.d.ts +0 -18
- package/dist/content/contexts.js +0 -24
- package/dist/content/contracts.d.ts +0 -2
- package/dist/content/contracts.js +0 -51
- package/dist/content/doctor-references.d.ts +0 -2
- package/dist/content/doctor-references.js +0 -150
- package/dist/content/eval-scaffold.d.ts +0 -15
- package/dist/content/eval-scaffold.js +0 -370
- package/dist/content/feature-command.d.ts +0 -2
- package/dist/content/feature-command.js +0 -123
- package/dist/content/flow-map.d.ts +0 -23
- package/dist/content/flow-map.js +0 -134
- package/dist/content/harness-doc.d.ts +0 -2
- package/dist/content/harness-doc.js +0 -202
- package/dist/content/harness-playbooks.d.ts +0 -24
- package/dist/content/harness-playbooks.js +0 -393
- package/dist/content/harness-tool-refs.d.ts +0 -20
- package/dist/content/harness-tool-refs.js +0 -268
- package/dist/content/ops-command.d.ts +0 -2
- package/dist/content/ops-command.js +0 -71
- package/dist/content/protocols.d.ts +0 -7
- package/dist/content/protocols.js +0 -215
- package/dist/content/retro-command.d.ts +0 -2
- package/dist/content/retro-command.js +0 -165
- package/dist/content/rewind-command.d.ts +0 -2
- package/dist/content/rewind-command.js +0 -106
- package/dist/content/tdd-log-command.d.ts +0 -2
- package/dist/content/tdd-log-command.js +0 -85
- package/dist/eval/agents/single-shot.d.ts +0 -27
- package/dist/eval/agents/single-shot.js +0 -79
- package/dist/eval/agents/with-tools.d.ts +0 -44
- package/dist/eval/agents/with-tools.js +0 -261
- package/dist/eval/agents/workflow.d.ts +0 -31
- package/dist/eval/agents/workflow.js +0 -155
- package/dist/eval/baseline.d.ts +0 -38
- package/dist/eval/baseline.js +0 -282
- package/dist/eval/config-loader.d.ts +0 -14
- package/dist/eval/config-loader.js +0 -395
- package/dist/eval/corpus.d.ts +0 -30
- package/dist/eval/corpus.js +0 -330
- package/dist/eval/cost-guard.d.ts +0 -102
- package/dist/eval/cost-guard.js +0 -190
- package/dist/eval/diff.d.ts +0 -64
- package/dist/eval/diff.js +0 -323
- package/dist/eval/llm-client.d.ts +0 -176
- package/dist/eval/llm-client.js +0 -267
- package/dist/eval/mode.d.ts +0 -28
- package/dist/eval/mode.js +0 -61
- package/dist/eval/progress.d.ts +0 -83
- package/dist/eval/progress.js +0 -59
- package/dist/eval/report.d.ts +0 -11
- package/dist/eval/report.js +0 -181
- package/dist/eval/rubric-loader.d.ts +0 -20
- package/dist/eval/rubric-loader.js +0 -143
- package/dist/eval/runner.d.ts +0 -81
- package/dist/eval/runner.js +0 -746
- package/dist/eval/runs.d.ts +0 -41
- package/dist/eval/runs.js +0 -114
- package/dist/eval/sandbox.d.ts +0 -38
- package/dist/eval/sandbox.js +0 -137
- package/dist/eval/tools/glob.d.ts +0 -2
- package/dist/eval/tools/glob.js +0 -163
- package/dist/eval/tools/grep.d.ts +0 -2
- package/dist/eval/tools/grep.js +0 -152
- package/dist/eval/tools/index.d.ts +0 -7
- package/dist/eval/tools/index.js +0 -35
- package/dist/eval/tools/read.d.ts +0 -2
- package/dist/eval/tools/read.js +0 -122
- package/dist/eval/tools/types.d.ts +0 -49
- package/dist/eval/tools/types.js +0 -41
- package/dist/eval/tools/write.d.ts +0 -2
- package/dist/eval/tools/write.js +0 -92
- package/dist/eval/types.d.ts +0 -561
- package/dist/eval/types.js +0 -47
- package/dist/eval/verifiers/judge.d.ts +0 -40
- package/dist/eval/verifiers/judge.js +0 -256
- package/dist/eval/verifiers/rules.d.ts +0 -24
- package/dist/eval/verifiers/rules.js +0 -218
- package/dist/eval/verifiers/structural.d.ts +0 -14
- package/dist/eval/verifiers/structural.js +0 -171
- package/dist/eval/verifiers/traceability.d.ts +0 -23
- package/dist/eval/verifiers/traceability.js +0 -84
- package/dist/eval/verifiers/workflow-consistency.d.ts +0 -21
- package/dist/eval/verifiers/workflow-consistency.js +0 -225
- package/dist/eval/workflow-corpus.d.ts +0 -7
- package/dist/eval/workflow-corpus.js +0 -207
- package/dist/feature-system.d.ts +0 -42
- package/dist/feature-system.js +0 -432
- package/dist/internal/knowledge-digest.d.ts +0 -7
- package/dist/internal/knowledge-digest.js +0 -93
|
@@ -38,10 +38,11 @@ Reuse prior project knowledge before choosing a direction.
|
|
|
38
38
|
|
|
39
39
|
## Steps
|
|
40
40
|
|
|
41
|
-
1.
|
|
42
|
-
2.
|
|
43
|
-
3.
|
|
44
|
-
4.
|
|
41
|
+
1. Use the session-injected knowledge digest first.
|
|
42
|
+
2. Read \`.cclaw/knowledge.jsonl\` only if the digest is missing or too thin.
|
|
43
|
+
3. Match by stage/domain keywords from the current task.
|
|
44
|
+
4. Rank matches by confidence and recency.
|
|
45
|
+
5. Return the top entries verbatim.
|
|
45
46
|
|
|
46
47
|
## Output Contract
|
|
47
48
|
|
|
@@ -107,18 +108,17 @@ Summarize citable domain practices for a narrow design decision.
|
|
|
107
108
|
|
|
108
109
|
## Purpose
|
|
109
110
|
|
|
110
|
-
Run a
|
|
111
|
+
Run a tiered investigation before design lock so architecture choices are grounded
|
|
111
112
|
in current ecosystem data, not intuition.
|
|
112
113
|
|
|
113
|
-
## Dispatch Lenses (
|
|
114
|
+
## Dispatch Lenses (tiered)
|
|
114
115
|
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
Choose the smallest tier that matches the change; use parallel threads only when the
|
|
117
|
+
harness supports it and the lenses are independent:
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
4. **pitfalls-researcher** — known failure modes, CVEs, and operational traps.
|
|
119
|
+
- **Lightweight:** pitfalls-researcher only — known failure modes, CVEs, and operational traps.
|
|
120
|
+
- **Standard:** architecture-researcher + pitfalls-researcher.
|
|
121
|
+
- **Deep:** stack-researcher + features-researcher + architecture-researcher + pitfalls-researcher.
|
|
122
122
|
|
|
123
123
|
## Output Contract
|
|
124
124
|
|
|
@@ -130,8 +130,8 @@ Write findings to \`.cclaw/artifacts/02a-research.md\` with these sections:
|
|
|
130
130
|
- \`## Pitfalls & Risks\`
|
|
131
131
|
- \`## Synthesis\`
|
|
132
132
|
|
|
133
|
-
Each section must contain concrete notes and at least one evidence reference
|
|
134
|
-
(source URL, file path, or command output anchor).
|
|
133
|
+
Each section that was run must contain concrete notes and at least one evidence reference
|
|
134
|
+
(source URL, file path, or command output anchor). Sections skipped by tier should say \`Not run for this tier\`.
|
|
135
135
|
|
|
136
136
|
## Guardrails
|
|
137
137
|
|
|
@@ -100,6 +100,8 @@ export interface RunReviewLoopOptions {
|
|
|
100
100
|
shouldOptOut?: () => boolean;
|
|
101
101
|
emitEnvelope?: (envelope: ReviewLoopEnvelope) => void;
|
|
102
102
|
}
|
|
103
|
+
export declare function reviewLoopPolicySummary(stage: ReviewLoopStage): string;
|
|
104
|
+
export declare function reviewLoopSecondOpinionSummary(stage: ReviewLoopStage): string;
|
|
103
105
|
export declare const REVIEW_LOOP_CHECKLISTS: {
|
|
104
106
|
readonly scope: readonly [{
|
|
105
107
|
readonly id: "premise_fit";
|
|
@@ -22,6 +22,14 @@ const REVIEW_LOOP_RESPONSE_SCHEMA = `{
|
|
|
22
22
|
}
|
|
23
23
|
]
|
|
24
24
|
}`;
|
|
25
|
+
export function reviewLoopPolicySummary(stage) {
|
|
26
|
+
const checklist = REVIEW_LOOP_CHECKLISTS[stage];
|
|
27
|
+
const ids = checklist.map((dimension) => `\`${dimension.id}\``).join(", ");
|
|
28
|
+
return `outside-voice review loop policy: use checklist dimensions ${ids}; stop at quality score >= ${REVIEW_LOOP_DEFAULT_TARGET_SCORE} or max ${REVIEW_LOOP_DEFAULT_MAX_ITERATIONS} iterations.`;
|
|
29
|
+
}
|
|
30
|
+
export function reviewLoopSecondOpinionSummary(stage) {
|
|
31
|
+
return `when \`.cclaw/config.yaml::reviewLoop.externalSecondOpinion.enabled\` is true, run an extra external-model pass for ${stage} and explicitly reconcile score/finding disagreements.`;
|
|
32
|
+
}
|
|
25
33
|
export const REVIEW_LOOP_CHECKLISTS = {
|
|
26
34
|
scope: [
|
|
27
35
|
{
|
|
@@ -19,25 +19,24 @@ These are prompt-discipline guidelines that complement the real hooks cclaw gene
|
|
|
19
19
|
|
|
20
20
|
## HARD-GATE
|
|
21
21
|
|
|
22
|
-
**Never end a session with uncommitted or untested changes.** If you must stop,
|
|
22
|
+
**Never end a session with uncommitted or untested changes.** If you must stop, leave a short handoff in the current artifact or commit message.
|
|
23
23
|
|
|
24
24
|
## Session Start Protocol
|
|
25
25
|
|
|
26
26
|
When a new session begins in any harness:
|
|
27
27
|
|
|
28
28
|
1. **Read flow state:** Load \`.cclaw/state/flow-state.json\` to find the current stage and completed stages.
|
|
29
|
-
2. **Load knowledge:**
|
|
29
|
+
2. **Load knowledge:** Use the session-injected knowledge digest first; stream \`.cclaw/knowledge.jsonl\` only when the digest is missing or insufficient.
|
|
30
30
|
3. **Check for in-progress work:** If the last stage is incomplete, remind the user and offer to resume.
|
|
31
|
-
4. **Load
|
|
32
|
-
5. **
|
|
33
|
-
6. **Read AGENTS.md:** The cclaw block contains routing and rules — follow them.
|
|
31
|
+
4. **Load iron laws:** Read \`.cclaw/state/iron-laws.json\` to know which laws are strict in this repo.
|
|
32
|
+
5. **Read AGENTS.md:** The cclaw block contains routing and rules — follow them.
|
|
34
33
|
|
|
35
34
|
### What to show the user at session start
|
|
36
35
|
|
|
37
36
|
\`\`\`
|
|
38
37
|
Cclaw flow state: [current stage] ([N] of 8 stages completed)
|
|
39
38
|
Knowledge highlights: [rule/pattern 1], [rule/pattern 2], [rule/pattern 3]
|
|
40
|
-
Next action: /cc-
|
|
39
|
+
Next action: /cc-next to continue, /cc to start new work, or describe what you'd like to do.
|
|
41
40
|
\`\`\`
|
|
42
41
|
|
|
43
42
|
## Session Stop Protocol
|
|
@@ -47,7 +46,7 @@ Before ending a session or when context is full:
|
|
|
47
46
|
1. **Verify no pending changes:** All modified files must be either committed or explicitly reverted.
|
|
48
47
|
2. **Update flow state:** Mark the current stage as its actual status (DONE / DONE_WITH_CONCERNS / BLOCKED).
|
|
49
48
|
3. **Write knowledge:** If any non-obvious reusable insight appears, append one strict-schema JSON line to \`.cclaw/knowledge.jsonl\` with type \`rule\`, \`pattern\`, \`lesson\`, or \`compound\`.
|
|
50
|
-
4. **
|
|
49
|
+
4. **Leave handoff context:** Put blockers and remaining work in the current stage artifact, not a separate state file.
|
|
51
50
|
|
|
52
51
|
### Stop conditions (agent must halt and report)
|
|
53
52
|
|
|
@@ -61,44 +60,13 @@ Before ending a session or when context is full:
|
|
|
61
60
|
When resuming work after a break:
|
|
62
61
|
|
|
63
62
|
1. Re-read \`.cclaw/state/flow-state.json\` (may have changed externally).
|
|
64
|
-
2. Re-read the current stage's artifact to verify it matches
|
|
65
|
-
3. Re-load
|
|
63
|
+
2. Re-read the current stage's artifact to verify it matches the last handoff.
|
|
64
|
+
3. Re-load the knowledge digest first, then scan \`.cclaw/knowledge.jsonl\` only if the digest lacks enough evidence.
|
|
66
65
|
4. Continue from the last incomplete step — do not restart the stage.
|
|
67
66
|
|
|
68
|
-
|
|
67
|
+
### Optional session-history scan for compound
|
|
69
68
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
- State file: \`.cclaw/state/suggestion-memory.json\`
|
|
73
|
-
- Default: \`enabled: true\`
|
|
74
|
-
- Persistent opt-out: set \`enabled: false\` and keep the file in repo-local state
|
|
75
|
-
- Optional per-stage mute: add stage names to \`mutedStages\`
|
|
76
|
-
|
|
77
|
-
Example:
|
|
78
|
-
|
|
79
|
-
\`\`\`json
|
|
80
|
-
{
|
|
81
|
-
"enabled": false,
|
|
82
|
-
"mutedStages": ["plan"],
|
|
83
|
-
"lastSuggestedStage": "review",
|
|
84
|
-
"lastSuggestedAt": "2026-04-11T14:30:00Z"
|
|
85
|
-
}
|
|
86
|
-
\`\`\`
|
|
87
|
-
|
|
88
|
-
## Checkpoint Format
|
|
89
|
-
|
|
90
|
-
When creating a checkpoint at session boundaries:
|
|
91
|
-
|
|
92
|
-
\`\`\`json
|
|
93
|
-
{
|
|
94
|
-
"stage": "tdd",
|
|
95
|
-
"status": "in_progress",
|
|
96
|
-
"lastCompletedStep": "GREEN for task T2",
|
|
97
|
-
"remainingSteps": ["REFACTOR T2", "RED T3", "GREEN T3", "REFACTOR T3"],
|
|
98
|
-
"blockers": [],
|
|
99
|
-
"timestamp": "2026-04-11T14:30:00Z"
|
|
100
|
-
}
|
|
101
|
-
\`\`\`
|
|
69
|
+
During post-ship \`compound_review\`, ask before scanning external session history. If the user opts in, inspect only relevant Cursor/Claude/Codex transcripts for repeated failures or process lessons, summarize matches, and then apply the same overlap/refresh/supersede rules before touching \`.cclaw/knowledge.jsonl\`.
|
|
102
70
|
|
|
103
71
|
## Context Management
|
|
104
72
|
|
|
@@ -114,14 +82,14 @@ When approaching context limits:
|
|
|
114
82
|
| Rationalization | Reality |
|
|
115
83
|
|---|---|
|
|
116
84
|
| "I'll remember where I was" | Context is lost between sessions. Write it down. |
|
|
117
|
-
| "This is almost done, no need for
|
|
85
|
+
| "This is almost done, no need for handoff" | "Almost done" is the most dangerous state — changes are half-applied. |
|
|
118
86
|
| "The tests will tell me the state" | Tests tell you pass/fail, not intent or remaining work. |
|
|
119
87
|
|
|
120
88
|
## Red Flags
|
|
121
89
|
|
|
122
90
|
- Ending a session with modified but uncommitted files
|
|
123
91
|
- No flow state update after completing work
|
|
124
|
-
- Restarting a stage from scratch instead of resuming from
|
|
92
|
+
- Restarting a stage from scratch instead of resuming from artifact context
|
|
125
93
|
- Ignoring knowledge from prior sessions
|
|
126
94
|
`;
|
|
127
95
|
}
|
|
@@ -130,8 +98,8 @@ export function sessionHooksAgentsMdBlock() {
|
|
|
130
98
|
|
|
131
99
|
Session boundary behavior (real hooks inject context automatically; guidelines cover manual steps):
|
|
132
100
|
- **Start:** Hooks inject flow state + knowledge snapshot. Check for in-progress work, show status.
|
|
133
|
-
- **Stop:** Hooks remind about
|
|
134
|
-
- **Resume:** Re-read state, verify artifact, re-load knowledge, continue from last step.
|
|
101
|
+
- **Stop:** Hooks remind about handoff. Verify no pending changes, update flow state, append useful knowledge after overlap check.
|
|
102
|
+
- **Resume:** Re-read state, verify artifact, re-load knowledge, continue from last step. For compound closeout, optional session-history scans require user opt-in.
|
|
135
103
|
|
|
136
104
|
Skill: \`.cclaw/skills/session/SKILL.md\`
|
|
137
105
|
Policy: \`.cclaw/skills/iron-laws/SKILL.md\`
|
package/dist/content/skills.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import type { FlowStage, FlowTrack } from "../types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Long-form Batch Execution walkthrough. Rendered once into
|
|
4
|
-
* \`.cclaw/references/stages/tdd-batch-walkthrough.md\` by the installer.
|
|
5
|
-
*/
|
|
6
|
-
export declare const TDD_BATCH_WALKTHROUGH_MARKDOWN = "# TDD \u2014 Batch Execution Walkthrough\n\nDetailed RED / GREEN / REFACTOR transcript for a 3-task batch. Illustrative\nonly \u2014 do not copy the command names blindly, match them to your stack.\n\n## Batch 1 example tasks\n\n| Task ID | Description | AC | Verification |\n|---|---|---|---|\n| T-1 `[~3m]` | Add `User.emailNormalized` column | AC-1 | `npm test -- users/schema` |\n| T-2 `[~4m]` | Normalize on write in `UserRepo.save` | AC-1 | `npm test -- users/repo` |\n| T-3 `[~3m]` | Reject duplicates in `UserService.signup` | AC-2 | `npm test -- users/service` |\n\n## Execution transcript\n\n### T-1 \u2014 RED\n\n> Run: `npm test -- users/schema` \u2192 **FAIL** (missing column: `emailNormalized`). Captured the failure stack as RED evidence. No production code touched yet.\n\n### T-1 \u2014 GREEN\n\n> Added the column in the schema module. Re-ran `npm test -- users/schema` \u2192 **PASS**. Ran the full suite `npm test` \u2192 **PASS**. Captured both outputs as GREEN evidence.\n\n### T-1 \u2014 REFACTOR\n\n> Extracted the column definition into a shared `NormalizedEmail` type used by T-2/T-3. Re-ran `npm test` \u2192 **PASS**. Captured REFACTOR note: \"Extracted NormalizedEmail type to keep T-2/T-3 DRY; zero behavior change, all tests still green.\"\n\n### T-2 \u2014 RED / GREEN / REFACTOR\n\nWrite the repo test that expects normalised writes, watch it fail (RED), implement normalisation inside `UserRepo.save` only (GREEN), then refactor the normaliser out of the repo into a helper shared with T-3 (REFACTOR).\n\n### T-3 \u2014 RED / GREEN / REFACTOR\n\nWrite the service-level duplicate test that expects a rejection, watch it fail (RED), add the duplicate check in `UserService.signup` (GREEN), refactor the error message into a named constant (REFACTOR).\n\n## Batch gate check\n\nAfter T-3 REFACTOR, before declaring Batch 1 done:\n\n1. Run the full suite (`npm test`) one final time \u2192 **PASS** captured as batch-exit evidence.\n2. Verify the TDD artifact contains RED, GREEN, and REFACTOR evidence for T-1, T-2, **and** T-3. No partial batches.\n3. Only now mark Batch 1 complete. Batch 2 cannot start until this step.\n\n## When to stop mid-batch (do NOT push through)\n\n- A RED test fails for a reason you did not predict (e.g. an unrelated flaky test) \u2192 **pause**, diagnose, log an operational-self-improvement entry, and decide with the user before proceeding.\n- A GREEN step would require touching code outside the task's acceptance criterion \u2192 **pause**, the task is scoped wrong; adjust the plan or open a follow-up task.\n- The same RED failure reappears after a GREEN change \u2192 **escalate** per the 3-attempts rule; do not keep patching.\n";
|
|
7
2
|
export declare function stageSkillFolder(stage: FlowStage): string;
|
|
8
3
|
export declare function stageSkillMarkdown(stage: FlowStage, track?: FlowTrack): string;
|
package/dist/content/skills.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { RUNTIME_ROOT, STAGE_TO_SKILL_FOLDER } from "../constants.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { stageAutoSubagentDispatch, stageSchema } from "./stage-schema.js";
|
|
2
|
+
import { stageExamples } from "./examples.js";
|
|
3
|
+
import { reviewStackAwareRoutes, reviewStackAwareRoutingSummary, stageAutoSubagentDispatch, stageSchema, stageTrackRenderContext } from "./stage-schema.js";
|
|
5
4
|
const VERIFICATION_STAGES = ["tdd", "review", "ship"];
|
|
6
|
-
const DECISION_PROTOCOL_PATH = `${RUNTIME_ROOT}/references/protocols/decision.md`;
|
|
7
|
-
const COMPLETION_PROTOCOL_PATH = `${RUNTIME_ROOT}/references/protocols/completion.md`;
|
|
8
5
|
function whenNotToUseBlock(items) {
|
|
9
6
|
if (items.length === 0) {
|
|
10
7
|
return "";
|
|
@@ -14,10 +11,16 @@ ${items.map((item) => `- ${item}`).join("\n")}
|
|
|
14
11
|
|
|
15
12
|
`;
|
|
16
13
|
}
|
|
17
|
-
function contextLoadingBlock(trace) {
|
|
14
|
+
function contextLoadingBlock(trace, executionModel) {
|
|
18
15
|
const readLines = trace.readsFrom.length > 0
|
|
19
16
|
? trace.readsFrom.map((value) => `- \`${value}\``).join("\n")
|
|
20
17
|
: "- (first stage — no upstream artifacts)";
|
|
18
|
+
const inputs = executionModel.inputs.length > 0
|
|
19
|
+
? executionModel.inputs.map((item) => `- ${item}`).join("\n")
|
|
20
|
+
: "- (first stage — no required inputs)";
|
|
21
|
+
const requiredContext = executionModel.requiredContext.length > 0
|
|
22
|
+
? executionModel.requiredContext.map((item) => `- ${item}`).join("\n")
|
|
23
|
+
: "- None beyond this skill";
|
|
21
24
|
return `## Context Loading
|
|
22
25
|
|
|
23
26
|
Before execution:
|
|
@@ -25,7 +28,16 @@ Before execution:
|
|
|
25
28
|
2. Load active artifacts from \`.cclaw/artifacts/\`.
|
|
26
29
|
3. Load upstream artifacts required by this stage:
|
|
27
30
|
${readLines}
|
|
28
|
-
4.
|
|
31
|
+
4. Extract upstream decisions, constraints, and open questions into the current
|
|
32
|
+
artifact's \`Upstream Handoff\` section when that section exists.
|
|
33
|
+
5. Before doing stage work, give a compact user-facing drift preamble: "Carrying forward: <1-3 bullets>. Drift since upstream: None / <specific drift>. Recommendation: continue / re-scope."
|
|
34
|
+
6. If you change an upstream decision, record an explicit drift reason in the
|
|
35
|
+
current artifact before continuing.
|
|
36
|
+
7. Confirm stage inputs:
|
|
37
|
+
${inputs}
|
|
38
|
+
8. Confirm required context:
|
|
39
|
+
${requiredContext}
|
|
40
|
+
9. Use the injected knowledge digest from session-start; only fall back to full
|
|
29
41
|
\`.cclaw/knowledge.jsonl\` when the digest is insufficient.
|
|
30
42
|
`;
|
|
31
43
|
}
|
|
@@ -82,6 +94,20 @@ function reviewSectionsBlock(sectionsInput) {
|
|
|
82
94
|
${sections}
|
|
83
95
|
`;
|
|
84
96
|
}
|
|
97
|
+
function stackAwareReviewRoutingBlock(stage) {
|
|
98
|
+
if (stage !== "review")
|
|
99
|
+
return "";
|
|
100
|
+
const routes = reviewStackAwareRoutes()
|
|
101
|
+
.map((route) => `- ${route.stack}: ${route.signals.map((signal) => `\`${signal}\``).join(", ")} -> ${route.agent} lens for ${route.focus}.`)
|
|
102
|
+
.join("\n");
|
|
103
|
+
return `## Stack-Aware Review Routing
|
|
104
|
+
${reviewStackAwareRoutingSummary()}
|
|
105
|
+
|
|
106
|
+
Default general review still runs. Add only the matching stack lens when repo signals or changed files justify it.
|
|
107
|
+
|
|
108
|
+
${routes}
|
|
109
|
+
`;
|
|
110
|
+
}
|
|
85
111
|
function reviewLoopBlock(reviewLoop) {
|
|
86
112
|
if (!reviewLoop)
|
|
87
113
|
return "";
|
|
@@ -99,14 +125,16 @@ function verificationBlock(stage) {
|
|
|
99
125
|
return "";
|
|
100
126
|
return `## Verification Before Completion
|
|
101
127
|
|
|
102
|
-
|
|
128
|
+
This is the gate function for completion claims. No "done", "all good", or
|
|
129
|
+
"tests pass" unless fresh evidence from this turn proves it.
|
|
103
130
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
131
|
+
- Run verification commands (tests/build/lint/type-check) for the changed scope.
|
|
132
|
+
- Confirm output directly; do not infer success from prior runs or green memories.
|
|
133
|
+
- If this is a bug fix, capture RED -> GREEN evidence for the regression path.
|
|
134
|
+
- If a command fails, report the failure as diagnostic evidence and stop before completion.
|
|
135
|
+
- If you only inspected files or reasoned about the change, say so; that is not verification.
|
|
107
136
|
|
|
108
|
-
|
|
109
|
-
\`.cclaw/skills/verification-before-completion/SKILL.md\`
|
|
137
|
+
Keep this verification evidence in the artifact before completion.
|
|
110
138
|
`;
|
|
111
139
|
}
|
|
112
140
|
function batchExecutionModeBlock(stage, track) {
|
|
@@ -121,7 +149,7 @@ Apply concise turn announces: one announce per batch boundary (or when risk/plan
|
|
|
121
149
|
changes materially), then execute tasks without repetitive boilerplate.
|
|
122
150
|
|
|
123
151
|
Detailed walkthrough:
|
|
124
|
-
|
|
152
|
+
Use the current plan artifact for batch order and keep RED -> GREEN -> REFACTOR evidence in the TDD artifact.
|
|
125
153
|
`;
|
|
126
154
|
}
|
|
127
155
|
function crossStageTraceBlock(trace) {
|
|
@@ -170,46 +198,6 @@ function mergedAntiPatterns(philosophy, execution) {
|
|
|
170
198
|
}
|
|
171
199
|
return merged.map((item) => `- ${item}`).join("\n");
|
|
172
200
|
}
|
|
173
|
-
function stageSpecificSeeAlso(stage) {
|
|
174
|
-
const refs = {
|
|
175
|
-
brainstorm: [
|
|
176
|
-
`- \`${RUNTIME_ROOT}/skills/learnings/SKILL.md\``,
|
|
177
|
-
`- \`${RUNTIME_ROOT}/references/stages/brainstorm-examples.md\``
|
|
178
|
-
],
|
|
179
|
-
scope: [
|
|
180
|
-
`- \`${RUNTIME_ROOT}/skills/learnings/SKILL.md\``,
|
|
181
|
-
`- \`${RUNTIME_ROOT}/references/stages/scope-examples.md\``
|
|
182
|
-
],
|
|
183
|
-
design: [
|
|
184
|
-
`- \`${RUNTIME_ROOT}/skills/security/SKILL.md\``,
|
|
185
|
-
`- \`${RUNTIME_ROOT}/skills/performance/SKILL.md\``
|
|
186
|
-
],
|
|
187
|
-
spec: [
|
|
188
|
-
`- \`${RUNTIME_ROOT}/skills/docs/SKILL.md\``,
|
|
189
|
-
`- \`${RUNTIME_ROOT}/references/stages/spec-examples.md\``
|
|
190
|
-
],
|
|
191
|
-
plan: [
|
|
192
|
-
`- \`${RUNTIME_ROOT}/skills/subagent-dev/SKILL.md\``,
|
|
193
|
-
`- \`${RUNTIME_ROOT}/skills/parallel-dispatch/SKILL.md\``
|
|
194
|
-
],
|
|
195
|
-
tdd: [
|
|
196
|
-
`- \`${RUNTIME_ROOT}/skills/debugging/SKILL.md\``,
|
|
197
|
-
`- \`${RUNTIME_ROOT}/references/stages/tdd-batch-walkthrough.md\``
|
|
198
|
-
],
|
|
199
|
-
review: [
|
|
200
|
-
`- \`${RUNTIME_ROOT}/skills/security/SKILL.md\``,
|
|
201
|
-
`- \`${RUNTIME_ROOT}/skills/parallel-dispatch/SKILL.md\``,
|
|
202
|
-
`- \`${RUNTIME_ROOT}/skills/verification-before-completion/SKILL.md\``
|
|
203
|
-
],
|
|
204
|
-
ship: [
|
|
205
|
-
`- \`${RUNTIME_ROOT}/skills/ci-cd/SKILL.md\``,
|
|
206
|
-
`- \`${RUNTIME_ROOT}/skills/docs/SKILL.md\``,
|
|
207
|
-
`- \`${RUNTIME_ROOT}/skills/verification-before-completion/SKILL.md\``,
|
|
208
|
-
`- \`${RUNTIME_ROOT}/skills/finishing-a-development-branch/SKILL.md\``
|
|
209
|
-
]
|
|
210
|
-
};
|
|
211
|
-
return refs[stage];
|
|
212
|
-
}
|
|
213
201
|
function completionParametersBlock(schema, track) {
|
|
214
202
|
const gateList = schema.executionModel.requiredGates.map((g) => `\`${g.id}\``).join(", ");
|
|
215
203
|
const mandatory = schema.reviewLens.mandatoryDelegations.length > 0
|
|
@@ -230,7 +218,7 @@ function completionParametersBlock(schema, track) {
|
|
|
230
218
|
- Fill \`## Learnings\` before closeout: either \`- None this stage.\` or JSON bullets with required keys \`type\`, \`trigger\`, \`action\`, \`confidence\` (knowledge-schema compatible).
|
|
231
219
|
- Record mandatory delegation completion/waiver in \`${RUNTIME_ROOT}/state/delegation-log.json\` with rationale as needed.
|
|
232
220
|
- Use the completion helper instead of raw \`flow-state.json\` edits (legacy direct edits trigger workflow-guard warnings or strict-mode blocks).
|
|
233
|
-
- Completion protocol
|
|
221
|
+
- Completion protocol: verify required gates, update the artifact, then use the completion helper.
|
|
234
222
|
`;
|
|
235
223
|
}
|
|
236
224
|
function quickStartBlock(stage, track) {
|
|
@@ -244,59 +232,6 @@ function quickStartBlock(stage, track) {
|
|
|
244
232
|
4. Satisfy gates (${gatePreview}${schema.executionModel.requiredGates.length > 3 ? ` +${schema.executionModel.requiredGates.length - 3}` : ""}).
|
|
245
233
|
`;
|
|
246
234
|
}
|
|
247
|
-
/**
|
|
248
|
-
* Long-form Batch Execution walkthrough. Rendered once into
|
|
249
|
-
* \`.cclaw/references/stages/tdd-batch-walkthrough.md\` by the installer.
|
|
250
|
-
*/
|
|
251
|
-
export const TDD_BATCH_WALKTHROUGH_MARKDOWN = `# TDD — Batch Execution Walkthrough
|
|
252
|
-
|
|
253
|
-
Detailed RED / GREEN / REFACTOR transcript for a 3-task batch. Illustrative
|
|
254
|
-
only — do not copy the command names blindly, match them to your stack.
|
|
255
|
-
|
|
256
|
-
## Batch 1 example tasks
|
|
257
|
-
|
|
258
|
-
| Task ID | Description | AC | Verification |
|
|
259
|
-
|---|---|---|---|
|
|
260
|
-
| T-1 \`[~3m]\` | Add \`User.emailNormalized\` column | AC-1 | \`npm test -- users/schema\` |
|
|
261
|
-
| T-2 \`[~4m]\` | Normalize on write in \`UserRepo.save\` | AC-1 | \`npm test -- users/repo\` |
|
|
262
|
-
| T-3 \`[~3m]\` | Reject duplicates in \`UserService.signup\` | AC-2 | \`npm test -- users/service\` |
|
|
263
|
-
|
|
264
|
-
## Execution transcript
|
|
265
|
-
|
|
266
|
-
### T-1 — RED
|
|
267
|
-
|
|
268
|
-
> Run: \`npm test -- users/schema\` → **FAIL** (missing column: \`emailNormalized\`). Captured the failure stack as RED evidence. No production code touched yet.
|
|
269
|
-
|
|
270
|
-
### T-1 — GREEN
|
|
271
|
-
|
|
272
|
-
> Added the column in the schema module. Re-ran \`npm test -- users/schema\` → **PASS**. Ran the full suite \`npm test\` → **PASS**. Captured both outputs as GREEN evidence.
|
|
273
|
-
|
|
274
|
-
### T-1 — REFACTOR
|
|
275
|
-
|
|
276
|
-
> Extracted the column definition into a shared \`NormalizedEmail\` type used by T-2/T-3. Re-ran \`npm test\` → **PASS**. Captured REFACTOR note: "Extracted NormalizedEmail type to keep T-2/T-3 DRY; zero behavior change, all tests still green."
|
|
277
|
-
|
|
278
|
-
### T-2 — RED / GREEN / REFACTOR
|
|
279
|
-
|
|
280
|
-
Write the repo test that expects normalised writes, watch it fail (RED), implement normalisation inside \`UserRepo.save\` only (GREEN), then refactor the normaliser out of the repo into a helper shared with T-3 (REFACTOR).
|
|
281
|
-
|
|
282
|
-
### T-3 — RED / GREEN / REFACTOR
|
|
283
|
-
|
|
284
|
-
Write the service-level duplicate test that expects a rejection, watch it fail (RED), add the duplicate check in \`UserService.signup\` (GREEN), refactor the error message into a named constant (REFACTOR).
|
|
285
|
-
|
|
286
|
-
## Batch gate check
|
|
287
|
-
|
|
288
|
-
After T-3 REFACTOR, before declaring Batch 1 done:
|
|
289
|
-
|
|
290
|
-
1. Run the full suite (\`npm test\`) one final time → **PASS** captured as batch-exit evidence.
|
|
291
|
-
2. Verify the TDD artifact contains RED, GREEN, and REFACTOR evidence for T-1, T-2, **and** T-3. No partial batches.
|
|
292
|
-
3. Only now mark Batch 1 complete. Batch 2 cannot start until this step.
|
|
293
|
-
|
|
294
|
-
## When to stop mid-batch (do NOT push through)
|
|
295
|
-
|
|
296
|
-
- A RED test fails for a reason you did not predict (e.g. an unrelated flaky test) → **pause**, diagnose, log an operational-self-improvement entry, and decide with the user before proceeding.
|
|
297
|
-
- A GREEN step would require touching code outside the task's acceptance criterion → **pause**, the task is scoped wrong; adjust the plan or open a follow-up task.
|
|
298
|
-
- The same RED failure reappears after a GREEN change → **escalate** per the 3-attempts rule; do not keep patching.
|
|
299
|
-
`;
|
|
300
235
|
export function stageSkillFolder(stage) {
|
|
301
236
|
return STAGE_TO_SKILL_FOLDER[stage];
|
|
302
237
|
}
|
|
@@ -383,6 +318,7 @@ function dedupeGuidance(items, blockedBy) {
|
|
|
383
318
|
}
|
|
384
319
|
export function stageSkillMarkdown(stage, track = "standard") {
|
|
385
320
|
const schema = stageSchema(stage, track);
|
|
321
|
+
const trackContext = stageTrackRenderContext(track);
|
|
386
322
|
const philosophy = schema.philosophy;
|
|
387
323
|
const executionModel = schema.executionModel;
|
|
388
324
|
const artifactRules = schema.artifactRules;
|
|
@@ -400,7 +336,6 @@ export function stageSkillMarkdown(stage, track = "standard") {
|
|
|
400
336
|
const interactionFocus = dedupeGuidance(executionModel.interactionProtocol, [...executionModel.checklist, ...executionModel.process]).slice(0, 5);
|
|
401
337
|
const processFlowMermaid = renderProcessFlowMermaid(executionModel);
|
|
402
338
|
const platformNotesBlock = renderPlatformNotesBlock(executionModel.platformNotes);
|
|
403
|
-
const stageRefs = stageSpecificSeeAlso(stage);
|
|
404
339
|
const reviewLoopSection = reviewLoopBlock(reviewLens.reviewLoop);
|
|
405
340
|
const mandatoryDelegationSummary = mandatoryDelegations.length > 0
|
|
406
341
|
? mandatoryDelegations.map((name) => `\`${name}\``).join(", ")
|
|
@@ -428,6 +363,7 @@ ${philosophy.purpose}
|
|
|
428
363
|
## Complexity Tier
|
|
429
364
|
- Active tier: \`${schema.complexityTier}\`
|
|
430
365
|
- Mandatory delegations at this tier: ${mandatoryDelegationSummary}
|
|
366
|
+
- Track render context: \`${trackContext.track}\` (${trackContext.usesPlanTerminology ? "plan-first wording" : "acceptance-first wording"})
|
|
431
367
|
|
|
432
368
|
## When to Use
|
|
433
369
|
${philosophy.whenToUse.map((item) => `- ${item}`).join("\n")}
|
|
@@ -445,14 +381,9 @@ This is the stage **state machine** — the canonical ordered flow. For every de
|
|
|
445
381
|
|
|
446
382
|
${processFlowMermaid.length > 0 ? processFlowMermaid : "```mermaid\nflowchart TD\n S1[\"Execute Checklist\"] --> S2[\"Satisfy required gates\"] --> S3[\"Verify before closeout\"]\n```"}
|
|
447
383
|
|
|
448
|
-
|
|
449
|
-
${executionModel.inputs.length > 0 ? executionModel.inputs.map((item) => `- ${item}`).join("\n") : "- (first stage — no required inputs)"}
|
|
450
|
-
|
|
451
|
-
## Required Context
|
|
452
|
-
${executionModel.requiredContext.length > 0 ? executionModel.requiredContext.map((item) => `- ${item}`).join("\n") : "- None beyond this skill"}
|
|
453
|
-
|
|
454
|
-
${platformNotesBlock}${contextLoadingBlock(artifactRules.crossStageTrace)}
|
|
384
|
+
${platformNotesBlock}${contextLoadingBlock(artifactRules.crossStageTrace, executionModel)}
|
|
455
385
|
${autoSubagentDispatchBlock(stage, track)}
|
|
386
|
+
${stackAwareReviewRoutingBlock(stage)}
|
|
456
387
|
${researchPlaybooksBlock(executionModel.researchPlaybooks ?? [])}
|
|
457
388
|
|
|
458
389
|
## Checklist
|
|
@@ -469,7 +400,7 @@ These are **rules for HOW you interact with the user** during this stage — ton
|
|
|
469
400
|
|
|
470
401
|
${interactionFocus.length > 0 ? interactionFocus.map((item, i) => `${i + 1}. ${item}`).join("\n") : "- Keep communication concise and decision-focused; rely on the Checklist for execution order."}
|
|
471
402
|
|
|
472
|
-
Decision protocol
|
|
403
|
+
Decision protocol: ask only decision-changing questions, record the chosen option, rationale, risk, and rollback when the stage makes a non-trivial call.
|
|
473
404
|
|
|
474
405
|
${batchExecutionModeBlock(stage, track)}
|
|
475
406
|
## Required Gates
|
|
@@ -480,7 +411,7 @@ ${evidenceList}
|
|
|
480
411
|
|
|
481
412
|
${verificationBlock(stage)}
|
|
482
413
|
|
|
483
|
-
##
|
|
414
|
+
## Exit Criteria
|
|
484
415
|
${executionModel.exitCriteria.map((item) => `- [ ] ${item}`).join("\n")}
|
|
485
416
|
|
|
486
417
|
${completionParametersBlock(schema, track)}
|
|
@@ -497,15 +428,9 @@ ${reviewLens.outputs.map((item) => `- ${item}`).join("\n")}
|
|
|
497
428
|
${reviewSectionsBlock(reviewLens.reviewSections)}
|
|
498
429
|
|
|
499
430
|
## Shared Stage Guidance
|
|
500
|
-
|
|
501
|
-
-
|
|
502
|
-
-
|
|
503
|
-
-
|
|
504
|
-
|
|
505
|
-
## See Also
|
|
506
|
-
- \`${RUNTIME_ROOT}/skills/using-cclaw/SKILL.md\`
|
|
507
|
-
- \`${RUNTIME_ROOT}/skills/session/SKILL.md\`
|
|
508
|
-
${stageRefs.join("\n")}
|
|
509
|
-
- \`${RUNTIME_ROOT}/commands/${stage}.md\`
|
|
431
|
+
- Follow the handoff menu: advance, revise, pause, rewind, or archive only when the user explicitly chooses it.
|
|
432
|
+
- Carry upstream decisions forward explicitly; record drift instead of silently changing direction.
|
|
433
|
+
- Before closeout, fill \`## Learnings\` with \`- None this stage.\` or 1-3 strict JSON bullets.
|
|
434
|
+
- Keep decisions explicit: context, options, chosen option, rationale, risk, and rollback.
|
|
510
435
|
`;
|
|
511
436
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { RUNTIME_ROOT } from "../constants.js";
|
|
2
|
-
export const STAGE_COMMON_GUIDANCE_REL_PATH = `${RUNTIME_ROOT}/references/stages/common-guidance.md`;
|
|
3
1
|
export function stageCommonGuidanceMarkdown() {
|
|
4
2
|
return `# Common Stage Guidance
|
|
5
3
|
|
|
@@ -8,25 +6,28 @@ per-stage skills can stay focused on stage-specific work.
|
|
|
8
6
|
|
|
9
7
|
## Shared completion protocol
|
|
10
8
|
|
|
11
|
-
- Stage-specific skills expose **Completion Parameters**
|
|
12
|
-
|
|
13
|
-
-
|
|
9
|
+
- Stage-specific skills expose **Completion Parameters** plus the gates that
|
|
10
|
+
matter for that stage.
|
|
11
|
+
- Generic execution stays inline: verify required gates, update the artifact,
|
|
12
|
+
harvest learnings, then use \`/cc-next\` for progression.
|
|
13
|
+
- Do not create separate protocol files.
|
|
14
14
|
|
|
15
15
|
## Shared decision protocol
|
|
16
16
|
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
-
|
|
17
|
+
- Ask only decision-changing questions.
|
|
18
|
+
- Prefer one focused question over broad questionnaires.
|
|
19
|
+
- When choices are equivalent, recommend one path and state the trade-off.
|
|
20
|
+
- If a blocker remains after a short retry, stop and ask the user.
|
|
20
21
|
|
|
21
22
|
## Shared handoff menu
|
|
22
23
|
|
|
23
24
|
Use this same closeout menu for every stage:
|
|
24
25
|
|
|
25
|
-
- **A) Advance** — run \`/cc-next\` and continue
|
|
26
|
+
- **A) Advance** — run \`/cc-next\` and continue the critical path; after \`ship\`, the same command drives \`retro -> compound -> archive\`.
|
|
26
27
|
- **B) Revise this stage** — stay on current stage and apply feedback.
|
|
27
28
|
- **C) Pause / park** — run \`/cc-view status\`, then stop and resume later.
|
|
28
|
-
- **D) Rewind** — run
|
|
29
|
-
- **E) Abandon** — archive with
|
|
29
|
+
- **D) Rewind** — run \`cclaw internal rewind <target-stage> "<reason>"\`.
|
|
30
|
+
- **E) Abandon** — only when the user explicitly wants to end a non-ship active run early, archive with \`cclaw archive --skip-retro --retro-reason="<reason>"\`. Once in post-ship closeout, continue \`/cc-next\` through retro/compound/archive instead.
|
|
30
31
|
|
|
31
32
|
Recommendation defaults:
|
|
32
33
|
|
|
@@ -80,8 +81,8 @@ insight (for example, purely mechanical edits with no new decisions).
|
|
|
80
81
|
## Progressive disclosure baseline
|
|
81
82
|
|
|
82
83
|
- Start with the current stage skill.
|
|
83
|
-
- Load deeper
|
|
84
|
-
-
|
|
85
|
-
|
|
84
|
+
- Load deeper skills or docs only when required by a blocker or gate.
|
|
85
|
+
- Keep examples as short shape cues inside the current skill instead of
|
|
86
|
+
materializing separate reference files.
|
|
86
87
|
`;
|
|
87
88
|
}
|
|
@@ -3,10 +3,12 @@ import type { StageComplexityTier, StageAutoSubagentDispatch, StageSchema } from
|
|
|
3
3
|
export type { ArtifactValidation, CrossStageTrace, ReviewSection, StageComplexityTier, StageExecutionModel, StagePhilosophy, StageArtifactRules, StageReviewLoop, StageReviewLens, StageAutoSubagentDispatch, StageGate, StageSchemaLegacyInput, StageSchema, StageSchemaInput, StageSchemaV2Input } from "./stages/schema-types.js";
|
|
4
4
|
export declare const SKILL_ENVELOPE_KINDS: readonly ["stage-output", "gate-result", "delegation-record"];
|
|
5
5
|
export type SkillEnvelopeKind = (typeof SKILL_ENVELOPE_KINDS)[number];
|
|
6
|
+
export declare const NON_FLOW_ENVELOPE_STAGE: "non-flow";
|
|
7
|
+
export type SkillEnvelopeStage = FlowStage | typeof NON_FLOW_ENVELOPE_STAGE;
|
|
6
8
|
export interface SkillEnvelope {
|
|
7
9
|
version: "1";
|
|
8
10
|
kind: SkillEnvelopeKind;
|
|
9
|
-
stage:
|
|
11
|
+
stage: SkillEnvelopeStage;
|
|
10
12
|
payload: unknown;
|
|
11
13
|
emittedAt: string;
|
|
12
14
|
agent?: string;
|
|
@@ -15,6 +17,28 @@ export interface SkillEnvelopeValidation {
|
|
|
15
17
|
ok: boolean;
|
|
16
18
|
errors: string[];
|
|
17
19
|
}
|
|
20
|
+
export interface StageStackAwareReviewRoute {
|
|
21
|
+
stack: string;
|
|
22
|
+
agent: "reviewer";
|
|
23
|
+
signals: string[];
|
|
24
|
+
focus: string;
|
|
25
|
+
}
|
|
26
|
+
export interface StageDelegationSummary {
|
|
27
|
+
stage: FlowStage;
|
|
28
|
+
mandatoryAgents: string[];
|
|
29
|
+
proactiveAgents: string[];
|
|
30
|
+
primaryAgents: string[];
|
|
31
|
+
stackAwareRoutes: StageStackAwareReviewRoute[];
|
|
32
|
+
}
|
|
33
|
+
export declare function reviewStackAwareRoutes(): StageStackAwareReviewRoute[];
|
|
34
|
+
export declare function reviewStackAwareRoutingSummary(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Canonical delegation summary derived from STAGE_AUTO_SUBAGENT_DISPATCH.
|
|
37
|
+
*
|
|
38
|
+
* Keep all generated routing surfaces (skills, AGENTS.md) on this helper so
|
|
39
|
+
* stage->agent defaults are maintained in one place.
|
|
40
|
+
*/
|
|
41
|
+
export declare function stageDelegationSummary(complexityTier?: StageComplexityTier): StageDelegationSummary[];
|
|
18
42
|
export declare function validateSkillEnvelope(value: unknown): SkillEnvelopeValidation;
|
|
19
43
|
export declare function parseSkillEnvelope(raw: string): SkillEnvelope | null;
|
|
20
44
|
/** Transition guard: agents with `mode: "mandatory"` in auto-subagent dispatch for this stage. */
|
|
@@ -26,4 +50,5 @@ export declare function stageRecommendedGateIds(stage: FlowStage, track?: FlowTr
|
|
|
26
50
|
export declare function nextCclawCommand(stage: FlowStage): string;
|
|
27
51
|
export declare function buildTransitionRules(): TransitionRule[];
|
|
28
52
|
export declare function stagePolicyNeedles(stage: FlowStage, track?: FlowTrack): string[];
|
|
53
|
+
export declare function stageTrackRenderContext(track?: FlowTrack): import("./track-render-context.js").TrackRenderContext;
|
|
29
54
|
export declare function stageAutoSubagentDispatch(stage: FlowStage): StageAutoSubagentDispatch[];
|