cclaw-cli 0.14.0 → 0.15.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.
@@ -11,14 +11,14 @@ function activeArtifactsPath() {
11
11
  return `${RUNTIME_ROOT}/artifacts`;
12
12
  }
13
13
  export function archiveCommandContract() {
14
- return `# /cc-archive
14
+ return `# /cc-ops archive
15
15
 
16
16
  ## Purpose
17
17
 
18
18
  Archive the active cclaw run from inside the harness flow (agent-first finish).
19
19
 
20
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.
21
+ finish with \`/cc-ops archive\` after ship + retro are complete.
22
22
 
23
23
  ## HARD-GATE
24
24
 
@@ -28,13 +28,13 @@ finish with \`/cc-archive\` after ship + retro are complete.
28
28
 
29
29
  ## Inputs
30
30
 
31
- \`/cc-archive [--name=<slug>] [--skip-retro --retro-reason=<text>]\`
31
+ \`/cc-ops archive [--name=<slug>] [--skip-retro --retro-reason=<text>]\`
32
32
 
33
33
  ## Algorithm
34
34
 
35
35
  1. Read \`${flowStatePath()}\`.
36
36
  2. If ship is complete and \`retro.completedAt\` is absent:
37
- - block with explicit instruction: run \`/cc-retro\` first.
37
+ - block with explicit instruction: run \`/cc-ops retro\` first.
38
38
  3. Build archive command:
39
39
  - base: \`npx cclaw archive\`
40
40
  - optional: \`--name=<slug>\`
@@ -66,7 +66,7 @@ name: ${ARCHIVE_SKILL_NAME}
66
66
  description: "Archive the active cclaw run from harness flow and reset runtime safely."
67
67
  ---
68
68
 
69
- # /cc-archive
69
+ # /cc-ops archive
70
70
 
71
71
  ## HARD-GATE
72
72
 
@@ -78,7 +78,7 @@ runtime command so state snapshots and manifest generation stay atomic.
78
78
  1. Read \`${flowStatePath()}\`:
79
79
  - confirm whether ship is completed,
80
80
  - check \`retro.completedAt\` for post-ship runs.
81
- 2. If ship complete and retro incomplete -> stop and direct user to \`/cc-retro\`.
81
+ 2. If ship complete and retro incomplete -> stop and direct user to \`/cc-ops retro\`.
82
82
  3. Build shell command:
83
83
  - \`npx cclaw archive\`
84
84
  - append \`--name=<slug>\` when provided
@@ -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 by \`/cc-archive\` (agent-facing wrapper over archive runtime).
39
+ 6. Do NOT copy artifacts into \`.cclaw/runs/\`; archival is handled by \`/cc-ops archive\` (agent-facing wrapper over archive runtime).
40
40
 
41
41
  ## Gates
42
42
  ${gateIds}
@@ -8,7 +8,7 @@ function snapshotPath() {
8
8
  return `${RUNTIME_ROOT}/state/flow-state.snapshot.json`;
9
9
  }
10
10
  export function diffCommandContract() {
11
- return `# /cc-diff
11
+ return `# /cc-view diff
12
12
 
13
13
  ## Purpose
14
14
 
@@ -54,7 +54,7 @@ name: ${DIFF_SKILL_NAME}
54
54
  description: "Compare current flow-state against saved snapshot and render gate/stage deltas."
55
55
  ---
56
56
 
57
- # /cc-diff
57
+ # /cc-view diff
58
58
 
59
59
  ## HARD-GATE
60
60
 
@@ -14,7 +14,7 @@ function runtimeStatePath() {
14
14
  return `${RUNTIME_ROOT}/state`;
15
15
  }
16
16
  export function featureCommandContract() {
17
- return `# /cc-feature
17
+ return `# /cc-ops feature
18
18
 
19
19
  ## Purpose
20
20
 
@@ -34,19 +34,19 @@ Feature snapshots live under \`${featuresRoot()}/<feature-id>/\`.
34
34
 
35
35
  ## Subcommands
36
36
 
37
- ### \`/cc-feature status\`
37
+ ### \`/cc-ops feature status\`
38
38
  Show active feature id and snapshot location.
39
39
 
40
- ### \`/cc-feature list\`
40
+ ### \`/cc-ops feature list\`
41
41
  List all feature ids in \`${featuresRoot()}/\` (directory names).
42
42
 
43
- ### \`/cc-feature new <feature-id>\`
43
+ ### \`/cc-ops feature new <feature-id>\`
44
44
  Create \`${featuresRoot()}/<feature-id>/artifacts\` and \`${featuresRoot()}/<feature-id>/state\`.
45
45
 
46
46
  Optional flag:
47
47
  - \`--clone-active\`: clone current active runtime into the new feature snapshot.
48
48
 
49
- ### \`/cc-feature switch <feature-id>\`
49
+ ### \`/cc-ops feature switch <feature-id>\`
50
50
  1. Snapshot current active runtime into \`${featuresRoot()}/<active>/\`.
51
51
  2. Restore target snapshot from \`${featuresRoot()}/<feature-id>/\` into active runtime:
52
52
  - \`${runtimeArtifactsPath()}\`
@@ -73,7 +73,7 @@ name: ${FEATURE_SKILL_NAME}
73
73
  description: "Manage cclaw multi-feature workspaces (status/list/new/switch) while preserving active flow runtime."
74
74
  ---
75
75
 
76
- # /cc-feature — Feature Workspace Manager
76
+ # /cc-ops feature — Feature Workspace Manager
77
77
 
78
78
  ## HARD-GATE
79
79
 
@@ -113,7 +113,7 @@ Do not switch feature by editing only \`active-feature.json\`. A valid switch mu
113
113
 
114
114
  ## Safety checks
115
115
 
116
- - If target feature does not exist: block and suggest \`/cc-feature new <id>\`.
116
+ - If target feature does not exist: block and suggest \`/cc-ops feature new <id>\`.
117
117
  - If snapshot copy fails: abort switch, keep current active feature unchanged.
118
118
  - Preserve global pointer file \`active-feature.json\` when restoring state.
119
119
  `;
@@ -67,16 +67,20 @@ All harnesses receive the same utility commands:
67
67
  - \`/cc-next\` - stage progression
68
68
  - \`/cc-view\` - read-only router for status/tree/diff
69
69
  - \`/cc-learn\` - knowledge capture/lookup
70
- - \`/cc-status\` - read-only visual flow snapshot
71
- - \`/cc-tree\` - deep flow tree (stages, artifacts, stale markers)
72
- - \`/cc-diff\` - before/after flow-state diff map
73
70
  - \`/cc-ops\` - operations router for feature/tdd-log/retro/archive/rewind
74
- - \`/cc-feature\` - multi-feature workspace management
75
- - \`/cc-tdd-log\` - explicit RED/GREEN/REFACTOR evidence log
76
- - \`/cc-retro\` - mandatory retrospective gate before archive
77
- - \`/cc-archive\` - archive active run from harness flow
78
- - \`/cc-rewind\` - rewind flow and invalidate downstream stages
79
- - \`/cc-rewind-ack\` - clear stale stage markers after redo
71
+
72
+ Read-only subcommands:
73
+ - \`/cc-view status\` - visual flow snapshot
74
+ - \`/cc-view tree\` - deep flow tree (stages, artifacts, stale markers)
75
+ - \`/cc-view diff\` - before/after flow-state diff map
76
+
77
+ Operations subcommands:
78
+ - \`/cc-ops feature ...\` - multi-feature workspace management
79
+ - \`/cc-ops tdd-log ...\` - explicit RED/GREEN/REFACTOR evidence log
80
+ - \`/cc-ops retro\` - mandatory retrospective gate before archive
81
+ - \`/cc-ops archive\` - archive active run from harness flow
82
+ - \`/cc-ops rewind ...\` - rewind flow and invalidate downstream stages
83
+ - \`/cc-ops rewind-ack ...\` - clear stale stage markers after redo
80
84
 
81
85
  Stage order remains canonical:
82
86
  \`brainstorm -> scope -> design -> spec -> plan -> tdd -> review -> ship\`
@@ -496,7 +496,7 @@ To disable suggestions persistently set ${RUNTIME_ROOT}/state/suggestion-memory.
496
496
  fi
497
497
  if [ -n "$STALE_STAGES" ]; then
498
498
  CTX="$CTX
499
- Stale stages pending acknowledgement: $STALE_STAGES (use /cc-rewind-ack <stage> after redo)."
499
+ Stale stages pending acknowledgement: $STALE_STAGES (use /cc-ops rewind-ack <stage> after redo)."
500
500
  fi
501
501
  if [ -n "$KNOWLEDGE_DIGEST" ]; then
502
502
  CTX="$CTX
@@ -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 /cc-archive (or cclaw archive runtime)."
745
+ RUN_SYNC_NOTE="Run metadata sync removed; active artifacts stay in ${RUNTIME_ROOT}/artifacts until /cc-ops archive (or cclaw archive runtime)."
746
746
 
747
747
  # --- Escape for JSON ---
748
748
  ${ESCAPE_FN}
@@ -5,4 +5,3 @@
5
5
  export declare const KNOWLEDGE_JSONL_FIELDS: readonly ["type", "trigger", "action", "confidence", "domain", "stage", "created", "project"];
6
6
  export declare function learnSkillMarkdown(): string;
7
7
  export declare function learnCommandContract(): string;
8
- export declare function selfImprovementBlock(stageName: string): string;
@@ -134,12 +134,3 @@ Do not edit source code from this command. Only operate on \`${KNOWLEDGE_PATH}\`
134
134
  | \`curate\` | — | Hand off to the **knowledge-curation** skill: read-only audit + soft-archive plan when the file exceeds the curation threshold. |
135
135
  `;
136
136
  }
137
- export function selfImprovementBlock(stageName) {
138
- return `## Operational Self-Improvement
139
-
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.
144
- `;
145
- }
@@ -33,13 +33,13 @@ 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 reaches terminal ship completion, route closeout in order: **/cc-retro -> /cc-archive**.
36
+ - If the flow reaches terminal ship completion, route closeout in order: **/cc-ops retro -> /cc-ops archive**.
37
37
 
38
38
  ## Algorithm (mandatory)
39
39
 
40
40
  1. Read **\`${flowPath}\`**. If missing → **BLOCKED** (state missing).
41
41
  2. Parse JSON. Capture \`currentStage\` and \`stageGateCatalog[currentStage]\`.
42
- 3. If \`staleStages[currentStage]\` exists, do not advance automatically. Re-run the stage artifact work, then clear the marker with \`/cc-rewind-ack <currentStage>\`.
42
+ 3. If \`staleStages[currentStage]\` exists, do not advance automatically. Re-run the stage artifact work, then clear the marker with \`/cc-ops rewind-ack <currentStage>\`.
43
43
  4. Let \`G\` = \`requiredGates\` for **\`currentStage\`** from the stage schema.
44
44
  5. Let \`catalog\` = \`stageGateCatalog[currentStage]\` from flow state.
45
45
  6. **Satisfied** for gate id \`g\`: \`g\` in \`catalog.passed\` and \`g\` not in \`catalog.blocked\`.
@@ -55,8 +55,8 @@ This is the only progression command the user needs to drive the entire flow. St
55
55
  ### Path B: Current stage IS complete (all gates passed, all delegations satisfied)
56
56
 
57
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\`,
58
+ - if \`currentStage === "ship"\` and \`retro.completedAt\` is missing -> route to \`/cc-ops retro\`,
59
+ - if \`currentStage === "ship"\` and \`retro.completedAt\` is present -> route to \`/cc-ops archive\`,
60
60
  - otherwise report **"Flow complete. All stages finished."** and stop.
61
61
  → Otherwise: load **\`${RUNTIME_ROOT}/skills/<skillFolder>/SKILL.md\`** and **\`${RUNTIME_ROOT}/commands/<nextStage>.md\`** for the successor stage. Execute that stage's protocol.
62
62
 
@@ -124,7 +124,7 @@ Do **not** mark gates satisfied from memory alone. Cite **artifact evidence** (p
124
124
 
125
125
  1. Open **\`${flowPath}\`**.
126
126
  2. Record \`currentStage\` and \`stageGateCatalog[currentStage]\`.
127
- 3. If \`staleStages[currentStage]\` exists, re-run the stage and clear marker via \`/cc-rewind-ack <currentStage>\` before advancing.
127
+ 3. If \`staleStages[currentStage]\` exists, re-run the stage and clear marker via \`/cc-ops rewind-ack <currentStage>\` before advancing.
128
128
  4. If the file is missing or invalid JSON → **BLOCKED** (report and stop).
129
129
 
130
130
  ### Step 2: Evaluate gates
@@ -149,8 +149,8 @@ Execute the stage protocol. The stage skill handles interaction, STOP points, ga
149
149
 
150
150
  If \`next\` is \`done\`:
151
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\`.
152
+ - If \`currentStage\` is \`ship\` and \`retro.completedAt\` is missing -> route to \`/cc-ops retro\`.
153
+ - If \`currentStage\` is \`ship\` and \`retro.completedAt\` exists -> route to \`/cc-ops archive\`.
154
154
  - Otherwise report **"Flow complete. All stages finished."** and stop.
155
155
 
156
156
  Otherwise load the next stage's skill and command contract, begin execution.
@@ -9,12 +9,12 @@ export function opsCommandContract() {
9
9
  Unified operational command surface for non-stage flow actions.
10
10
 
11
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\`
12
+ - \`feature\` -> \`/cc-ops feature\`
13
+ - \`tdd-log\` -> \`/cc-ops tdd-log\`
14
+ - \`retro\` -> \`/cc-ops retro\`
15
+ - \`archive\` -> \`/cc-ops archive\`
16
+ - \`rewind\` -> \`/cc-ops rewind\`
17
+ - \`rewind-ack\` -> \`/cc-ops rewind-ack\`
18
18
 
19
19
  ## HARD-GATE
20
20
 
@@ -11,7 +11,7 @@ function knowledgePath() {
11
11
  return `${RUNTIME_ROOT}/knowledge.jsonl`;
12
12
  }
13
13
  export function retroCommandContract() {
14
- return `# /cc-retro
14
+ return `# /cc-ops retro
15
15
 
16
16
  ## Purpose
17
17
 
@@ -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 \`/cc-archive\` is now unblocked.
39
+ 5. Report completion summary and remind user that \`/cc-ops archive\` is now unblocked.
40
40
 
41
41
  ## Primary skill
42
42
 
@@ -49,7 +49,7 @@ name: ${RETRO_SKILL_NAME}
49
49
  description: "Run mandatory retrospective and record compound knowledge before archive."
50
50
  ---
51
51
 
52
- # /cc-retro
52
+ # /cc-ops retro
53
53
 
54
54
  ## HARD-GATE
55
55
 
@@ -11,7 +11,7 @@ function rewindLogPath() {
11
11
  return `${RUNTIME_ROOT}/state/rewind-log.jsonl`;
12
12
  }
13
13
  export function rewindCommandContract() {
14
- return `# /cc-rewind
14
+ return `# /cc-ops rewind
15
15
 
16
16
  ## Purpose
17
17
 
@@ -25,7 +25,7 @@ Rewind active flow to an earlier stage and atomically invalidate downstream work
25
25
 
26
26
  ## Inputs
27
27
 
28
- \`/cc-rewind <target-stage> [reason]\`
28
+ \`/cc-ops rewind <target-stage> [reason]\`
29
29
 
30
30
  ## Algorithm
31
31
 
@@ -55,7 +55,7 @@ Rewind active flow to an earlier stage and atomically invalidate downstream work
55
55
  `;
56
56
  }
57
57
  export function rewindAcknowledgeCommandContract() {
58
- return `# /cc-rewind-ack
58
+ return `# /cc-ops rewind-ack
59
59
 
60
60
  ## Purpose
61
61
 
@@ -63,7 +63,7 @@ Acknowledge and clear stale-stage markers after downstream work is intentionally
63
63
 
64
64
  ## Input
65
65
 
66
- \`/cc-rewind-ack <stage>\`
66
+ \`/cc-ops rewind-ack <stage>\`
67
67
 
68
68
  ## HARD-GATE
69
69
 
@@ -89,7 +89,7 @@ name: ${REWIND_SKILL_NAME}
89
89
  description: "Rewind active flow stage safely and acknowledge stale invalidations."
90
90
  ---
91
91
 
92
- # /cc-rewind + /cc-rewind-ack
92
+ # /cc-ops rewind + /cc-ops rewind-ack
93
93
 
94
94
  ## HARD-GATE
95
95
 
@@ -1,6 +1,5 @@
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";
4
3
  import { STAGE_COMMON_GUIDANCE_REL_PATH } from "./stage-common-guidance.js";
5
4
  import { stageAutoSubagentDispatch, stageSchema } from "./stage-schema.js";
6
5
  const VERIFICATION_STAGES = ["tdd", "review", "ship"];
@@ -378,7 +377,6 @@ ${mergedAntiPatterns(schema)}
378
377
  ## Verification
379
378
  ${schema.exitCriteria.map((item) => `- [ ] ${item}`).join("\n")}
380
379
 
381
- ${selfImprovementBlock(schema.stage)}
382
380
  ${completionParametersBlock(schema)}
383
381
  ## Shared Stage Guidance
384
382
  See:
@@ -24,9 +24,9 @@ Use this same closeout menu for every stage:
24
24
 
25
25
  - **A) Advance** — run \`/cc-next\` and continue.
26
26
  - **B) Revise this stage** — stay on current stage and apply feedback.
27
- - **C) Pause / park** — stop now and resume later.
28
- - **D) Rewind** — move to a prior stage explicitly chosen by the user.
29
- - **E) Abandon** — cancel this flow; artifacts remain on disk.
27
+ - **C) Pause / park** — run \`/cc-view status\`, then stop and resume later.
28
+ - **D) Rewind** — run \`/cc-ops rewind <target-stage>\`.
29
+ - **E) Abandon** — archive with \`/cc-ops archive --skip-retro --retro-reason="<reason>"\` when user explicitly wants to end the run.
30
30
 
31
31
  Recommendation defaults:
32
32
 
@@ -58,9 +58,17 @@ Rollback / fallback: <if decision proves wrong>
58
58
 
59
59
  ## Self-improvement reminder
60
60
 
61
- If a reusable lesson appears during the stage, append one strict-schema JSONL
62
- entry (manually via \`/cc-learn add\` or directly in stage closeout protocol).
63
- Do not keep operational lessons only in chat.
61
+ Before closeout, capture 1-3 reusable insights in \`.cclaw/knowledge.jsonl\`
62
+ whenever the stage produced non-obvious decisions, patterns, or lessons.
63
+ Prefer \`type=rule|pattern|lesson\` (\`compound\` stays retro-focused).
64
+
65
+ Track policy:
66
+ - \`standard\` / \`medium\`: required for \`design\`, \`tdd\`, and \`review\`;
67
+ recommended for other stages.
68
+ - \`quick\`: recommended only.
69
+
70
+ "No learning captured" is acceptable only with an explicit reason
71
+ (for example, purely mechanical edits with no new decisions).
64
72
 
65
73
  ## Progressive disclosure baseline
66
74
 
@@ -6,14 +6,6 @@ export interface StageGate {
6
6
  /** Used when tier=conditional. Predicate syntax mirrors conditional delegation rules. */
7
7
  condition?: string;
8
8
  }
9
- export interface StageRationalization {
10
- claim: string;
11
- reality: string;
12
- }
13
- export interface CognitivePattern {
14
- name: string;
15
- description: string;
16
- }
17
9
  export interface ReviewSection {
18
10
  title: string;
19
11
  evaluationPoints: string[];
@@ -54,10 +46,6 @@ export interface StageAutoSubagentDispatch {
54
46
  /** Optional skill folder the dispatched agent should load as additional context. */
55
47
  skill?: string;
56
48
  }
57
- export interface NamedAntiPattern {
58
- title: string;
59
- description: string;
60
- }
61
49
  export interface StageSchema {
62
50
  stage: FlowStage;
63
51
  skillFolder: string;
@@ -87,19 +75,15 @@ export interface StageSchema {
87
75
  blockers: string[];
88
76
  exitCriteria: string[];
89
77
  antiPatterns: string[];
90
- rationalizations: StageRationalization[];
91
78
  redFlags: string[];
92
79
  policyNeedles: string[];
93
80
  artifactFile: string;
94
81
  next: FlowStage | "done";
95
82
  checklist: string[];
96
- cognitivePatterns: CognitivePattern[];
97
83
  reviewSections: ReviewSection[];
98
84
  completionStatus: string[];
99
85
  crossStageTrace: CrossStageTrace;
100
86
  artifactValidation: ArtifactValidation[];
101
- namedAntiPattern?: NamedAntiPattern;
102
- decisionRecordFormat?: string;
103
87
  /** When true, stage skill includes wave auto-execute guidance (tdd). */
104
88
  waveExecutionAllowed?: boolean;
105
89
  /** Sections that remain required even when the trivial-change escape hatch is active (design only). */