cclaw-cli 0.51.17 → 0.51.18

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.
@@ -1,3 +1,3 @@
1
- import type { FlowStage, FlowTrack } from "../types.js";
1
+ import { type FlowStage, type FlowTrack } from "../types.js";
2
2
  export declare function stageSkillFolder(stage: FlowStage): string;
3
3
  export declare function stageSkillMarkdown(stage: FlowStage, track?: FlowTrack): string;
@@ -1,5 +1,6 @@
1
1
  import { RUNTIME_ROOT, STAGE_TO_SKILL_FOLDER } from "../constants.js";
2
2
  import { nextStage as nextStageForTrack } from "../flow-state.js";
3
+ import { FLOW_STAGES } from "../types.js";
3
4
  import { stageExamples } from "./examples.js";
4
5
  import { reviewStackAwareRoutes, reviewStackAwareRoutingSummary, stageAutoSubagentDispatch, stageSchema, stageTrackRenderContext } from "./stage-schema.js";
5
6
  import { conversationLanguagePolicyMarkdown } from "./language-policy.js";
@@ -13,7 +14,12 @@ ${items.map((item) => `- ${item}`).join("\n")}
13
14
 
14
15
  `;
15
16
  }
16
- function contextLoadingBlock(trace, executionModel) {
17
+ function artifactTemplatePathForStage(stage) {
18
+ const stageIndex = FLOW_STAGES.indexOf(stage) + 1;
19
+ const stageNumber = String(stageIndex).padStart(2, "0");
20
+ return `${RUNTIME_ROOT}/templates/${stageNumber}-${stage}.md`;
21
+ }
22
+ function contextLoadingBlock(stage, trace, executionModel) {
17
23
  const readLines = trace.readsFrom.length > 0
18
24
  ? trace.readsFrom.map((value) => `- \`${value}\``).join("\n")
19
25
  : "- (first stage — no upstream artifacts)";
@@ -23,6 +29,7 @@ function contextLoadingBlock(trace, executionModel) {
23
29
  const requiredContext = executionModel.requiredContext.length > 0
24
30
  ? executionModel.requiredContext.map((item) => `- ${item}`).join("\n")
25
31
  : "- None beyond this skill";
32
+ const artifactTemplatePath = artifactTemplatePathForStage(stage);
26
33
  return `## Context Loading
27
34
 
28
35
  Before execution:
@@ -34,16 +41,19 @@ ${readLines}
34
41
  Treat it as the machine-readable skeleton: required top-level fields,
35
42
  closed taxonomies, and the derived markdown path. Do not validate natural-language
36
43
  prose by regex; put semantic quality checks in the review prompts.
37
- 5. Extract upstream decisions, constraints, and open questions into the current
44
+ 5. Read the canonical artifact template at \`${artifactTemplatePath}\` and reuse its
45
+ exact section layout — per-row tables with stable column order, calibrated review block;
46
+ do not invent layouts for sections the template already defines.
47
+ 6. Extract upstream decisions, constraints, and open questions into the current
38
48
  artifact's \`Upstream Handoff\` section when that section exists.
39
- 6. Before doing stage work, give a compact user-facing drift preamble: "Carrying forward: <1-3 bullets>. Drift since upstream: None / <specific drift>. Recommendation: continue / re-scope."
40
- 7. If you change an upstream decision, record an explicit drift reason in the
49
+ 7. Before doing stage work, give a compact user-facing drift preamble: "Carrying forward: <1-3 bullets>. Drift since upstream: None / <specific drift>. Recommendation: continue / re-scope."
50
+ 8. If you change an upstream decision, record an explicit drift reason in the
41
51
  current artifact before continuing.
42
- 8. Confirm stage inputs:
52
+ 9. Confirm stage inputs:
43
53
  ${inputs}
44
- 9. Confirm required context:
54
+ 10. Confirm required context:
45
55
  ${requiredContext}
46
- 10. Use the injected knowledge digest from session-start; only fall back to full
56
+ 11. Use the injected knowledge digest from session-start; only fall back to full
47
57
  \`.cclaw/knowledge.jsonl\` when the digest is insufficient.
48
58
  `;
49
59
  }
@@ -395,7 +405,7 @@ This is the stage **state machine** — the canonical ordered flow. For every de
395
405
 
396
406
  ${processFlowMermaid.length > 0 ? processFlowMermaid : "```mermaid\nflowchart TD\n S1[\"Execute Checklist\"] --> S2[\"Satisfy required gates\"] --> S3[\"Verify before closeout\"]\n```"}
397
407
 
398
- ${platformNotesBlock}${contextLoadingBlock(artifactRules.crossStageTrace, executionModel)}
408
+ ${platformNotesBlock}${contextLoadingBlock(stage, artifactRules.crossStageTrace, executionModel)}
399
409
  ${autoSubagentDispatchBlock(stage, track)}
400
410
  ${stackAwareReviewRoutingBlock(stage)}
401
411
  ${researchPlaybooksBlock(executionModel.researchPlaybooks ?? [])}
@@ -47,7 +47,7 @@ export const BRAINSTORM = {
47
47
  "**Compare 2-3 distinct approaches with stable Role/Upside columns** — Role values are `baseline` | `challenger` | `wild-card`; Upside is `low` | `modest` | `high` | `higher`; include real trade-offs and reuse notes; include exactly one challenger with explicit `high` or `higher` upside.",
48
48
  "**Collect reaction before recommending** — ask which option feels closest and what concern remains, then recommend based on that reaction.",
49
49
  "**Write the `Not Doing` list** — name 3-5 things this brainstorm explicitly is not committing to (vs. deferred). This protects scope from silent enlargement and the next stage from rework.",
50
- "**Self-review before user approval** — re-read the artifact and patch contradictions, weak trade-offs, placeholders, ambiguity, and weak handoff language; record the patch list in `Self-Review Notes` (or `- None.`).",
50
+ "**Self-review before user approval** — re-read the artifact and patch contradictions, weak trade-offs, placeholders, ambiguity, and weak handoff language. Record the result in `Self-Review Notes` using the calibrated review format: `- Status: Approved` (or `Issues Found`), `- Patches applied:` with inline note or sub-bullets, `- Remaining concerns:` with inline note or sub-bullets. Use `Patches applied: None` and `Remaining concerns: None` when there is nothing to record.",
51
51
  "**Request explicit approval** — state exactly what direction is being approved; do not advance without approval and artifact review.",
52
52
  "**Handoff** — only after approval, complete the stage and point to `/cc-next`."
53
53
  ],
@@ -137,7 +137,7 @@ export const BRAINSTORM = {
137
137
  { section: "Not Doing", required: false, validationRule: "Recommended: 3-5 explicitly non-committed items (distinct from deferred). Protects scope from silent enlargement and the next stage from rework." },
138
138
  { section: "Design", required: false, validationRule: "Must cover architecture, key components, and data flow scaled to complexity." },
139
139
  { section: "Visual Companion", required: false, validationRule: "If architecture/data-flow complexity is medium+, include compact ASCII/Mermaid diagram or explicitly justify omission." },
140
- { section: "Self-Review Notes", required: false, validationRule: "Recommended: list of patches applied during self-review (or `- None.`) done before requesting user approval." },
140
+ { section: "Self-Review Notes", required: false, validationRule: "Recommended: use the calibrated review format — `- Status: Approved` (or `Issues Found`), `- Patches applied:` (inline note or sub-bullets, use `None` if nothing changed), `- Remaining concerns:` (inline note or sub-bullets, use `None` if nothing remains). Done before requesting user approval." },
141
141
  { section: "Assumptions and Open Questions", required: false, validationRule: "Must capture unresolved assumptions/open questions, or explicitly state none." }
142
142
  ],
143
143
  trivialOverrideSections: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cclaw-cli",
3
- "version": "0.51.17",
3
+ "version": "0.51.18",
4
4
  "description": "Installer-first flow toolkit for coding agents",
5
5
  "type": "module",
6
6
  "bin": {