cclaw-cli 0.13.0 → 0.14.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/dist/cli.js CHANGED
@@ -115,6 +115,17 @@ function buildInitSurfacePreview(harnesses) {
115
115
  ".cclaw/config.yaml",
116
116
  ".cclaw/commands/*.md",
117
117
  ".cclaw/skills/*/SKILL.md",
118
+ ".cclaw/contexts/*.md",
119
+ ".cclaw/templates/*",
120
+ ".cclaw/agents/*.md",
121
+ ".cclaw/hooks/*",
122
+ ".cclaw/rules/**",
123
+ ".cclaw/adapters/*.md",
124
+ ".cclaw/custom-skills/README.md",
125
+ ".cclaw/features/**",
126
+ ".cclaw/runs/**",
127
+ ".cclaw/artifacts/**",
128
+ ".cclaw/knowledge.jsonl",
118
129
  ".cclaw/state/*.json|*.jsonl",
119
130
  ".cclaw/references/**",
120
131
  "AGENTS.md (managed block)"
package/dist/config.js CHANGED
@@ -15,7 +15,6 @@ const ALLOWED_CONFIG_KEYS = new Set([
15
15
  "version",
16
16
  "flowVersion",
17
17
  "harnesses",
18
- "autoAdvance",
19
18
  "promptGuardMode",
20
19
  "tddEnforcement",
21
20
  "tddTestGlobs",
@@ -60,7 +59,6 @@ export function createDefaultConfig(harnesses = DEFAULT_HARNESSES, defaultTrack
60
59
  version: CCLAW_VERSION,
61
60
  flowVersion: FLOW_VERSION,
62
61
  harnesses,
63
- autoAdvance: false,
64
62
  promptGuardMode: "advisory",
65
63
  tddEnforcement: "advisory",
66
64
  tddTestGlobs: ["**/*.test.*", "**/*.spec.*", "**/test/**"],
@@ -81,7 +79,6 @@ export function createProfileConfig(profile, overrides = {}) {
81
79
  return {
82
80
  ...base,
83
81
  harnesses: overrides.harnesses ?? ["claude"],
84
- autoAdvance: false,
85
82
  promptGuardMode: "advisory",
86
83
  tddEnforcement: "advisory",
87
84
  gitHookGuards: false,
@@ -92,7 +89,6 @@ export function createProfileConfig(profile, overrides = {}) {
92
89
  return {
93
90
  ...base,
94
91
  harnesses: overrides.harnesses ?? DEFAULT_HARNESSES,
95
- autoAdvance: false,
96
92
  promptGuardMode: "advisory",
97
93
  tddEnforcement: "advisory",
98
94
  gitHookGuards: false,
@@ -103,7 +99,6 @@ export function createProfileConfig(profile, overrides = {}) {
103
99
  return {
104
100
  ...base,
105
101
  harnesses: overrides.harnesses ?? DEFAULT_HARNESSES,
106
- autoAdvance: false,
107
102
  promptGuardMode: "strict",
108
103
  tddEnforcement: "strict",
109
104
  gitHookGuards: true,
@@ -147,8 +142,6 @@ export async function readConfig(projectRoot) {
147
142
  const harnesses = hasHarnessesField
148
143
  ? [...new Set(validatedHarnesses)]
149
144
  : DEFAULT_HARNESSES;
150
- const autoAdvanceRaw = parsed.autoAdvance;
151
- const autoAdvance = typeof autoAdvanceRaw === "boolean" ? autoAdvanceRaw : false;
152
145
  const promptGuardModeRaw = parsed.promptGuardMode;
153
146
  if (Object.prototype.hasOwnProperty.call(parsed, "promptGuardMode") &&
154
147
  promptGuardModeRaw !== "advisory" &&
@@ -261,7 +254,6 @@ export async function readConfig(projectRoot) {
261
254
  version: parsed.version ?? CCLAW_VERSION,
262
255
  flowVersion: parsed.flowVersion ?? FLOW_VERSION,
263
256
  harnesses,
264
- autoAdvance,
265
257
  promptGuardMode,
266
258
  tddEnforcement,
267
259
  tddTestGlobs,
@@ -7,6 +7,6 @@ export declare const DEFAULT_HARNESSES: HarnessId[];
7
7
  export declare const REQUIRED_DIRS: readonly [".cclaw", ".cclaw/commands", ".cclaw/skills", ".cclaw/contexts", ".cclaw/templates", ".cclaw/artifacts", ".cclaw/features", ".cclaw/state", ".cclaw/runs", ".cclaw/rules", ".cclaw/adapters", ".cclaw/agents", ".cclaw/hooks", ".cclaw/custom-skills"];
8
8
  export declare const REQUIRED_GITIGNORE_PATTERNS: readonly ["# cclaw generated artifacts", ".cclaw/", ".claude/commands/cc-*.md", ".claude/commands/cc.md", ".cursor/commands/cc-*.md", ".cursor/commands/cc.md", ".opencode/commands/cc-*.md", ".opencode/commands/cc.md", ".codex/commands/cc-*.md", ".codex/commands/cc.md", ".claude/hooks/hooks.json", ".cursor/hooks.json", ".codex/hooks.json", ".opencode/plugins/cclaw-plugin.mjs", ".cursor/rules/cclaw-workflow.mdc"];
9
9
  export declare const COMMAND_FILE_ORDER: FlowStage[];
10
- export declare const UTILITY_COMMANDS: readonly ["learn", "next", "status", "tree", "diff", "feature", "tdd-log", "retro", "rewind", "rewind-ack"];
10
+ export declare const UTILITY_COMMANDS: readonly ["learn", "next", "view", "status", "tree", "diff", "ops", "feature", "tdd-log", "retro", "archive", "rewind", "rewind-ack"];
11
11
  export declare const SUBAGENT_SKILL_FOLDERS: readonly ["subagent-dev", "parallel-dispatch"];
12
12
  export type UtilityCommand = (typeof UTILITY_COMMANDS)[number];
package/dist/constants.js CHANGED
@@ -54,12 +54,15 @@ export const COMMAND_FILE_ORDER = [
54
54
  export const UTILITY_COMMANDS = [
55
55
  "learn",
56
56
  "next",
57
+ "view",
57
58
  "status",
58
59
  "tree",
59
60
  "diff",
61
+ "ops",
60
62
  "feature",
61
63
  "tdd-log",
62
64
  "retro",
65
+ "archive",
63
66
  "rewind",
64
67
  "rewind-ack"
65
68
  ];
@@ -0,0 +1,2 @@
1
+ export declare function archiveCommandContract(): string;
2
+ export declare function archiveCommandSkillMarkdown(): string;
@@ -0,0 +1,98 @@
1
+ import { RUNTIME_ROOT } from "../constants.js";
2
+ const ARCHIVE_SKILL_FOLDER = "flow-archive";
3
+ const ARCHIVE_SKILL_NAME = "flow-archive";
4
+ function flowStatePath() {
5
+ return `${RUNTIME_ROOT}/state/flow-state.json`;
6
+ }
7
+ function runsPath() {
8
+ return `${RUNTIME_ROOT}/runs`;
9
+ }
10
+ function activeArtifactsPath() {
11
+ return `${RUNTIME_ROOT}/artifacts`;
12
+ }
13
+ export function archiveCommandContract() {
14
+ return `# /cc-archive
15
+
16
+ ## Purpose
17
+
18
+ Archive the active cclaw run from inside the harness flow (agent-first finish).
19
+
20
+ This command removes the user-facing CLI gap: users can stay in \`/cc-*\` flow and
21
+ finish with \`/cc-archive\` after ship + retro are complete.
22
+
23
+ ## HARD-GATE
24
+
25
+ - Do not archive a shipped run when retro is still incomplete.
26
+ - Do not manually move files between \`${activeArtifactsPath()}\` and \`${runsPath()}\`.
27
+ - Use the archive runtime so state snapshots + manifest stay consistent.
28
+
29
+ ## Inputs
30
+
31
+ \`/cc-archive [--name=<slug>] [--skip-retro --retro-reason=<text>]\`
32
+
33
+ ## Algorithm
34
+
35
+ 1. Read \`${flowStatePath()}\`.
36
+ 2. If ship is complete and \`retro.completedAt\` is absent:
37
+ - block with explicit instruction: run \`/cc-retro\` first.
38
+ 3. Build archive command:
39
+ - base: \`npx cclaw archive\`
40
+ - optional: \`--name=<slug>\`
41
+ - optional override: \`--skip-retro --retro-reason=<text>\`
42
+ 4. Execute archive command in project root.
43
+ 5. Surface result:
44
+ - archive id/path,
45
+ - reset stage (brainstorm/spec depending on track default),
46
+ - knowledge curation hint when threshold exceeded.
47
+
48
+ ## Output format
49
+
50
+ \`\`\`
51
+ cclaw archive
52
+ status: archived
53
+ run: <archive-id>
54
+ path: .cclaw/runs/<archive-id>
55
+ next: /cc <new-idea>
56
+ \`\`\`
57
+
58
+ ## Primary skill
59
+
60
+ **${RUNTIME_ROOT}/skills/${ARCHIVE_SKILL_FOLDER}/SKILL.md**
61
+ `;
62
+ }
63
+ export function archiveCommandSkillMarkdown() {
64
+ return `---
65
+ name: ${ARCHIVE_SKILL_NAME}
66
+ description: "Archive the active cclaw run from harness flow and reset runtime safely."
67
+ ---
68
+
69
+ # /cc-archive
70
+
71
+ ## HARD-GATE
72
+
73
+ Never simulate archive by hand-editing runtime files. Always execute the archive
74
+ runtime command so state snapshots and manifest generation stay atomic.
75
+
76
+ ## Protocol
77
+
78
+ 1. Read \`${flowStatePath()}\`:
79
+ - confirm whether ship is completed,
80
+ - check \`retro.completedAt\` for post-ship runs.
81
+ 2. If ship complete and retro incomplete -> stop and direct user to \`/cc-retro\`.
82
+ 3. Build shell command:
83
+ - \`npx cclaw archive\`
84
+ - append \`--name=<slug>\` when provided
85
+ - append \`--skip-retro --retro-reason=<text>\` only when user explicitly requests skip
86
+ 4. Run command from repo root.
87
+ 5. Relay key lines from output:
88
+ - archive destination under \`${runsPath()}\`
89
+ - flow reset confirmation
90
+ - knowledge curation recommendation
91
+
92
+ ## Validation
93
+
94
+ - \`${runsPath()}\` contains a new archive folder.
95
+ - \`${activeArtifactsPath()}\` is reset for the next run.
96
+ - \`${flowStatePath()}\` is valid JSON and points to the initial stage.
97
+ `;
98
+ }
@@ -36,7 +36,7 @@ ${schema.hardGate}
36
36
  ${hydrationLines}
37
37
  4. Stream \`.cclaw/knowledge.jsonl\` and apply relevant JSON-line entries (strict schema: type, trigger, action, confidence, domain, stage, created, project).
38
38
  5. Write stage output to ${writeStepPaths}.
39
- 6. Do NOT copy artifacts into \`.cclaw/runs/\`; archival is handled only by \`cclaw archive\`.
39
+ 6. Do NOT copy artifacts into \`.cclaw/runs/\`; archival is handled by \`/cc-archive\` (agent-facing wrapper over archive runtime).
40
40
 
41
41
  ## Gates
42
42
  ${gateIds}
@@ -65,13 +65,16 @@ All harnesses receive the same utility commands:
65
65
 
66
66
  - \`/cc\` - flow entry and resume
67
67
  - \`/cc-next\` - stage progression
68
+ - \`/cc-view\` - read-only router for status/tree/diff
68
69
  - \`/cc-learn\` - knowledge capture/lookup
69
70
  - \`/cc-status\` - read-only visual flow snapshot
70
71
  - \`/cc-tree\` - deep flow tree (stages, artifacts, stale markers)
71
72
  - \`/cc-diff\` - before/after flow-state diff map
73
+ - \`/cc-ops\` - operations router for feature/tdd-log/retro/archive/rewind
72
74
  - \`/cc-feature\` - multi-feature workspace management
73
75
  - \`/cc-tdd-log\` - explicit RED/GREEN/REFACTOR evidence log
74
76
  - \`/cc-retro\` - mandatory retrospective gate before archive
77
+ - \`/cc-archive\` - archive active run from harness flow
75
78
  - \`/cc-rewind\` - rewind flow and invalidate downstream stages
76
79
  - \`/cc-rewind-ack\` - clear stale stage markers after redo
77
80
 
@@ -742,7 +742,7 @@ if [ "$CHECKPOINT_WRITTEN" -eq 0 ]; then
742
742
  CHECKPOINT_NOTE="Checkpoint update failed. Review ${RUNTIME_ROOT}/state/checkpoint.json manually."
743
743
  fi
744
744
 
745
- RUN_SYNC_NOTE="Run metadata sync removed; active artifacts stay in ${RUNTIME_ROOT}/artifacts until cclaw archive."
745
+ RUN_SYNC_NOTE="Run metadata sync removed; active artifacts stay in ${RUNTIME_ROOT}/artifacts until /cc-archive (or cclaw archive runtime)."
746
746
 
747
747
  # --- Escape for JSON ---
748
748
  ${ESCAPE_FN}
@@ -6,5 +6,3 @@ export declare const KNOWLEDGE_JSONL_FIELDS: readonly ["type", "trigger", "actio
6
6
  export declare function learnSkillMarkdown(): string;
7
7
  export declare function learnCommandContract(): string;
8
8
  export declare function selfImprovementBlock(stageName: string): string;
9
- export declare function learningsSearchPreamble(stage: string): string;
10
- export declare function learningsAgentsMdBlock(): string;
@@ -137,38 +137,9 @@ Do not edit source code from this command. Only operate on \`${KNOWLEDGE_PATH}\`
137
137
  export function selfImprovementBlock(stageName) {
138
138
  return `## Operational Self-Improvement
139
139
 
140
- After this stage, ask:
141
- - Did I discover a non-obvious reusable **rule** or **pattern**?
142
- - Did a failure reveal a reusable **lesson**?
143
-
144
- If yes, append one concise JSON line to the canonical knowledge store
145
- (\`${KNOWLEDGE_PATH}\`) using the strict 8-field schema:
146
-
147
- \`\`\`bash
148
- TS="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
149
- printf '%s\\n' '{"type":"pattern","trigger":"when <situation>","action":"<concrete move>","confidence":"medium","domain":null,"stage":"${stageName}","created":"'"$TS"'","project":null}' >> ${KNOWLEDGE_PATH}
150
- \`\`\`
151
-
152
- Type must be exactly one of: \`rule\`, \`pattern\`, \`lesson\`, \`compound\`.
153
- Fields must appear in the order: \`type, trigger, action, confidence, domain, stage, created, project\`.
154
- Missing optional values must be emitted as \`null\`, never omitted.
155
- `;
156
- }
157
- export function learningsSearchPreamble(stage) {
158
- return `## Prior Knowledge (load at stage start)
159
-
160
- Before stage work, stream \`${KNOWLEDGE_PATH}\` and filter for entries relevant to
161
- this stage (\`${stage}\`), affected domains, and key constraints. Apply matching
162
- entries explicitly. If the file is empty, continue normally.
163
- `;
164
- }
165
- export function learningsAgentsMdBlock() {
166
- return `### Knowledge Store
167
-
168
- \`${KNOWLEDGE_PATH}\` — append-only JSONL memory with entry types \`rule\`, \`pattern\`, \`lesson\`, \`compound\`.
169
- Strict 8-field schema: \`type, trigger, action, confidence, domain, stage, created, project\`.
170
- At session start and stage transitions, tail the file and apply relevant entries.
171
- If a non-obvious reusable rule/pattern/lesson is discovered, append a new line
172
- through \`/cc-learn add\` (never hand-edit).
140
+ Before closeout, capture 1-3 reusable insights in \`${KNOWLEDGE_PATH}\` whenever
141
+ the stage produced non-obvious decisions, patterns, or lessons.
142
+ Prefer \`type=rule|pattern|lesson\` (\`compound\` stays retro-only) and set
143
+ \`stage: "${stageName}"\` unless the insight is explicitly cross-stage.
173
144
  `;
174
145
  }
@@ -3,7 +3,7 @@ export const META_SKILL_NAME = "using-cclaw";
3
3
  export function usingCclawSkillMarkdown() {
4
4
  return `---
5
5
  name: using-cclaw
6
- description: "Routing brain for cclaw. Decide whether to start/resume a stage, answer directly, or use utility commands like /cc-learn, /cc-status, /cc-tree, and /cc-diff."
6
+ description: "Routing brain for cclaw. Decide whether to start/resume a stage, answer directly, or use utility commands like /cc-learn, /cc-view, and /cc-ops."
7
7
  ---
8
8
 
9
9
  # Using Cclaw
@@ -27,7 +27,8 @@ Task arrives
27
27
  ├─ New software work? -> /cc <idea>
28
28
  ├─ Resume existing flow? -> /cc or /cc-next
29
29
  ├─ Knowledge operation? -> /cc-learn
30
- └─ Workspace operation? -> /cc-status, /cc-tree, /cc-diff, /cc-feature, /cc-tdd-log, /cc-retro, /cc-rewind
30
+ ├─ Read-only workspace view? -> /cc-view [status|tree|diff]
31
+ └─ Workspace operation? -> /cc-ops [feature|tdd-log|retro|archive|rewind|rewind-ack]
31
32
  \`\`\`
32
33
 
33
34
  ## Task classification
@@ -33,7 +33,7 @@ This is the only progression command the user needs to drive the entire flow. St
33
33
 
34
34
  - **Do not** invent gate completion: use only \`${flowPath}\` plus observable evidence in repo artifacts.
35
35
  - **Do not** skip stages: advance only from \`currentStage\` to its configured successor.
36
- - If the flow is at the terminal stage with all ship gates satisfied, **report completion**.
36
+ - If the flow reaches terminal ship completion, route closeout in order: **/cc-retro -> /cc-archive**.
37
37
 
38
38
  ## Algorithm (mandatory)
39
39
 
@@ -54,7 +54,10 @@ This is the only progression command the user needs to drive the entire flow. St
54
54
 
55
55
  ### Path B: Current stage IS complete (all gates passed, all delegations satisfied)
56
56
 
57
- → If current stage's \`next\` is **\`done\`**: report **"Flow complete. All stages finished."** and stop.
57
+ → If current stage's \`next\` is **\`done\`**:
58
+ - if \`currentStage === "ship"\` and \`retro.completedAt\` is missing -> route to \`/cc-retro\`,
59
+ - if \`currentStage === "ship"\` and \`retro.completedAt\` is present -> route to \`/cc-archive\`,
60
+ - otherwise report **"Flow complete. All stages finished."** and stop.
58
61
  → Otherwise: load **\`${RUNTIME_ROOT}/skills/<skillFolder>/SKILL.md\`** and **\`${RUNTIME_ROOT}/commands/<nextStage>.md\`** for the successor stage. Execute that stage's protocol.
59
62
 
60
63
  ### Track-aware successor resolution
@@ -144,7 +147,11 @@ Execute the stage protocol. The stage skill handles interaction, STOP points, ga
144
147
 
145
148
  **Path B — stage IS complete (all gates met, all delegations done):**
146
149
 
147
- If \`next\` is \`done\` → report **"Flow complete. All stages finished."** and stop.
150
+ If \`next\` is \`done\`:
151
+
152
+ - If \`currentStage\` is \`ship\` and \`retro.completedAt\` is missing -> route to \`/cc-retro\`.
153
+ - If \`currentStage\` is \`ship\` and \`retro.completedAt\` exists -> route to \`/cc-archive\`.
154
+ - Otherwise report **"Flow complete. All stages finished."** and stop.
148
155
 
149
156
  Otherwise load the next stage's skill and command contract, begin execution.
150
157
 
@@ -0,0 +1,2 @@
1
+ export declare function opsCommandContract(): string;
2
+ export declare function opsCommandSkillMarkdown(): string;
@@ -0,0 +1,60 @@
1
+ import { RUNTIME_ROOT } from "../constants.js";
2
+ const OPS_SKILL_FOLDER = "flow-ops";
3
+ const OPS_SKILL_NAME = "flow-ops";
4
+ export function opsCommandContract() {
5
+ return `# /cc-ops
6
+
7
+ ## Purpose
8
+
9
+ Unified operational command surface for non-stage flow actions.
10
+
11
+ Subcommands:
12
+ - \`feature\` -> \`/cc-feature\`
13
+ - \`tdd-log\` -> \`/cc-tdd-log\`
14
+ - \`retro\` -> \`/cc-retro\`
15
+ - \`archive\` -> \`/cc-archive\`
16
+ - \`rewind\` -> \`/cc-rewind\`
17
+ - \`rewind-ack\` -> \`/cc-rewind-ack\`
18
+
19
+ ## HARD-GATE
20
+
21
+ - \`/cc-ops\` is a routing wrapper; execute only one target subcommand per call.
22
+ - Preserve target command safety contracts (retro gate, archive gate, rewind atomicity, etc.).
23
+
24
+ ## Routing
25
+
26
+ 1. Parse required subcommand token.
27
+ 2. Dispatch:
28
+ - \`feature\` -> \`${RUNTIME_ROOT}/commands/feature.md\`
29
+ - \`tdd-log\` -> \`${RUNTIME_ROOT}/commands/tdd-log.md\`
30
+ - \`retro\` -> \`${RUNTIME_ROOT}/commands/retro.md\`
31
+ - \`archive\` -> \`${RUNTIME_ROOT}/commands/archive.md\`
32
+ - \`rewind\` -> \`${RUNTIME_ROOT}/commands/rewind.md\`
33
+ - \`rewind-ack\` -> \`${RUNTIME_ROOT}/commands/rewind-ack.md\`
34
+ 3. Unknown subcommand -> print supported values and stop.
35
+
36
+ ## Primary skill
37
+
38
+ **${RUNTIME_ROOT}/skills/${OPS_SKILL_FOLDER}/SKILL.md**
39
+ `;
40
+ }
41
+ export function opsCommandSkillMarkdown() {
42
+ return `---
43
+ name: ${OPS_SKILL_NAME}
44
+ description: "Unified operational router for feature/tdd-log/retro/archive/rewind commands."
45
+ ---
46
+
47
+ # /cc-ops
48
+
49
+ ## HARD-GATE
50
+
51
+ This wrapper only dispatches. It must not apply state mutations itself.
52
+
53
+ ## Protocol
54
+
55
+ 1. Require a subcommand (\`feature|tdd-log|retro|archive|rewind|rewind-ack\`).
56
+ 2. Route to the matching command contract + skill pair.
57
+ 3. Preserve pass-through args after the subcommand (e.g. \`/cc-ops rewind design\`).
58
+ 4. Echo which subcommand was dispatched for auditability.
59
+ `;
60
+ }
@@ -46,8 +46,20 @@ Shared closeout sequence applied by every stage skill.
46
46
  - update \`guardEvidence\`.
47
47
  3. Persist stage artifact under \`.cclaw/artifacts/\`.
48
48
  4. Run \`npx cclaw doctor\` and resolve failures.
49
- 5. Notify user with stage completion and next action (\`/cc-next\`).
50
- 6. Stop; do not auto-run the next stage unless user asks.
49
+ 5. Capture reusable learnings from this stage artifact:
50
+ - append 1-3 strict-schema JSONL entries when the stage produced non-obvious
51
+ decisions, patterns, or lessons,
52
+ - use \`type=rule|pattern|lesson\` (\`compound\` stays retro-focused).
53
+ 6. Notify user with stage completion and next action (\`/cc-next\`).
54
+ 7. Stop; do not auto-run the next stage unless user asks.
55
+
56
+ ## Automatic learning capture policy
57
+
58
+ - \`standard\` / \`medium\` tracks: required for \`design\`, \`tdd\`, and \`review\`;
59
+ recommended for other stages.
60
+ - \`quick\` track: recommended only (avoid overhead for tiny fixes).
61
+ - "No learning captured" is acceptable only when explicitly justified (e.g. pure
62
+ mechanical change, no new trade-offs).
51
63
 
52
64
  ## Resume protocol
53
65
 
@@ -36,7 +36,7 @@ Mandatory retrospective gate before archive once ship is complete.
36
36
  - \`required: true\`
37
37
  - \`completedAt: <ISO>\`
38
38
  - \`compoundEntries: <count>\`
39
- 5. Report completion summary and remind user that \`cclaw archive\` is now unblocked.
39
+ 5. Report completion summary and remind user that \`/cc-archive\` is now unblocked.
40
40
 
41
41
  ## Primary skill
42
42
 
@@ -1,5 +1,6 @@
1
1
  import { RUNTIME_ROOT } from "../constants.js";
2
2
  import { STAGE_EXAMPLES_REFERENCE_DIR, stageDomainExamples, stageExamples, stageGoodBadExamples } from "./examples.js";
3
+ import { selfImprovementBlock } from "./learnings.js";
3
4
  import { STAGE_COMMON_GUIDANCE_REL_PATH } from "./stage-common-guidance.js";
4
5
  import { stageAutoSubagentDispatch, stageSchema } from "./stage-schema.js";
5
6
  const VERIFICATION_STAGES = ["tdd", "review", "ship"];
@@ -377,6 +378,7 @@ ${mergedAntiPatterns(schema)}
377
378
  ## Verification
378
379
  ${schema.exitCriteria.map((item) => `- [ ] ${item}`).join("\n")}
379
380
 
381
+ ${selfImprovementBlock(schema.stage)}
380
382
  ${completionParametersBlock(schema)}
381
383
  ## Shared Stage Guidance
382
384
  See:
@@ -59,7 +59,8 @@ Rollback / fallback: <if decision proves wrong>
59
59
  ## Self-improvement reminder
60
60
 
61
61
  If a reusable lesson appears during the stage, append one strict-schema JSONL
62
- entry via \`/cc-learn add\`. Do not keep operational lessons only in chat.
62
+ entry (manually via \`/cc-learn add\` or directly in stage closeout protocol).
63
+ Do not keep operational lessons only in chat.
63
64
 
64
65
  ## Progressive disclosure baseline
65
66
 
@@ -1,4 +1,4 @@
1
1
  export declare const ARTIFACT_TEMPLATES: Record<string, string>;
2
2
  export declare const RULEBOOK_MARKDOWN = "# Cclaw Rulebook\n\n## MUST_ALWAYS\n- Follow flow order: brainstorm -> scope -> design -> spec -> plan -> tdd -> review -> ship\n- Require explicit user confirmation after plan before TDD\n- Keep evidence artifacts in `.cclaw/artifacts/`\n- Enforce RED before GREEN in TDD\n- Run two-layer review (spec_compliance and code_quality) before ship\n- Validate all inputs before processing \u2014 never trust external data without sanitization\n- Prefer immutable data patterns and pure functions where the language supports them\n- Follow existing repo conventions, patterns, and directory structure \u2014 match the codebase\n- Verify claims with fresh evidence: \"tests pass\" requires running tests in this message\n- Use conventional commits: `type(scope): description` (feat, fix, refactor, test, docs, chore)\n\n## MUST_NEVER\n- Skip RED phase and jump directly to GREEN in TDD\n- Ship with critical review findings\n- Start implementation during /brainstorm\n- Modify generated cclaw files manually when CLI can regenerate them\n- Commit `.cclaw/` or generated shim files\n- Expose secrets, tokens, API keys, or absolute system paths in agent output\n- Duplicate existing functionality without explicit justification \u2014 search before building\n- Bypass security checks, linting hooks, or type checking to \"move faster\"\n- Claim success (\"Done,\" \"All good,\" \"Tests pass\") without running verification in this message\n- Make changes outside the blast radius of the current task without user consent\n\n## DELEGATION\nWhen a task requires specialist knowledge (security audit, performance profiling, database review),\ndelegate to a specialized agent or skill if the harness supports it. The primary agent should:\n1. Identify the specialist domain\n2. Provide focused context (relevant files, the specific concern)\n3. Evaluate the specialist output before acting on it \u2014 do not blindly apply recommendations\n";
3
- export declare const CURSOR_WORKFLOW_RULE_MDC = "---\ndescription: cclaw workflow guardrails for Cursor agent sessions\nglobs:\n - \"**/*\"\nalwaysApply: true\n---\n\n<!-- cclaw-managed-cursor-workflow-rule -->\n\n# Cclaw Workflow Guardrails\n\n## Activation Rule\n\nBefore responding to coding work:\n1. Read `.cclaw/state/flow-state.json`.\n2. Start with `/cc` or continue with `/cc-next`.\n3. If no software-stage flow applies, respond normally.\n\n## Stage Order\n\n`brainstorm -> scope -> design -> spec -> plan -> tdd -> review -> ship`\n\nTrack-specific skips are allowed only when `flow-state.track` + `skippedStages` explicitly say so.\n\n## Task Classification\n\n| Class | Route |\n|---|---|\n| non-trivial software work | `/cc <idea>` |\n| trivial software fix | `/cc <idea>` (quick or medium track) |\n| bugfix with repro | `/cc <idea>` and enforce RED-first in tdd |\n| pure question / non-software | direct answer (no stage flow) |\n\n## Command Surface\n\n- `/cc` = entry and resume.\n- `/cc-next` = only progression path.\n- `/cc-learn` = knowledge capture and recall.\n\n## Verification Discipline\n\n- No completion claim without fresh command evidence in this turn.\n- Do not mark gates passed from memory.\n- Keep evidence in `.cclaw/artifacts/`; archive only via `cclaw archive`.\n\n## Delegation And Approvals\n\n- Machine-only checks in design/plan/tdd/review/ship should auto-dispatch when tooling supports it.\n- Ask for user input only at explicit approval gates (scope mode, plan approval, challenge resolution, ship finalization).\n- If harness capabilities are partial, record waiver reasons in delegation logs.\n\n## Routing Source Of Truth\n\n- Primary router: `.cclaw/skills/using-cclaw/SKILL.md`.\n- Protocols: `.cclaw/references/protocols/*.md`.\n- Preamble budget: `.cclaw/references/protocols/ethos.md`.\n";
3
+ export declare const CURSOR_WORKFLOW_RULE_MDC = "---\ndescription: cclaw workflow guardrails for Cursor agent sessions\nglobs:\n - \"**/*\"\nalwaysApply: true\n---\n\n<!-- cclaw-managed-cursor-workflow-rule -->\n\n# Cclaw Workflow Guardrails\n\n## Activation Rule\n\nBefore responding to coding work:\n1. Read `.cclaw/state/flow-state.json`.\n2. Start with `/cc` or continue with `/cc-next`.\n3. If no software-stage flow applies, respond normally.\n\n## Stage Order\n\n`brainstorm -> scope -> design -> spec -> plan -> tdd -> review -> ship`\n\nTrack-specific skips are allowed only when `flow-state.track` + `skippedStages` explicitly say so.\n\n## Task Classification\n\n| Class | Route |\n|---|---|\n| non-trivial software work | `/cc <idea>` |\n| trivial software fix | `/cc <idea>` (quick or medium track) |\n| bugfix with repro | `/cc <idea>` and enforce RED-first in tdd |\n| pure question / non-software | direct answer (no stage flow) |\n\n## Command Surface\n\n- `/cc` = entry and resume.\n- `/cc-next` = only progression path.\n- `/cc-learn` = knowledge capture and recall.\n\n## Verification Discipline\n\n- No completion claim without fresh command evidence in this turn.\n- Do not mark gates passed from memory.\n- Keep evidence in `.cclaw/artifacts/`; archive via `/cc-archive` (agent flow) or archive runtime.\n\n## Delegation And Approvals\n\n- Machine-only checks in design/plan/tdd/review/ship should auto-dispatch when tooling supports it.\n- Ask for user input only at explicit approval gates (scope mode, plan approval, challenge resolution, ship finalization).\n- If harness capabilities are partial, record waiver reasons in delegation logs.\n\n## Routing Source Of Truth\n\n- Primary router: `.cclaw/skills/using-cclaw/SKILL.md`.\n- Protocols: `.cclaw/references/protocols/*.md`.\n- Preamble budget: `.cclaw/references/protocols/ethos.md`.\n";
4
4
  export declare function buildRulesJson(): Record<string, unknown>;
@@ -593,7 +593,7 @@ Track-specific skips are allowed only when \`flow-state.track\` + \`skippedStage
593
593
 
594
594
  - No completion claim without fresh command evidence in this turn.
595
595
  - Do not mark gates passed from memory.
596
- - Keep evidence in \`.cclaw/artifacts/\`; archive only via \`cclaw archive\`.
596
+ - Keep evidence in \`.cclaw/artifacts/\`; archive via \`/cc-archive\` (agent flow) or archive runtime.
597
597
 
598
598
  ## Delegation And Approvals
599
599
 
@@ -771,7 +771,7 @@ description: "Read-only curation pass over the canonical strict-JSONL knowledge
771
771
  ## When to run
772
772
 
773
773
  - Triggered automatically by **\`/cc-learn curate\`**.
774
- - Recommended after \`cclaw archive\` of a feature run, when knowledge has grown.
774
+ - Recommended after \`/cc-archive\` (or archive runtime) of a feature run, when knowledge has grown.
775
775
  - Recommended when active entry count exceeds **50**.
776
776
 
777
777
  ## Audit dimensions
@@ -0,0 +1,2 @@
1
+ export declare function viewCommandContract(): string;
2
+ export declare function viewCommandSkillMarkdown(): string;
@@ -0,0 +1,57 @@
1
+ import { RUNTIME_ROOT } from "../constants.js";
2
+ const VIEW_SKILL_FOLDER = "flow-view";
3
+ const VIEW_SKILL_NAME = "flow-view";
4
+ export function viewCommandContract() {
5
+ return `# /cc-view
6
+
7
+ ## Purpose
8
+
9
+ Unified read-only command surface for flow visibility.
10
+
11
+ Subcommands:
12
+ - \`/cc-view\` or \`/cc-view status\` -> status snapshot
13
+ - \`/cc-view tree\` -> structural flow tree
14
+ - \`/cc-view diff\` -> baseline delta map
15
+
16
+ ## HARD-GATE
17
+
18
+ - \`/cc-view\` is strictly read-only at wrapper level.
19
+ - Do not mutate flow-state unless routing to \`diff\` (which updates snapshot baseline by design).
20
+
21
+ ## Routing
22
+
23
+ 1. Parse subcommand (default \`status\`).
24
+ 2. Route:
25
+ - \`status\` -> load \`${RUNTIME_ROOT}/commands/status.md\` + \`${RUNTIME_ROOT}/skills/flow-status/SKILL.md\`
26
+ - \`tree\` -> load \`${RUNTIME_ROOT}/commands/tree.md\` + \`${RUNTIME_ROOT}/skills/flow-tree/SKILL.md\`
27
+ - \`diff\` -> load \`${RUNTIME_ROOT}/commands/diff.md\` + \`${RUNTIME_ROOT}/skills/flow-diff/SKILL.md\`
28
+ 3. Unknown subcommand -> print supported values and stop.
29
+
30
+ ## Primary skill
31
+
32
+ **${RUNTIME_ROOT}/skills/${VIEW_SKILL_FOLDER}/SKILL.md**
33
+ `;
34
+ }
35
+ export function viewCommandSkillMarkdown() {
36
+ return `---
37
+ name: ${VIEW_SKILL_NAME}
38
+ description: "Unified read-only view router for status/tree/diff flow visibility commands."
39
+ ---
40
+
41
+ # /cc-view
42
+
43
+ ## HARD-GATE
44
+
45
+ Wrapper is read-only and dispatch-only. It must not mutate flow state directly.
46
+
47
+ ## Protocol
48
+
49
+ 1. Parse optional subcommand token:
50
+ - missing -> \`status\`
51
+ - \`status\` -> dispatch to \`/cc-status\`
52
+ - \`tree\` -> dispatch to \`/cc-tree\`
53
+ - \`diff\` -> dispatch to \`/cc-diff\`
54
+ 2. Execute the target command contract and skill.
55
+ 3. Return concise output and suggest \`/cc-view <subcommand>\` variants for navigation.
56
+ `;
57
+ }
@@ -119,9 +119,9 @@ export function doctorCheckMetadata(checkName) {
119
119
  }
120
120
  }
121
121
  return {
122
- severity: "error",
123
- summary: "Doctor runtime integrity check.",
124
- fix: "Inspect check details, apply the suggested remediation, and re-run `cclaw doctor`.",
122
+ severity: "warning",
123
+ summary: "Unclassified doctor check.",
124
+ fix: "Review the check details and add a matching rule in doctor-registry when this check should be severity-scoped.",
125
125
  docRef: ref("README.md")
126
126
  };
127
127
  }
@@ -18,6 +18,12 @@ const UTILITY_SHIMS = [
18
18
  skillFolder: "flow-next-step",
19
19
  commandFile: "next.md"
20
20
  },
21
+ {
22
+ fileName: "cc-view.md",
23
+ command: "view",
24
+ skillFolder: "flow-view",
25
+ commandFile: "view.md"
26
+ },
21
27
  {
22
28
  fileName: "cc-learn.md",
23
29
  command: "learn",
@@ -42,6 +48,12 @@ const UTILITY_SHIMS = [
42
48
  skillFolder: "flow-diff",
43
49
  commandFile: "diff.md"
44
50
  },
51
+ {
52
+ fileName: "cc-ops.md",
53
+ command: "ops",
54
+ skillFolder: "flow-ops",
55
+ commandFile: "ops.md"
56
+ },
45
57
  {
46
58
  fileName: "cc-feature.md",
47
59
  command: "feature",
@@ -60,6 +72,12 @@ const UTILITY_SHIMS = [
60
72
  skillFolder: "flow-retro",
61
73
  commandFile: "retro.md"
62
74
  },
75
+ {
76
+ fileName: "cc-archive.md",
77
+ command: "archive",
78
+ skillFolder: "flow-archive",
79
+ commandFile: "archive.md"
80
+ },
63
81
  {
64
82
  fileName: "cc-rewind.md",
65
83
  command: "rewind",
@@ -166,13 +184,16 @@ When in doubt, prefer **non-trivial** — the quick track is opt-in and only saf
166
184
  |---|---|
167
185
  | \`/cc\` | **Entry point.** No args = resume current stage. With prompt = classify task and start the right flow. |
168
186
  | \`/cc-next\` | **Progression.** Advances to the next stage when current is complete. |
187
+ | \`/cc-view\` | **Read-only router.** Unified entry for status/tree/diff views. |
169
188
  | \`/cc-learn\` | **Cross-cutting.** Capture or review project knowledge (append-only JSONL). |
170
189
  | \`/cc-status\` | **Read-only.** Visual snapshot with progress bar, gate delta, and delegations. |
171
190
  | \`/cc-tree\` | **Read-only.** Deep flow tree for stages, artifacts, and stale markers. |
172
191
  | \`/cc-diff\` | **Delta map.** Compare current flow-state with saved baseline snapshot. |
192
+ | \`/cc-ops\` | **Operations router.** Unified entry for feature/tdd-log/retro/archive/rewind actions. |
173
193
  | \`/cc-feature\` | **Workspace.** Manage active feature snapshots for parallel tracks. |
174
194
  | \`/cc-tdd-log\` | **Evidence.** Record RED/GREEN/REFACTOR cycle events for enforcement. |
175
195
  | \`/cc-retro\` | **Learning gate.** Mandatory retrospective before archive after ship. |
196
+ | \`/cc-archive\` | **Run finalization.** Archive active flow into \`.cclaw/runs/\` and reset runtime. |
176
197
  | \`/cc-rewind\` | **Recovery.** Rewind flow to an earlier stage and invalidate downstream work. |
177
198
  | \`/cc-rewind-ack\` | **Recovery.** Clear stale-stage markers after redo. |
178
199
 
package/dist/install.js CHANGED
@@ -12,9 +12,12 @@ import { startCommandContract, startCommandSkillMarkdown } from "./content/start
12
12
  import { statusCommandContract, statusCommandSkillMarkdown } from "./content/status-command.js";
13
13
  import { treeCommandContract, treeCommandSkillMarkdown } from "./content/tree-command.js";
14
14
  import { diffCommandContract, diffCommandSkillMarkdown } from "./content/diff-command.js";
15
+ import { viewCommandContract, viewCommandSkillMarkdown } from "./content/view-command.js";
16
+ import { opsCommandContract, opsCommandSkillMarkdown } from "./content/ops-command.js";
15
17
  import { featureCommandContract, featureCommandSkillMarkdown } from "./content/feature-command.js";
16
18
  import { tddLogCommandContract, tddLogCommandSkillMarkdown } from "./content/tdd-log-command.js";
17
19
  import { retroCommandContract, retroCommandSkillMarkdown } from "./content/retro-command.js";
20
+ import { archiveCommandContract, archiveCommandSkillMarkdown } from "./content/archive-command.js";
18
21
  import { rewindAcknowledgeCommandContract, rewindCommandContract, rewindCommandSkillMarkdown } from "./content/rewind-command.js";
19
22
  import { subagentDrivenDevSkill, parallelAgentsSkill } from "./content/subagents.js";
20
23
  import { sessionHooksSkillMarkdown } from "./content/session-hooks.js";
@@ -202,13 +205,16 @@ async function writeSkills(projectRoot, config) {
202
205
  await writeFileSafe(runtimePath(projectRoot, "skills", "learnings", "SKILL.md"), learnSkillMarkdown());
203
206
  await writeFileSafe(runtimePath(projectRoot, "skills", "flow-next-step", "SKILL.md"), nextCommandSkillMarkdown());
204
207
  await writeFileSafe(runtimePath(projectRoot, "skills", "flow-start", "SKILL.md"), startCommandSkillMarkdown());
208
+ await writeFileSafe(runtimePath(projectRoot, "skills", "flow-view", "SKILL.md"), viewCommandSkillMarkdown());
205
209
  await writeFileSafe(runtimePath(projectRoot, "skills", "flow-status", "SKILL.md"), statusCommandSkillMarkdown());
206
210
  await writeFileSafe(runtimePath(projectRoot, "skills", "flow-tree", "SKILL.md"), treeCommandSkillMarkdown());
207
211
  await writeFileSafe(runtimePath(projectRoot, "skills", "flow-diff", "SKILL.md"), diffCommandSkillMarkdown());
212
+ await writeFileSafe(runtimePath(projectRoot, "skills", "flow-ops", "SKILL.md"), opsCommandSkillMarkdown());
208
213
  await writeFileSafe(runtimePath(projectRoot, "skills", "feature-workspaces", "SKILL.md"), featureCommandSkillMarkdown());
209
214
  await writeFileSafe(runtimePath(projectRoot, "skills", "tdd-cycle-log", "SKILL.md"), tddLogCommandSkillMarkdown());
210
215
  await writeFileSafe(runtimePath(projectRoot, "skills", "flow-retro", "SKILL.md"), retroCommandSkillMarkdown());
211
216
  await writeFileSafe(runtimePath(projectRoot, "skills", "flow-rewind", "SKILL.md"), rewindCommandSkillMarkdown());
217
+ await writeFileSafe(runtimePath(projectRoot, "skills", "flow-archive", "SKILL.md"), archiveCommandSkillMarkdown());
212
218
  await writeFileSafe(runtimePath(projectRoot, "skills", "subagent-dev", "SKILL.md"), subagentDrivenDevSkill());
213
219
  await writeFileSafe(runtimePath(projectRoot, "skills", "parallel-dispatch", "SKILL.md"), parallelAgentsSkill());
214
220
  await writeFileSafe(runtimePath(projectRoot, "skills", "session", "SKILL.md"), sessionHooksSkillMarkdown());
@@ -260,13 +266,16 @@ async function writeSkills(projectRoot, config) {
260
266
  async function writeUtilityCommands(projectRoot) {
261
267
  await writeFileSafe(runtimePath(projectRoot, "commands", "learn.md"), learnCommandContract());
262
268
  await writeFileSafe(runtimePath(projectRoot, "commands", "next.md"), nextCommandContract());
269
+ await writeFileSafe(runtimePath(projectRoot, "commands", "view.md"), viewCommandContract());
263
270
  await writeFileSafe(runtimePath(projectRoot, "commands", "start.md"), startCommandContract());
264
271
  await writeFileSafe(runtimePath(projectRoot, "commands", "status.md"), statusCommandContract());
265
272
  await writeFileSafe(runtimePath(projectRoot, "commands", "tree.md"), treeCommandContract());
266
273
  await writeFileSafe(runtimePath(projectRoot, "commands", "diff.md"), diffCommandContract());
274
+ await writeFileSafe(runtimePath(projectRoot, "commands", "ops.md"), opsCommandContract());
267
275
  await writeFileSafe(runtimePath(projectRoot, "commands", "feature.md"), featureCommandContract());
268
276
  await writeFileSafe(runtimePath(projectRoot, "commands", "tdd-log.md"), tddLogCommandContract());
269
277
  await writeFileSafe(runtimePath(projectRoot, "commands", "retro.md"), retroCommandContract());
278
+ await writeFileSafe(runtimePath(projectRoot, "commands", "archive.md"), archiveCommandContract());
270
279
  await writeFileSafe(runtimePath(projectRoot, "commands", "rewind.md"), rewindCommandContract());
271
280
  await writeFileSafe(runtimePath(projectRoot, "commands", "rewind-ack.md"), rewindAcknowledgeCommandContract());
272
281
  }
package/dist/types.d.ts CHANGED
@@ -57,8 +57,6 @@ export interface VibyConfig {
57
57
  version: string;
58
58
  flowVersion: string;
59
59
  harnesses: HarnessId[];
60
- /** When true, stage skills instruct the agent to continue to the following stage after gates pass. */
61
- autoAdvance?: boolean;
62
60
  /** Prompt guard behavior for runtime write-risk detection hooks. */
63
61
  promptGuardMode?: "advisory" | "strict";
64
62
  /** TDD red->green->refactor enforcement mode used by workflow guard hooks. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cclaw-cli",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Installer-first flow toolkit for coding agents",
5
5
  "type": "module",
6
6
  "bin": {