cclaw-cli 0.48.35 → 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 -495
- package/dist/constants.d.ts +2 -13
- package/dist/constants.js +1 -46
- 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 -24
- 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 -1533
- 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 -408
- 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 -520
- 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 -109
- 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 -9
- package/dist/content/contexts.js +0 -65
- 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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { renderTrackTerminology, trackRenderContext } from "../track-render-context.js";
|
|
1
2
|
// ---------------------------------------------------------------------------
|
|
2
3
|
// TDD — RED → GREEN → REFACTOR cycle (merged test + build)
|
|
3
4
|
// ---------------------------------------------------------------------------
|
|
@@ -7,9 +8,9 @@ export const TDD = {
|
|
|
7
8
|
complexityTier: "standard",
|
|
8
9
|
skillFolder: "test-driven-development",
|
|
9
10
|
skillName: "test-driven-development",
|
|
10
|
-
skillDescription: "Full TDD cycle: RED (failing tests), GREEN (minimal implementation), REFACTOR (cleanup). One plan slice at a time with strict traceability.",
|
|
11
|
+
skillDescription: "Full TDD cycle: discover existing tests and system impact, then RED (failing tests), GREEN (minimal implementation), REFACTOR (cleanup). One plan slice at a time with strict traceability.",
|
|
11
12
|
philosophy: {
|
|
12
|
-
hardGate: "Do NOT merge, ship, or skip review. Follow RED → GREEN → REFACTOR strictly for each plan slice. Do NOT write implementation code before RED tests exist. Do NOT skip the REFACTOR step.",
|
|
13
|
+
hardGate: "Do NOT merge, ship, or skip review. Follow RED → GREEN → REFACTOR strictly for each plan slice. Do NOT write implementation code before RED tests exist. Do NOT write RED tests before discovering relevant existing tests and impacted contracts. Do NOT skip the REFACTOR step.",
|
|
13
14
|
ironLaw: "NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST — THE RED FAILURE IS THE SPEC.",
|
|
14
15
|
purpose: "Implement features through the TDD cycle: write failing tests, make them pass with minimal code, then refactor.",
|
|
15
16
|
whenToUse: [
|
|
@@ -28,50 +29,64 @@ export const TDD = {
|
|
|
28
29
|
"Skipping evidence capture",
|
|
29
30
|
"Undocumented refactor changes",
|
|
30
31
|
"No full-suite GREEN evidence",
|
|
31
|
-
"Multiple tasks implemented in one pass without justification"
|
|
32
|
+
"Multiple tasks implemented in one pass without justification",
|
|
33
|
+
"Skipping test discovery and duplicating an existing test pattern blindly",
|
|
34
|
+
"Ignoring callbacks, state transitions, interfaces, or contract surfaces affected by the slice",
|
|
35
|
+
"Collapsing RED/GREEN/REFACTOR into one unreviewable checkpoint"
|
|
32
36
|
]
|
|
33
37
|
},
|
|
34
38
|
executionModel: {
|
|
35
39
|
checklist: [
|
|
36
|
-
"Select plan slice — pick one task from the plan. Do not batch multiple tasks. Before starting, read `.cclaw/state/ralph-loop.json` (`loopIteration`, `acClosed[]`, `redOpenSlices[]`) so you skip cycles already closed.",
|
|
40
|
+
"Select plan slice — pick one task from the plan. Do not batch multiple tasks. Before starting, read `.cclaw/state/ralph-loop.json` (`loopIteration`, `acClosed[]`, `redOpenSlices[]`) so you skip cycles already closed. If `redOpenSlices[]` is non-empty, repair or explicitly park those slices before opening a new RED.",
|
|
37
41
|
"Map to acceptance criterion — identify the specific spec criterion this test proves.",
|
|
38
|
-
"
|
|
42
|
+
"Discover the test surface — inspect existing tests, fixtures, helpers, test commands, and nearby assertions before authoring RED. Reuse the local test style unless the slice genuinely needs a new pattern.",
|
|
43
|
+
"Run a system-wide impact check — name callbacks, state transitions, interfaces, schemas, CLI/config/API contracts, persistence, or event boundaries that this slice can affect. Add RED coverage for each affected public contract or record why it is out of scope.",
|
|
44
|
+
"Set execution posture — record whether this slice is sequential, batch-safe, or blocked; when the existing git workflow permits small commits, checkpoint after RED, GREEN, and REFACTOR (or record why commits are deferred).",
|
|
45
|
+
"Use the mandatory `test-author` delegation for RED — after discovery and impact check, produce failing behavior tests and RED evidence only (no production edits). Set `CCLAW_ACTIVE_AGENT=tdd-red` when the harness supports phase labels.",
|
|
39
46
|
"RED: Capture failure output — copy the exact failure output as RED evidence. Record in artifact.",
|
|
40
|
-
"
|
|
47
|
+
"Continue the same `test-author` delegation intent for GREEN — minimal implementation plus full-suite GREEN evidence. Set `CCLAW_ACTIVE_AGENT=tdd-green` when the harness supports phase labels.",
|
|
41
48
|
"GREEN: Run full suite — execute ALL tests, not just the ones you wrote. The full suite must be GREEN.",
|
|
42
49
|
"GREEN: Verify no regressions — if any existing test breaks, fix the regression before proceeding.",
|
|
43
50
|
"Run verification-before-completion discipline for the slice — capture a fresh test command, commit SHA, and explicit PASS/FAIL status before completion claims.",
|
|
44
|
-
"REFACTOR:
|
|
45
|
-
"Record evidence — capture RED failure, GREEN output, and REFACTOR notes in the TDD artifact. When logging
|
|
51
|
+
"REFACTOR: continue the `test-author` evidence cycle (or a dedicated refactor mode when available) to improve code quality without behavior changes. Set `CCLAW_ACTIVE_AGENT=tdd-refactor` when the harness supports phase labels.",
|
|
52
|
+
"Record evidence — capture test discovery, system-wide impact check, RED failure, GREEN output, and REFACTOR notes in the TDD artifact. When logging a `green` row, attach the closed acceptance-criterion IDs in `acIds` so Ralph Loop status counts them.",
|
|
46
53
|
"Annotate traceability — link to plan task ID and spec criterion.",
|
|
47
54
|
"Per-Slice Review (conditional) — if `.cclaw/config.yaml::sliceReview.enabled` is true and the slice meets any trigger (touchCount >= filesChangedThreshold, touchPaths match touchTriggers, or highRisk=true), append a `## Per-Slice Review` entry for this slice before moving on (see the dedicated section below).",
|
|
48
55
|
"Repeat for each slice — return to step 1 for the next plan slice."
|
|
49
56
|
],
|
|
50
57
|
interactionProtocol: [
|
|
51
58
|
"Pick one planned slice at a time.",
|
|
52
|
-
"Controller owns orchestration;
|
|
59
|
+
"Controller owns orchestration; one mandatory `test-author` delegation carries phase-specific RED -> GREEN -> REFACTOR evidence instead of spawning separate workers by default.",
|
|
60
|
+
"Before writing RED tests, discover relevant existing tests and commands so the new test extends the suite instead of fighting it.",
|
|
61
|
+
"Before implementation, perform a system-wide impact check across callbacks, state, interfaces, schemas, and external contracts touched by the slice.",
|
|
53
62
|
"Write behavior-focused tests before changing implementation (RED).",
|
|
54
63
|
"Capture and store failing output as RED evidence.",
|
|
55
64
|
"Apply minimal change to satisfy RED tests (GREEN).",
|
|
56
65
|
"Run full suite, not partial checks, for GREEN validation.",
|
|
57
66
|
"Before declaring the slice complete, run a fresh verification check and record command + commit SHA + PASS/FAIL.",
|
|
58
67
|
"Refactor without changing behavior and document rationale (REFACTOR).",
|
|
68
|
+
"Use incremental RED/GREEN/REFACTOR commits when the repository workflow and working tree make that appropriate; otherwise record the checkpoint boundaries in the artifact.",
|
|
59
69
|
"Stop if regressions appear and fix before proceeding.",
|
|
60
70
|
"If a test passes unexpectedly, investigate: does the behavior already exist, or is the test wrong?",
|
|
61
|
-
"**Per-Slice Review
|
|
71
|
+
"**Per-Slice Review point (conditional, opt-in).** When `.cclaw/config.yaml::sliceReview.enabled` is true, check every slice against the triggers before declaring it DONE. Triggers: `touchCount >= filesChangedThreshold`, any `touchPaths` match a `touchTriggers` glob, or the plan row declares `highRisk: true`. On a trigger, run two passes on the slice alone — (1) Spec-Compliance: trace RED/GREEN/REFACTOR evidence back to its plan task + spec criterion, noting edge cases the tests skip; (2) Quality: diff-scan for naming, error handling, dead code, simpler alternatives. Record both under `## Per-Slice Review` in `06-tdd.md`, naming the trigger that fired. Dispatch the `reviewer` subagent natively when available (log `fulfillmentMode: \"isolated\"`); otherwise fulfil via in-session role switch (`fulfillmentMode: \"role-switch\"`). Never fabricate an isolated pass from memory. Tracks outside `sliceReview.enforceOnTracks` still emit the section; doctor only escalates missed reviews on enforced tracks."
|
|
62
72
|
],
|
|
63
73
|
process: [
|
|
64
74
|
"Select slice and map to acceptance criterion.",
|
|
65
|
-
"
|
|
75
|
+
"Discover existing tests, fixtures, helpers, and exact test commands for the affected area.",
|
|
76
|
+
"Check system-wide impact across callbacks, state transitions, interfaces, schemas, and external contracts.",
|
|
77
|
+
"Record execution posture and checkpoint plan for RED/GREEN/REFACTOR commits or deferred commits.",
|
|
78
|
+
"Use `test-author` in RED intent and produce failing test(s) for the expected reason (RED).",
|
|
66
79
|
"Run tests and capture failure output.",
|
|
67
|
-
"
|
|
80
|
+
"Use `test-author` in GREEN intent and implement the smallest change needed for GREEN.",
|
|
68
81
|
"Run full tests and build checks.",
|
|
69
82
|
"Run a fresh verification-before-completion check and capture command + commit SHA + PASS/FAIL in guard evidence.",
|
|
70
|
-
"
|
|
83
|
+
"Run the REFACTOR intent preserving behavior.",
|
|
71
84
|
"Record RED, GREEN, and REFACTOR evidence in artifact.",
|
|
72
85
|
"Annotate traceability to plan task and spec criterion; on `sliceReview` triggers, append a Per-Slice Review entry before closing the slice."
|
|
73
86
|
],
|
|
74
87
|
requiredGates: [
|
|
88
|
+
{ id: "tdd_test_discovery_complete", description: "Relevant existing tests, fixtures, helpers, and runnable commands were discovered before RED tests were written." },
|
|
89
|
+
{ id: "tdd_impact_check_complete", description: "Callbacks, state transitions, interfaces, schemas, and contracts affected by the slice were checked before implementation." },
|
|
75
90
|
{ id: "tdd_red_test_written", description: "Failing tests exist before implementation changes." },
|
|
76
91
|
{ id: "tdd_green_full_suite", description: "Full relevant suite passes in GREEN state." },
|
|
77
92
|
{ id: "tdd_refactor_completed", description: "Refactor pass completed with behavior preservation verified." },
|
|
@@ -80,7 +95,10 @@ export const TDD = {
|
|
|
80
95
|
{ id: "tdd_docs_drift_check", description: "When public API/config/CLI surfaces change, docs drift is addressed via a completed doc-updater pass." }
|
|
81
96
|
],
|
|
82
97
|
requiredEvidence: [
|
|
83
|
-
"Artifact updated at `.cclaw/artifacts/06-tdd.md` with RED, GREEN, and REFACTOR sections.",
|
|
98
|
+
"Artifact updated at `.cclaw/artifacts/06-tdd.md` with Test Discovery, System-Wide Impact Check, RED, GREEN, and REFACTOR sections.",
|
|
99
|
+
"Relevant existing test files, helpers, fixtures, and exact commands identified before RED.",
|
|
100
|
+
"Callbacks, state transitions, interfaces, schemas, and contracts checked for impact before implementation.",
|
|
101
|
+
"Execution posture and RED/GREEN/REFACTOR checkpoint plan recorded, including commit boundaries when the repo workflow supports them.",
|
|
84
102
|
"Failing command output captured (RED).",
|
|
85
103
|
"Full test/build output recorded (GREEN).",
|
|
86
104
|
"Fresh verification evidence recorded with command, commit SHA, and PASS/FAIL status before completion.",
|
|
@@ -90,14 +108,17 @@ export const TDD = {
|
|
|
90
108
|
"Traceability to task identifier is documented."
|
|
91
109
|
],
|
|
92
110
|
inputs: ["approved plan slice", "spec acceptance criterion", "test harness configuration", "coding standards and constraints"],
|
|
93
|
-
requiredContext: ["plan artifact", "spec artifact", "existing test patterns"],
|
|
111
|
+
requiredContext: ["plan artifact", "spec artifact", "existing test patterns", "affected contracts and state boundaries"],
|
|
94
112
|
blockers: [
|
|
113
|
+
"test discovery skipped before RED",
|
|
114
|
+
"system-wide impact check missing for callbacks/state/interfaces/contracts",
|
|
95
115
|
"tests pass before behavior change (RED failure missing)",
|
|
96
116
|
"full suite not green",
|
|
97
117
|
"behavior changed during refactor",
|
|
98
118
|
"no evidence recorded"
|
|
99
119
|
],
|
|
100
120
|
exitCriteria: [
|
|
121
|
+
"test discovery and system-wide impact check are recorded",
|
|
101
122
|
"RED evidence exists and is traceable",
|
|
102
123
|
"GREEN evidence captured with full suite pass",
|
|
103
124
|
"REFACTOR evidence captured",
|
|
@@ -120,6 +141,10 @@ export const TDD = {
|
|
|
120
141
|
traceabilityRule: "Every RED test traces to a plan task. Every GREEN change traces to a RED test. Every plan task traces to a spec criterion. Design decisions inform test strategy. Evidence chain must be unbroken."
|
|
121
142
|
},
|
|
122
143
|
artifactValidation: [
|
|
144
|
+
{ section: "Upstream Handoff", required: false, validationRule: "Summarizes plan/spec/design decisions, constraints, open questions, and explicit drift before RED work." },
|
|
145
|
+
{ section: "Test Discovery", required: true, validationRule: "Before RED: lists existing tests, fixtures/helpers, exact commands, and the chosen local pattern to extend." },
|
|
146
|
+
{ section: "System-Wide Impact Check", required: true, validationRule: "Before implementation: names affected callbacks, state transitions, interfaces, schemas, public APIs/config/CLI, persistence, or event contracts, with coverage or explicit out-of-scope notes." },
|
|
147
|
+
{ section: "Execution Posture", required: false, validationRule: "Records sequential/batch/blocked posture and RED/GREEN/REFACTOR checkpoint plan, including incremental commit boundaries when consistent with the repository git workflow." },
|
|
123
148
|
{ section: "RED Evidence", required: true, validationRule: "Failing test output captured per slice." },
|
|
124
149
|
{ section: "Acceptance Mapping", required: false, validationRule: "Each RED test links to a plan task and spec criterion." },
|
|
125
150
|
{ section: "Failure Analysis", required: false, validationRule: "Failure reason matches expected missing behavior." },
|
|
@@ -139,6 +164,8 @@ export const TDD = {
|
|
|
139
164
|
{
|
|
140
165
|
title: "RED Evidence Audit",
|
|
141
166
|
evaluationPoints: [
|
|
167
|
+
"Did every slice discover relevant existing tests, helpers, fixtures, and commands before adding RED coverage?",
|
|
168
|
+
"Does the system-wide impact check cover callbacks, state transitions, interfaces, schemas, and public contracts touched by the slice?",
|
|
142
169
|
"Does every slice have a captured failing test output?",
|
|
143
170
|
"Does each failure reason match the expected missing behavior (not a typo or config error)?",
|
|
144
171
|
"Were tests written BEFORE any production code for that slice?",
|
|
@@ -152,6 +179,7 @@ export const TDD = {
|
|
|
152
179
|
evaluationPoints: [
|
|
153
180
|
"Does GREEN evidence show a FULL suite pass (not partial)?",
|
|
154
181
|
"Is the GREEN implementation minimal — no features beyond what RED tests require?",
|
|
182
|
+
"Do checkpoint notes or commits keep RED, GREEN, and REFACTOR reviewable according to the repository git workflow?",
|
|
155
183
|
"Does the REFACTOR step preserve all existing behavior (no new failures)?",
|
|
156
184
|
"Are REFACTOR notes documented with rationale?",
|
|
157
185
|
"Is traceability complete: every change links to plan task ID and spec criterion?"
|
|
@@ -203,53 +231,48 @@ export const TDD = {
|
|
|
203
231
|
next: "review",
|
|
204
232
|
batchExecutionAllowed: true
|
|
205
233
|
};
|
|
206
|
-
function
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
.replace(/\bplan row\b/giu, "acceptance row")
|
|
212
|
-
.replace(/\bplan slice\b/giu, "acceptance slice")
|
|
213
|
-
.replace(/\bplan artifact\b/giu, "spec artifact")
|
|
214
|
-
.replace(/\btraceable to plan slice\b/giu, "traceable to acceptance criterion")
|
|
215
|
-
.replace(/05-plan\.md/gu, "04-spec.md");
|
|
216
|
-
}
|
|
217
|
-
function tddQuickTrackVariant() {
|
|
234
|
+
function tddStageVariantForTrack(track) {
|
|
235
|
+
const renderContext = trackRenderContext(track);
|
|
236
|
+
if (renderContext.usesPlanTerminology) {
|
|
237
|
+
return TDD;
|
|
238
|
+
}
|
|
218
239
|
return {
|
|
219
240
|
...TDD,
|
|
220
|
-
|
|
221
|
-
skillDescription: quickTrackText(TDD.skillDescription),
|
|
241
|
+
skillDescription: renderTrackTerminology(TDD.skillDescription, renderContext),
|
|
222
242
|
philosophy: {
|
|
223
243
|
...TDD.philosophy,
|
|
224
|
-
hardGate:
|
|
244
|
+
hardGate: renderTrackTerminology(TDD.philosophy.hardGate, renderContext)
|
|
225
245
|
},
|
|
226
246
|
executionModel: {
|
|
227
247
|
...TDD.executionModel,
|
|
228
|
-
checklist: TDD.executionModel.checklist.map(
|
|
229
|
-
interactionProtocol: TDD.executionModel.interactionProtocol
|
|
230
|
-
|
|
248
|
+
checklist: TDD.executionModel.checklist.map((value) => renderTrackTerminology(value, renderContext)),
|
|
249
|
+
interactionProtocol: TDD.executionModel.interactionProtocol
|
|
250
|
+
.map((value) => renderTrackTerminology(value, renderContext)),
|
|
251
|
+
process: TDD.executionModel.process.map((value) => renderTrackTerminology(value, renderContext)),
|
|
231
252
|
requiredGates: TDD.executionModel.requiredGates
|
|
232
253
|
.filter((gate) => gate.id !== "tdd_traceable_to_plan")
|
|
233
254
|
.map((gate) => ({
|
|
234
255
|
...gate,
|
|
235
|
-
description:
|
|
256
|
+
description: renderTrackTerminology(gate.description, renderContext)
|
|
236
257
|
})),
|
|
237
|
-
requiredEvidence: TDD.executionModel.requiredEvidence
|
|
238
|
-
|
|
239
|
-
|
|
258
|
+
requiredEvidence: TDD.executionModel.requiredEvidence
|
|
259
|
+
.map((value) => renderTrackTerminology(value, renderContext)),
|
|
260
|
+
inputs: TDD.executionModel.inputs.map((value) => renderTrackTerminology(value, renderContext)),
|
|
261
|
+
requiredContext: [renderContext.upstreamArtifactLabel, "existing test patterns", "affected contracts and state boundaries"]
|
|
240
262
|
},
|
|
241
263
|
reviewLens: {
|
|
242
264
|
...TDD.reviewLens,
|
|
243
265
|
reviewSections: TDD.reviewLens.reviewSections.map((section) => ({
|
|
244
266
|
...section,
|
|
245
|
-
evaluationPoints: section.evaluationPoints
|
|
267
|
+
evaluationPoints: section.evaluationPoints
|
|
268
|
+
.map((point) => renderTrackTerminology(point, renderContext))
|
|
246
269
|
}))
|
|
247
270
|
},
|
|
248
271
|
artifactRules: {
|
|
249
272
|
...TDD.artifactRules,
|
|
250
273
|
crossStageTrace: {
|
|
251
274
|
...TDD.artifactRules.crossStageTrace,
|
|
252
|
-
readsFrom: [
|
|
275
|
+
readsFrom: [renderContext.upstreamArtifactPath],
|
|
253
276
|
traceabilityRule: "Every RED test traces to an acceptance criterion. Every GREEN change traces to a RED test. Evidence chain must be unbroken."
|
|
254
277
|
},
|
|
255
278
|
artifactValidation: TDD.artifactRules.artifactValidation.map((row) => {
|
|
@@ -268,15 +291,12 @@ function tddQuickTrackVariant() {
|
|
|
268
291
|
}
|
|
269
292
|
return {
|
|
270
293
|
...row,
|
|
271
|
-
validationRule:
|
|
294
|
+
validationRule: renderTrackTerminology(row.validationRule, renderContext)
|
|
272
295
|
};
|
|
273
296
|
})
|
|
274
297
|
}
|
|
275
298
|
};
|
|
276
299
|
}
|
|
277
300
|
export function tddStageForTrack(track) {
|
|
278
|
-
|
|
279
|
-
return tddQuickTrackVariant();
|
|
280
|
-
}
|
|
281
|
-
return TDD;
|
|
301
|
+
return tddStageVariantForTrack(track);
|
|
282
302
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RUNTIME_ROOT } from "../constants.js";
|
|
2
|
-
import { FLOW_MAP_REL_PATH } from "./flow-map.js";
|
|
3
2
|
const START_SKILL_FOLDER = "flow-start";
|
|
4
3
|
const START_SKILL_NAME = "flow-start";
|
|
5
4
|
function flowStatePath() {
|
|
@@ -79,17 +78,18 @@ This is the **recommended way to start** working with cclaw. Use \`/cc-next\` fo
|
|
|
79
78
|
- **standard** (full 8 stages — default fallback) — anything that introduces a new capability with architecture uncertainty, touches many modules, or has unclear scope.
|
|
80
79
|
Triggers: \`new feature\`, \`refactor\`, \`migration\`, \`platform\`, \`architecture\`, \`schema\`, \`integrate\`, \`workflow\`, \`onboarding\`, or any prompt that does not match quick/medium confidently.
|
|
81
80
|
- When triggers conflict, prefer **standard** over **medium**, and **medium** over **quick**.
|
|
82
|
-
8. Present the
|
|
81
|
+
8. Present one compact **Start framing** summary: class, recommended track, stack, origin docs, seed recalls, and the recommended next action. Ask a single confirmation question only when there is a destructive reset, a real contradiction, or ambiguous software/non-software classification.
|
|
82
|
+
9. Present the recommendation as a single decision with explicit options:
|
|
83
83
|
> \`Recommended track: <quick|medium|standard>\` because \`<one-line reason citing matched triggers>\`.
|
|
84
84
|
> Override? (A) keep \`<recommended>\` (B) switch track (C) cancel.
|
|
85
85
|
If the harness's native ask tool is available (\`AskUserQuestion\` / \`AskQuestion\` / \`question\` / \`request_user_input\`), send exactly ONE question; on schema error, fall back to a plain-text lettered list.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- quick → \`.cclaw/skills/specification-authoring/SKILL.md\`
|
|
90
|
-
- medium/standard → \`.cclaw/skills/brainstorming/SKILL.md\`
|
|
86
|
+
10. Persist the chosen track to \`${flowPath}\` (\`track\` field). Compute \`skippedStages\` from the track and write that too. Use the **first stage of the chosen track** as \`currentStage\` (quick → \`spec\`, medium/standard → \`brainstorm\`, trivial fast-path → \`design\` or \`spec\` per Phase 0).
|
|
87
|
+
11. Write the prompt to \`.cclaw/artifacts/00-idea.md\` with the following header lines: \`Class:\` (from Phase 0), \`Track:\` (chosen track + matched heuristic), \`Stack:\` (from Phase 2 detection, or \`unknown\`), and a \`Discovered context\` section if Phase 1/seed recall found references.
|
|
88
|
+
12. Load the **first-stage skill for the chosen track** and its command file:
|
|
89
|
+
- quick → \`.cclaw/skills/specification-authoring/SKILL.md\`
|
|
90
|
+
- medium/standard → \`.cclaw/skills/brainstorming/SKILL.md\`
|
|
91
91
|
- trivial fast-path → design or spec skill per Phase 0 decision.
|
|
92
|
-
|
|
92
|
+
13. Execute that stage with the prompt + Phase 1/Phase 2 + seed context as initial input.
|
|
93
93
|
|
|
94
94
|
### Reclassification on discovery
|
|
95
95
|
|
|
@@ -124,9 +124,7 @@ Validate envelopes with:
|
|
|
124
124
|
|
|
125
125
|
## Surface reference
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
files) load \`${FLOW_MAP_REL_PATH}\` — useful when a fresh session
|
|
129
|
-
needs orientation before \`/cc <prompt>\` runs.
|
|
127
|
+
Use the start skill plus \`.cclaw/state/flow-state.json\` for orientation before \`/cc <prompt>\` runs.
|
|
130
128
|
`;
|
|
131
129
|
}
|
|
132
130
|
/**
|
|
@@ -165,7 +163,7 @@ Do **not** silently discard an existing flow when the user provides a prompt. If
|
|
|
165
163
|
- Inform: "You have an active flow at stage **{currentStage}** with {N} completed stages. Starting a new tracked flow will reset progress."
|
|
166
164
|
- Ask: "Continue with reset? (A) Yes, start fresh (B) No, resume current flow"
|
|
167
165
|
- If (B) → switch to Path B behavior.
|
|
168
|
-
7. **Classify the idea** using the heuristic below and present
|
|
166
|
+
7. **Classify the idea** using the heuristic below and present one compact Start framing summary (class, track, stack, origin docs, seed recalls, next action). Wait for explicit confirmation or override before mutating any state only when reset/conflict/ambiguity makes it necessary.
|
|
169
167
|
- If \`${RUNTIME_ROOT}/config.yaml\` defines \`trackHeuristics\`, apply those vocabulary hints (\`fallback\`, \`tracks.<id>.{triggers,veto}\`) on top of built-in defaults. Evaluation order is fixed: \`standard -> medium -> quick\`. (Honest note: this is advisory prose; the LLM applies it, not a Node-level router.)
|
|
170
168
|
|
|
171
169
|
**Track heuristic** (lowercase substring match against the user prompt):
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Does not mutate state. Always safe to run.
|
|
2
|
+
* Body for /cc-view status — read-only status snapshot embedded in flow-view.
|
|
4
3
|
*/
|
|
5
|
-
export declare function
|
|
6
|
-
/**
|
|
7
|
-
* Skill body for /cc-view status — read-only status snapshot.
|
|
8
|
-
*/
|
|
9
|
-
export declare function statusCommandSkillMarkdown(): string;
|
|
4
|
+
export declare function statusSubcommandMarkdown(): string;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { RUNTIME_ROOT } from "../constants.js";
|
|
2
|
-
const STATUS_SKILL_FOLDER = "flow-status";
|
|
3
|
-
const STATUS_SKILL_NAME = "flow-status";
|
|
4
2
|
function flowStatePath() {
|
|
5
3
|
return `${RUNTIME_ROOT}/state/flow-state.json`;
|
|
6
4
|
}
|
|
@@ -10,134 +8,16 @@ function delegationLogPath() {
|
|
|
10
8
|
function knowledgePath() {
|
|
11
9
|
return `${RUNTIME_ROOT}/knowledge.jsonl`;
|
|
12
10
|
}
|
|
13
|
-
function contextModePath() {
|
|
14
|
-
return `${RUNTIME_ROOT}/state/context-mode.json`;
|
|
15
|
-
}
|
|
16
|
-
function checkpointPath() {
|
|
17
|
-
return `${RUNTIME_ROOT}/state/checkpoint.json`;
|
|
18
|
-
}
|
|
19
|
-
function stageActivityPath() {
|
|
20
|
-
return `${RUNTIME_ROOT}/state/stage-activity.jsonl`;
|
|
21
|
-
}
|
|
22
|
-
function snapshotPath() {
|
|
23
|
-
return `${RUNTIME_ROOT}/state/flow-state.snapshot.json`;
|
|
24
|
-
}
|
|
25
|
-
function harnessGapsPath() {
|
|
26
|
-
return `${RUNTIME_ROOT}/state/harness-gaps.json`;
|
|
27
|
-
}
|
|
28
11
|
function retroArtifactPath() {
|
|
29
12
|
return `${RUNTIME_ROOT}/artifacts/09-retro.md`;
|
|
30
13
|
}
|
|
31
14
|
/**
|
|
32
|
-
*
|
|
33
|
-
* Does not mutate state. Always safe to run.
|
|
34
|
-
*/
|
|
35
|
-
export function statusCommandContract() {
|
|
36
|
-
const flowPath = flowStatePath();
|
|
37
|
-
const delegationPath = delegationLogPath();
|
|
38
|
-
return `# /cc-view status
|
|
39
|
-
|
|
40
|
-
## Purpose
|
|
41
|
-
|
|
42
|
-
**Read-only visual snapshot of the cclaw run.** Shows progress bar, current stage,
|
|
43
|
-
gate coverage, delegation status with fulfillmentMode, closeout substate after
|
|
44
|
-
ship, harness parity fallback, stale markers, and top knowledge highlights.
|
|
45
|
-
|
|
46
|
-
This command **never mutates state**. Use it at session start to orient, or at any
|
|
47
|
-
time to answer "where are we?" without advancing the flow.
|
|
48
|
-
|
|
49
|
-
## HARD-GATE
|
|
50
|
-
|
|
51
|
-
- **Do not** use \`/cc-view status\` output to infer gate completion for decisions — cite
|
|
52
|
-
artifact evidence via \`/cc-next\` when advancing.
|
|
53
|
-
- **Do not** mutate \`${flowPath}\` or delegation log from this command.
|
|
54
|
-
- **Do not** rewrite \`${snapshotPath()}\` from this command (use \`/cc-view diff\`).
|
|
55
|
-
|
|
56
|
-
## Algorithm
|
|
57
|
-
|
|
58
|
-
1. Read **\`${flowPath}\`** — capture \`track\`, \`currentStage\`, \`completedStages\`,
|
|
59
|
-
\`skippedStages\`, \`staleStages\`, per-stage gate catalog, and **\`closeout\`**
|
|
60
|
-
(shipSubstate + retro/compound flags).
|
|
61
|
-
2. Read **\`${delegationPath}\`** — for each mandatory agent of the current stage,
|
|
62
|
-
capture \`status\`, \`fulfillmentMode\`, and whether \`evidenceRefs\` are present.
|
|
63
|
-
3. Read **\`${contextModePath()}\`** — surface \`activeMode\` (default if missing).
|
|
64
|
-
4. Compute **time in current stage** from the most recent stage-entry signal:
|
|
65
|
-
- Prefer \`${checkpointPath()}\`'s \`timestamp\` when its \`stage\` matches \`currentStage\`.
|
|
66
|
-
- Otherwise scan \`${stageActivityPath()}\` from the end for the first entry whose \`stage\` matches \`currentStage\` and use its \`ts\`.
|
|
67
|
-
- Compute the duration as \`now - signalTimestamp\` and render compactly: \`<X>m\`, \`<X>h<Y>m\`, or \`<X>d<Y>h\`.
|
|
68
|
-
- If no signal exists, render \`(unknown)\`.
|
|
69
|
-
5. Optionally read **\`${snapshotPath()}\`** to compute gate delta versus prior baseline:
|
|
70
|
-
- If missing or invalid, render \`delta: (baseline unavailable; run /cc-view diff)\`.
|
|
71
|
-
6. Read **\`${harnessGapsPath()}\`** (schemaVersion 2). For every installed harness
|
|
72
|
-
capture \`tier\`, \`subagentFallback\`, and \`playbookPath\` for the harness row.
|
|
73
|
-
7. Read the top of **\`${knowledgePath()}\`** — surface up to 3 most recent entries
|
|
74
|
-
(by trailing timestamp or source marker).
|
|
75
|
-
8. Detect **closeout artifacts**: check whether \`${retroArtifactPath()}\` exists on
|
|
76
|
-
disk and annotate the closeout row accordingly.
|
|
77
|
-
9. Emit the visual status block described below. Do **not** load any stage skill.
|
|
78
|
-
|
|
79
|
-
## Visual markers
|
|
80
|
-
|
|
81
|
-
Default UTF markers: \`✓\` passed, \`▶\` current, \`○\` pending, \`⊘\` skipped, \`⏸\` stale, \`✗\` blocked.
|
|
82
|
-
ASCII fallback (no UTF locale): \`[x]\`, \`[>]\`, \`[ ]\`, \`[-]\`, \`[=]\`, \`[!]\`.
|
|
83
|
-
|
|
84
|
-
Delegation markers: \`✓\` completed, \`◎\` completed-no-evidence (role-switch
|
|
85
|
-
harness; **blocks stage**), \`○\` scheduled/pending, \`⊘\` waived, \`✗\` failed.
|
|
86
|
-
|
|
87
|
-
## Status Block Format
|
|
88
|
-
|
|
89
|
-
\`\`\`
|
|
90
|
-
cclaw status
|
|
91
|
-
flow: <track> · run=<runId> · feature=<feature-id>
|
|
92
|
-
stage: <stage> (<N>/<total>) · time <Xd|XhYm|Xm|unknown> · mode <activeMode>
|
|
93
|
-
bar: [✓ brainstorm] [✓ scope] [▶ design] [○ spec] [○ plan] [○ tdd] [○ review] [○ ship]
|
|
94
|
-
gates: now <passed>/<required> · blocked <count> · delta <summary or baseline-unavailable>
|
|
95
|
-
delegations (<expectedMode>):
|
|
96
|
-
- planner ✓ completed mode=<isolated|generic-dispatch|role-switch>
|
|
97
|
-
- reviewer ○ pending
|
|
98
|
-
- test-author ◎ missing-evidence (role-switch; add evidenceRefs)
|
|
99
|
-
closeout: <shipSubstate> · retro=<drafted|accepted|skipped|—> · compound=<N promoted|skipped|—>
|
|
100
|
-
harness: <id>=<tier>/<fallback>, ... · playbooks: <M>/<N>
|
|
101
|
-
stale: <list or none>
|
|
102
|
-
knowledge:
|
|
103
|
-
- <latest entry summary>
|
|
104
|
-
- <second entry summary>
|
|
105
|
-
- <third entry summary>
|
|
106
|
-
next: /cc-next · /cc-view tree · /cc-view diff
|
|
107
|
-
\`\`\`
|
|
108
|
-
|
|
109
|
-
- Omit the \`closeout:\` row when \`currentStage !== "ship"\` and \`shipSubstate === "idle"\`.
|
|
110
|
-
- Omit \`delegations\` line when the current stage has zero mandatory delegations.
|
|
111
|
-
- Omit \`harness\` line only when \`${harnessGapsPath()}\` is missing or invalid
|
|
112
|
-
(render \`harness: (report unavailable; run cclaw upgrade)\`).
|
|
113
|
-
|
|
114
|
-
## Anti-patterns
|
|
115
|
-
|
|
116
|
-
- Inventing gate status without reading \`${flowPath}\`.
|
|
117
|
-
- Reporting delegations as satisfied when the log says \`pending\`.
|
|
118
|
-
- Treating a \`completed\` role-switch delegation without \`evidenceRefs\` as green
|
|
119
|
-
— it must surface as \`◎ missing-evidence\`.
|
|
120
|
-
- Advancing the stage from \`/cc-view status\` — progression belongs to \`/cc-next\`.
|
|
121
|
-
- Hiding the closeout substate after ship; retro/compound/archive progress must
|
|
122
|
-
be visible so \`/cc-next\` resumes at the right step.
|
|
123
|
-
|
|
124
|
-
## Primary skill
|
|
125
|
-
|
|
126
|
-
**${RUNTIME_ROOT}/skills/${STATUS_SKILL_FOLDER}/SKILL.md**
|
|
127
|
-
`;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Skill body for /cc-view status — read-only status snapshot.
|
|
15
|
+
* Body for /cc-view status — read-only status snapshot embedded in flow-view.
|
|
131
16
|
*/
|
|
132
|
-
export function
|
|
17
|
+
export function statusSubcommandMarkdown() {
|
|
133
18
|
const flowPath = flowStatePath();
|
|
134
19
|
const delegationPath = delegationLogPath();
|
|
135
|
-
return
|
|
136
|
-
name: ${STATUS_SKILL_NAME}
|
|
137
|
-
description: "Read-only visual snapshot of the cclaw flow with progress bar, gate delta, delegations (fulfillmentMode + evidence), closeout substate, and harness parity row."
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
# /cc-view status — Flow Status Snapshot
|
|
20
|
+
return `# /cc-view status — Flow Status Snapshot
|
|
141
21
|
|
|
142
22
|
## Overview
|
|
143
23
|
|
|
@@ -145,38 +25,29 @@ description: "Read-only visual snapshot of the cclaw flow with progress bar, gat
|
|
|
145
25
|
advancing or mutating anything. Safe to run at any point. The snapshot reflects:
|
|
146
26
|
|
|
147
27
|
- progress across stages with per-stage markers,
|
|
148
|
-
- gate coverage
|
|
28
|
+
- gate coverage,
|
|
149
29
|
- mandatory delegations with **fulfillmentMode** (isolated / generic-dispatch /
|
|
150
|
-
role-switch
|
|
30
|
+
role-switch) plus explicit waived status and evidence gate,
|
|
151
31
|
- **closeout substate** after ship (retro → compound → archive),
|
|
152
32
|
- **harness parity row** (tier + fallback) for the active harness set.
|
|
153
33
|
|
|
154
34
|
## HARD-GATE
|
|
155
35
|
|
|
156
36
|
Do **not** mutate \`${flowPath}\` or \`${delegationPath}\` from this skill. This is
|
|
157
|
-
a read-only command.
|
|
37
|
+
a read-only command.
|
|
158
38
|
|
|
159
39
|
## Algorithm
|
|
160
40
|
|
|
161
41
|
1. Read \`${flowPath}\`. If missing → report **BLOCKED: flow state absent** and suggest \`cclaw init\`.
|
|
162
42
|
2. Read \`${delegationPath}\`. Missing → treat all mandatory delegations as pending.
|
|
163
|
-
3.
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
- If available, compare current stage \`passed\` / \`blocked\` sets against baseline.
|
|
170
|
-
- If unavailable, render \`delta: (baseline unavailable; run /cc-view diff)\`.
|
|
171
|
-
6. Read \`${harnessGapsPath()}\`:
|
|
172
|
-
- If \`schemaVersion === 2\`, for each entry render \`<harness>=<tier>/<subagentFallback>\`.
|
|
173
|
-
- Count existing \`playbookPath\` files on disk to print \`playbooks: <M>/<N>\`.
|
|
174
|
-
- If the file is missing or has an older schema, render
|
|
175
|
-
\`harness: (report unavailable; run cclaw upgrade)\`.
|
|
176
|
-
7. Read \`${RUNTIME_ROOT}/knowledge.jsonl\`. If missing or empty → knowledge highlights are \`(none recorded)\`. Parse each line as JSON and surface its \`trigger\`/\`action\`.
|
|
177
|
-
8. For each gate in \`stageGateCatalog[currentStage].required\`:
|
|
43
|
+
3. Render **time in stage** as \`(unknown)\` unless visible conversation or
|
|
44
|
+
artifact handoff context gives a timestamp.
|
|
45
|
+
4. Summarize current-stage gate counts from \`passed\`, \`blocked\`, and required gate metadata.
|
|
46
|
+
5. Derive harness \`<tier>/<fallback>\` rows from cclaw capability metadata.
|
|
47
|
+
6. Read \`${RUNTIME_ROOT}/knowledge.jsonl\`. If missing or empty → knowledge highlights are \`(none recorded)\`. Parse each line as JSON and surface its \`trigger\`/\`action\`.
|
|
48
|
+
7. For each gate in \`stageGateCatalog[currentStage].required\`:
|
|
178
49
|
- Satisfied if present in \`passed\` and absent from \`blocked\`.
|
|
179
|
-
|
|
50
|
+
8. For each mandatory delegation of the current stage, evaluate:
|
|
180
51
|
- \`✓ completed\` when \`status === "completed"\` and (harness is not role-switch
|
|
181
52
|
**or** \`evidenceRefs.length >= 1\`).
|
|
182
53
|
- \`◎ missing-evidence\` when \`status === "completed"\`, harness declares
|
|
@@ -184,22 +55,22 @@ a read-only command. Do **not** update \`${snapshotPath()}\` here.
|
|
|
184
55
|
- \`○ <status>\` for \`scheduled\` / pending.
|
|
185
56
|
- \`⊘ waived\` when \`status === "waived"\`.
|
|
186
57
|
- \`✗ failed\` when \`status === "failed"\`.
|
|
187
|
-
|
|
58
|
+
9. Compute **closeout row** when \`currentStage === "ship"\` or
|
|
188
59
|
\`closeout.shipSubstate !== "idle"\`:
|
|
189
60
|
- \`shipSubstate\` verbatim,
|
|
190
61
|
- \`retro=drafted|accepted|skipped|—\` derived from \`closeout.retroDraftedAt\`,
|
|
191
62
|
\`closeout.retroAcceptedAt\`, \`closeout.retroSkipped\`,
|
|
192
63
|
- \`compound=<N promoted>|skipped|—\` from
|
|
193
64
|
\`closeout.compoundPromoted\` / \`closeout.compoundSkipped\`.
|
|
194
|
-
|
|
65
|
+
10. Build and print the visual status block:
|
|
195
66
|
- stage header
|
|
196
67
|
- one-line progress bar with per-stage markers
|
|
197
|
-
- gate summary
|
|
68
|
+
- gate summary
|
|
198
69
|
- delegation rows (per mandatory agent)
|
|
199
70
|
- closeout row (when active)
|
|
200
71
|
- harness row
|
|
201
72
|
- stale stage row
|
|
202
|
-
|
|
73
|
+
11. Suggest the next action:
|
|
203
74
|
- If current stage has unmet gates → \`/cc-next\` to resume.
|
|
204
75
|
- If closeout substate is non-idle → \`/cc-next\` to continue the chain.
|
|
205
76
|
- If current stage is complete → \`/cc-next\` to advance (or report "Flow complete" if terminal).
|
|
@@ -207,6 +78,8 @@ a read-only command. Do **not** update \`${snapshotPath()}\` here.
|
|
|
207
78
|
## Output Guidelines
|
|
208
79
|
|
|
209
80
|
- Keep output compact (≤ 40 lines) — status, not narrative.
|
|
81
|
+
- Start with the same operator rows as \`/cc-next\` when possible:
|
|
82
|
+
\`Stage\`, \`Gates\`, \`Delegations\`, \`Blockers\`, \`Next\`.
|
|
210
83
|
- Report counts, not full artifact contents.
|
|
211
84
|
- If any data source is missing or corrupt, say so explicitly rather than guessing.
|
|
212
85
|
- Include \`/cc-view tree\` for deep structure and \`/cc-view diff\` for before/after map in the final line.
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Markdown content generators for Cclaw’s subagent orchestration skills and enhanced
|
|
3
|
-
* specialist payloads. Cclaw materializes static instructions — this module does not
|
|
4
|
-
* execute orchestration logic at install time beyond string assembly.
|
|
5
|
-
*/
|
|
6
1
|
export declare function subagentDrivenDevSkill(): string;
|
|
7
2
|
export declare function parallelAgentsSkill(): string;
|
|
8
3
|
/**
|