cclaw-cli 0.51.9 → 0.51.11
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/dist/artifact-linter.js
CHANGED
|
@@ -303,22 +303,6 @@ function tokensFromRule(rule) {
|
|
|
303
303
|
}
|
|
304
304
|
return [];
|
|
305
305
|
}
|
|
306
|
-
/**
|
|
307
|
-
* Extract required keywords from validation rules that contain comma-separated
|
|
308
|
-
* concept lists. Activates only for rules with structured enumerations like
|
|
309
|
-
* "failure modes, error surface, data-flow paths" — not for short rules.
|
|
310
|
-
*/
|
|
311
|
-
function extractRequiredKeywords(rule) {
|
|
312
|
-
const colonMatch = /:\s*(.+)$/u.exec(rule);
|
|
313
|
-
if (!colonMatch)
|
|
314
|
-
return [];
|
|
315
|
-
const tail = colonMatch[1];
|
|
316
|
-
const parts = tail.split(/,\s*(?:and\s+)?/u).map((p) => p.trim().replace(/\.$/u, ""));
|
|
317
|
-
const phrases = parts.filter((p) => p.length >= 4 && !/^(must|should|at least|if |or )/iu.test(p));
|
|
318
|
-
if (phrases.length < 3)
|
|
319
|
-
return [];
|
|
320
|
-
return phrases;
|
|
321
|
-
}
|
|
322
306
|
const VAGUE_AC_ADJECTIVES = [
|
|
323
307
|
"fast",
|
|
324
308
|
"quick",
|
|
@@ -492,6 +476,126 @@ function validateFailureModeTable(sectionBody) {
|
|
|
492
476
|
details: "Failure Mode Table header and critical-risk checks passed."
|
|
493
477
|
};
|
|
494
478
|
}
|
|
479
|
+
// Canonical scope mode tokens (gstack CEO review). The four mode names live in
|
|
480
|
+
// the scope skill, the artifact template, and downstream traces. Requiring one
|
|
481
|
+
// of them in Scope Summary is **structural** — not free-form English keyword
|
|
482
|
+
// matching on user prose. Authors may also use the canonical short form on a
|
|
483
|
+
// `Mode:` / `Selected mode:` line (e.g. `Selected mode: hold`) as a courtesy.
|
|
484
|
+
const SCOPE_MODE_FULL_TOKENS = [
|
|
485
|
+
"SCOPE EXPANSION",
|
|
486
|
+
"SELECTIVE EXPANSION",
|
|
487
|
+
"HOLD SCOPE",
|
|
488
|
+
"SCOPE REDUCTION"
|
|
489
|
+
];
|
|
490
|
+
const SCOPE_MODE_FULL_REGEX = new RegExp("\\b(?:" +
|
|
491
|
+
SCOPE_MODE_FULL_TOKENS
|
|
492
|
+
.map((token) => token.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "[\\s_-]+"))
|
|
493
|
+
.join("|") +
|
|
494
|
+
")\\b", "iu");
|
|
495
|
+
// Short-form synonyms accepted only when stamped on an explicit `Mode:` /
|
|
496
|
+
// `Selected mode:` / `Scope mode:` line. Plain prose with the same word does
|
|
497
|
+
// not count, so `strict` / `broad` / `narrow` / similar non-mode adjectives
|
|
498
|
+
// remain rejected.
|
|
499
|
+
const SCOPE_MODE_LINE_REGEX = /(?:^|\n)\s*[-*]?\s*\**\s*(?:Selected\s+|Scope\s+)?Mode\**\s*:\s*\**\s*([^\n]+)/iu;
|
|
500
|
+
const SCOPE_MODE_SHORT_TOKEN_REGEX = /\b(?:hold(?:[\s_-]?scope)?|selective(?:[\s_-]?expansion)?|scope[\s_-]?expansion|expansion|scope[\s_-]?reduction|reduction|expand|reduce)\b/iu;
|
|
501
|
+
// Next-stage handoff token. We only enforce the canonical machine-surface stage
|
|
502
|
+
// IDs (`design`, `spec`) plus stable handoff phrases. The surrounding prose may
|
|
503
|
+
// be written in any language — this guards the downstream cross-stage trace,
|
|
504
|
+
// not the wording of the rationale.
|
|
505
|
+
const NEXT_STAGE_HANDOFF_REGEX = /(?:`(?:design|spec)`|\bdesign\b|\bspec\b|next[-\s_]stage|next stage|handoff|hand[-\s]off)/iu;
|
|
506
|
+
function hasCanonicalScopeMode(body) {
|
|
507
|
+
if (SCOPE_MODE_FULL_REGEX.test(body))
|
|
508
|
+
return true;
|
|
509
|
+
for (const match of body.matchAll(new RegExp(SCOPE_MODE_LINE_REGEX, "giu"))) {
|
|
510
|
+
const value = match[1] ?? "";
|
|
511
|
+
if (SCOPE_MODE_SHORT_TOKEN_REGEX.test(value))
|
|
512
|
+
return true;
|
|
513
|
+
}
|
|
514
|
+
return false;
|
|
515
|
+
}
|
|
516
|
+
function validatePremiseChallenge(sectionBody) {
|
|
517
|
+
// gstack-style premise challenge requires a real Q/A structure (table or
|
|
518
|
+
// list), not free-form prose. The validation is *structural* only — we do
|
|
519
|
+
// NOT keyword-grep for English phrases like "right problem"; authors may
|
|
520
|
+
// write the questions in any language, and the answers carry the meaning.
|
|
521
|
+
// The template ships with canonical question labels as scaffolding, but
|
|
522
|
+
// the linter only enforces that the section actually compares premise
|
|
523
|
+
// questions to answers.
|
|
524
|
+
const tableRows = getMarkdownTableRows(sectionBody);
|
|
525
|
+
const bulletRows = sectionBody
|
|
526
|
+
.split(/\r?\n/u)
|
|
527
|
+
.map((line) => line.trim())
|
|
528
|
+
.filter((line) => /^(?:[-*]|\d+\.)\s+\S/u.test(line));
|
|
529
|
+
const rowCount = Math.max(tableRows.length, bulletRows.length);
|
|
530
|
+
if (rowCount < 3) {
|
|
531
|
+
return {
|
|
532
|
+
ok: false,
|
|
533
|
+
details: `Premise Challenge needs at least 3 substantive rows in a table or bullet list. Found ${rowCount}.`
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
// For tables, each data row must have at least 2 non-empty cells so the
|
|
537
|
+
// section is genuinely a premise/answer comparison, not a list of headlines.
|
|
538
|
+
// For bullet lists, each line must be substantive so we don't accept
|
|
539
|
+
// placeholders like `- a`; punctuation style and natural language do not
|
|
540
|
+
// matter.
|
|
541
|
+
if (tableRows.length >= 3) {
|
|
542
|
+
const sparseRows = tableRows.filter((row) => {
|
|
543
|
+
const filledCells = row.filter((cell) => cell.replace(/[\s|]/gu, "").length >= 2);
|
|
544
|
+
return filledCells.length < 2;
|
|
545
|
+
});
|
|
546
|
+
if (sparseRows.length > 0) {
|
|
547
|
+
return {
|
|
548
|
+
ok: false,
|
|
549
|
+
details: "Premise Challenge table rows must populate at least the question and answer columns (no empty answers)."
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
else if (bulletRows.length >= 3) {
|
|
554
|
+
const sparseBullets = bulletRows.filter((line) => {
|
|
555
|
+
const cleaned = line.replace(/^[-*\d.\s]+/u, "").replace(/[`*_]/gu, "").trim();
|
|
556
|
+
const meaningful = cleaned.match(/[\p{L}\p{N}]/gu)?.length ?? 0;
|
|
557
|
+
return meaningful < 12;
|
|
558
|
+
});
|
|
559
|
+
if (sparseBullets.length > 0) {
|
|
560
|
+
return {
|
|
561
|
+
ok: false,
|
|
562
|
+
details: "Premise Challenge bullet list must include at least 3 substantive rows, not placeholders."
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return {
|
|
567
|
+
ok: true,
|
|
568
|
+
details: `Premise Challenge structures ${rowCount} Q/A rows.`
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
function validateScopeSummary(sectionBody) {
|
|
572
|
+
const meaningfulLines = sectionBody
|
|
573
|
+
.split(/\r?\n/)
|
|
574
|
+
.map((line) => line.trim())
|
|
575
|
+
.filter((line) => line.length > 0 && /[\p{L}\p{N}]/u.test(line));
|
|
576
|
+
if (meaningfulLines.length < 2) {
|
|
577
|
+
return {
|
|
578
|
+
ok: false,
|
|
579
|
+
details: "Scope Summary must list at least 2 substantive lines covering the selected mode and the next-stage handoff."
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
if (!hasCanonicalScopeMode(sectionBody)) {
|
|
583
|
+
return {
|
|
584
|
+
ok: false,
|
|
585
|
+
details: "Scope Summary must name the selected mode using a canonical token (SCOPE EXPANSION, SELECTIVE EXPANSION, HOLD SCOPE, SCOPE REDUCTION) or a short form on a `Mode:` line (hold, selective, expansion, reduction)."
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
if (!NEXT_STAGE_HANDOFF_REGEX.test(sectionBody)) {
|
|
589
|
+
return {
|
|
590
|
+
ok: false,
|
|
591
|
+
details: "Scope Summary must record the track-aware next-stage handoff (mention `design` for standard, `spec` for medium, or include a `Next-stage handoff:` line)."
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
return {
|
|
595
|
+
ok: true,
|
|
596
|
+
details: "Scope Summary names the selected mode and the next-stage handoff."
|
|
597
|
+
};
|
|
598
|
+
}
|
|
495
599
|
const INTERACTION_EDGE_CASE_REQUIREMENTS = [
|
|
496
600
|
{ label: "double-click", pattern: /\bdouble[\s-]?click\b/iu },
|
|
497
601
|
{
|
|
@@ -1212,6 +1316,12 @@ function validateSectionBody(sectionBody, rule, sectionName) {
|
|
|
1212
1316
|
if (sectionNameNormalized === "pre-scope system audit") {
|
|
1213
1317
|
return validatePreScopeSystemAudit(sectionBody);
|
|
1214
1318
|
}
|
|
1319
|
+
if (sectionNameNormalized === "scope summary") {
|
|
1320
|
+
return validateScopeSummary(sectionBody);
|
|
1321
|
+
}
|
|
1322
|
+
if (sectionNameNormalized === "premise challenge") {
|
|
1323
|
+
return validatePremiseChallenge(sectionBody);
|
|
1324
|
+
}
|
|
1215
1325
|
if (sectionNameNormalized === "data flow") {
|
|
1216
1326
|
return validateInteractionEdgeCaseMatrix(sectionBody);
|
|
1217
1327
|
}
|
|
@@ -1249,21 +1359,6 @@ function validateSectionBody(sectionBody, rule, sectionName) {
|
|
|
1249
1359
|
};
|
|
1250
1360
|
}
|
|
1251
1361
|
}
|
|
1252
|
-
if (sectionNameNormalized !== "architecture diagram") {
|
|
1253
|
-
const keywords = extractRequiredKeywords(rule);
|
|
1254
|
-
if (keywords.length > 0) {
|
|
1255
|
-
const bodyLower = sectionBody.toLowerCase();
|
|
1256
|
-
const found = keywords.filter((kw) => bodyLower.includes(kw.toLowerCase()));
|
|
1257
|
-
const threshold = Math.ceil(keywords.length * 0.5);
|
|
1258
|
-
if (found.length < threshold) {
|
|
1259
|
-
const missing = keywords.filter((kw) => !bodyLower.includes(kw.toLowerCase()));
|
|
1260
|
-
return {
|
|
1261
|
-
ok: false,
|
|
1262
|
-
details: `Rule expects keywords (${threshold}/${keywords.length} minimum): missing ${missing.join(", ")}.`
|
|
1263
|
-
};
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
}
|
|
1267
1362
|
if (sectionNameNormalized === "acceptance criteria" &&
|
|
1268
1363
|
/observable[\s,]*measurable[\s,]+(and )?falsifiable/iu.test(rule)) {
|
|
1269
1364
|
const rows = getMarkdownTableRows(sectionBody);
|
package/dist/content/examples.js
CHANGED
|
@@ -142,9 +142,11 @@ The original premise (“add notifications”) was reframed to **“ensure users
|
|
|
142
142
|
|
|
143
143
|
## Scope Summary
|
|
144
144
|
|
|
145
|
+
- Selected mode: SELECTIVE EXPANSION (cherry-pick durable feed on hold-scope baseline).
|
|
145
146
|
- Accepted scope: durable feed + SSE + explicit degraded UX.
|
|
146
147
|
- Deferred: WebSocket channel and rich-media/search enhancements.
|
|
147
|
-
- Explicitly excluded: outbound channels and marketing workflows for v1
|
|
148
|
+
- Explicitly excluded: outbound channels and marketing workflows for v1.
|
|
149
|
+
- Next-stage handoff: design — carry the durable-feed contract, SSE failover paths, and degraded-UX expectations into architecture lock-in.`,
|
|
148
150
|
design: `## Codebase Investigation (blast-radius files)
|
|
149
151
|
|
|
150
152
|
| File | Current responsibility | Patterns discovered |
|
|
@@ -36,23 +36,29 @@ export const BRAINSTORM = {
|
|
|
36
36
|
},
|
|
37
37
|
executionModel: {
|
|
38
38
|
checklist: [
|
|
39
|
-
"**Explore project context** — inspect existing files/docs/recent activity before asking what to build.",
|
|
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
40
|
"**Classify depth and scope** — pick Lightweight / Standard / Deep; decompose independent subsystems before deeper work.",
|
|
41
|
+
"**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.",
|
|
42
|
+
"**Reframe with How Might We** — write a single `How Might We …?` line that names the user, the desired outcome, and the constraint. This is the altitude check before approaches.",
|
|
43
|
+
"**Sharpening questions (3-5)** — capture decision-changing question/answer pairs in the `Sharpening Questions` table with the actual decision impact; if a question would not change architecture/scope/UX, state the assumption and skip it.",
|
|
41
44
|
"**Use compact discovery for simple apps** — for concrete low-risk asks (todo app, landing page, local widget), 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.",
|
|
42
45
|
"**Short-circuit concrete asks** — for unambiguous implementation-only requests, write a compact brainstorm stub (context, problem, approved intent, constraints, assumptions) and ask for one explicit approval.",
|
|
43
46
|
"**Ask only decision-changing questions** — one at a time; if answers would not change approach, state the assumption and continue.",
|
|
44
|
-
"**Compare 2-3 distinct approaches** — include real trade-offs
|
|
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.",
|
|
45
48
|
"**Collect reaction before recommending** — ask which option feels closest and what concern remains, then recommend based on that reaction.",
|
|
46
|
-
"**Write
|
|
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.`).",
|
|
47
51
|
"**Request explicit approval** — state exactly what direction is being approved; do not advance without approval and artifact review.",
|
|
48
52
|
"**Handoff** — only after approval, complete the stage and point to `/cc-next`."
|
|
49
53
|
],
|
|
50
54
|
interactionProtocol: [
|
|
51
|
-
"Start from observed project context; if the idea is vague, first narrow the project type.",
|
|
55
|
+
"Start from observed project context; if the idea is vague, first narrow the project type with **one** structured question, then keep going.",
|
|
56
|
+
"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.",
|
|
52
57
|
"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.",
|
|
53
|
-
"If likely answers do not change architecture or scope boundaries, choose the default and state the assumption.",
|
|
54
|
-
"For simple greenfield web apps, present a compact A/B choice with one recommended path and one higher-upside challenger; keep the artifact concise but structurally complete.",
|
|
58
|
+
"If likely answers do not change architecture or scope boundaries, choose the default and state the assumption inline.",
|
|
59
|
+
"For simple greenfield web apps, 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).",
|
|
55
60
|
"Show approaches before the recommendation; include a higher-upside challenger and gather reaction first.",
|
|
61
|
+
"Self-review before approval: re-read the artifact, fix contradictions/placeholders/weak trade-offs, then ask for approval. Do not ask for approval on a draft you have not re-read.",
|
|
56
62
|
"State exactly what is being approved, then **STOP** until the user explicitly approves the artifact."
|
|
57
63
|
],
|
|
58
64
|
process: [
|
|
@@ -117,16 +123,21 @@ export const BRAINSTORM = {
|
|
|
117
123
|
traceabilityRule: "Scope and design decisions must trace back to explored context and approved brainstorm direction."
|
|
118
124
|
},
|
|
119
125
|
artifactValidation: [
|
|
120
|
-
{ section: "Context", required: true, validationRule: "Must reference project state and relevant existing code or patterns." },
|
|
126
|
+
{ section: "Context", required: true, validationRule: "Must reference project state and relevant existing code or patterns. A `Discovered context` subsection (or list) is recommended for downstream traceability." },
|
|
121
127
|
{ section: "Problem", required: true, validationRule: "Must define what we're solving, success criteria, and constraints." },
|
|
128
|
+
{ section: "Premise Check", required: false, validationRule: "Recommended: explicit answers to `Right problem?`, `Direct path?`, `What if we do nothing?` — take a position, do not hedge." },
|
|
129
|
+
{ section: "How Might We", required: false, validationRule: "Recommended: a single `How Might We …?` line naming the user, the outcome, and the binding constraint." },
|
|
130
|
+
{ section: "Sharpening Questions", required: false, validationRule: "Recommended: 3-5 question/answer pairs with explicit `Decision impact` so downstream stages see what each answer changed." },
|
|
122
131
|
{ section: "Clarifying Questions", required: false, validationRule: "Must capture question, answer, and decision impact for each clarifying question." },
|
|
123
132
|
{ section: "Approach Tier", required: true, validationRule: "Must classify depth as Lightweight/Standard/Deep and explain why." },
|
|
124
133
|
{ section: "Short-Circuit Decision", required: false, validationRule: "Must include Status/Why/Scope handoff lines when short-circuit is discussed; compact stubs are valid for concrete asks." },
|
|
125
|
-
{ section: "Approaches", required: true, validationRule: "Must compare 2-3 distinct options with real trade-offs
|
|
134
|
+
{ section: "Approaches", required: true, validationRule: "Must compare 2-3 distinct options with real trade-offs. Use the canonical `Role` column with `baseline` | `challenger` | `wild-card` and the `Upside` column with `low` | `modest` | `high` | `higher`; include exactly one challenger row with `high` or `higher` upside." },
|
|
126
135
|
{ section: "Approach Reaction", required: true, validationRule: "Must appear before Selected Direction and summarize user reaction before recommendation, including `Closest option`, `Concerns`, and what changed after reaction." },
|
|
127
136
|
{ section: "Selected Direction", required: true, validationRule: "Must include the selected approach, an explicit approval marker, rationale traceable to the prior Approach Reaction, and a track-aware next-stage handoff." },
|
|
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." },
|
|
128
138
|
{ section: "Design", required: false, validationRule: "Must cover architecture, key components, and data flow scaled to complexity." },
|
|
129
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." },
|
|
130
141
|
{ section: "Assumptions and Open Questions", required: false, validationRule: "Must capture unresolved assumptions/open questions, or explicitly state none." }
|
|
131
142
|
],
|
|
132
143
|
trivialOverrideSections: [
|
|
@@ -46,13 +46,14 @@ export const SCOPE = {
|
|
|
46
46
|
executionModel: {
|
|
47
47
|
checklist: [
|
|
48
48
|
"**Compact CEO pass first** — read brainstorm, name the job-to-be-done, challenge whether this is the right product slice, and propose the highest-leverage scope in one pass. For simple apps, keep this to a tight scope contract instead of a full strategy workshop.",
|
|
49
|
-
"**
|
|
49
|
+
"**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
50
|
"**Draft the 10-star vs current-slice boundary** — show what would make the product meaningfully better, then explicitly choose what ships now, what is deferred, and what is excluded without using vague `later/for now` placeholders.",
|
|
51
|
-
"**
|
|
52
|
-
"**
|
|
51
|
+
"**Pick one of four gstack modes with the user** — SCOPE EXPANSION, SELECTIVE EXPANSION, HOLD SCOPE, or SCOPE REDUCTION. Recommend one, state why and what signal would change it, then STOP for the user's mode/scope approval before writing the final artifact.",
|
|
52
|
+
"**Run mode-specific analysis** — match the analysis to the chosen mode: SCOPE EXPANSION enumerates 10x opportunities + delight features; SELECTIVE EXPANSION lists baseline + cherry-picked additions with leverage rationale; HOLD SCOPE proves rigor on the current slice; SCOPE REDUCTION names the smallest useful wedge and what is cut, with follow-up split.",
|
|
53
|
+
"**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.",
|
|
53
54
|
"**Run outside voice before final approval** — for simple/low-risk scope, record one concise adversarial self-check row; for complex/high-risk/configured scope, iterate until threshold. Record the loop summary in `## Spec Review Loop`, but do not treat it as user approval.",
|
|
54
55
|
"**Ask only one decision-changing question** — if the user rejects the contract but is unsure, offer 3-4 concrete scope moves instead of open-ended interrogation.",
|
|
55
|
-
"**Write the scope contract after approval** — include in-scope/out-of-scope, discretion areas, deferred items, locked decisions, error/rescue notes, completion dashboard, scope summary
|
|
56
|
+
"**Write the scope contract after approval** — include in-scope/out-of-scope, discretion areas, deferred items, locked decisions, error/rescue notes, completion dashboard, scope summary (with canonical mode token + next-stage handoff), and explicit approval evidence."
|
|
56
57
|
],
|
|
57
58
|
interactionProtocol: [
|
|
58
59
|
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"),
|
|
@@ -138,7 +139,7 @@ export const SCOPE = {
|
|
|
138
139
|
{ section: "Upstream Handoff", required: false, validationRule: "Summarizes brainstorm/idea decisions, constraints, open questions, and explicit drift before scope decisions." },
|
|
139
140
|
{ section: "Pre-Scope System Audit", required: false, validationRule: "When `.cclaw/config.yaml::optInAudits.scopePreAudit` is true: must capture git log -30, git diff --stat, git stash list, and debt-marker scan (TODO/FIXME/XXX/HACK) before premise challenge." },
|
|
140
141
|
{ section: "Prime Directives", required: false, validationRule: "For each scoped capability: named failure modes, explicit error surface, four data-flow paths, interaction edge cases, observability expectations, and deferred-item handling." },
|
|
141
|
-
{ section: "Premise Challenge", required: false, validationRule: "Must
|
|
142
|
+
{ section: "Premise Challenge", required: false, validationRule: "Must list at least 3 question/answer rows in a markdown table or bullet list (gstack default trio: right problem? direct path? what if we do nothing? — extend with leverage and reversibility for richer scope). The linter enforces structure, not English wording — answers may be in any language." },
|
|
142
143
|
{ section: "Landscape Check", required: false, validationRule: "When mode is EXPAND/SELECTIVE, include at least one external reference insight and its impact on scope." },
|
|
143
144
|
{ section: "Taste Calibration", required: false, validationRule: "Must reference 2-3 strong in-repo modules/files that define the quality bar or explicitly justify omission." },
|
|
144
145
|
{ section: "Requirements", required: false, validationRule: "Table of stable requirement IDs (R1, R2, R3…) one per row with observable outcome, priority, and source. IDs are assigned once and never renumbered across scope/design/spec/plan/review; dropped requirements stay with Priority `DROPPED`." },
|
|
@@ -153,7 +154,7 @@ export const SCOPE = {
|
|
|
153
154
|
{ section: "Outside Voice Findings", required: false, validationRule: "Must list external/adversarial findings and disposition (accept/reject/defer) with rationale." },
|
|
154
155
|
{ section: "Spec Review Loop", required: false, validationRule: `Must record iterations, quality score per iteration, stop reason, and unresolved concerns. Enforce ${reviewLoopPolicySummary("scope")}` },
|
|
155
156
|
{ section: "Completion Dashboard", required: true, validationRule: "Lists per-review-section status, count of critical/open gaps, resolved decisions, and unresolved decisions (or 'None')." },
|
|
156
|
-
{ section: "Scope Summary", required: true, validationRule: "
|
|
157
|
+
{ section: "Scope Summary", required: true, validationRule: "Compact recap of the locked scope. Must name the selected mode using one of the canonical tokens (`SCOPE EXPANSION`, `SELECTIVE EXPANSION`, `HOLD SCOPE`, `SCOPE REDUCTION`) and record the track-aware next-stage handoff (`design` for standard, `spec` for medium); the linter checks structure, not English wording." },
|
|
157
158
|
{ section: "Dream State Mapping", required: false, validationRule: "If present (complex projects): CURRENT STATE, THIS PLAN, 12-MONTH IDEAL, and alignment verdict." },
|
|
158
159
|
{ section: "Temporal Interrogation", required: false, validationRule: "If present (complex projects): timeline simulation table with decision pressures and lock-now vs defer verdicts." }
|
|
159
160
|
]
|
|
@@ -26,11 +26,29 @@ export const ARTIFACT_TEMPLATES = {
|
|
|
26
26
|
- **Project state:**
|
|
27
27
|
- **Relevant existing code/patterns:**
|
|
28
28
|
|
|
29
|
+
### Discovered context
|
|
30
|
+
- (paths, prior artifacts, seeds, prompt fragments — referenced by downstream stages, or \`- None.\`)
|
|
31
|
+
|
|
29
32
|
## Problem
|
|
30
33
|
- **What we're solving:**
|
|
31
34
|
- **Success criteria:**
|
|
32
35
|
- **Constraints:**
|
|
33
36
|
|
|
37
|
+
## Premise Check
|
|
38
|
+
- **Right problem?** (yes/no + one-line justification — take a position)
|
|
39
|
+
- **Direct path?** (yes/no + one-line justification)
|
|
40
|
+
- **What if we do nothing?** (concrete consequence, not "nothing happens")
|
|
41
|
+
|
|
42
|
+
## How Might We
|
|
43
|
+
- *How might we …?* — one line naming the user, the desired outcome, and the binding constraint.
|
|
44
|
+
|
|
45
|
+
## Sharpening Questions
|
|
46
|
+
| # | Question | Answer / Assumption | Decision impact |
|
|
47
|
+
|---|---|---|---|
|
|
48
|
+
| 1 | | | |
|
|
49
|
+
| 2 | | | |
|
|
50
|
+
| 3 | | | |
|
|
51
|
+
|
|
34
52
|
## Clarifying Questions
|
|
35
53
|
| # | Question | Answer | Decision impact |
|
|
36
54
|
|---|---|---|---|
|
|
@@ -46,10 +64,12 @@ export const ARTIFACT_TEMPLATES = {
|
|
|
46
64
|
- Scope handoff:
|
|
47
65
|
|
|
48
66
|
## Approaches
|
|
49
|
-
| Approach | Role | Upside | Architecture | Trade-offs | Recommendation |
|
|
50
|
-
|
|
51
|
-
| A | baseline | modest | | | |
|
|
52
|
-
| B | challenger | high | | | |
|
|
67
|
+
| Approach | Role | Upside | Architecture | Trade-offs | Reuses | Recommendation |
|
|
68
|
+
|---|---|---|---|---|---|---|
|
|
69
|
+
| A | baseline | modest | | | | |
|
|
70
|
+
| B | challenger | high | | | | |
|
|
71
|
+
|
|
72
|
+
> Role values: \`baseline\` | \`challenger\` | \`wild-card\`. Upside values: \`low\` | \`modest\` | \`high\` | \`higher\`. Exactly one row must be a \`challenger\` with \`high\` or \`higher\` upside.
|
|
53
73
|
|
|
54
74
|
## Approach Reaction
|
|
55
75
|
- Closest option:
|
|
@@ -62,6 +82,9 @@ export const ARTIFACT_TEMPLATES = {
|
|
|
62
82
|
- **Approval:** pending
|
|
63
83
|
- **Next-stage handoff:** On standard track, hand this to \`scope\`; on medium track, hand this directly to \`spec\` with explicit requirements/constraints.
|
|
64
84
|
|
|
85
|
+
## Not Doing
|
|
86
|
+
- (3-5 things this brainstorm is *not* committing to — distinct from \`Deferred\`. These will not appear in scope unless the user explicitly opts in.)
|
|
87
|
+
|
|
65
88
|
${SEED_SHELF_SECTION}
|
|
66
89
|
|
|
67
90
|
## Design
|
|
@@ -69,6 +92,12 @@ ${SEED_SHELF_SECTION}
|
|
|
69
92
|
- **Key components:**
|
|
70
93
|
- **Data flow:**
|
|
71
94
|
|
|
95
|
+
## Visual Companion
|
|
96
|
+
- (compact ASCII/Mermaid diagram for medium+ complexity, or one-line justification for omission.)
|
|
97
|
+
|
|
98
|
+
## Self-Review Notes
|
|
99
|
+
- (list patches applied to this artifact during self-review, or \`- None.\`)
|
|
100
|
+
|
|
72
101
|
## Assumptions and Open Questions
|
|
73
102
|
- **Assumptions:**
|
|
74
103
|
- **Open questions (or "None"):**
|
|
@@ -101,9 +130,13 @@ ${SEED_SHELF_SECTION}
|
|
|
101
130
|
- Four paths per data flow:
|
|
102
131
|
|
|
103
132
|
## Premise Challenge
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
133
|
+
| Question | Answer (take a position) | Evidence / leverage |
|
|
134
|
+
|---|---|---|
|
|
135
|
+
| Right problem? | | |
|
|
136
|
+
| Direct path? | | |
|
|
137
|
+
| What if we do nothing? | | |
|
|
138
|
+
| Existing-code leverage? | | |
|
|
139
|
+
| Reversibility cost? | | |
|
|
107
140
|
|
|
108
141
|
## Dream State Mapping
|
|
109
142
|
- CURRENT STATE:
|
|
@@ -198,7 +231,9 @@ ${SEED_SHELF_SECTION}
|
|
|
198
231
|
- Unresolved decisions (or \`None\`):
|
|
199
232
|
|
|
200
233
|
## Scope Summary
|
|
201
|
-
- Selected mode:
|
|
234
|
+
- Selected mode: (one of \`SCOPE EXPANSION\` | \`SELECTIVE EXPANSION\` | \`HOLD SCOPE\` | \`SCOPE REDUCTION\`)
|
|
235
|
+
- Strongest challenges resolved:
|
|
236
|
+
- Recommended path:
|
|
202
237
|
- Accepted scope:
|
|
203
238
|
- Deferred:
|
|
204
239
|
- Explicitly excluded:
|