cclaw-cli 0.48.13 → 0.48.14

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.
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Relative path used by skills/commands to cite the consolidated flow map.
3
+ * Stable contract — changing this value is a breaking change for doctor
4
+ * policies and meta-skill links.
5
+ */
6
+ export declare const FLOW_MAP_REL_PATH = ".cclaw/references/flow-map.md";
7
+ /**
8
+ * Canonical one-page overview of cclaw's user-facing surface.
9
+ *
10
+ * Purpose: give the model (and any curious human) a single file that
11
+ * answers "what does cclaw expose, where does my current stage fit, and
12
+ * which files drive progress?" without forcing a walk of the 8 stage
13
+ * skills plus the 4 router skills plus the meta-skill.
14
+ *
15
+ * Design rules:
16
+ * - Keep it under ~150 lines; it is a map, not a manual.
17
+ * - Only cite files that already exist under `.cclaw/`.
18
+ * - Do not duplicate protocol text (decision/completion/ethos live in
19
+ * `.cclaw/references/protocols/`). Link, don't inline.
20
+ * - Do not introduce new gates or hard rules here — flow-map is
21
+ * descriptive, not prescriptive.
22
+ */
23
+ export declare function flowMapMarkdown(): string;
@@ -0,0 +1,117 @@
1
+ import { RUNTIME_ROOT } from "../constants.js";
2
+ /**
3
+ * Relative path used by skills/commands to cite the consolidated flow map.
4
+ * Stable contract — changing this value is a breaking change for doctor
5
+ * policies and meta-skill links.
6
+ */
7
+ export const FLOW_MAP_REL_PATH = `${RUNTIME_ROOT}/references/flow-map.md`;
8
+ /**
9
+ * Canonical one-page overview of cclaw's user-facing surface.
10
+ *
11
+ * Purpose: give the model (and any curious human) a single file that
12
+ * answers "what does cclaw expose, where does my current stage fit, and
13
+ * which files drive progress?" without forcing a walk of the 8 stage
14
+ * skills plus the 4 router skills plus the meta-skill.
15
+ *
16
+ * Design rules:
17
+ * - Keep it under ~150 lines; it is a map, not a manual.
18
+ * - Only cite files that already exist under `.cclaw/`.
19
+ * - Do not duplicate protocol text (decision/completion/ethos live in
20
+ * `.cclaw/references/protocols/`). Link, don't inline.
21
+ * - Do not introduce new gates or hard rules here — flow-map is
22
+ * descriptive, not prescriptive.
23
+ */
24
+ export function flowMapMarkdown() {
25
+ return `# cclaw Flow Map
26
+
27
+ One-page surface reference. Use this when you need the shape of cclaw
28
+ without reading every skill — the stage quick-map, the user-facing
29
+ slash commands, the Ralph Loop signal, and the key state files.
30
+
31
+ For enforcement details, load the matching stage skill or command
32
+ contract. For protocols (decision/completion/ethos) see
33
+ \`${RUNTIME_ROOT}/references/protocols/\`.
34
+
35
+ ## Stages (8)
36
+
37
+ | # | Stage | Goal | Primary artifact |
38
+ |---|---|---|---|
39
+ | 1 | brainstorm | Explore options and constraints | \`.cclaw/artifacts/00-idea.md\` (+ \`01-brainstorm.md\`) |
40
+ | 2 | scope | Freeze scope (in/out, assumptions) | \`.cclaw/artifacts/02-scope.md\` |
41
+ | 3 | design | Pick the shape of the change | \`.cclaw/artifacts/03-design.md\` |
42
+ | 4 | spec | Turn design into testable acceptance criteria | \`.cclaw/artifacts/04-spec.md\` |
43
+ | 5 | plan | Decompose spec into executable slices | \`.cclaw/artifacts/05-plan.md\` |
44
+ | 6 | tdd | Drive each slice through RED → GREEN → REFACTOR (Ralph Loop) | \`.cclaw/artifacts/06-tdd.md\` + \`.cclaw/state/tdd-cycle-log.jsonl\` |
45
+ | 7 | review | Cross-check correctness, spec coverage, and ethos | \`.cclaw/artifacts/07-review.md\` |
46
+ | 8 | ship | Close out: retro, compound, archive | \`.cclaw/artifacts/08-ship.md\` (+ \`09-retro.md\`) |
47
+
48
+ Track shortcuts (set in \`.cclaw/state/flow-state.json\`):
49
+
50
+ - \`quick\` — spec → tdd → review → ship
51
+ - \`medium\` — brainstorm → spec → plan → tdd → review → ship
52
+ - \`standard\` — all 8 stages (default)
53
+
54
+ ## User-facing slash commands
55
+
56
+ | Command | Role | Notes |
57
+ |---|---|---|
58
+ | \`/cc\` | Entry point. No args = resume. With prompt = classify + start. | Writes \`00-idea.md\` and picks the track. |
59
+ | \`/cc-next\` | Advance or resume the current stage based on gates. | Soft nudge from Ralph Loop during \`tdd\`. |
60
+ | \`/cc-ideate\` | Repo-improvement discovery, separate from product flow. | Produces ideas, not stage artifacts. |
61
+ | \`/cc-view [status\\|tree\\|diff]\` | Read-only router. Never mutates flow state. | \`diff\` refreshes the snapshot baseline by design. |
62
+ | \`/cc-ops [feature\\|tdd-log\\|retro\\|compound\\|archive\\|rewind]\` | Operations router for post-flow and side-channel actions. | Mutations are scoped to each subcommand. |
63
+
64
+ Subcommand dispatch lives in \`${RUNTIME_ROOT}/commands/\` and the
65
+ matching \`${RUNTIME_ROOT}/skills/flow-*/SKILL.md\`. The meta-skill
66
+ (\`${RUNTIME_ROOT}/skills/using-cclaw/SKILL.md\`) decides which router to
67
+ use before any substantive work.
68
+
69
+ ## Ralph Loop (TDD progress signal)
70
+
71
+ When \`currentStage === "tdd"\`, SessionStart writes
72
+ \`${RUNTIME_ROOT}/state/ralph-loop.json\` from the TDD cycle log. Fields
73
+ worth acting on:
74
+
75
+ - \`loopIteration\` — how many RED → GREEN cycles already landed.
76
+ - \`redOpenSlices\` — slices with an unsatisfied RED. Non-empty means do
77
+ **not** advance to review.
78
+ - \`acClosed\` — distinct acceptance-criterion IDs closed by a GREEN row
79
+ (requires \`acIds\` on the green log entry via \`/cc-ops tdd-log\`).
80
+ - \`sliceCount\` — total distinct plan slices ever touched.
81
+
82
+ Ralph Loop is a signal, not a gate. Stage advancement still runs
83
+ through the normal \`flow-state.json\` gate catalog.
84
+
85
+ ## Key state files
86
+
87
+ | Path | What it holds |
88
+ |---|---|
89
+ | \`${RUNTIME_ROOT}/state/flow-state.json\` | Track, currentStage, completedStages, gate catalog, closeout substate. |
90
+ | \`${RUNTIME_ROOT}/state/delegation-log.json\` | Per-stage mandatory agent status + fulfillmentMode + evidenceRefs. |
91
+ | \`${RUNTIME_ROOT}/state/tdd-cycle-log.jsonl\` | Append-only RED/GREEN/REFACTOR entries (source of Ralph Loop). |
92
+ | \`${RUNTIME_ROOT}/state/ralph-loop.json\` | Derived Ralph Loop status (TDD-only). |
93
+ | \`${RUNTIME_ROOT}/state/stage-activity.jsonl\` | Append-only stage-enter/exit and gate-pass signals. |
94
+ | \`${RUNTIME_ROOT}/state/checkpoint.json\` | Latest session checkpoint (stage + timestamp). |
95
+ | \`${RUNTIME_ROOT}/state/context-mode.json\` | Active context mode (\`default\`, \`headless\`, ...). |
96
+ | \`${RUNTIME_ROOT}/state/harness-gaps.json\` | Per-harness tier, subagent fallback, playbook path (schemaVersion 2). |
97
+ | \`${RUNTIME_ROOT}/knowledge.jsonl\` | Append-only learnings; surfaced to sessions via digest. |
98
+
99
+ ## Strictness and hooks
100
+
101
+ Hook-driven guards respect the \`strictness\` field in
102
+ \`${RUNTIME_ROOT}/config.yaml\`:
103
+
104
+ - \`advisory\` (default) — hooks warn but never block tool calls.
105
+ - \`strict\` — hooks block tool calls that violate their scope.
106
+
107
+ Override per-session with \`CCLAW_STRICTNESS=advisory|strict\`.
108
+
109
+ ## When in doubt
110
+
111
+ 1. Read \`${RUNTIME_ROOT}/state/flow-state.json\` to know where you are.
112
+ 2. Load the matching stage skill only if you are about to do
113
+ substantive work (see \`using-cclaw\` meta-skill).
114
+ 3. Prefer \`/cc-next\` for progression. \`/cc-view\` for visibility.
115
+ \`/cc-ops\` for side-channel operations.
116
+ `;
117
+ }
@@ -1,3 +1,4 @@
1
+ import { FLOW_MAP_REL_PATH } from "./flow-map.js";
1
2
  import { COMPLETION_PROTOCOL_REL_PATH, DECISION_PROTOCOL_REL_PATH, ETHOS_PROTOCOL_REL_PATH } from "./protocols.js";
2
3
  export const META_SKILL_NAME = "using-cclaw";
3
4
  export function usingCclawSkillMarkdown() {
@@ -76,6 +77,8 @@ Before stage work:
76
77
  brainstorm -> scope -> design -> spec -> plan -> tdd -> review -> ship
77
78
 
78
79
  Tracks may skip stages via \`flow-state.track\` + \`skippedStages\`.
80
+ For the full surface (stages, routers, Ralph Loop, state files) load
81
+ \`${FLOW_MAP_REL_PATH}\` — it is the single-page overview of cclaw.
79
82
 
80
83
  ## Contextual skill activation
81
84
 
@@ -1,4 +1,5 @@
1
1
  import { RUNTIME_ROOT } from "../constants.js";
2
+ import { FLOW_MAP_REL_PATH } from "./flow-map.js";
2
3
  import { stageSchema } from "./stage-schema.js";
3
4
  import { stageSkillFolder } from "./skills.js";
4
5
  const NEXT_SKILL_FOLDER = "flow-next-step";
@@ -128,6 +129,12 @@ Validate envelopes with:
128
129
  ## Primary skill
129
130
 
130
131
  **${skillRel}** — full protocol and stage table.
132
+
133
+ ## Surface reference
134
+
135
+ When you need the full shape of cclaw (stages, routers, Ralph Loop,
136
+ state files) load \`${FLOW_MAP_REL_PATH}\`. It is the single-page
137
+ overview and is safe to read at any time.
131
138
  `;
132
139
  }
133
140
  /**
@@ -1,4 +1,5 @@
1
1
  import { RUNTIME_ROOT } from "../constants.js";
2
+ import { FLOW_MAP_REL_PATH } from "./flow-map.js";
2
3
  const START_SKILL_FOLDER = "flow-start";
3
4
  const START_SKILL_NAME = "flow-start";
4
5
  function flowStatePath() {
@@ -115,6 +116,12 @@ Validate envelopes with:
115
116
  ## Primary skill
116
117
 
117
118
  **${RUNTIME_ROOT}/skills/${START_SKILL_FOLDER}/SKILL.md**
119
+
120
+ ## Surface reference
121
+
122
+ For the 1-page overview of cclaw (stages, routers, Ralph Loop, state
123
+ files) load \`${FLOW_MAP_REL_PATH}\` — useful when a fresh session
124
+ needs orientation before \`/cc <prompt>\` runs.
118
125
  `;
119
126
  }
120
127
  /**
@@ -85,7 +85,7 @@ const RULES = [
85
85
  }
86
86
  },
87
87
  {
88
- test: /^(meta_skill:|protocol:|stage_skill:|context_mode:)/,
88
+ test: /^(meta_skill:|protocol:|stage_skill:|context_mode:|reference:)/,
89
89
  metadata: {
90
90
  severity: "error",
91
91
  summary: "Routing skill and protocol integrity check.",
package/dist/install.js CHANGED
@@ -28,6 +28,7 @@ import { stageCompleteScript, opencodePluginJs, claudeHooksJson, codexHooksJson,
28
28
  import { nodeHookRuntimeScript } from "./content/node-hooks.js";
29
29
  import { META_SKILL_NAME, usingCclawSkillMarkdown } from "./content/meta-skill.js";
30
30
  import { decisionProtocolMarkdown, completionProtocolMarkdown, ethosProtocolMarkdown } from "./content/protocols.js";
31
+ import { flowMapMarkdown } from "./content/flow-map.js";
31
32
  import { ARTIFACT_TEMPLATES, CURSOR_WORKFLOW_RULE_MDC, RULEBOOK_MARKDOWN, buildRulesJson } from "./content/templates.js";
32
33
  import { EVAL_BASELINES_README, EVAL_CONFIG_YAML, EVAL_CORPUS_README, EVAL_REPORTS_README, EVAL_RUBRIC_FILES, EVAL_RUBRICS_README } from "./content/eval-scaffold.js";
33
34
  import { TDD_BATCH_WALKTHROUGH_MARKDOWN, stageSkillFolder, stageSkillMarkdown } from "./content/skills.js";
@@ -355,6 +356,7 @@ async function writeSkills(projectRoot, config) {
355
356
  await writeFileSafe(runtimePath(projectRoot, "references", "protocols", "decision.md"), decisionProtocolMarkdown());
356
357
  await writeFileSafe(runtimePath(projectRoot, "references", "protocols", "completion.md"), completionProtocolMarkdown());
357
358
  await writeFileSafe(runtimePath(projectRoot, "references", "protocols", "ethos.md"), ethosProtocolMarkdown());
359
+ await writeFileSafe(runtimePath(projectRoot, "references", "flow-map.md"), flowMapMarkdown());
358
360
  for (const folder of UTILITY_SKILL_FOLDERS) {
359
361
  const generator = UTILITY_SKILL_MAP[folder];
360
362
  await writeFileSafe(runtimePath(projectRoot, "skills", folder, "SKILL.md"), generator());
package/dist/policy.js CHANGED
@@ -142,6 +142,10 @@ export async function policyChecks(projectRoot, options = {}) {
142
142
  { file: runtimeFile("references/protocols/decision.md"), needle: "# Decision Protocol", name: "protocol:decision" },
143
143
  { file: runtimeFile("references/protocols/completion.md"), needle: "# Stage Completion Protocol", name: "protocol:completion" },
144
144
  { file: runtimeFile("references/protocols/ethos.md"), needle: "# Engineering Ethos", name: "protocol:ethos" },
145
+ { file: runtimeFile("references/flow-map.md"), needle: "# cclaw Flow Map", name: "reference:flow_map:header" },
146
+ { file: runtimeFile("references/flow-map.md"), needle: "## Stages (8)", name: "reference:flow_map:stages" },
147
+ { file: runtimeFile("references/flow-map.md"), needle: "## Ralph Loop", name: "reference:flow_map:ralph_loop" },
148
+ { file: runtimeFile("references/flow-map.md"), needle: "## Key state files", name: "reference:flow_map:state_files" },
145
149
  { file: runtimeFile("skills/session/SKILL.md"), needle: "## Session Resume Protocol", name: "utility_skill:session:resume" },
146
150
  { file: runtimeFile("skills/brainstorming/SKILL.md"), needle: "common-guidance.md", name: "stage_skill:shared_guidance_reference" },
147
151
  { file: runtimeFile("skills/security/SKILL.md"), needle: "## HARD-GATE", name: "utility_skill:security:hard_gate" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cclaw-cli",
3
- "version": "0.48.13",
3
+ "version": "0.48.14",
4
4
  "description": "Installer-first flow toolkit for coding agents",
5
5
  "type": "module",
6
6
  "bin": {