cclaw-cli 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/constants.d.ts +2 -2
- package/dist/constants.js +6 -3
- package/dist/content/agents.d.ts +1 -1
- package/dist/content/agents.js +12 -16
- package/dist/content/examples.js +4 -3
- package/dist/content/hooks.js +4 -6
- package/dist/content/learnings.js +1 -1
- package/dist/content/meta-skill.js +21 -32
- package/dist/content/next-command.js +2 -2
- package/dist/content/observe.js +22 -8
- package/dist/content/session-hooks.js +1 -1
- package/dist/content/skills.js +13 -10
- package/dist/content/stage-schema.d.ts +1 -1
- package/dist/content/stage-schema.js +71 -156
- package/dist/content/start-command.d.ts +10 -0
- package/dist/content/start-command.js +109 -0
- package/dist/content/subagents.js +3 -3
- package/dist/content/templates.d.ts +2 -2
- package/dist/content/templates.js +5 -5
- package/dist/content/utility-skills.js +2 -2
- package/dist/doctor.js +10 -41
- package/dist/harness-adapters.js +13 -42
- package/dist/install.js +10 -6
- package/dist/policy.js +1 -10
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -2
- package/package.json +1 -1
- package/dist/content/autoplan.d.ts +0 -7
- package/dist/content/autoplan.js +0 -344
package/dist/content/autoplan.js
DELETED
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Autoplan orchestrator content for cclaw.
|
|
3
|
-
* Generates markdown instructions that AI agents follow; cclaw does not execute the pipeline.
|
|
4
|
-
*/
|
|
5
|
-
export function autoplanSkillMarkdown() {
|
|
6
|
-
return `---
|
|
7
|
-
name: autoplan
|
|
8
|
-
description: "One command, rough idea in, fully reviewed plan out. Runs brainstorm through plan stages in sequence with auto-decisions."
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Cclaw Autoplan — Auto-Orchestration
|
|
12
|
-
|
|
13
|
-
## Overview
|
|
14
|
-
|
|
15
|
-
Autoplan is a **one-shot planning pipeline** that accepts a rough idea (plus whatever context already exists in the repo) and produces a **fully reviewed plan** as markdown artifacts under \`.cclaw/artifacts/\`.
|
|
16
|
-
|
|
17
|
-
It runs the **first five cclaw flow stages in strict order**:
|
|
18
|
-
|
|
19
|
-
\`brainstorm → scope → design → spec → plan\`
|
|
20
|
-
|
|
21
|
-
Mechanical questions are **auto-answered** using the Six Decision Principles and logged to a running **Decision Audit Trail**. **Taste** decisions are also auto-answered but must be **surfaced with rationale** at the single **Final Approval Gate**. **User challenges** (cases where the agent believes the user’s stated direction should change) are **never** auto-decided.
|
|
22
|
-
|
|
23
|
-
Autoplan ends with **one structured HARD STOP** for human approval before any downstream work (test/build/review/ship) should proceed.
|
|
24
|
-
|
|
25
|
-
This skill describes **what the agent must do when invoked as \`/cc-autoplan\`**. Cclaw installs the markdown; **the agent performs the protocol**.
|
|
26
|
-
|
|
27
|
-
## HARD-GATE
|
|
28
|
-
|
|
29
|
-
- **Do NOT write implementation code** (no feature code, refactors, migrations, or "quick fixes" in application sources). Autoplan output is **planning artifacts only**.
|
|
30
|
-
- **Do NOT skip any phase** (Phases 0–6). If something seems redundant, still execute it and record "no material change" with evidence.
|
|
31
|
-
- **Do NOT auto-answer user challenges.** Present them explicitly and wait.
|
|
32
|
-
- **Do NOT "shortcut"** to individual stage commands mid-pipeline unless the user explicitly aborts autoplan and chooses a different path.
|
|
33
|
-
|
|
34
|
-
## Phase Sequence
|
|
35
|
-
|
|
36
|
-
### Phase 0 — Intake (always runs)
|
|
37
|
-
|
|
38
|
-
1. **Create restore point (mandatory, first filesystem write of autoplan):**
|
|
39
|
-
- Path: \`.cclaw/state/autoplan-restore-{ISO-8601-timestamp}.md\`
|
|
40
|
-
- Ensure parent directories exist.
|
|
41
|
-
- File must include:
|
|
42
|
-
- **Timestamp** (same as filename)
|
|
43
|
-
- **Current git branch** (or explicit note if not a git repo)
|
|
44
|
-
- **Original idea/plan text** (verbatim capture of what the user provided for this autoplan run)
|
|
45
|
-
- **Re-run instructions** (how to resume; see **Restore Points**)
|
|
46
|
-
2. **Load context:**
|
|
47
|
-
- Read existing \`.cclaw/artifacts/\` (if present) to avoid contradicting prior locked decisions without calling it out.
|
|
48
|
-
- Read **recent git log** (bounded, e.g., last ~30 commits) and **current branch**.
|
|
49
|
-
- Read \`AGENTS.md\` and/or \`CLAUDE.md\` if present (repo agent guidance).
|
|
50
|
-
3. **Scope detection flags (heuristic, non-blocking):**
|
|
51
|
-
- **UI scope active** if the request matches **2+** UI/UX terms (examples: "layout", "responsive", "animation", "accessibility", "Figma", "design system", "component", "CSS", "dark mode", "modal", "form validation UX", "empty state", "loading skeleton", "pixel", "spacing", "typography", "contrast", "WCAG", "screen reader", "keyboard navigation").
|
|
52
|
-
- **DX scope active** if the request matches **2+** dev-tooling terms (examples: "CLI", "flag", "subcommand", "SDK", "API client", "OpenAPI", "schema", "codegen", "plugin", "hook", "watcher", "dev server", "logging format", "telemetry", "error codes", "CI", "lint rule", "formatter", "LSP", "extension", "REPL").
|
|
53
|
-
- If both activate, **record both** and prefer **explicit user priority** if stated; otherwise treat as **multi-surface** and keep UX + DX constraints visible in later phases.
|
|
54
|
-
4. **Load stage skills (read fully, treat as authoritative for stage depth):**
|
|
55
|
-
- \`.cclaw/skills/brainstorming/SKILL.md\`
|
|
56
|
-
- \`.cclaw/skills/scope-shaping/SKILL.md\`
|
|
57
|
-
- \`.cclaw/skills/engineering-design-lock/SKILL.md\`
|
|
58
|
-
- \`.cclaw/skills/specification-authoring/SKILL.md\`
|
|
59
|
-
- \`.cclaw/skills/planning-and-task-breakdown/SKILL.md\`
|
|
60
|
-
|
|
61
|
-
### Phase 1 — Brainstorm (always runs)
|
|
62
|
-
|
|
63
|
-
- Follow \`.cclaw/skills/brainstorming/SKILL.md\` at **full depth** (all sections, all required evaluations).
|
|
64
|
-
- **Auto-answer mechanical questions** using the Six Decision Principles + phase tie-breakers.
|
|
65
|
-
- **Premise / USER CHALLENGE rule:** If the agent believes a core user premise is wrong, risky, or incompatible with repo reality, classify it as **User Challenge** and **stop auto-progression** on that item until the user confirms or revises.
|
|
66
|
-
- **Artifact:** write/update \`.cclaw/artifacts/01-brainstorm.md\` (single source of truth for brainstorm outputs).
|
|
67
|
-
|
|
68
|
-
### Phase 2 — Scope (always runs)
|
|
69
|
-
|
|
70
|
-
- Follow \`.cclaw/skills/scope-shaping/SKILL.md\` at **full depth**.
|
|
71
|
-
- **Run scope-mode heuristics** (see dedicated section below), then select exactly one:
|
|
72
|
-
- **SCOPE_EXPANSION** (dream big)
|
|
73
|
-
- **SELECTIVE_EXPANSION** (hold core scope, cherry-pick high-value expansions)
|
|
74
|
-
- **HOLD** (maximum rigor on requested scope)
|
|
75
|
-
- **SCOPE_REDUCTION** (strip to essentials)
|
|
76
|
-
- **Default recommendation (before scoring):**
|
|
77
|
-
- Greenfield/product-bet starts at **SELECTIVE_EXPANSION**.
|
|
78
|
-
- Enhancement/bugfix starts at **HOLD**.
|
|
79
|
-
- If predicted blast radius is **>15 files** or introduces new infra under tight constraints, bias toward **SCOPE_REDUCTION**.
|
|
80
|
-
- **Auto-answer** scope boundary questions when they are **mechanical** or **taste** (never user challenges).
|
|
81
|
-
- **Surface requirement:** write a **Scope Mode Heuristics** table and final selected mode rationale in \`02-scope.md\`.
|
|
82
|
-
- **Artifact:** \`.cclaw/artifacts/02-scope.md\`
|
|
83
|
-
|
|
84
|
-
### Phase 3 — Design (always runs)
|
|
85
|
-
|
|
86
|
-
- Follow \`.cclaw/skills/engineering-design-lock/SKILL.md\` at **full depth**.
|
|
87
|
-
- **All review sections** must be evaluated; **none skipped**. If a section has no findings, write **"No issues found"** with a brief evidence note (what you checked).
|
|
88
|
-
- **Artifact:** \`.cclaw/artifacts/03-design.md\`
|
|
89
|
-
|
|
90
|
-
### Phase 4 — Spec (always runs)
|
|
91
|
-
|
|
92
|
-
- Follow \`.cclaw/skills/specification-authoring/SKILL.md\` at **full depth**.
|
|
93
|
-
- **Artifact:** \`.cclaw/artifacts/04-spec.md\`
|
|
94
|
-
|
|
95
|
-
### Phase 5 — Plan (always runs)
|
|
96
|
-
|
|
97
|
-
- Follow \`.cclaw/skills/planning-and-task-breakdown/SKILL.md\` at **full depth**.
|
|
98
|
-
- Maintain the **Decision Audit Trail** as a running markdown table inside \`05-plan.md\` (append rows after each auto-decision).
|
|
99
|
-
- **Artifact:** \`.cclaw/artifacts/05-plan.md\`
|
|
100
|
-
|
|
101
|
-
### Phase 6 — Final Approval Gate (HARD STOP)
|
|
102
|
-
|
|
103
|
-
Present a **structured summary** to the user and **do not proceed** to implementation stages until the user selects an option.
|
|
104
|
-
|
|
105
|
-
**Must include:**
|
|
106
|
-
|
|
107
|
-
- **Plan summary** (goal, scope cut-line, key design decisions, spec highlights, plan outline).
|
|
108
|
-
- **Total auto-decisions count** (mechanical + taste).
|
|
109
|
-
- **Taste decisions** with **one-line impact of the rejected alternative** each.
|
|
110
|
-
- **User challenges** (if any) — explicitly list: what user said, agent recommendation, why, cost if agent is wrong.
|
|
111
|
-
- **Decision audit trail pointer** (where the full table lives — typically \`.cclaw/artifacts/05-plan.md\`).
|
|
112
|
-
- **Cross-phase themes** (recurring constraints, risks, or invariants spanning brainstorm→plan).
|
|
113
|
-
|
|
114
|
-
**Options:**
|
|
115
|
-
|
|
116
|
-
- **(A) Approve as-is** — treat artifacts as locked enough to start downstream cclaw stages.
|
|
117
|
-
- **(B) Approve with overrides** — user states explicit overrides; update artifacts to reflect overrides **without** inventing new scope; re-present diff summary.
|
|
118
|
-
- **(C) Interrogate a specific decision** — answer questions; only mutate artifacts if corrections are agreed.
|
|
119
|
-
- **(D) Revise plan** — re-run **affected phases only**, preserving intact artifacts where unchanged; **max 3 revision cycles** total (count across the whole autoplan session).
|
|
120
|
-
- **(E) Reject / start over** — stop; optionally create a fresh restore point on the next run.
|
|
121
|
-
|
|
122
|
-
## Six Decision Principles (for auto-answering)
|
|
123
|
-
|
|
124
|
-
1. **Completeness (P1):** Ship the whole thing. Prefer covering edge cases and failure modes over leaving silent gaps.
|
|
125
|
-
2. **Boil Lakes (P2):** Fix everything in the blast radius (touched files + direct importers). Auto-approve lake-boiling when **< 5 files** and **no new infra** (no new services, queues, clusters, deployables).
|
|
126
|
-
3. **Pragmatic (P3):** If two options solve the same problem, pick the cleaner/faster-to-validate one. **5 seconds, not 5 minutes** — but do not disguise uncertainty as speed.
|
|
127
|
-
4. **DRY (P4):** Reject duplicating existing functionality; prefer extension points and shared modules already present in-repo.
|
|
128
|
-
5. **Explicit over Clever (P5):** Prefer obvious, short solutions with clear boundaries over clever abstractions.
|
|
129
|
-
6. **Bias toward Action (P6):** Prefer merging decisions and moving forward; **flag** residual risks rather than **blocking** unless a true stop condition exists (security, correctness, ethics, user challenge).
|
|
130
|
-
|
|
131
|
-
### Phase tie-breakers
|
|
132
|
-
|
|
133
|
-
- **Brainstorm + Scope:** **P1 + P2 dominate** (completeness + blast-radius integrity).
|
|
134
|
-
- **Design + Spec:** **P5 + P1 dominate** (explicitness + completeness of specification).
|
|
135
|
-
- **Plan:** **P3 + P5 dominate** (pragmatic sequencing + explicit tasks).
|
|
136
|
-
|
|
137
|
-
## Decision Taxonomy
|
|
138
|
-
|
|
139
|
-
### Mechanical
|
|
140
|
-
|
|
141
|
-
- **Definition:** Exactly one clearly correct answer given repo conventions and constraints.
|
|
142
|
-
- **Behavior:** Auto-decide **silently** (no chat clutter), but **still log** to the audit trail.
|
|
143
|
-
- **Examples:** use the repo's existing test framework; follow established lint/format patterns; reuse established error handling utilities.
|
|
144
|
-
|
|
145
|
-
### Taste
|
|
146
|
-
|
|
147
|
-
- **Definition:** Reasonable engineers could disagree; tradeoffs are real but not safety-critical.
|
|
148
|
-
- **Behavior:** Auto-decide with a **stated recommendation** + rationale; **must surface** at Final Approval Gate with **one-line impact of rejected alternative**.
|
|
149
|
-
- **Examples:** borderline scope inclusion; close architectural approaches; naming that affects ergonomics but not correctness.
|
|
150
|
-
|
|
151
|
-
### User Challenge
|
|
152
|
-
|
|
153
|
-
- **Definition:** The agent believes the user's direction should change (premise risk, wrong problem framing, incompatible constraints, ethical/safety concern).
|
|
154
|
-
- **Behavior:** **NEVER auto-decided.** Present:
|
|
155
|
-
- what the user said (quoted, concise)
|
|
156
|
-
- what the agent recommends instead
|
|
157
|
-
- why (repo evidence + reasoning)
|
|
158
|
-
- cost if the agent is wrong
|
|
159
|
-
- **Gate:** Wait for explicit user resolution before treating that thread as decided.
|
|
160
|
-
|
|
161
|
-
## Scope Mode Heuristics (Phase 2)
|
|
162
|
-
|
|
163
|
-
Score each signal as **+1** (expansion bias), **0** (neutral), or **-1** (contraction bias), then total.
|
|
164
|
-
Record the scoring table in \`.cclaw/artifacts/02-scope.md\`.
|
|
165
|
-
|
|
166
|
-
| Signal | +1 Expansion Bias | 0 Neutral | -1 Contraction Bias |
|
|
167
|
-
|---|---|---|---|
|
|
168
|
-
| Product novelty | Net-new workflow/subsystem | Moderate feature extension | Bugfix or narrow patch |
|
|
169
|
-
| User value upside | Material step-function in UX/DX/business value | Incremental improvement | Marginal gain only |
|
|
170
|
-
| Blast radius | Limited, coherent module set | Mixed | Wide cross-cutting changes |
|
|
171
|
-
| Delivery risk | Low dependency and integration risk | Moderate | High regression or unknown coupling |
|
|
172
|
-
| Time/constraint pressure | Flexible timeline | Manageable | Tight deadline or strict compliance window |
|
|
173
|
-
| Operability burden | Existing observability/release path supports growth | Partial readiness | Missing guardrails; expansion would outpace controls |
|
|
174
|
-
|
|
175
|
-
**Mode recommendation by score:**
|
|
176
|
-
- **+3 or higher:** recommend **SCOPE_EXPANSION**
|
|
177
|
-
- **+1 to +2:** recommend **SELECTIVE_EXPANSION**
|
|
178
|
-
- **0 to -2:** recommend **HOLD**
|
|
179
|
-
- **-3 or lower:** recommend **SCOPE_REDUCTION**
|
|
180
|
-
|
|
181
|
-
**Override heuristics (higher priority):**
|
|
182
|
-
- If user asks for immediate bugfix/hotfix with reliability urgency, floor mode at **HOLD**.
|
|
183
|
-
- If expansion requires new infra/service boundaries without prior operational readiness, prefer **SCOPE_REDUCTION** or **HOLD**.
|
|
184
|
-
- If user explicitly requests an ambitious bet and constraints are flexible, allow **SCOPE_EXPANSION** even when score is borderline (must log risk assumptions).
|
|
185
|
-
|
|
186
|
-
**Surfacing rule:**
|
|
187
|
-
- Final Approval Gate must include: selected mode, score summary, and top 2 signals that drove the choice.
|
|
188
|
-
|
|
189
|
-
## Decision Audit Trail (running table)
|
|
190
|
-
|
|
191
|
-
After **each** auto-decision (mechanical or taste), append a row to the running table stored in \`.cclaw/artifacts/05-plan.md\` (create the table if missing):
|
|
192
|
-
|
|
193
|
-
| # | Phase | Decision | Classification | Principle | Rationale | Rejected Alternative |
|
|
194
|
-
|---:|---|---|---|---|---|---|
|
|
195
|
-
| 1 | brainstorm | … | Mechanical | P4 | … | … |
|
|
196
|
-
|
|
197
|
-
**Rules:**
|
|
198
|
-
|
|
199
|
-
- **Monotonic numbering** across the entire autoplan run (do not reset per phase).
|
|
200
|
-
- **No blank classifications.** If unsure between mechanical vs taste, default to **taste** (safer) and surface at the gate.
|
|
201
|
-
- The table is part of the **evidence bundle** for the Final Approval Gate.
|
|
202
|
-
|
|
203
|
-
## Restore Points
|
|
204
|
-
|
|
205
|
-
- **When:** Phase 0, **before any substantive work** begins (before mutating artifacts beyond creating dirs).
|
|
206
|
-
- **Path:** \`.cclaw/state/autoplan-restore-{ISO-timestamp}.md\`
|
|
207
|
-
- **Contents must include:**
|
|
208
|
-
- timestamp
|
|
209
|
-
- branch
|
|
210
|
-
- original idea/plan text
|
|
211
|
-
- re-run instructions
|
|
212
|
-
- **Resume procedure:** copy the captured **original idea/plan text** back into the working plan input the user provides, then run \`/cc-autoplan\` again (optionally after reverting artifact edits manually if needed).
|
|
213
|
-
|
|
214
|
-
## Completion Status
|
|
215
|
-
|
|
216
|
-
Report exactly one terminal status for the autoplan session:
|
|
217
|
-
|
|
218
|
-
- **APPROVED** — user chose (A) or accepted post-(B) state without further revision cycles.
|
|
219
|
-
- **APPROVED_WITH_OVERRIDES** — user chose (B) and artifacts reflect explicit overrides.
|
|
220
|
-
- **REJECTED** — user chose (E) or explicitly abandoned the plan.
|
|
221
|
-
- **BLOCKED** — cannot proceed due to unresolved **User Challenge(s)** or hard external dependency; list what unblocks.
|
|
222
|
-
|
|
223
|
-
## Anti-Patterns
|
|
224
|
-
|
|
225
|
-
- **Skipping a phase** because "it's obvious."
|
|
226
|
-
- **Auto-deciding user challenges** "to save time."
|
|
227
|
-
- **Failing to log** auto-decisions in the audit trail.
|
|
228
|
-
- **Aborting mid-pipeline** and redirecting to individual stage commands without an explicit user abort decision.
|
|
229
|
-
- **Exceeding 3 revision cycles** for option (D); if still unresolved, stop with **BLOCKED** and a crisp list of remaining forks.
|
|
230
|
-
- **Silent artifact drift** (changing earlier artifacts without marking what changed and why).
|
|
231
|
-
|
|
232
|
-
## Common Rationalizations (reject these)
|
|
233
|
-
|
|
234
|
-
| Rationalization | Reality |
|
|
235
|
-
|---|---|
|
|
236
|
-
| "We can skip scope because brainstorm was thorough." | Thorough brainstorm does not replace scope shaping; different obligations, different failure modes. |
|
|
237
|
-
| "Design lock is redundant if the spec is going to rewrite it anyway." | Spec authorizes details; design lock prevents architectural drift and hidden coupling before authorization. |
|
|
238
|
-
| "I'll batch auto-decisions mentally and log them at the end." | End-only logging guarantees omissions; the audit trail is a **running** compliance artifact. |
|
|
239
|
-
| "The user's premise is probably wrong, but I'll implement around it." | That is a **User Challenge**; autoplan must surface it, not sneak around it. |
|
|
240
|
-
|
|
241
|
-
## Red Flags (stop and reassess)
|
|
242
|
-
|
|
243
|
-
- **Missing restore file** after claiming Phase 0 complete.
|
|
244
|
-
- **05-plan.md** has fewer audit rows than claimed auto-decisions.
|
|
245
|
-
- **Any implementation patch** appears during autoplan (source edits outside \`.cclaw/\` planning artifacts).
|
|
246
|
-
- **Contradictions across artifacts** without an explicit "revision delta" section explaining the change.
|
|
247
|
-
- **Skipped review sections** in design (missing "No issues found" where applicable).
|
|
248
|
-
- **Revision cycle count** is unclear or exceeds three.
|
|
249
|
-
|
|
250
|
-
## Agent Execution Notes (non-normative but helpful)
|
|
251
|
-
|
|
252
|
-
- Prefer **small, explicit commits** of artifacts only if the repo workflow expects it; otherwise keep changes grouped logically — but never hide planning edits.
|
|
253
|
-
- Treat **UI scope** / **DX scope** flags as persistent headers in artifacts **02–05** so downstream agents inherit the context quickly.
|
|
254
|
-
`;
|
|
255
|
-
}
|
|
256
|
-
export function autoplanCommandContract() {
|
|
257
|
-
return `# /cc-autoplan
|
|
258
|
-
|
|
259
|
-
## Purpose
|
|
260
|
-
|
|
261
|
-
Run **brainstorm → scope → design → spec → plan** as a single orchestrated pass: load repo context, create a restore point, execute each stage skill at full depth, auto-answer mechanical questions, auto-resolve taste questions with explicit rationale, never auto-resolve user challenges, and finish with **one Final Approval Gate** before any implementation work.
|
|
262
|
-
|
|
263
|
-
## HARD-GATE
|
|
264
|
-
|
|
265
|
-
- **No implementation code** during autoplan (planning artifacts only).
|
|
266
|
-
- **No skipped phases** (Phases 0–6).
|
|
267
|
-
- **No auto-answers for user challenges** (explicit user resolution required).
|
|
268
|
-
|
|
269
|
-
## Phase Sequence (numbered, one-line each)
|
|
270
|
-
|
|
271
|
-
1. **Phase 0 — Intake:** restore point + context scan + UI/DX scope flags + read all five stage skills.
|
|
272
|
-
2. **Phase 1 — Brainstorm:** full \`brainstorming\` skill depth → \`.cclaw/artifacts/01-brainstorm.md\`.
|
|
273
|
-
3. **Phase 2 — Scope:** full \`scope-shaping\` skill depth + scope-mode heuristic scoring (EXPANSION / SELECTIVE / HOLD / REDUCTION) → \`02-scope.md\`.
|
|
274
|
-
4. **Phase 3 — Design:** full \`engineering-design-lock\` skill depth; all review sections evaluated → \`03-design.md\`.
|
|
275
|
-
5. **Phase 4 — Spec:** full \`specification-authoring\` skill depth → \`04-spec.md\`.
|
|
276
|
-
6. **Phase 5 — Plan:** full \`planning-and-task-breakdown\` skill depth; maintain audit trail table → \`05-plan.md\`.
|
|
277
|
-
7. **Phase 6 — Final Approval Gate:** HARD STOP summary + options **A–E** (max **3** revision cycles for **D**).
|
|
278
|
-
|
|
279
|
-
## Decision Principles (numbered list)
|
|
280
|
-
|
|
281
|
-
1. **Completeness (P1):** ship the whole thing; favor edge-case and failure-mode coverage.
|
|
282
|
-
2. **Boil Lakes (P2):** clean the full blast radius; auto-approve when **< 5 files** and **no new infra**.
|
|
283
|
-
3. **Pragmatic (P3):** pick the cleaner equal fix quickly (**5 seconds not 5 minutes**).
|
|
284
|
-
4. **DRY (P4):** do not duplicate existing functionality; extend what exists.
|
|
285
|
-
5. **Explicit over Clever (P5):** obvious, short solutions win.
|
|
286
|
-
6. **Bias toward Action (P6):** merge over endless review; flag residual risks instead of stalling.
|
|
287
|
-
|
|
288
|
-
**Phase tie-breakers:** brainstorm/scope → **P1+P2**; design/spec → **P5+P1**; plan → **P3+P5**.
|
|
289
|
-
|
|
290
|
-
## Decision Taxonomy (Mechanical / Taste / User Challenge)
|
|
291
|
-
|
|
292
|
-
- **Mechanical:** one clearly right answer → auto-decide silently + **audit log row**.
|
|
293
|
-
- **Taste:** reasonable disagreement → auto-decide with recommendation + **audit log row** + **surface at gate** with **one-line rejected-alternative impact**.
|
|
294
|
-
- **User Challenge:** agent recommends changing user direction → **never** auto-decide; present evidence + costs; await user.
|
|
295
|
-
|
|
296
|
-
## Scope Mode Heuristics (Phase 2)
|
|
297
|
-
|
|
298
|
-
- Score six scope signals (+1 / 0 / -1): novelty, value upside, blast radius, delivery risk, time pressure, operability burden.
|
|
299
|
-
- Map total score to recommendation:
|
|
300
|
-
- **+3+** → **SCOPE_EXPANSION**
|
|
301
|
-
- **+1..+2** → **SELECTIVE_EXPANSION**
|
|
302
|
-
- **0..-2** → **HOLD**
|
|
303
|
-
- **-3-** → **SCOPE_REDUCTION**
|
|
304
|
-
- Apply overrides: urgent bugfixes floor at **HOLD**; high-risk infra expansion biases **HOLD/REDUCTION**.
|
|
305
|
-
- Persist scoring + selected mode in \`02-scope.md\`, then surface it again in the Final Approval Gate summary.
|
|
306
|
-
|
|
307
|
-
## Final Approval Gate (options A-E)
|
|
308
|
-
|
|
309
|
-
- **(A) Approve as-is**
|
|
310
|
-
- **(B) Approve with overrides** (explicit user deltas reflected in artifacts)
|
|
311
|
-
- **(C) Interrogate a specific decision** (Q/A; only change artifacts if corrections are agreed)
|
|
312
|
-
- **(D) Revise plan** (re-run affected phases only; **≤ 3** cycles)
|
|
313
|
-
- **(E) Reject / start over**
|
|
314
|
-
|
|
315
|
-
## Restore Points
|
|
316
|
-
|
|
317
|
-
Created in **Phase 0** at \`.cclaw/state/autoplan-restore-{ISO-timestamp}.md\` containing timestamp, branch, original idea text, and resume instructions (**copy original idea/plan text → rerun \`/cc-autoplan\`**).
|
|
318
|
-
|
|
319
|
-
## Completion Status
|
|
320
|
-
|
|
321
|
-
**APPROVED**, **APPROVED_WITH_OVERRIDES**, **REJECTED**, **BLOCKED**.
|
|
322
|
-
|
|
323
|
-
## Anti-Patterns
|
|
324
|
-
|
|
325
|
-
Skipping phases; auto-deciding user challenges; missing audit trail rows; mid-run redirects to other cclaw commands without explicit user abort; >3 revision cycles; silent cross-artifact contradictions.
|
|
326
|
-
|
|
327
|
-
## Primary Skill (.cclaw/skills/autoplan/SKILL.md)
|
|
328
|
-
|
|
329
|
-
The executable protocol and tables live in the installed autoplan skill markdown at \`.cclaw/skills/autoplan/SKILL.md\` (generated from cclaw's orchestrator content module).
|
|
330
|
-
`;
|
|
331
|
-
}
|
|
332
|
-
export function autoplanAgentsMdBlock() {
|
|
333
|
-
return `### Autoplan Orchestrator
|
|
334
|
-
|
|
335
|
-
Use \`/cc-autoplan\` to run brainstorm→scope→design→spec→plan in one shot with auto-decisions.
|
|
336
|
-
- Mechanical questions are auto-answered using 6 principles
|
|
337
|
-
- Scope mode (EXPANSION / SELECTIVE / HOLD / REDUCTION) is selected via explicit heuristic scoring in Phase 2
|
|
338
|
-
- Taste decisions are auto-answered but surfaced at a single final approval gate
|
|
339
|
-
- User challenges are NEVER auto-answered
|
|
340
|
-
- Restore point is created before any work begins
|
|
341
|
-
|
|
342
|
-
Use this when you want a complete planning pass without interactive per-stage approval.
|
|
343
|
-
`;
|
|
344
|
-
}
|