cclaw-cli 0.55.2 → 2.0.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.
Files changed (92) hide show
  1. package/README.md +3 -3
  2. package/dist/artifact-linter/brainstorm.js +59 -1
  3. package/dist/artifact-linter/design.js +46 -1
  4. package/dist/artifact-linter/plan.js +22 -1
  5. package/dist/artifact-linter/review.js +35 -1
  6. package/dist/artifact-linter/scope.js +33 -9
  7. package/dist/artifact-linter/shared.d.ts +12 -10
  8. package/dist/artifact-linter/shared.js +102 -41
  9. package/dist/artifact-linter/ship.js +36 -0
  10. package/dist/artifact-linter/spec.js +23 -1
  11. package/dist/artifact-linter/tdd.js +74 -0
  12. package/dist/artifact-linter.d.ts +1 -1
  13. package/dist/artifact-linter.js +11 -1
  14. package/dist/constants.d.ts +1 -1
  15. package/dist/constants.js +1 -0
  16. package/dist/content/closeout-guidance.d.ts +1 -1
  17. package/dist/content/closeout-guidance.js +10 -11
  18. package/dist/content/core-agents.d.ts +35 -36
  19. package/dist/content/core-agents.js +189 -99
  20. package/dist/content/diff-command.js +1 -1
  21. package/dist/content/examples.d.ts +0 -3
  22. package/dist/content/examples.js +197 -752
  23. package/dist/content/hook-events.js +1 -2
  24. package/dist/content/hook-manifest.d.ts +3 -4
  25. package/dist/content/hook-manifest.js +22 -25
  26. package/dist/content/hooks.js +54 -14
  27. package/dist/content/idea.d.ts +60 -0
  28. package/dist/content/idea.js +404 -0
  29. package/dist/content/learnings.d.ts +2 -4
  30. package/dist/content/learnings.js +10 -26
  31. package/dist/content/meta-skill.js +4 -3
  32. package/dist/content/node-hooks.js +368 -164
  33. package/dist/content/observe.js +3 -3
  34. package/dist/content/opencode-plugin.js +12 -32
  35. package/dist/content/reference-patterns.js +2 -2
  36. package/dist/content/runtime-shared-snippets.d.ts +8 -0
  37. package/dist/content/runtime-shared-snippets.js +80 -0
  38. package/dist/content/session-hooks.js +1 -1
  39. package/dist/content/skills-elicitation.d.ts +1 -0
  40. package/dist/content/skills-elicitation.js +123 -0
  41. package/dist/content/skills.d.ts +1 -0
  42. package/dist/content/skills.js +54 -2
  43. package/dist/content/stage-schema.js +107 -63
  44. package/dist/content/stages/brainstorm.js +7 -3
  45. package/dist/content/stages/design.js +4 -0
  46. package/dist/content/stages/review.js +8 -8
  47. package/dist/content/stages/schema-types.d.ts +2 -2
  48. package/dist/content/stages/scope.js +7 -3
  49. package/dist/content/stages/ship.js +1 -1
  50. package/dist/content/start-command.js +4 -4
  51. package/dist/content/status-command.js +3 -3
  52. package/dist/content/subagent-context-skills.js +156 -1
  53. package/dist/content/subagents.d.ts +0 -5
  54. package/dist/content/subagents.js +12 -82
  55. package/dist/content/templates.js +108 -6
  56. package/dist/content/utility-skills.js +26 -97
  57. package/dist/flow-state.d.ts +12 -6
  58. package/dist/flow-state.js +5 -6
  59. package/dist/gate-evidence.d.ts +0 -31
  60. package/dist/gate-evidence.js +3 -181
  61. package/dist/harness-adapters.js +1 -1
  62. package/dist/hook-schemas/claude-hooks.v1.json +2 -3
  63. package/dist/hook-schemas/codex-hooks.v1.json +1 -1
  64. package/dist/hook-schemas/cursor-hooks.v1.json +1 -1
  65. package/dist/install.js +50 -7
  66. package/dist/internal/advance-stage/advance.js +22 -2
  67. package/dist/internal/advance-stage/parsers.d.ts +1 -0
  68. package/dist/internal/advance-stage/parsers.js +6 -0
  69. package/dist/internal/advance-stage/review-loop.js +1 -10
  70. package/dist/knowledge-store.d.ts +2 -20
  71. package/dist/knowledge-store.js +43 -57
  72. package/dist/policy.js +3 -3
  73. package/dist/retro-gate.js +8 -90
  74. package/dist/run-archive.js +1 -4
  75. package/dist/run-persistence.d.ts +1 -1
  76. package/dist/run-persistence.js +43 -111
  77. package/dist/runtime/run-hook.entry.d.ts +3 -0
  78. package/dist/runtime/run-hook.entry.js +5 -0
  79. package/dist/runtime/run-hook.mjs +9647 -0
  80. package/dist/track-heuristics.d.ts +7 -1
  81. package/dist/track-heuristics.js +12 -0
  82. package/package.json +4 -2
  83. package/dist/content/hook-inline-snippets.d.ts +0 -96
  84. package/dist/content/hook-inline-snippets.js +0 -515
  85. package/dist/content/idea-command.d.ts +0 -8
  86. package/dist/content/idea-command.js +0 -322
  87. package/dist/content/idea-frames.d.ts +0 -31
  88. package/dist/content/idea-frames.js +0 -140
  89. package/dist/content/idea-ranking.d.ts +0 -25
  90. package/dist/content/idea-ranking.js +0 -65
  91. package/dist/trace-matrix.d.ts +0 -27
  92. package/dist/trace-matrix.js +0 -226
@@ -90,25 +90,23 @@ function defaultReturnSchemaForAgent(agent) {
90
90
  case "spec-validator":
91
91
  return "spec-validation-return";
92
92
  case "spec-document-reviewer":
93
+ case "coherence-reviewer":
94
+ case "scope-guardian-reviewer":
95
+ case "feasibility-reviewer":
93
96
  return "review-return";
94
97
  case "slice-implementer":
95
98
  return "worker-return";
96
- case "performance-reviewer":
97
- return "performance-return";
98
- case "compatibility-reviewer":
99
- return "compatibility-return";
100
- case "observability-reviewer":
101
- return "observability-return";
102
99
  case "release-reviewer":
103
100
  return "release-return";
104
101
  case "planner":
105
102
  return "planning-return";
106
- case "product-manager":
107
- case "product-strategist":
103
+ case "product-discovery":
108
104
  return "product-return";
105
+ case "divergent-thinker":
109
106
  case "critic":
110
107
  return "critic-return";
111
108
  case "reviewer":
109
+ case "integration-overseer":
112
110
  return "review-return";
113
111
  case "security-reviewer":
114
112
  return "security-return";
@@ -118,14 +116,12 @@ function defaultReturnSchemaForAgent(agent) {
118
116
  return "docs-return";
119
117
  case "fixer":
120
118
  return "fixer-return";
121
- case "implementer":
122
- return "worker-return";
123
119
  }
124
120
  }
125
121
  function dispatchClassForRow(row) {
126
122
  if (row.dispatchClass)
127
123
  return row.dispatchClass;
128
- if (row.agent === "implementer" || row.agent === "fixer" || row.agent === "slice-implementer")
124
+ if (row.agent === "fixer" || row.agent === "slice-implementer")
129
125
  return "worker";
130
126
  return row.skill?.includes("review") || row.agent === "reviewer" || row.agent === "security-reviewer" || row.agent.endsWith("-reviewer")
131
127
  ? "review-lens"
@@ -298,8 +294,7 @@ const REQUIRED_GATE_IDS = {
298
294
  "review_layer2_security",
299
295
  "review_layer_coverage_complete",
300
296
  "review_criticals_resolved",
301
- "review_army_json_valid",
302
- ...(track === "quick" ? [] : ["review_trace_matrix_clean"])
297
+ "review_army_json_valid"
303
298
  ],
304
299
  ship: [
305
300
  "ship_review_verdict_valid",
@@ -447,11 +442,18 @@ const STAGE_SCHEMA_MAP = {
447
442
  const STAGE_AUTO_SUBAGENT_DISPATCH = {
448
443
  brainstorm: [
449
444
  {
450
- agent: "product-manager",
445
+ agent: "product-discovery",
451
446
  mode: "mandatory",
452
447
  requiredAtTier: "standard",
453
448
  when: "Always for standard/deep brainstorm to validate value, persona/JTBD, success metric, and why-now framing.",
454
- purpose: "Pressure-test problem/value fit and produce product-discovery evidence for the Problem Decision Record.",
449
+ purpose: "Run product-discovery mode to pressure-test problem/value fit and produce product evidence for the Problem Decision Record.",
450
+ requiresUserGate: false
451
+ },
452
+ {
453
+ agent: "divergent-thinker",
454
+ mode: "proactive",
455
+ when: "When brainstorm has >1 candidate direction or user signals openness to alternatives.",
456
+ purpose: "Expand option-space with alternative framings and approaches before planner/critic convergence.",
455
457
  requiresUserGate: false
456
458
  },
457
459
  {
@@ -459,8 +461,9 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
459
461
  mode: "mandatory",
460
462
  requiredAtTier: "standard",
461
463
  when: "Always for standard/deep brainstorm to challenge the premise, do-nothing path, and higher-upside alternatives.",
462
- purpose: "Attack assumptions and surface non-goals before direction approval.",
463
- requiresUserGate: false
464
+ purpose: "Attack assumptions and surface non-goals before direction approval, with pre-commitment predictions validated against evidence.",
465
+ requiresUserGate: false,
466
+ skill: "critic-multi-perspective"
464
467
  },
465
468
  {
466
469
  agent: "researcher",
@@ -479,13 +482,21 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
479
482
  purpose: "Challenge premise, map alternatives, and produce explicit in/out contract.",
480
483
  requiresUserGate: false
481
484
  },
485
+ {
486
+ agent: "divergent-thinker",
487
+ mode: "proactive",
488
+ when: "When scope mode is SCOPE EXPANSION or SELECTIVE EXPANSION, or scope contract has fewer than 3 alternatives considered.",
489
+ purpose: "Generate additional framings and approach variants before scope convergence hardens.",
490
+ requiresUserGate: false
491
+ },
482
492
  {
483
493
  agent: "critic",
484
494
  mode: "mandatory",
485
495
  requiredAtTier: "standard",
486
496
  when: "Always during scope shaping for standard/deep work.",
487
- purpose: "Test whether the selected scope mode is too timid, too broad, or hiding a smaller useful slice.",
488
- requiresUserGate: false
497
+ purpose: "Test whether the selected scope mode is too timid, too broad, or hiding a smaller useful slice, using pre-commitment predictions and validation.",
498
+ requiresUserGate: false,
499
+ skill: "critic-multi-perspective"
489
500
  },
490
501
  {
491
502
  agent: "researcher",
@@ -495,19 +506,27 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
495
506
  requiresUserGate: false
496
507
  },
497
508
  {
498
- agent: "product-manager",
509
+ agent: "product-discovery",
499
510
  mode: "proactive",
500
- when: "When scope choices change user value, success metrics, or product positioning.",
501
- purpose: "Keep accepted/deferred reference ideas tied to user value and measurable success.",
511
+ when: "When scope choices change user value, success metrics, or product positioning (Mode: discovery).",
512
+ purpose: "Keep accepted/deferred reference ideas tied to user value and measurable success under product-discovery mode.",
502
513
  requiresUserGate: false
503
514
  },
504
515
  {
505
- agent: "product-strategist",
516
+ agent: "product-discovery",
506
517
  mode: "proactive",
507
518
  requiredAtTier: "standard",
508
- when: "When scope mode resolves to SCOPE EXPANSION or SELECTIVE EXPANSION.",
509
- purpose: "Drive 10x vision and concrete expansion proposals before locking the scope contract.",
519
+ when: "When scope mode resolves to SCOPE EXPANSION or SELECTIVE EXPANSION (Mode: strategist).",
520
+ purpose: "Drive 10x vision and concrete expansion proposals before locking the scope contract via product-discovery strategist mode.",
510
521
  requiresUserGate: false
522
+ },
523
+ {
524
+ agent: "scope-guardian-reviewer",
525
+ mode: "proactive",
526
+ when: "When scope mode is SCOPE EXPANSION or SELECTIVE EXPANSION, or scope contract has many accepted ideas.",
527
+ purpose: "Challenge complexity growth and enforce minimum-change scope discipline before scope lock.",
528
+ requiresUserGate: false,
529
+ skill: "document-scope-guard"
511
530
  }
512
531
  ],
513
532
  design: [
@@ -530,9 +549,10 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
530
549
  {
531
550
  agent: "critic",
532
551
  mode: "proactive",
533
- when: "When architecture alternatives, coupling, cost, or rollback risk remain debatable.",
534
- purpose: "Produce a shadow alternative, switch trigger, and cheaper-path challenge for the engineering lock.",
535
- requiresUserGate: false
552
+ when: "When architecture alternatives, coupling, cost, or rollback risk remain debatable, or when security/auth/authz trust boundaries are involved.",
553
+ purpose: "Produce a shadow alternative, switch trigger, and cheaper-path challenge for the engineering lock with pre-commitment predictions and validation.",
554
+ requiresUserGate: false,
555
+ skill: "critic-multi-perspective"
536
556
  },
537
557
  {
538
558
  agent: "researcher",
@@ -549,20 +569,20 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
549
569
  requiresUserGate: false
550
570
  },
551
571
  {
552
- agent: "compatibility-reviewer",
572
+ agent: "coherence-reviewer",
553
573
  mode: "proactive",
554
- requiredAtTier: "lightweight",
555
- when: "When public API, config, persisted data, CLI, generated clients, or cross-version behavior can change.",
556
- purpose: "Identify backward-compatibility and migration hazards before spec/plan.",
557
- requiresUserGate: false
574
+ when: "When design touches multiple subsystems or includes multiple alternatives sections.",
575
+ purpose: "Detect internal contradictions, terminology drift, and broken cross-section references in design docs.",
576
+ requiresUserGate: false,
577
+ skill: "document-coherence-pass"
558
578
  },
559
579
  {
560
- agent: "observability-reviewer",
580
+ agent: "feasibility-reviewer",
561
581
  mode: "proactive",
562
- requiredAtTier: "lightweight",
563
- when: "When runtime/debuggability, rollout, failure detection, or supportability matters.",
564
- purpose: "Validate logs/metrics/traces, alerting, and rescue-path visibility before implementation.",
565
- requiresUserGate: false
582
+ when: "When design assumes runtime conditions, scaling behavior, or external service availability.",
583
+ purpose: "Validate that design assumptions remain feasible in real runtime and rollout constraints.",
584
+ requiresUserGate: false,
585
+ skill: "document-feasibility-pass"
566
586
  }
567
587
  ],
568
588
  spec: [
@@ -588,6 +608,14 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
588
608
  when: "When Spec Self-Review reports gaps (Status: Issues Found) or subsystem boundaries drift beyond one coherent plan slice.",
589
609
  purpose: "Run a final document-level quality pass for completeness, consistency, clarity, and scope fit before handoff to plan.",
590
610
  requiresUserGate: false
611
+ },
612
+ {
613
+ agent: "coherence-reviewer",
614
+ mode: "proactive",
615
+ when: "When spec has more than five acceptance criteria or multiple assumptions sections.",
616
+ purpose: "Check cross-section coherence, terminology consistency, and internal references before plan handoff.",
617
+ requiresUserGate: false,
618
+ skill: "document-coherence-pass"
591
619
  }
592
620
  ],
593
621
  plan: [
@@ -605,6 +633,30 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
605
633
  when: "When plan tasks touch unfamiliar areas or reference-pattern adoption needs source verification.",
606
634
  purpose: "Confirm context/search evidence before plan packets rely on discovered patterns.",
607
635
  requiresUserGate: false
636
+ },
637
+ {
638
+ agent: "coherence-reviewer",
639
+ mode: "proactive",
640
+ when: "When plan packets touch more than one subsystem or map more than five dependency edges.",
641
+ purpose: "Verify internal consistency across batches, dependencies, and handoff narratives.",
642
+ requiresUserGate: false,
643
+ skill: "document-coherence-pass"
644
+ },
645
+ {
646
+ agent: "scope-guardian-reviewer",
647
+ mode: "proactive",
648
+ when: "When plan introduces new abstractions or generic utility layers.",
649
+ purpose: "Challenge unnecessary abstraction and enforce minimum viable implementation scope.",
650
+ requiresUserGate: false,
651
+ skill: "document-scope-guard"
652
+ },
653
+ {
654
+ agent: "feasibility-reviewer",
655
+ mode: "proactive",
656
+ when: "When plan carries runtime, environment, dependency, or resource assumptions.",
657
+ purpose: "Validate execution and rollout feasibility before implementation starts.",
658
+ requiresUserGate: false,
659
+ skill: "document-feasibility-pass"
608
660
  }
609
661
  ],
610
662
  tdd: [
@@ -625,6 +677,13 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
625
677
  purpose: "Implement the minimal passing slice inside explicit file boundaries and return strict worker evidence.",
626
678
  requiresUserGate: false
627
679
  },
680
+ {
681
+ agent: "integration-overseer",
682
+ mode: "proactive",
683
+ when: "When TDD fan-out used 2+ parallel slice-implementers, or when slices touch shared interfaces.",
684
+ purpose: "Verify cohesion-contract integrity across shared types, touchpoints, invariants, and integration test outcomes after fan-in.",
685
+ requiresUserGate: false
686
+ },
628
687
  {
629
688
  agent: "reviewer",
630
689
  mode: "proactive",
@@ -646,7 +705,7 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
646
705
  mode: "mandatory",
647
706
  requiredAtTier: "lightweight",
648
707
  when: "Always in review stage.",
649
- purpose: "Layer 1 spec compliance plus integrated Layer 2 review across correctness, architecture, and external-safety tags with source-tagged findings.",
708
+ purpose: "Layer 1 spec compliance plus integrated Layer 2 review across correctness, architecture, and inline performance/compatibility/observability lens coverage with source-tagged findings. Escalate to optional dedicated lens skills only when diff scope/risk justifies a deeper pass.",
650
709
  requiresUserGate: false,
651
710
  skill: "review-spec-pass"
652
711
  },
@@ -659,30 +718,6 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
659
718
  requiresUserGate: false,
660
719
  skill: "security-audit"
661
720
  },
662
- {
663
- agent: "performance-reviewer",
664
- mode: "proactive",
665
- requiredAtTier: "lightweight",
666
- when: "When hot paths, IO, data volume, rendering, caching, or algorithmic cost can move.",
667
- purpose: "Run a focused performance lens and report evidence-backed regressions or no-impact rationale.",
668
- requiresUserGate: false
669
- },
670
- {
671
- agent: "compatibility-reviewer",
672
- mode: "proactive",
673
- requiredAtTier: "lightweight",
674
- when: "When public API, CLI/config, persisted data, generated clients, or dependency versions change.",
675
- purpose: "Check compatibility, migrations, and consumer-facing contract stability.",
676
- requiresUserGate: false
677
- },
678
- {
679
- agent: "observability-reviewer",
680
- mode: "proactive",
681
- requiredAtTier: "lightweight",
682
- when: "When failure diagnosis, logging/metrics/traces, rollout, or operational support matters.",
683
- purpose: "Check observability and supportability evidence against the design/review artifact.",
684
- requiresUserGate: false
685
- },
686
721
  {
687
722
  agent: "reviewer",
688
723
  mode: "proactive",
@@ -709,6 +744,15 @@ const STAGE_AUTO_SUBAGENT_DISPATCH = {
709
744
  }
710
745
  ],
711
746
  ship: [
747
+ {
748
+ agent: "architect",
749
+ mode: "mandatory",
750
+ requiredAtTier: "lightweight",
751
+ when: "Always before final ship — verify cross-stage cohesion across scope/design/spec/plan/code.",
752
+ purpose: "Final cross-stage cohesion gate before release finalization.",
753
+ requiresUserGate: false,
754
+ skill: "architect-cross-stage-verification"
755
+ },
712
756
  {
713
757
  agent: "release-reviewer",
714
758
  mode: "mandatory",
@@ -37,14 +37,16 @@ export const BRAINSTORM = {
37
37
  executionModel: {
38
38
  checklist: [
39
39
  "**Explore project context** — inspect existing files/docs/recent activity before asking what to build; capture matching files/patterns/seeds in `Context > Discovered context` so downstream stages don't redo discovery.",
40
+ "**Adaptive elicitation loop (shared skill)** — load `.cclaw/skills/adaptive-elicitation/SKILL.md` and run one decision-changing question at a time via harness-native question tools. After each answer, append one row to `## Q&A Log` (`Turn | Question | User answer (1-line) | Decision impact`). Continue until context is clear or user signals to proceed.",
41
+ "**Brainstorm forcing questions (must be covered or explicitly waived)** — what pain are we solving, what is the direct path, what happens if we do nothing, who is the first operator/user affected, and what no-go boundaries are non-negotiable.",
40
42
  "**Classify stage depth** — choose `lite` for clear low-risk tasks, `standard` for normal engineering/product changes, or `deep` for ambiguity, architecture, external dependency, security/data risk, or explicit think-bigger requests.",
41
43
  "**Write the Problem Decision Record** — pick a free-form `Frame type` label that names how this work is framed (examples: product, technical-maintenance, research-spike, ops-incident, infrastructure), then fill the universal Framing fields: affected user/role/operator, current state/failure mode/opportunity, desired observable outcome, evidence/signal, why now, do-nothing consequence, and non-goals.",
42
44
  "**Premise check (one pass)** — answer the three gstack-style questions in the artifact body: *Right problem? Direct path? What if we do nothing?* Take a position; do not hedge.",
43
45
  "**Reframe with How Might We** — write a single `How Might We …?` line that names the user/operator, the desired outcome, and the constraint. This is the altitude check before approaches.",
44
46
  "**Run Clarity Gate** — record ambiguity score (0.00-1.00), decision boundaries, reaffirmed non-goals, and residual-risk handoff before locking recommendations. If ambiguity remains high (>0.40), ask one decision-changing question before recommending.",
45
47
  "**Sharpening question discipline** — ask one decision-changing question at a time. Do not default to 3-5 batched questions; record only questions that changed the direction or a critical stop decision.",
46
- "**Use compact discovery for low-risk asks** — for concrete bounded requests, do one context pass, compare one baseline and one challenger, then ask for one explicit approval; do not drag the user through a full workshop.",
47
- "**Early-exit concrete asks** — for unambiguous implementation-only requests, write a compact Problem Decision Record plus short-circuit handoff (context, approved intent, constraints, assumptions, next-stage risks) and ask for one explicit approval.",
48
+ "**Use compact discovery for low-risk asks** — for concrete bounded requests, do one context pass, compare one baseline and one challenger, and move to draft once context is sufficient; do not drag the user through a full workshop.",
49
+ "**Early-exit concrete asks** — for unambiguous implementation-only requests, write a compact Problem Decision Record plus short-circuit handoff (context, approved intent, constraints, assumptions, next-stage risks) and request explicit approval when the draft is ready.",
48
50
  "**Ask only decision-changing questions** — one at a time; if answers would not change approach and are non-critical preference/default assumptions, state the assumption and continue; STOP on scope, architecture, security, data loss, public API, migration, auth/pricing, or user approval uncertainty.",
49
51
  "**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, reuse notes, and reference-pattern source/disposition when a known pattern influenced the option; include exactly one challenger with explicit `high` or `higher` upside.",
50
52
  "**Collect reaction before recommending** — ask which option feels closest and what concern remains, then recommend based on that reaction.",
@@ -52,14 +54,16 @@ export const BRAINSTORM = {
52
54
  "**Run early Ralph loop discipline** — after each producer iteration, append a `Critic Pass` JSONL row to `.cclaw/state/early-loop-log.jsonl`, refresh `.cclaw/state/early-loop.json`, and iterate until open concerns clear or convergence guard escalates.",
53
55
  "**Embedded Grill (post-pick)** — after `Selected Direction` is named, run 3-5 sharp checks on hidden constraints, reversibility/rollback, scope boundaries, existing-pattern conformance, and domain-language fit; record each question with recommended answer and disposition (accept/refine/reject).",
54
56
  "**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.",
55
- "**Request explicit approval** — state exactly what direction is being approved; do not advance without approval and artifact review.",
57
+ "**Request explicit approval to close the stage** — state exactly what direction is being approved after the adaptive elicitation loop converges; do not advance without approval and artifact review.",
56
58
  "**Handoff packet** — only after approval, produce a scope handoff packet with selected direction, why rejected options were rejected, explicit non-goals, unresolved questions, risk hints, and explicit drift from the initial ask so scope starts from locked upstream decisions instead of rediscovering intent."
57
59
  ],
58
60
  interactionProtocol: [
61
+ "\"If something is unclear, stop. Name what's confusing. Ask.\"",
59
62
  "Start from observed project context; if the idea is vague, first narrow the project type with **one** structured question, then keep going.",
60
63
  "Select depth explicitly: `lite`, `standard`, or `deep`; keep lite concise, but escalate when risk/ambiguity changes decisions.",
61
64
  "Lead with the premise check (right problem / direct path / what if nothing) and the `How Might We` reframing before approaches; both go in the artifact, not just the chat.",
62
65
  "Ask at most one question per turn, only when decision-changing; if using a structured question tool, send exactly one question object, not a multi-question form.",
66
+ "Run the shared adaptive elicitation cycle from `.cclaw/skills/adaptive-elicitation/SKILL.md`, including stop-signal handling (RU/EN/UA), smart-skip, conditional grilling triggers, and append-only `## Q&A Log` updates.",
63
67
  "Only non-critical preference/default assumptions may continue inline. STOP and ask when uncertainty affects scope, architecture, security, data loss, public API, migration, auth/pricing, or user approval.",
64
68
  "For simple low-risk greenfield work, present a compact A/B choice with one recommended path and one higher-upside challenger; keep the artifact concise but structurally complete (Context, Premise, How Might We, Sharpening Questions, Approaches, Reaction, Selected Direction, Not Doing).",
65
69
  "Show approaches before the recommendation; include a higher-upside challenger and gather reaction first.",
@@ -40,6 +40,8 @@ export const DESIGN = {
40
40
  },
41
41
  executionModel: {
42
42
  checklist: [
43
+ "**Adaptive elicitation loop (shared skill)** — load `.cclaw/skills/adaptive-elicitation/SKILL.md` and run one decision-changing question per turn via harness-native tools. After each answer, append one row to `## Q&A Log` (`Turn | Question | User answer (1-line) | Decision impact`). Continue until architecture context is clear or user signals to proceed.",
44
+ "**Design forcing questions (must be covered or explicitly waived)** — what is the end-to-end data flow, where are seams/ownership boundaries, which invariants must hold, and what will explicitly NOT be refactored now.",
43
45
  "Compact design lock — design does not decide what to build; it decides how the approved scope works. For simple slices, produce a tight lock: upstream handoff, existing fit, architecture boundary, one labeled diagram, data/state flow, critical path, failure/rescue, trust boundaries, test/perf expectations, rollout/rollback, rejected alternative, and spec handoff.",
44
46
  "Trivial-Change Escape Hatch — for <=3 files, no new interfaces, and no cross-module data flow, produce a mini-design (rationale, changed files, one risk) and proceed to spec.",
45
47
  "Tiered Research — for simple/medium work, do compact inline codebase/research synthesis in `Research Fleet Synthesis`; write `.cclaw/artifacts/02a-research.md` and run the full fleet only for deep/high-risk work or when external framework/architecture uncertainty exists.",
@@ -55,8 +57,10 @@ export const DESIGN = {
55
57
  "Capture leftovers — seed high-upside deferred ideas, list unresolved decisions with defaults, document distribution for new artifact types, and cross-reference deferred items to scope or unresolved decisions."
56
58
  ],
57
59
  interactionProtocol: [
60
+ "\"Constrain, don't micromanage - enforce invariants, separate the doer from the checker.\"",
58
61
  "Review section-by-section: investigator first, critic second, then reconcile. For simple apps, collapse this into one compact design lock with explicit risks and a single approval stop.",
59
62
  "Present each issue one at a time; do not batch issues or move sections until current issues are resolved.",
63
+ "Run the shared adaptive elicitation cycle from `.cclaw/skills/adaptive-elicitation/SKILL.md`, including stop-signal handling (RU/EN/UA), smart-skip, conditional grilling triggers, and append-only `## Q&A Log` updates.",
60
64
  decisionProtocolInstruction("each issue", "describe concretely with file/line references, present labeled options (A/B/C) with trade-offs, effort estimate (S/M/L/XL), risk level (Low/Med/High), and mark one as (recommended)", "recommend the option that closes the issue with the smallest blast radius and clearest verification path"),
61
65
  "If a section has no issues, say 'No issues found' and move on.",
62
66
  "Do not skip failure-mode mapping; use Method/Exception/Rescue/UserSees and treat silent user impact without rescue as critical.",
@@ -36,7 +36,7 @@ export const REVIEW = {
36
36
  "Change-Size Check — ~100 lines = normal. ~300 lines = consider splitting. ~1000+ lines = strongly recommend stacked PRs. Flag large diffs to the user.",
37
37
  "Risk-Based Second Opinion — compute changed-line count, files-touched count, and trust-boundary movement. Dispatch an adversarial reviewer only when trust boundaries changed, Critical/Important ambiguity remains, or the diff is both large and high-risk; otherwise record `not triggered`.",
38
38
  "Load upstream evidence — read TDD artifact (RED + GREEN + REFACTOR), spec, and the active track's upstream source items.",
39
- "Run traceability matrix when the active track enforces it; otherwise confirm spec acceptance/reproduction slices are covered directly.",
39
+ "Confirm spec acceptance criteria and reproduction slices are covered directly in the review artifact evidence.",
40
40
  "Layer 1: Spec Compliance — check every acceptance criterion against implementation. Verdict: pass/fail per criterion.",
41
41
  "Review Evidence Scope — record base/head, files inspected, changed-file coverage, diagnostics run, dependency/version audit when relevant, and any files intentionally not inspected with explicit reason.",
42
42
  "Layer 2: Integrated findings — one structured pass tagged by category: correctness, security, performance, architecture, external-safety. Every finding uses file:line; if impossible, include an explicit no-line reason.",
@@ -45,7 +45,7 @@ export const REVIEW = {
45
45
  "Structured Review reconciliation — normalize findings into `07-review-army.json`, dedup by fingerprint, and mark multi-specialist confirmations when multiple lenses agree.",
46
46
  "Meta-Review — Were tests/diagnostics actually run? Do test names match what they test? Are there real assertions? Is the dependency/version surface unchanged or audited?",
47
47
  "Classify findings — Critical (blocks ship), Important (should fix), Suggestion (optional improvement).",
48
- "Victory Detector — before verdict, confirm Layer 1, Layer 2, security sweep, structured findings, trace evidence, and unresolved-critical status are complete; otherwise iterate findings or route back to TDD.",
48
+ "Victory Detector — before verdict, confirm Layer 1, Layer 2, security sweep, structured findings, acceptance/reproduction coverage evidence, and unresolved-critical status are complete; otherwise iterate findings or route back to TDD.",
49
49
  "Produce verdict — APPROVED, APPROVED_WITH_CONCERNS, or BLOCKED.",
50
50
  "If verdict is BLOCKED, emit remediation route token `ROUTE_BACK_TO_TDD`, include the managed command `npx cclaw-cli internal rewind tdd \"review_blocked_by_critical <finding-ids>\"`, list the critical finding IDs and required TDD evidence to repair, and satisfy the special transition guard `review_verdict_blocked` instead of `review_criticals_resolved`. After TDD rework, clear the stale marker with `npx cclaw-cli internal rewind --ack tdd` before `/cc`."
51
51
  ],
@@ -73,13 +73,12 @@ export const REVIEW = {
73
73
  { id: "review_layer2_security", description: "Security review completed." },
74
74
  { id: "review_layer_coverage_complete", description: "Layer coverage map in 07-review-army.json confirms spec/correctness/security/performance/architecture/external-safety tags were considered." },
75
75
  { id: "review_criticals_resolved", description: "Normal APPROVED or APPROVED_WITH_CONCERNS path only: no unresolved critical blockers remain. BLOCKED routes use review_verdict_blocked instead." },
76
- { id: "review_army_json_valid", description: "07-review-army.json passes schema validation (validateReviewArmy)." },
77
- { id: "review_trace_matrix_clean", description: "Trace matrix has no orphaned source items or test slices for the active run, and evidence cites a discovered real test command before ship handoff." }
76
+ { id: "review_army_json_valid", description: "07-review-army.json passes schema validation (validateReviewArmy)." }
78
77
  ],
79
78
  requiredEvidence: [
80
79
  "Artifact written to `.cclaw/artifacts/07-review.md`.",
81
80
  "Artifact written to `.cclaw/artifacts/07-review-army.json`.",
82
- "Traceability matrix run recorded (no orphaned source items or tests for enforced tracks).",
81
+ "Acceptance/reproduction coverage evidence recorded in the review artifact (AC and source-item/slice coverage snapshot).",
83
82
  "Layer 1 verdict captured with per-criterion pass/fail.",
84
83
  "Review Evidence Scope lists files inspected, changed-file coverage, diagnostics run, and omitted files with explicit reason.",
85
84
  "Layer 2 sections completed across correctness, security, performance, architecture, and external-safety findings.",
@@ -87,9 +86,9 @@ export const REVIEW = {
87
86
  "No-finding attestation is explicit when no issues are found.",
88
87
  "Dependency/version audit is recorded when manifests, lockfiles, generated clients, CI, runtime config, or external APIs are relevant.",
89
88
  "Severity log includes critical/important/suggestion buckets.",
90
- "Victory Detector recorded: Layer 1, Layer 2, security sweep, structured findings, trace evidence, and unresolved-critical status are complete, or BLOCKED route is explicit.",
89
+ "Victory Detector recorded: Layer 1, Layer 2, security sweep, structured findings, acceptance/reproduction coverage evidence, and unresolved-critical status are complete, or BLOCKED route is explicit.",
91
90
  "Explicit final verdict: APPROVED, APPROVED_WITH_CONCERNS, or BLOCKED.",
92
- "Fresh verification command discovery recorded, and the command cited in `review_trace_matrix_clean` evidence before ship handoff.",
91
+ "Fresh verification command discovery recorded before ship handoff, with command and result captured in review evidence.",
93
92
  "If BLOCKED: include explicit remediation route (`ROUTE_BACK_TO_TDD`) with blocking finding IDs, managed rewind command, and post-rework ack instruction."
94
93
  ],
95
94
  inputs: ["implementation diff", "upstream artifacts", "test/build evidence"],
@@ -125,13 +124,14 @@ export const REVIEW = {
125
124
  { section: "Changed-File Coverage", required: true, validationRule: "Each changed file is covered, intentionally omitted with no-impact reason, or linked to a broader inspected module." },
126
125
  { section: "Layer 1 Verdict", required: true, validationRule: "Per-criterion pass/fail with references." },
127
126
  { section: "Layer 2 Findings", required: false, validationRule: "Each finding has severity, category, file:line or explicit no-line reason, description, and resolution status across correctness/security/performance/architecture/external-safety. If there are no findings, include a no-finding attestation." },
127
+ { section: "Lens Coverage", required: true, validationRule: "Reviewer must report inline lens outcomes: Performance/Compatibility/Observability as `NO_IMPACT` or `FOUND_<n>`, plus `Security: routed to security-reviewer`." },
128
128
  { section: "Security Sweep Attestation", required: false, validationRule: "Dedicated security-reviewer result: findings or `NO_CHANGE_ATTESTATION` / `NO_SECURITY_IMPACT` with inspected surfaces and rationale." },
129
129
  { section: "Dependency & Version Audit", required: false, validationRule: "Required when manifests, lockfiles, generated clients, CI, runtime config, or external APIs changed; otherwise record no-impact rationale." },
130
130
  { section: "Review Findings Contract", required: true, validationRule: "Structured findings in 07-review-army.json include id/severity/confidence/fingerprint/reportedBy/status and source tags from {spec, correctness, security, performance, architecture, external-safety} with dedup reconciliation summary." },
131
131
  { section: "Review Readiness Snapshot", required: false, validationRule: "Optional compact summary: completed checks, delegation-log status, staleness signal, open critical blockers, ship recommendation, and Victory Detector pass/fail." },
132
132
  { section: "Completeness Snapshot", required: false, validationRule: "Optional compact coverage summary for AC coverage, source item coverage, test-slice coverage, and adversarial-review status when triggered." },
133
133
  { section: "Incoming Feedback Queue", required: false, validationRule: "When external review feedback exists, include a queue summary with per-item disposition (resolved / accepted-risk / rejected-with-evidence) and evidence refs." },
134
- { section: "Trace Matrix Check", required: false, validationRule: "Records source-item/test orphan counts (all zero on enforced tracks) with command output reference." },
134
+ { section: "Coverage Check", required: false, validationRule: "Records AC/source-item/slice coverage status with explicit no-orphan rationale and evidence references." },
135
135
  { section: "Blocked Route", required: false, validationRule: "When Final Verdict is BLOCKED: includes `ROUTE_BACK_TO_TDD`, rewind target `tdd`, and blocked finding IDs." },
136
136
  { section: "Severity Summary", required: true, validationRule: "Per-severity count lines for critical, important, and suggestion buckets." },
137
137
  { section: "Final Verdict", required: true, validationRule: "Exactly one of: APPROVED, APPROVED_WITH_CONCERNS, BLOCKED." }
@@ -20,9 +20,9 @@ export interface ArtifactValidation {
20
20
  tier?: "required" | "recommended";
21
21
  validationRule: string;
22
22
  }
23
- export type StageSubagentName = "researcher" | "architect" | "spec-validator" | "spec-document-reviewer" | "slice-implementer" | "performance-reviewer" | "compatibility-reviewer" | "observability-reviewer" | "release-reviewer" | "planner" | "product-manager" | "product-strategist" | "critic" | "reviewer" | "security-reviewer" | "test-author" | "doc-updater" | "implementer" | "fixer";
23
+ export type StageSubagentName = "researcher" | "architect" | "spec-validator" | "spec-document-reviewer" | "coherence-reviewer" | "scope-guardian-reviewer" | "feasibility-reviewer" | "slice-implementer" | "release-reviewer" | "planner" | "product-discovery" | "divergent-thinker" | "critic" | "reviewer" | "security-reviewer" | "integration-overseer" | "test-author" | "doc-updater" | "fixer";
24
24
  export type StageSubagentDispatchClass = "stage-specialist" | "worker" | "review-lens";
25
- export type StageSubagentReturnSchema = "planning-return" | "product-return" | "critic-return" | "review-return" | "security-return" | "tdd-return" | "docs-return" | "worker-return" | "fixer-return" | "research-return" | "architecture-return" | "spec-validation-return" | "performance-return" | "compatibility-return" | "observability-return" | "release-return";
25
+ export type StageSubagentReturnSchema = "planning-return" | "product-return" | "critic-return" | "review-return" | "security-return" | "tdd-return" | "docs-return" | "worker-return" | "fixer-return" | "research-return" | "architecture-return" | "spec-validation-return" | "release-return";
26
26
  export interface StageAutoSubagentDispatch {
27
27
  agent: StageSubagentName;
28
28
  /**
@@ -45,10 +45,12 @@ export const SCOPE = {
45
45
  },
46
46
  executionModel: {
47
47
  checklist: [
48
+ "**Adaptive elicitation loop (shared skill)** — load `.cclaw/skills/adaptive-elicitation/SKILL.md` and run one decision-changing question per turn via harness-native tools. After each answer, append one row to `## Q&A Log` (`Turn | Question | User answer (1-line) | Decision impact`). Continue until scope clarity is sufficient or user signals to proceed.",
49
+ "**Scope forcing questions (must be covered or explicitly waived)** — what is definitely in/out, which upstream decisions are locked, and what rollback path protects users if scope assumptions fail.",
48
50
  "**Scope contract first** — read brainstorm handoff, name upstream decisions used, explicit drift, confidence, unresolved questions, and next-stage risk hints; draft the in-scope/out-of-scope/deferred/discretion contract before any design choice.",
49
51
  "**Premise and leverage check** — answer in the artifact: *Right problem? Direct path? What if nothing? Where can we leverage existing code? What is the reversibility cost?* Take a position; do not hedge.",
50
52
  "**Conditional 10-star boundary** — for deep/high-risk/product-strategy work, show what would make the product meaningfully better, then explicitly choose what ships now, what is deferred, and what is excluded without vague `later/for now` placeholders. Skip this for straightforward repair work and record `not needed: compact scope`.",
51
- "**Pick one operational mode with the user** — HOLD SCOPE preserves focus; SELECTIVE EXPANSION cherry-picks high-leverage reference ideas; SCOPE EXPANSION explores ambitious alternatives; SCOPE REDUCTION cuts to the essential wedge. Recommend one, state why and what signal would change it, then STOP for approval.",
53
+ "**Pick one operational mode with the user** — HOLD SCOPE preserves focus; SELECTIVE EXPANSION cherry-picks high-leverage reference ideas; SCOPE EXPANSION explores ambitious alternatives; SCOPE REDUCTION cuts to the essential wedge. Recommend one, state why and what signal would change it, then keep elicitation focused until the user either approves or asks to proceed with draft boundaries.",
52
54
  "**Run mode-specific analysis only to needed depth** — lite keeps the selected-mode row compact; standard adds requirements/locked decisions/discretion; deep may add Landscape Check, Taste Calibration, Reference Pattern Registry, Reference Pull, Ambitious Alternatives, and Ruthless Minimum Slice evidence when mode/risk warrants it.",
53
55
  "**Decision-driver contract** — list weighted decision drivers (value, risk, reversibility, effort, timeline) and score candidate scope moves so the selected mode and boundaries are evidence-backed, not preference-led.",
54
56
  "**Compare implementation alternatives** — include minimum viable, product-grade, and ideal architecture options with effort (S/M/L/XL), risk (Low/Med/High), pros, cons, and reuses. Recommend one and tie it to mode.",
@@ -58,9 +60,11 @@ export const SCOPE = {
58
60
  "**Write the scope contract after approval** — include selected mode, in scope, out of scope, requirements, locked decisions, discretion areas, deferred ideas, accepted/rejected reference ideas, success definition, design handoff, completion dashboard, and explicit approval evidence."
59
61
  ],
60
62
  interactionProtocol: [
63
+ "\"Strong success criteria let you loop independently. Weak criteria require constant clarification.\"",
61
64
  decisionProtocolInstruction("scope mode selection", "present expand/selective/hold/reduce as labeled options with trade-offs and mark one as (recommended)", "recommend the option that best covers the prime-directive failure modes, four data-flow paths, observability, and deferred handling for the in-scope set with the smallest blast radius. Base your recommendation on default heuristics: greenfield -> expand, enhancement -> selective, bugfix/hotfix/refactor -> hold, broad blast radius -> reduce"),
65
+ "Run the shared adaptive elicitation cycle from `.cclaw/skills/adaptive-elicitation/SKILL.md`, including stop-signal handling (RU/EN/UA), smart-skip, conditional grilling triggers, and append-only `## Q&A Log` updates.",
62
66
  "Do not walk the full checklist by default. Lead with a proposed scope contract, selected depth (`lite`/`standard`/`deep`), and the one decision that matters most; label the mode as recommended, not selected, until the user answers.",
63
- "For low-risk concrete asks, keep the proposal compact but still explicit: recommend (do not auto-select) one mode, show exact in/out/deferred boundaries, and STOP for one explicit approval before finalizing the artifact or completing the stage.",
67
+ "For low-risk concrete asks, keep the proposal compact but still explicit: recommend (do not auto-select) one mode, show exact in/out/deferred boundaries, and request explicit approval before finalizing the artifact or completing the stage.",
64
68
  "Challenge premise first, take a firm position, and name one concrete condition that would change it.",
65
69
  "Push back on weak framing: vague scope needs a specific user/problem, platform vision needs a narrow wedge, social proof needs behavioral evidence.",
66
70
  "Resolve one structural scope issue at a time. Only non-critical preference/default assumptions may continue; STOP on uncertainty about scope boundary, architecture commitment, security, data loss, public API, migration, auth/pricing, or required user approval.",
@@ -89,7 +93,7 @@ export const SCOPE = {
89
93
  "In-scope and out-of-scope lists are explicit.",
90
94
  "Discretion areas are explicit (or marked as `None`).",
91
95
  "Selected mode and rationale are documented using HOLD SCOPE, SELECTIVE EXPANSION, SCOPE EXPANSION, or SCOPE REDUCTION.",
92
- "When selected mode is SCOPE EXPANSION or SELECTIVE EXPANSION, active-run delegation ledger includes a completed `product-strategist` row with non-empty `evidenceRefs`.",
96
+ "When selected mode is SCOPE EXPANSION or SELECTIVE EXPANSION, active-run delegation ledger includes a completed `product-discovery` row with non-empty `evidenceRefs`.",
93
97
  "Scope Contract captures requirements, locked decisions, discretion areas, accepted/rejected/deferred reference ideas from the Reference Pattern Registry, success definition, and design handoff.",
94
98
  "Decision Drivers section records weighted criteria and per-option scores used to choose mode and boundary moves.",
95
99
  "Scope Completeness Score is recorded (0.00-1.00) with the explicit blocker list for any remaining uncertainty.",
@@ -118,7 +118,7 @@ export const SHIP = {
118
118
  { section: "Monitoring", required: false, validationRule: "If applicable: what metrics/logs to watch post-deploy. Risk note if no monitoring." },
119
119
  { section: "Finalization", required: true, validationRule: "Exactly one finalization enum token selected (FINALIZE_MERGE_LOCAL | FINALIZE_OPEN_PR | FINALIZE_KEEP_BRANCH | FINALIZE_DISCARD_BRANCH | FINALIZE_NO_VCS). Execution result documented. Worktree cleaned if applicable." },
120
120
  { section: "Completion Status", required: false, validationRule: "If present: exactly one of SHIPPED, SHIPPED_WITH_EXCEPTIONS, BLOCKED. Exceptions documented when applicable. BLOCKED is required when the Victory Detector has stale or missing evidence." },
121
- { section: "Compound Step", required: false, validationRule: "Optional retrospective: include overlap assessment before appending duplicate knowledge; distinguish bug-track fixes/tests from knowledge-track process/project guidance; use supersedes/superseded_by only for clear refreshes; or include an explicit 'No compound insight this run.' line." }
121
+ { section: "Compound Step", required: false, validationRule: "Optional retrospective: include overlap assessment before appending duplicate knowledge; distinguish bug-track fixes/tests from knowledge-track process/project guidance; or include an explicit 'No compound insight this run.' line." }
122
122
  ]
123
123
  },
124
124
  reviewLens: {
@@ -90,7 +90,7 @@ ${conversationLanguagePolicyMarkdown()}
90
90
  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.
91
91
  10. Start the tracked flow only through the managed helper:
92
92
  \`node .cclaw/hooks/start-flow.mjs --track=<quick|medium|standard> --class=<class> --prompt=<prompt> --stack=<stack> --reason=<matched heuristic>\`
93
- If this helper fails, STOP and report the exact command/output. Do **not** manually edit \`${flowPath}\`.
93
+ If this helper fails, STOP. Report one human-readable failure line from the JSON \`error\` field, include the helper JSON payload in a fenced \`json\` block, and never echo the invoking command line. Do **not** manually edit \`${flowPath}\`.
94
94
  11. The helper persists \`${flowPath}\`, computes \`skippedStages\`, sets the first stage for the track, resets the gate catalog, and writes \`.cclaw/artifacts/00-idea.md\`.
95
95
  12. Load the **first-stage skill for the chosen track** and its command file:
96
96
  - quick → \`.cclaw/skills/spec/SKILL.md\`
@@ -105,7 +105,7 @@ If during any stage the agent discovers evidence that contradicts the initial Ph
105
105
  1. Surface the new evidence in plain text.
106
106
  2. Propose the updated \`Class\` + \`Track\` with a one-line reason.
107
107
  3. Use the Decision Protocol to let the user accept, override, or cancel.
108
- 4. On acceptance: run \`node .cclaw/hooks/start-flow.mjs --reclassify --track=<new-track> --class=<new-class> --reason=<why>\`. The helper appends a \`Reclassification:\` entry to \`00-idea.md\` and updates flow state atomically. If it fails, STOP and report the exact output; do NOT manually edit \`flow-state.json\`.
108
+ 4. On acceptance: run \`node .cclaw/hooks/start-flow.mjs --reclassify --track=<new-track> --class=<new-class> --reason=<why>\`. The helper appends a \`Reclassification:\` entry to \`00-idea.md\` and updates flow state atomically. If it fails, STOP and report one human-readable line plus the helper JSON payload in a fenced \`json\` block; never echo the invoking command line. Do NOT manually edit \`flow-state.json\`.
109
109
 
110
110
  ### Without prompt (\`/cc\`)
111
111
 
@@ -187,12 +187,12 @@ ${conversationLanguagePolicyMarkdown()}
187
187
 
188
188
  - On conflict, prefer \`standard\` over \`medium\`, and \`medium\` over \`quick\`.
189
189
  - Always state the recommendation as a one-line reason citing matched triggers and a high/medium/low track selection confidence. Clarify that the heuristic is advisory until the managed helper writes state; after that, \`/cc\` follows the selected track. Include override guidance: switch to standard when architecture, schema, migration, security, or unclear scope appears; switch to medium when product framing is needed but architecture is known.
190
- 8. Run the managed start helper: \`node .cclaw/hooks/start-flow.mjs --track=<quick|medium|standard> --class=<class> --prompt=<prompt> --stack=<stack> --reason=<matched heuristic>\`. The helper writes \`${flowPath}\`, computes \`skippedStages\`, resets the gate catalog, and writes \`${RUNTIME_ROOT}/artifacts/00-idea.md\`. If it fails, STOP and report the exact command/output; do not manually edit flow state.
190
+ 8. Run the managed start helper: \`node .cclaw/hooks/start-flow.mjs --track=<quick|medium|standard> --class=<class> --prompt=<prompt> --stack=<stack> --reason=<matched heuristic>\`. The helper writes \`${flowPath}\`, computes \`skippedStages\`, resets the gate catalog, and writes \`${RUNTIME_ROOT}/artifacts/00-idea.md\`. If it fails, STOP, report one human-readable failure line from the JSON \`error\` field, and include the helper JSON payload in a fenced \`json\` block; do not echo the invoking command line, and do not manually edit flow state.
191
191
  9. Load and execute the **first stage skill of the chosen track** (\`brainstorm\` for medium/standard, \`spec\` for quick) plus its matching command file.
192
192
 
193
193
  ### Reclassification on discovery
194
194
 
195
- If mid-stage evidence contradicts the initial Class/Track decision (the "trivial" change needs a migration, the "quick" bug fix needs architecture work, an origin doc multiplies scope), STOP and re-classify using the Decision Protocol. On acceptance, run \`node .cclaw/hooks/start-flow.mjs --reclassify --track=<new-track> --class=<new-class> --reason=<why>\`; the helper records \`Reclassification:\` in \`00-idea.md\` and updates state atomically. Do NOT rewrite prior artifacts or manually edit flow-state.
195
+ If mid-stage evidence contradicts the initial Class/Track decision (the "trivial" change needs a migration, the "quick" bug fix needs architecture work, an origin doc multiplies scope), STOP and re-classify using the Decision Protocol. On acceptance, run \`node .cclaw/hooks/start-flow.mjs --reclassify --track=<new-track> --class=<new-class> --reason=<why>\`; the helper records \`Reclassification:\` in \`00-idea.md\` and updates state atomically. If it fails, report one human-readable line plus the helper JSON payload in a fenced \`json\` block, never echo the invoking command line, and do not rewrite prior artifacts or manually edit flow-state.
196
196
 
197
197
  ### Path B: \`/cc\` (no arguments)
198
198
 
@@ -89,7 +89,7 @@ a read-only command.
89
89
 
90
90
  - Keep output compact (≤ 40 lines) — status, not narrative.
91
91
  - Start with the same operator rows as \`/cc\` when possible:
92
- \`Current\`, \`Stage\`, \`Progress\`, \`Gates\`, \`Delegations\`, \`Risks\`, \`Blocked by\`, \`Next\`, \`Evidence needed\`. Use labels like \`gate: tdd_green_full_suite\`, \`delegation proof: reviewer evidenceRefs\`, and \`closeout: compound_review\` instead of raw JSON tone.
92
+ \`Current\`, \`Stage\`, \`Progress\`, \`Gates\`, \`Delegations\`, \`Risks\`, \`Blocked by\`, \`Next\`, \`Evidence needed\`. Use labels like \`gate: tdd_green_full_suite\`, \`delegation proof: reviewer evidenceRefs\`, and \`closeout: post_ship_review\` instead of raw JSON tone.
93
93
  - When blocked, include a plain-English action block:
94
94
  \`Current: <stage or closeout substate>\`; \`Blocked by: <gate/delegation/blocker code>\`; \`Next: <exact command or managed remediation>\`; \`Evidence needed: <artifact/test/review/delegation evidence>\`.
95
95
  - Report counts, not full artifact contents. Include active subagent count from \`${subagentsPath()}\` and proof gaps from \`${delegationEventsPath()}\` when present. Convert gate/delegation state into human labels: \`passed\`, \`blocked\`, \`missing proof\`, \`waived with reason\`, \`stale\`, \`ready to advance\`, or the closeout substate label.
@@ -98,12 +98,12 @@ a read-only command.
98
98
 
99
99
  ## Anti-patterns
100
100
 
101
- - Rebuilding trace-matrix or running sync from \`/cc-view status\` — those belong to dedicated tools.
101
+ - Re-running heavy artifact workflows from \`/cc-view status\` — status is read-only and should not trigger sync or mutation paths.
102
102
  - Treating absence of delegation log as "all delegations complete".
103
103
  - Collapsing \`◎ missing-evidence\` into \`✓ completed\` — role-switch gaps must stay
104
104
  visible so the stage cannot advance silently.
105
105
  - Omitting the closeout row when \`shipSubstate !== "idle"\`; it is the only signal
106
- that tells the user why \`/cc\` is about to run retro/compound/archive.
106
+ that tells the user why \`/cc\` is about to run post-ship closeout/archive.
107
107
  - Mutating state to "clean up" during a status check.
108
108
  `;
109
109
  }