@codename_inc/spectre 5.2.1 → 5.2.2
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/package.json +2 -2
- package/plugins/spectre/.claude-plugin/plugin.json +1 -1
- package/plugins/spectre/skills/create_plan/SKILL.md +31 -7
- package/plugins/spectre/skills/plan/SKILL.md +38 -12
- package/plugins/spectre/skills/plan_review/SKILL.md +35 -5
- package/plugins/spectre-codex/skills/create_plan/SKILL.md +31 -7
- package/plugins/spectre-codex/skills/plan/SKILL.md +38 -12
- package/plugins/spectre-codex/skills/plan_review/SKILL.md +35 -5
package/package.json
CHANGED
|
@@ -27,6 +27,7 @@ Treat the current command arguments as this workflow's input. When invoked from
|
|
|
27
27
|
- **Action** — CheckExistingResearch: Check if technical research already completed.
|
|
28
28
|
- Read `TASK_DIR/task_context.md`; look for "## Technical Research" section.
|
|
29
29
|
- **If** found with comprehensive analysis → use existing research; skip to Step 3.
|
|
30
|
+
- **If** ARGUMENTS contains `--depth light` and `TASK_DIR/task_context.md` already contains substantive router research (file locations, code understanding, codebase patterns, and impact summary) → use existing research; skip to Step 3.
|
|
30
31
|
- **Else** → proceed with new research below.
|
|
31
32
|
- **Action** — AutomatedResearch: Spawn parallel research agents for comprehensive analysis.
|
|
32
33
|
- Use `@finder` to find all files related to feature area.
|
|
@@ -61,6 +62,8 @@ Treat the current command arguments as this workflow's input. When invoked from
|
|
|
61
62
|
|
|
62
63
|
Dynamically generate up to 10 technical questions based on research findings. **IMPORTANT**: Only ask questions genuinely not answered in the PRD or discoverable through code investigation. Goal: eliminate scope and design ambiguity. If a question involves choosing between approaches, present options with Pros/Cons/Trade-offs.
|
|
63
64
|
|
|
65
|
+
- **Action** — LightModeClarifications: If ARGUMENTS contains `--depth light`, do NOT stop for user clarifications. Use conservative, codebase-consistent defaults and record them in the plan's **Filled Assumptions** section, then skip to Step 3. If an unresolved question would affect canonical scope, security/privacy, data correctness, or public API behavior, return control to `plan` with a tier reassessment recommendation instead of guessing.
|
|
66
|
+
|
|
64
67
|
- **Action** — DetectClarificationMethod: Check if `AskUserQuestion` tool is available.
|
|
65
68
|
- **If available** → use inline clarification flow (Path A).
|
|
66
69
|
- **If not available** → use file-based clarification flow (Path B).
|
|
@@ -94,16 +97,17 @@ Dynamically generate up to 10 technical questions based on research findings. **
|
|
|
94
97
|
- **Action** — DetermineDepth: Read `--depth` from ARGUMENTS
|
|
95
98
|
|
|
96
99
|
- Default: `standard` if not specified
|
|
97
|
-
- Options: `standard`, `comprehensive`
|
|
100
|
+
- Options: `light`, `standard`, `comprehensive`
|
|
101
|
+
- **Action** — DetectOrchestratedMode: If ARGUMENTS contains `--no-review`, this workflow is being invoked by `plan` as part of the meta-flow. Generate and save the plan, then return control to `plan` without asking for standalone user review.
|
|
98
102
|
|
|
99
103
|
- **Action** — DesignTechnicalApproach: Create the implementation plan.
|
|
100
104
|
|
|
101
|
-
Every plan, regardless of depth, MUST include
|
|
105
|
+
Every plan, regardless of depth, MUST include the verification spine. LIGHT is concise, not shallow: keep it brief and decisive, but still explain the solution shape, codebase pattern to follow, risks/assumptions, and how the work will be verified.
|
|
102
106
|
|
|
103
|
-
**Required for
|
|
107
|
+
**Required for LIGHT, STANDARD, and COMPREHENSIVE:**
|
|
104
108
|
1. **Overview** — 1–2 paragraphs: what problem, what shape the solution takes, why this approach.
|
|
105
109
|
2. **Technical Approach** — How the change actually lands: components touched, data flow, key decisions with rationale. Reference existing patterns from `@patterns` research by file:line (e.g., "follow the shape of `src/widgets/HotDogWidget.ts:42` for the registration step").
|
|
106
|
-
3. **Critical Files for Implementation** —
|
|
110
|
+
3. **Critical Files for Implementation** — 1–7 specific files from research. Format: `path/to/file.ts` — *reason* (Core logic to modify / Pattern to follow / Interface to implement / Test to extend). No guesses — only files surfaced during Step 1 research.
|
|
107
111
|
4. **External Dependencies — Verify Before Implementation** — Every third-party package required, with exact version and a one-line existence check. Format: `package@1.2.3 — verify: npm view package@1.2.3` (or pip equivalent). Required even if "no new packages" (write that explicitly). This is the slopsquatting fence: ~20% of AI-suggested packages don't exist; we catch that here, not in production.
|
|
108
112
|
5. **Verification — How We Know This Works** — For each major change in Technical Approach, 1–3 falsifiable signals: a test name, an observable behavior, or a state/file condition. Prose like "the feature works" is not acceptable — it must be checkable. Format: `<change> → verifies by: <test name | observable behavior | state condition>`. These become acceptance criteria in `create_tasks` downstream.
|
|
109
113
|
6. **Out-of-Bounds — DO NOT add** — 4–8 concrete things the implementation must NOT add, even if "best practice." Examples: rate limiting, retry/backoff, caching layer, optimistic UI, soft-delete, telemetry events, feature flags, admin UI. This is the YAGNI fence against familiar-shape bias (agents reproduce mature-system patterns unprompted). Be specific to this feature, not generic.
|
|
@@ -111,6 +115,12 @@ Dynamically generate up to 10 technical questions based on research findings. **
|
|
|
111
115
|
- *Risks*: what could go wrong (e.g., concurrent write race, migration ordering, third-party rate limit). Each with a one-line mitigation or "accept and monitor."
|
|
112
116
|
- *Filled Assumptions*: things the plan defaulted because the spec didn't say (e.g., "Assumed Postgres; spec didn't specify DB." "Assumed retry count = 0; spec didn't mention failure modes."). Reviewer-visible by design — these are the silent decisions that bite at execution.
|
|
113
117
|
|
|
118
|
+
**LIGHT constraints:**
|
|
119
|
+
- Keep the seven required sections compact: usually 1 short paragraph or 3–5 bullets per section.
|
|
120
|
+
- Prefer one clear implementation path that follows existing codebase patterns; do not enumerate broad alternatives.
|
|
121
|
+
- Do not add standalone clarification gates, review gates, plan_review, or expanded architecture sections.
|
|
122
|
+
- If the plan needs more than 3 critical files, a new abstraction, data migration, public API change, or unresolved scope/security/data correctness decision, stop and return a tier reassessment recommendation to `plan`.
|
|
123
|
+
|
|
114
124
|
**COMPREHENSIVE additionally requires:**
|
|
115
125
|
8. **Current State** — How the affected code path works today, with file:line refs. Anchored to research findings.
|
|
116
126
|
9. **Implementation Phases** — Ordered phases, each with its own Verification subsection (Phase N succeeds when …). Phases must be sequenced by dependency, not by file. Migration phases come before consumer phases.
|
|
@@ -125,14 +135,28 @@ Dynamically generate up to 10 technical questions based on research findings. **
|
|
|
125
135
|
|
|
126
136
|
- **Action** — RequestReview:
|
|
127
137
|
|
|
128
|
-
|
|
138
|
+
- **If `--no-review` is present**:
|
|
139
|
+
|
|
140
|
+
> "Draft implementation plan saved to `{path}`. Returning to `plan` for the next routed step."
|
|
141
|
+
|
|
142
|
+
Do NOT wait for user approval. Return control to the invoking `plan` workflow.
|
|
143
|
+
|
|
144
|
+
- **Else**:
|
|
129
145
|
|
|
130
|
-
|
|
146
|
+
> "Implementation plan saved to `{path}`. Review and reply with feedback or 'Approved' to proceed."
|
|
147
|
+
|
|
148
|
+
- **Wait** — User provides feedback or approval, unless `--no-review` is present.
|
|
131
149
|
|
|
132
150
|
## Step (4/4) - Finalize and Present Next Steps
|
|
133
151
|
|
|
134
152
|
- **Action** — ConfirmCompletion:
|
|
135
153
|
|
|
154
|
+
- **If `--no-review` is present**:
|
|
155
|
+
|
|
156
|
+
> "Draft implementation plan saved to `{plan_path}`. Returning to `plan`."
|
|
157
|
+
|
|
158
|
+
Stop here. Do not render the standalone Next Steps footer.
|
|
159
|
+
|
|
136
160
|
> "🎯 Implementation Planning Complete. Documents: {plan_path}, task_context.md"
|
|
137
161
|
|
|
138
|
-
- **Action** — RenderFooter: Use `@skill-spectre:spectre-guide` skill for Next Steps footer
|
|
162
|
+
- **Action** — RenderFooter: Use `@skill-spectre:spectre-guide` skill for Next Steps footer
|
|
@@ -15,7 +15,7 @@ Treat the current command arguments as this workflow's input. When invoked from
|
|
|
15
15
|
## Description
|
|
16
16
|
|
|
17
17
|
- **What** — Research codebase, assess complexity, route to appropriate workflow (direct tasks or plan-first)
|
|
18
|
-
- **Outcome** —
|
|
18
|
+
- **Outcome** — A right-sized `plan.md` + `tasks.md`; STANDARD/COMPREHENSIVE include review and a final execution gate, while LIGHT stays non-blocking.
|
|
19
19
|
|
|
20
20
|
## ARGUMENTS Input
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ Treat the current command arguments as this workflow's input. When invoked from
|
|
|
23
23
|
|
|
24
24
|
## MANDATORY COMPLIANCE RULES
|
|
25
25
|
|
|
26
|
-
> **⚠️ NON-NEGOTIABLE**:
|
|
26
|
+
> **⚠️ NON-NEGOTIABLE**: After tier routing, this workflow MUST invoke nested workflows via the Skill tool. LIGHT must invoke `Skill(create_plan)` and `Skill(create_tasks)`; STANDARD/COMPREHENSIVE must invoke `Skill(create_plan)`, `Skill(create_tasks)`, and `Skill(plan_review)` (Claude slash route: `/spectre:create_plan`, `/spectre:create_tasks`, and `/spectre:plan_review`). Failure to invoke the required skills is a critical error. Do NOT summarize, describe, or skip these workflows. INVOKE THEM.
|
|
27
27
|
|
|
28
28
|
**After ANY user conversation or questions:**
|
|
29
29
|
|
|
@@ -33,14 +33,16 @@ Treat the current command arguments as this workflow's input. When invoked from
|
|
|
33
33
|
|
|
34
34
|
**You MUST call these skills (not describe them):**
|
|
35
35
|
|
|
36
|
-
- Use the **Skill** tool with `skill: "spectre-create_plan"` and `args: "{path} --depth {tier}"` — generates plan.md
|
|
36
|
+
- Use the **Skill** tool with `skill: "spectre-create_plan"` and `args: "{path} --depth {tier}"` — generates plan.md, including LIGHT
|
|
37
37
|
- Use the **Skill** tool with `skill: "spectre-create_tasks"` and `args: "{path}"` — generates tasks.md
|
|
38
|
+
- Use the **Skill** tool with `skill: "spectre-plan_review"` and `args: "{OUT_DIR} --auto-apply scope-safe"` — reviews and integrates scope-safe feedback for STANDARD/COMPREHENSIVE
|
|
38
39
|
|
|
39
40
|
## Instructions
|
|
40
41
|
|
|
41
42
|
- Research before routing; present architectural options for user buy-in
|
|
42
43
|
- Route based on hard-stops and clarity, not point-scoring
|
|
43
44
|
- Never overwrite existing `tasks.md` or `plan.md` — use scoped names
|
|
45
|
+
- Treat `concepts/scope.md` (then `specs/prd.md` / `specs/ux.md` when present) as canonical. Plan generation, task generation, review, and feedback integration may change implementation approach, sequencing, verification, references, and YAGNI fences, but MUST NOT cut, narrow, expand, or reinterpret the agreed scope without an explicit user scope-change gate.
|
|
44
46
|
|
|
45
47
|
## Step 1 - Research Codebase
|
|
46
48
|
|
|
@@ -124,7 +126,7 @@ Use research findings from Step 1 to determine appropriate planning depth.
|
|
|
124
126
|
|
|
125
127
|
## Step 3 - High-Level Design
|
|
126
128
|
|
|
127
|
-
**SKIP IF LIGHT** — proceed directly to Step 4.
|
|
129
|
+
**SKIP IF LIGHT** — proceed directly to Step 4. LIGHT still generates a real plan in Step 4; it only skips this human alignment gate.
|
|
128
130
|
|
|
129
131
|
Goal: align on the *shape* of the solution before generating a full plan. This catches misalignments early and gives the user a chance to redirect before reading a long plan doc.
|
|
130
132
|
|
|
@@ -171,7 +173,7 @@ Goal: align on the *shape* of the solution before generating a full plan. This c
|
|
|
171
173
|
|
|
172
174
|
- **Action** — PersistDesign: Append a "Selected Design" section to `{OUT_DIR}/task_context.md` capturing the agreed approach, key decisions, and resolved questions. This is what `create_plan` consumes.
|
|
173
175
|
|
|
174
|
-
> **CHECKPOINT**: After alignment, proceed IMMEDIATELY to Step 4. The
|
|
176
|
+
> **CHECKPOINT**: After alignment, proceed IMMEDIATELY to Step 4. This is the early gate. The next valid actions are Skill invocations that generate the draft plan, generate tasks, run plan_review, integrate scope-safe feedback, and then present the final plan/tasks for the user's final gate.
|
|
175
177
|
|
|
176
178
|
## Step 4 - Route to Workflow
|
|
177
179
|
|
|
@@ -187,6 +189,7 @@ Goal: align on the *shape* of the solution before generating a full plan. This c
|
|
|
187
189
|
│ │
|
|
188
190
|
│ ✅ CORRECT: Skill tool with skill: "spectre-create_plan", args: "..." │
|
|
189
191
|
│ ✅ CORRECT: Skill tool with skill: "spectre-create_tasks", args: "..."│
|
|
192
|
+
│ ✅ CORRECT: Skill tool with skill: "spectre-plan_review", args: "..." │
|
|
190
193
|
└────────────────────────────────────────────────────────────────────────┘
|
|
191
194
|
```
|
|
192
195
|
|
|
@@ -202,6 +205,7 @@ Goal: align on the *shape* of the solution before generating a full plan. This c
|
|
|
202
205
|
|
|
203
206
|
- Use the Skill tool: `skill: "spectre-create_plan"`, `args: "{OUT_DIR}/task_context.md --depth {tier}"`
|
|
204
207
|
- Use the Skill tool: `skill: "spectre-create_tasks"`, `args: "{OUT_DIR}/task_context.md"`
|
|
208
|
+
- For STANDARD/COMPREHENSIVE, use the Skill tool: `skill: "spectre-plan_review"`, `args: "{OUT_DIR} --auto-apply scope-safe"`
|
|
205
209
|
|
|
206
210
|
---
|
|
207
211
|
|
|
@@ -209,27 +213,34 @@ Goal: align on the *shape* of the solution before generating a full plan. This c
|
|
|
209
213
|
|
|
210
214
|
- **If LIGHT**:
|
|
211
215
|
|
|
216
|
+
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_plan"`, `args: "{OUT_DIR}/task_context.md --depth light --no-review"`
|
|
217
|
+
- **Wait** — Returns concise plan with solution shape, patterns, risks, and verification approach
|
|
212
218
|
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_tasks"`, `args: "{OUT_DIR}/task_context.md --depth light"`
|
|
213
|
-
- **Wait** — Returns task breakdown
|
|
219
|
+
- **Wait** — Returns task breakdown grounded in the light plan
|
|
220
|
+
- **Action** — PresentLightArtifacts: Summarize `{OUT_DIR}/specs/plan.md` and `{OUT_DIR}/specs/tasks.md`. State that LIGHT skipped `plan_review` and the human execution gate by design.
|
|
214
221
|
- Skip to footer
|
|
215
222
|
|
|
216
223
|
- **ElseIf STANDARD**:
|
|
217
224
|
|
|
218
|
-
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_plan"`, `args: "{OUT_DIR}/task_context.md --depth standard"`
|
|
225
|
+
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_plan"`, `args: "{OUT_DIR}/task_context.md --depth standard --no-review"`
|
|
219
226
|
- **Wait** — Returns focused plan (Overview, Approach, Out of Scope)
|
|
220
|
-
- **Action** — PromptUser: "Review plan. Reply 'Approved' or provide feedback."
|
|
221
|
-
- **Wait** — User approval
|
|
222
227
|
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_tasks"`, `args: "{OUT_DIR}/task_context.md"`
|
|
223
228
|
- **Wait** — Returns task breakdown
|
|
229
|
+
- **INVOKE NOW** → Skill tool with `skill: "spectre-plan_review"`, `args: "{OUT_DIR} --auto-apply scope-safe"`
|
|
230
|
+
- **Wait** — Returns findings, applied edits, skipped scope-changing recommendations, and updated artifacts
|
|
231
|
+
- **Action** — IntegratePlanReviewFeedback: Read the plan_review report path returned by `plan_review`. Confirm every scope-safe Blocker/High finding is reflected in `plan.md` and/or `tasks.md`. If `plan_review` produced a scope-safe suggested edit but did not apply it because it needed minor adaptation, apply the smallest artifact edit now and record it in the final summary. Do not apply Scope Change Required findings.
|
|
232
|
+
- Continue to Final Gate
|
|
224
233
|
|
|
225
234
|
- **ElseIf COMPREHENSIVE**:
|
|
226
235
|
|
|
227
|
-
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_plan"`, `args: "{OUT_DIR}/task_context.md --depth comprehensive"`
|
|
236
|
+
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_plan"`, `args: "{OUT_DIR}/task_context.md --depth comprehensive --no-review"`
|
|
228
237
|
- **Wait** — Returns full plan (all sections: Architecture, Phases, API Design, Testing Strategy, etc.)
|
|
229
|
-
- **Action** — PromptUser: "Review plan. Reply 'Approved' or provide feedback."
|
|
230
|
-
- **Wait** — User approval
|
|
231
238
|
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_tasks"`, `args: "{OUT_DIR}/task_context.md"`
|
|
232
239
|
- **Wait** — Returns task breakdown
|
|
240
|
+
- **INVOKE NOW** → Skill tool with `skill: "spectre-plan_review"`, `args: "{OUT_DIR} --auto-apply scope-safe"`
|
|
241
|
+
- **Wait** — Returns findings, applied edits, skipped scope-changing recommendations, and updated artifacts
|
|
242
|
+
- **Action** — IntegratePlanReviewFeedback: Read the plan_review report path returned by `plan_review`. Confirm every scope-safe Blocker/High finding is reflected in `plan.md` and/or `tasks.md`. If `plan_review` produced a scope-safe suggested edit but did not apply it because it needed minor adaptation, apply the smallest artifact edit now and record it in the final summary. Do not apply Scope Change Required findings.
|
|
243
|
+
- Continue to Final Gate
|
|
233
244
|
|
|
234
245
|
---
|
|
235
246
|
|
|
@@ -253,4 +264,19 @@ Only proceed past this checkpoint when the user confirms.
|
|
|
253
264
|
|
|
254
265
|
---
|
|
255
266
|
|
|
267
|
+
### Final Gate
|
|
268
|
+
|
|
269
|
+
- **Action** — PresentFinalArtifacts:
|
|
270
|
+
- Summarize final artifact paths: `{OUT_DIR}/specs/plan.md`, `{OUT_DIR}/specs/tasks.md`, and the saved plan_review report under `{OUT_DIR}/reviews/`.
|
|
271
|
+
- Summarize review integration: findings applied by `plan_review`, any additional plan-orchestrator edits applied to integrate feedback, skipped edits, and any recommendations that were blocked because they would change canonical scope.
|
|
272
|
+
- If plan_review surfaced a scope-changing recommendation, state: "This requires a scope change; I did not apply it." Ask the user whether to reopen scope or approve the current canonical-scope-preserving plan/tasks.
|
|
273
|
+
- Otherwise prompt: "Final reviewed plan/tasks are ready. Reply `Approved` to proceed to execution, or provide final feedback."
|
|
274
|
+
|
|
275
|
+
- **Wait** — User final approval or feedback.
|
|
276
|
+
|
|
277
|
+
- **If feedback preserves canonical scope** — apply the smallest edits to `plan.md`/`tasks.md`, re-run `plan_review {OUT_DIR} --auto-apply scope-safe` if the feedback changes implementation approach, verification, dependencies, task sequencing, or references, then present the Final Gate again.
|
|
278
|
+
- **If feedback changes canonical scope** — stop and route back to `/spectre:scope` (or explicitly update the canonical scope artifact if the user directs it). Do not silently update plan/tasks against stale scope.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
256
282
|
- **Action** — RenderFooter: Use `@skill-spectre:spectre-guide` skill for Next Steps
|
|
@@ -16,8 +16,15 @@ Treat the current command arguments as this workflow's input. When invoked from
|
|
|
16
16
|
|
|
17
17
|
- **What** — Independent review of any available planning artifacts (`plan.md`, `tasks.md`, and optional `task_context.md`) from four specialized lenses, dispatched in parallel
|
|
18
18
|
- **Outcome** — Structured findings with concrete edit suggestions; optional write-back to update the available artifacts
|
|
19
|
+
- **Artifact** — Always save a Markdown review report before any write-back so pre-integration findings are auditable
|
|
19
20
|
- **Role** — Senior staff engineer + reviewer panel; bias toward pragmatic problem-solving, YAGNI enforcement, and verifiability
|
|
20
21
|
|
|
22
|
+
## Canonical Scope Invariant
|
|
23
|
+
|
|
24
|
+
`concepts/scope.md` is canonical when present. If absent, use `specs/prd.md`, `specs/ux.md`, and explicit requirements in `task_context.md` as the scope source, in that order.
|
|
25
|
+
|
|
26
|
+
Reviewers may recommend deleting unrequested implementation details, unnecessary abstractions, weak verification, hallucinated references, bad dependencies, or task sequencing problems. They MUST NOT cut, narrow, expand, or reinterpret agreed scope. If a reviewer believes the agreed scope itself is too large, internally inconsistent, or missing a requirement, phrase that as a **Scope Change Required** recommendation for the user. Do not apply it to `plan.md` or `tasks.md` during write-back.
|
|
27
|
+
|
|
21
28
|
## ARGUMENTS Input
|
|
22
29
|
|
|
23
30
|
<ARGUMENTS>
|
|
@@ -46,12 +53,15 @@ A single reviewer biases toward the issues it notices first. Published practice
|
|
|
46
53
|
- `PLAN=${TASK_DIR}/specs/plan.md` (or scoped name)
|
|
47
54
|
- `TASKS=${TASK_DIR}/specs/tasks.md` (or scoped name)
|
|
48
55
|
- `CONTEXT=${TASK_DIR}/task_context.md`
|
|
56
|
+
- `SCOPE=${TASK_DIR}/concepts/scope.md` when present; otherwise use `specs/prd.md` / `specs/ux.md` as available
|
|
57
|
+
- `REVIEWS_DIR=${TASK_DIR}/reviews`
|
|
58
|
+
- `REVIEW_REPORT=${REVIEWS_DIR}/plan_review.md`; if that exists, use `plan_review_{YYYY-MM-DD_HHMMSS}.md` to avoid overwriting prior review evidence.
|
|
49
59
|
- `plan.md` and `tasks.md` are independently reviewable. It is valid to review only `plan.md`, only `tasks.md`, or both.
|
|
50
60
|
- `task_context.md` is helpful context but is not required. If it is missing, continue and note that requirements traceability is limited.
|
|
51
61
|
- If both `plan.md` and `tasks.md` are missing, stop and suggest the user run `/spectre:plan` or `/spectre:create_tasks` first.
|
|
52
62
|
- If exactly one of `plan.md` or `tasks.md` is missing, list it as absent context and continue. Do not decline, stop, or ask the user to create the missing artifact.
|
|
53
63
|
|
|
54
|
-
- **Action** — ReadAvailable: Read each available file completely into context before dispatching reviewers. Reviewers receive curated excerpts plus an artifact manifest that says which files are present and absent. Every reviewer must review the artifacts that exist and must not treat absent artifacts as a blocker.
|
|
64
|
+
- **Action** — ReadAvailable: Read each available file completely into context before dispatching reviewers. Reviewers receive curated excerpts plus an artifact manifest that says which files are present and absent. Every reviewer must review the artifacts that exist and must not treat absent artifacts as a blocker. The manifest must label the canonical scope source and state that review findings may not remove or narrow scope.
|
|
55
65
|
|
|
56
66
|
## Step 2 — Dispatch Four Parallel Reviewers
|
|
57
67
|
|
|
@@ -64,13 +74,15 @@ Missing-artifact rule for every lens: review what exists. If a finding depends o
|
|
|
64
74
|
> Review the available plan and/or task list for unrequested complexity. Agents have a documented "familiar-shape bias": shown a feature, they reproduce the mature-system shape from their training data (auth → adds rate-limiting; CRUD → adds soft-delete; form → adds optimistic UI; service → adds telemetry; module → adds feature flags). Your job is to find that bias here.
|
|
65
75
|
>
|
|
66
76
|
> Find:
|
|
67
|
-
> 1. When `plan.md` is present: anything in Technical Approach that isn't traceable to a requirement in available context (`task_context.md` /
|
|
77
|
+
> 1. When `plan.md` is present: anything in Technical Approach that isn't traceable to a requirement in available context (`scope.md` / `task_context.md` / PRD / UX). If context is absent, use the plan's own requirements and boundaries.
|
|
68
78
|
> 2. When `tasks.md` is present: tasks that implement something the available requirements don't ask for. If requirements context is absent, use the task list's stated goals and boundaries.
|
|
69
79
|
> 3. Abstractions, interfaces, or layers introduced for a single concrete caller.
|
|
70
80
|
> 4. Generality (config files, plugin points, factories) where the actual need is one specific behavior.
|
|
71
81
|
> 5. Overlap with the `Out-of-Bounds — DO NOT add` list (if anything violates that list, it's a hard fail).
|
|
72
82
|
>
|
|
73
|
-
>
|
|
83
|
+
> Scope guard: you may nominate implementation detail to delete only when it is not required by canonical scope. Do not nominate an agreed requirement, user-approved behavior, or required task as the thing to delete. If the best "cut" would change canonical scope, label it **Scope Change Required** and do not include it as an auto-applicable deletion.
|
|
84
|
+
>
|
|
85
|
+
> Required output: nominate the SINGLE highest-leverage implementation detail to delete and justify it. You must pick one unless every possible deletion would change canonical scope; in that case, say "No scope-safe deletion found" and provide the nearest Scope Change Required recommendation separately. Then list other simplifications ranked by impact. For each finding, cite the exact file:line or section header it lives in.
|
|
74
86
|
|
|
75
87
|
### Lens 2 — Verifiability (`@analyst`)
|
|
76
88
|
|
|
@@ -118,6 +130,7 @@ Missing-artifact rule for every lens: review what exists. If a finding depends o
|
|
|
118
130
|
- **High** — meaningfully reduces output quality (missing RED test, weak canonical reference, prose criterion)
|
|
119
131
|
- **Medium** — overengineering or reuse miss without functional blast radius
|
|
120
132
|
- **Low** — stylistic or nice-to-have
|
|
133
|
+
- **Scope Change Required** — may be valid feedback, but would cut, expand, or reinterpret canonical scope and therefore needs explicit user approval before any artifact edit
|
|
121
134
|
|
|
122
135
|
- **Action** — RenderFindingsTable: Output a single structured table. Schema is fixed.
|
|
123
136
|
|
|
@@ -143,11 +156,24 @@ Missing-artifact rule for every lens: review what exists. If a finding depends o
|
|
|
143
156
|
- Low: {N}
|
|
144
157
|
```
|
|
145
158
|
|
|
159
|
+
- **Action** — SaveReviewArtifact: Before applying any edits to `plan.md` or `tasks.md`, save the pre-integration review findings as a Markdown report.
|
|
160
|
+
- Create `${REVIEWS_DIR}` if missing.
|
|
161
|
+
- Write `${REVIEW_REPORT}` using the RenderFindingsTable content plus:
|
|
162
|
+
- Reviewed artifacts: exact plan/tasks/context/scope paths present and absent.
|
|
163
|
+
- Canonical scope source used.
|
|
164
|
+
- Auto-apply mode: enabled/disabled.
|
|
165
|
+
- Timestamp.
|
|
166
|
+
- Explicit note: "This report captures plan_review findings before any write-back to plan.md or tasks.md."
|
|
167
|
+
- Do not overwrite an existing report. Use the timestamped filename if the default already exists.
|
|
168
|
+
- Include the saved report path in all subsequent summaries and in `ReportApplied`.
|
|
169
|
+
|
|
146
170
|
## Step 4 — Surface Findings & Apply Edits
|
|
147
171
|
|
|
148
|
-
- **Action** — PresentFindings: Render the findings table inline
|
|
172
|
+
- **Action** — PresentFindings: Render the findings table inline and include `Review report saved: {REVIEW_REPORT}`.
|
|
173
|
+
|
|
174
|
+
- **Action** — DetectAutoApplyMode: If ARGUMENTS contains `--auto-apply scope-safe`, skip the user selection prompt and apply all scope-safe Blocker and High findings, plus Medium/Low findings only when the Suggested Edit is unambiguous and cannot change canonical scope. Do not apply findings marked Scope Change Required. Continue to ApplyEdits and SelfCheck, then return the applied/skipped summary to the invoking workflow.
|
|
149
175
|
|
|
150
|
-
- **Action** — OfferWriteBack:
|
|
176
|
+
- **Action** — OfferWriteBack: Unless `--auto-apply scope-safe` is present, after the table prompt:
|
|
151
177
|
|
|
152
178
|
> Reply with which findings to apply:
|
|
153
179
|
> - `all` — apply every suggested edit
|
|
@@ -163,17 +189,21 @@ Missing-artifact rule for every lens: review what exists. If a finding depends o
|
|
|
163
189
|
- Open the named artifact (`plan.md` or `tasks.md`)
|
|
164
190
|
- Apply the Suggested Edit verbatim where possible; if the edit needs adaptation, make the minimum change consistent with the finding's intent
|
|
165
191
|
- Track which findings were applied
|
|
192
|
+
- Before writing, confirm the edit preserves every requirement and boundary in the canonical scope source. If it would remove, narrow, expand, or reinterpret scope, skip it and record it as "skipped: requires scope change."
|
|
166
193
|
|
|
167
194
|
- **Action** — SelfCheck: After edits, run a fast pass over the modified sections:
|
|
168
195
|
- Re-verify any file:line refs touched
|
|
169
196
|
- Re-verify acceptance criteria are still executable
|
|
170
197
|
- Confirm no edit introduced a new Out-of-Bounds violation
|
|
198
|
+
- Confirm canonical scope is still fully represented by the resulting plan/tasks
|
|
171
199
|
- If any check fails, surface it and ask the user before continuing
|
|
172
200
|
|
|
173
201
|
- **Action** — ReportApplied:
|
|
174
202
|
|
|
175
203
|
> Applied: {list of finding numbers}. Skipped: {list}.
|
|
204
|
+
> Review report: {REVIEW_REPORT}.
|
|
176
205
|
> {Path to updated artifact(s)}.
|
|
206
|
+
> Scope-change recommendations not applied: {list or "none"}.
|
|
177
207
|
|
|
178
208
|
## Step 5 — Next Steps
|
|
179
209
|
|
|
@@ -27,6 +27,7 @@ Treat the current command arguments as this workflow's input. When invoked from
|
|
|
27
27
|
- **Action** — CheckExistingResearch: Check if technical research already completed.
|
|
28
28
|
- Read `TASK_DIR/task_context.md`; look for "## Technical Research" section.
|
|
29
29
|
- **If** found with comprehensive analysis → use existing research; skip to Step 3.
|
|
30
|
+
- **If** ARGUMENTS contains `--depth light` and `TASK_DIR/task_context.md` already contains substantive router research (file locations, code understanding, codebase patterns, and impact summary) → use existing research; skip to Step 3.
|
|
30
31
|
- **Else** → proceed with new research below.
|
|
31
32
|
- **Action** — AutomatedResearch: Spawn parallel research agents for comprehensive analysis.
|
|
32
33
|
- Use `@finder` to find all files related to feature area.
|
|
@@ -61,6 +62,8 @@ Treat the current command arguments as this workflow's input. When invoked from
|
|
|
61
62
|
|
|
62
63
|
Dynamically generate up to 10 technical questions based on research findings. **IMPORTANT**: Only ask questions genuinely not answered in the PRD or discoverable through code investigation. Goal: eliminate scope and design ambiguity. If a question involves choosing between approaches, present options with Pros/Cons/Trade-offs.
|
|
63
64
|
|
|
65
|
+
- **Action** — LightModeClarifications: If ARGUMENTS contains `--depth light`, do NOT stop for user clarifications. Use conservative, codebase-consistent defaults and record them in the plan's **Filled Assumptions** section, then skip to Step 3. If an unresolved question would affect canonical scope, security/privacy, data correctness, or public API behavior, return control to `plan` with a tier reassessment recommendation instead of guessing.
|
|
66
|
+
|
|
64
67
|
- **Action** — DetectClarificationMethod: Check if `AskUserQuestion` tool is available.
|
|
65
68
|
- **If available** → use inline clarification flow (Path A).
|
|
66
69
|
- **If not available** → use file-based clarification flow (Path B).
|
|
@@ -94,16 +97,17 @@ Dynamically generate up to 10 technical questions based on research findings. **
|
|
|
94
97
|
- **Action** — DetermineDepth: Read `--depth` from ARGUMENTS
|
|
95
98
|
|
|
96
99
|
- Default: `standard` if not specified
|
|
97
|
-
- Options: `standard`, `comprehensive`
|
|
100
|
+
- Options: `light`, `standard`, `comprehensive`
|
|
101
|
+
- **Action** — DetectOrchestratedMode: If ARGUMENTS contains `--no-review`, this workflow is being invoked by `plan` as part of the meta-flow. Generate and save the plan, then return control to `plan` without asking for standalone user review.
|
|
98
102
|
|
|
99
103
|
- **Action** — DesignTechnicalApproach: Create the implementation plan.
|
|
100
104
|
|
|
101
|
-
Every plan, regardless of depth, MUST include
|
|
105
|
+
Every plan, regardless of depth, MUST include the verification spine. LIGHT is concise, not shallow: keep it brief and decisive, but still explain the solution shape, codebase pattern to follow, risks/assumptions, and how the work will be verified.
|
|
102
106
|
|
|
103
|
-
**Required for
|
|
107
|
+
**Required for LIGHT, STANDARD, and COMPREHENSIVE:**
|
|
104
108
|
1. **Overview** — 1–2 paragraphs: what problem, what shape the solution takes, why this approach.
|
|
105
109
|
2. **Technical Approach** — How the change actually lands: components touched, data flow, key decisions with rationale. Reference existing patterns from `@patterns` research by file:line (e.g., "follow the shape of `src/widgets/HotDogWidget.ts:42` for the registration step").
|
|
106
|
-
3. **Critical Files for Implementation** —
|
|
110
|
+
3. **Critical Files for Implementation** — 1–7 specific files from research. Format: `path/to/file.ts` — *reason* (Core logic to modify / Pattern to follow / Interface to implement / Test to extend). No guesses — only files surfaced during Step 1 research.
|
|
107
111
|
4. **External Dependencies — Verify Before Implementation** — Every third-party package required, with exact version and a one-line existence check. Format: `package@1.2.3 — verify: npm view package@1.2.3` (or pip equivalent). Required even if "no new packages" (write that explicitly). This is the slopsquatting fence: ~20% of AI-suggested packages don't exist; we catch that here, not in production.
|
|
108
112
|
5. **Verification — How We Know This Works** — For each major change in Technical Approach, 1–3 falsifiable signals: a test name, an observable behavior, or a state/file condition. Prose like "the feature works" is not acceptable — it must be checkable. Format: `<change> → verifies by: <test name | observable behavior | state condition>`. These become acceptance criteria in `create_tasks` downstream.
|
|
109
113
|
6. **Out-of-Bounds — DO NOT add** — 4–8 concrete things the implementation must NOT add, even if "best practice." Examples: rate limiting, retry/backoff, caching layer, optimistic UI, soft-delete, telemetry events, feature flags, admin UI. This is the YAGNI fence against familiar-shape bias (agents reproduce mature-system patterns unprompted). Be specific to this feature, not generic.
|
|
@@ -111,6 +115,12 @@ Dynamically generate up to 10 technical questions based on research findings. **
|
|
|
111
115
|
- *Risks*: what could go wrong (e.g., concurrent write race, migration ordering, third-party rate limit). Each with a one-line mitigation or "accept and monitor."
|
|
112
116
|
- *Filled Assumptions*: things the plan defaulted because the spec didn't say (e.g., "Assumed Postgres; spec didn't specify DB." "Assumed retry count = 0; spec didn't mention failure modes."). Reviewer-visible by design — these are the silent decisions that bite at execution.
|
|
113
117
|
|
|
118
|
+
**LIGHT constraints:**
|
|
119
|
+
- Keep the seven required sections compact: usually 1 short paragraph or 3–5 bullets per section.
|
|
120
|
+
- Prefer one clear implementation path that follows existing codebase patterns; do not enumerate broad alternatives.
|
|
121
|
+
- Do not add standalone clarification gates, review gates, plan_review, or expanded architecture sections.
|
|
122
|
+
- If the plan needs more than 3 critical files, a new abstraction, data migration, public API change, or unresolved scope/security/data correctness decision, stop and return a tier reassessment recommendation to `plan`.
|
|
123
|
+
|
|
114
124
|
**COMPREHENSIVE additionally requires:**
|
|
115
125
|
8. **Current State** — How the affected code path works today, with file:line refs. Anchored to research findings.
|
|
116
126
|
9. **Implementation Phases** — Ordered phases, each with its own Verification subsection (Phase N succeeds when …). Phases must be sequenced by dependency, not by file. Migration phases come before consumer phases.
|
|
@@ -125,14 +135,28 @@ Dynamically generate up to 10 technical questions based on research findings. **
|
|
|
125
135
|
|
|
126
136
|
- **Action** — RequestReview:
|
|
127
137
|
|
|
128
|
-
|
|
138
|
+
- **If `--no-review` is present**:
|
|
139
|
+
|
|
140
|
+
> "Draft implementation plan saved to `{path}`. Returning to `plan` for the next routed step."
|
|
141
|
+
|
|
142
|
+
Do NOT wait for user approval. Return control to the invoking `plan` workflow.
|
|
143
|
+
|
|
144
|
+
- **Else**:
|
|
129
145
|
|
|
130
|
-
|
|
146
|
+
> "Implementation plan saved to `{path}`. Review and reply with feedback or 'Approved' to proceed."
|
|
147
|
+
|
|
148
|
+
- **Wait** — User provides feedback or approval, unless `--no-review` is present.
|
|
131
149
|
|
|
132
150
|
## Step (4/4) - Finalize and Present Next Steps
|
|
133
151
|
|
|
134
152
|
- **Action** — ConfirmCompletion:
|
|
135
153
|
|
|
154
|
+
- **If `--no-review` is present**:
|
|
155
|
+
|
|
156
|
+
> "Draft implementation plan saved to `{plan_path}`. Returning to `plan`."
|
|
157
|
+
|
|
158
|
+
Stop here. Do not render the standalone Next Steps footer.
|
|
159
|
+
|
|
136
160
|
> "🎯 Implementation Planning Complete. Documents: {plan_path}, task_context.md"
|
|
137
161
|
|
|
138
|
-
- **Action** — RenderFooter: Use `Skill(spectre-guide)` skill for Next Steps footer
|
|
162
|
+
- **Action** — RenderFooter: Use `Skill(spectre-guide)` skill for Next Steps footer
|
|
@@ -15,7 +15,7 @@ Treat the current command arguments as this workflow's input. When invoked from
|
|
|
15
15
|
## Description
|
|
16
16
|
|
|
17
17
|
- **What** — Research codebase, assess complexity, route to appropriate workflow (direct tasks or plan-first)
|
|
18
|
-
- **Outcome** —
|
|
18
|
+
- **Outcome** — A right-sized `plan.md` + `tasks.md`; STANDARD/COMPREHENSIVE include review and a final execution gate, while LIGHT stays non-blocking.
|
|
19
19
|
|
|
20
20
|
## ARGUMENTS Input
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ Treat the current command arguments as this workflow's input. When invoked from
|
|
|
23
23
|
|
|
24
24
|
## MANDATORY COMPLIANCE RULES
|
|
25
25
|
|
|
26
|
-
> **⚠️ NON-NEGOTIABLE**:
|
|
26
|
+
> **⚠️ NON-NEGOTIABLE**: After tier routing, this workflow MUST invoke nested workflows via the Skill tool. LIGHT must invoke `Skill(create_plan)` and `Skill(create_tasks)`; STANDARD/COMPREHENSIVE must invoke `Skill(create_plan)`, `Skill(create_tasks)`, and `Skill(plan_review)` (Claude slash route: `create_plan`, `create_tasks`, and `plan_review`). Failure to invoke the required skills is a critical error. Do NOT summarize, describe, or skip these workflows. INVOKE THEM.
|
|
27
27
|
|
|
28
28
|
**After ANY user conversation or questions:**
|
|
29
29
|
|
|
@@ -33,14 +33,16 @@ Treat the current command arguments as this workflow's input. When invoked from
|
|
|
33
33
|
|
|
34
34
|
**You MUST call these skills (not describe them):**
|
|
35
35
|
|
|
36
|
-
- Use the **Skill** tool with `skill: "spectre-create_plan"` and `args: "{path} --depth {tier}"` — generates plan.md
|
|
36
|
+
- Use the **Skill** tool with `skill: "spectre-create_plan"` and `args: "{path} --depth {tier}"` — generates plan.md, including LIGHT
|
|
37
37
|
- Use the **Skill** tool with `skill: "spectre-create_tasks"` and `args: "{path}"` — generates tasks.md
|
|
38
|
+
- Use the **Skill** tool with `skill: "spectre-plan_review"` and `args: "{OUT_DIR} --auto-apply scope-safe"` — reviews and integrates scope-safe feedback for STANDARD/COMPREHENSIVE
|
|
38
39
|
|
|
39
40
|
## Instructions
|
|
40
41
|
|
|
41
42
|
- Research before routing; present architectural options for user buy-in
|
|
42
43
|
- Route based on hard-stops and clarity, not point-scoring
|
|
43
44
|
- Never overwrite existing `tasks.md` or `plan.md` — use scoped names
|
|
45
|
+
- Treat `concepts/scope.md` (then `specs/prd.md` / `specs/ux.md` when present) as canonical. Plan generation, task generation, review, and feedback integration may change implementation approach, sequencing, verification, references, and YAGNI fences, but MUST NOT cut, narrow, expand, or reinterpret the agreed scope without an explicit user scope-change gate.
|
|
44
46
|
|
|
45
47
|
## Step 1 - Research Codebase
|
|
46
48
|
|
|
@@ -124,7 +126,7 @@ Use research findings from Step 1 to determine appropriate planning depth.
|
|
|
124
126
|
|
|
125
127
|
## Step 3 - High-Level Design
|
|
126
128
|
|
|
127
|
-
**SKIP IF LIGHT** — proceed directly to Step 4.
|
|
129
|
+
**SKIP IF LIGHT** — proceed directly to Step 4. LIGHT still generates a real plan in Step 4; it only skips this human alignment gate.
|
|
128
130
|
|
|
129
131
|
Goal: align on the *shape* of the solution before generating a full plan. This catches misalignments early and gives the user a chance to redirect before reading a long plan doc.
|
|
130
132
|
|
|
@@ -171,7 +173,7 @@ Goal: align on the *shape* of the solution before generating a full plan. This c
|
|
|
171
173
|
|
|
172
174
|
- **Action** — PersistDesign: Append a "Selected Design" section to `{OUT_DIR}/task_context.md` capturing the agreed approach, key decisions, and resolved questions. This is what `create_plan` consumes.
|
|
173
175
|
|
|
174
|
-
> **CHECKPOINT**: After alignment, proceed IMMEDIATELY to Step 4. The
|
|
176
|
+
> **CHECKPOINT**: After alignment, proceed IMMEDIATELY to Step 4. This is the early gate. The next valid actions are Skill invocations that generate the draft plan, generate tasks, run plan_review, integrate scope-safe feedback, and then present the final plan/tasks for the user's final gate.
|
|
175
177
|
|
|
176
178
|
## Step 4 - Route to Workflow
|
|
177
179
|
|
|
@@ -187,6 +189,7 @@ Goal: align on the *shape* of the solution before generating a full plan. This c
|
|
|
187
189
|
│ │
|
|
188
190
|
│ ✅ CORRECT: Skill tool with skill: "spectre-create_plan", args: "..." │
|
|
189
191
|
│ ✅ CORRECT: Skill tool with skill: "spectre-create_tasks", args: "..."│
|
|
192
|
+
│ ✅ CORRECT: Skill tool with skill: "spectre-plan_review", args: "..." │
|
|
190
193
|
└────────────────────────────────────────────────────────────────────────┘
|
|
191
194
|
```
|
|
192
195
|
|
|
@@ -202,6 +205,7 @@ Goal: align on the *shape* of the solution before generating a full plan. This c
|
|
|
202
205
|
|
|
203
206
|
- Use the Skill tool: `skill: "spectre-create_plan"`, `args: "{OUT_DIR}/task_context.md --depth {tier}"`
|
|
204
207
|
- Use the Skill tool: `skill: "spectre-create_tasks"`, `args: "{OUT_DIR}/task_context.md"`
|
|
208
|
+
- For STANDARD/COMPREHENSIVE, use the Skill tool: `skill: "spectre-plan_review"`, `args: "{OUT_DIR} --auto-apply scope-safe"`
|
|
205
209
|
|
|
206
210
|
---
|
|
207
211
|
|
|
@@ -209,27 +213,34 @@ Goal: align on the *shape* of the solution before generating a full plan. This c
|
|
|
209
213
|
|
|
210
214
|
- **If LIGHT**:
|
|
211
215
|
|
|
216
|
+
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_plan"`, `args: "{OUT_DIR}/task_context.md --depth light --no-review"`
|
|
217
|
+
- **Wait** — Returns concise plan with solution shape, patterns, risks, and verification approach
|
|
212
218
|
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_tasks"`, `args: "{OUT_DIR}/task_context.md --depth light"`
|
|
213
|
-
- **Wait** — Returns task breakdown
|
|
219
|
+
- **Wait** — Returns task breakdown grounded in the light plan
|
|
220
|
+
- **Action** — PresentLightArtifacts: Summarize `{OUT_DIR}/specs/plan.md` and `{OUT_DIR}/specs/tasks.md`. State that LIGHT skipped `plan_review` and the human execution gate by design.
|
|
214
221
|
- Skip to footer
|
|
215
222
|
|
|
216
223
|
- **ElseIf STANDARD**:
|
|
217
224
|
|
|
218
|
-
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_plan"`, `args: "{OUT_DIR}/task_context.md --depth standard"`
|
|
225
|
+
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_plan"`, `args: "{OUT_DIR}/task_context.md --depth standard --no-review"`
|
|
219
226
|
- **Wait** — Returns focused plan (Overview, Approach, Out of Scope)
|
|
220
|
-
- **Action** — PromptUser: "Review plan. Reply 'Approved' or provide feedback."
|
|
221
|
-
- **Wait** — User approval
|
|
222
227
|
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_tasks"`, `args: "{OUT_DIR}/task_context.md"`
|
|
223
228
|
- **Wait** — Returns task breakdown
|
|
229
|
+
- **INVOKE NOW** → Skill tool with `skill: "spectre-plan_review"`, `args: "{OUT_DIR} --auto-apply scope-safe"`
|
|
230
|
+
- **Wait** — Returns findings, applied edits, skipped scope-changing recommendations, and updated artifacts
|
|
231
|
+
- **Action** — IntegratePlanReviewFeedback: Read the plan_review report path returned by `plan_review`. Confirm every scope-safe Blocker/High finding is reflected in `plan.md` and/or `tasks.md`. If `plan_review` produced a scope-safe suggested edit but did not apply it because it needed minor adaptation, apply the smallest artifact edit now and record it in the final summary. Do not apply Scope Change Required findings.
|
|
232
|
+
- Continue to Final Gate
|
|
224
233
|
|
|
225
234
|
- **ElseIf COMPREHENSIVE**:
|
|
226
235
|
|
|
227
|
-
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_plan"`, `args: "{OUT_DIR}/task_context.md --depth comprehensive"`
|
|
236
|
+
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_plan"`, `args: "{OUT_DIR}/task_context.md --depth comprehensive --no-review"`
|
|
228
237
|
- **Wait** — Returns full plan (all sections: Architecture, Phases, API Design, Testing Strategy, etc.)
|
|
229
|
-
- **Action** — PromptUser: "Review plan. Reply 'Approved' or provide feedback."
|
|
230
|
-
- **Wait** — User approval
|
|
231
238
|
- **INVOKE NOW** → Skill tool with `skill: "spectre-create_tasks"`, `args: "{OUT_DIR}/task_context.md"`
|
|
232
239
|
- **Wait** — Returns task breakdown
|
|
240
|
+
- **INVOKE NOW** → Skill tool with `skill: "spectre-plan_review"`, `args: "{OUT_DIR} --auto-apply scope-safe"`
|
|
241
|
+
- **Wait** — Returns findings, applied edits, skipped scope-changing recommendations, and updated artifacts
|
|
242
|
+
- **Action** — IntegratePlanReviewFeedback: Read the plan_review report path returned by `plan_review`. Confirm every scope-safe Blocker/High finding is reflected in `plan.md` and/or `tasks.md`. If `plan_review` produced a scope-safe suggested edit but did not apply it because it needed minor adaptation, apply the smallest artifact edit now and record it in the final summary. Do not apply Scope Change Required findings.
|
|
243
|
+
- Continue to Final Gate
|
|
233
244
|
|
|
234
245
|
---
|
|
235
246
|
|
|
@@ -253,4 +264,19 @@ Only proceed past this checkpoint when the user confirms.
|
|
|
253
264
|
|
|
254
265
|
---
|
|
255
266
|
|
|
267
|
+
### Final Gate
|
|
268
|
+
|
|
269
|
+
- **Action** — PresentFinalArtifacts:
|
|
270
|
+
- Summarize final artifact paths: `{OUT_DIR}/specs/plan.md`, `{OUT_DIR}/specs/tasks.md`, and the saved plan_review report under `{OUT_DIR}/reviews/`.
|
|
271
|
+
- Summarize review integration: findings applied by `plan_review`, any additional plan-orchestrator edits applied to integrate feedback, skipped edits, and any recommendations that were blocked because they would change canonical scope.
|
|
272
|
+
- If plan_review surfaced a scope-changing recommendation, state: "This requires a scope change; I did not apply it." Ask the user whether to reopen scope or approve the current canonical-scope-preserving plan/tasks.
|
|
273
|
+
- Otherwise prompt: "Final reviewed plan/tasks are ready. Reply `Approved` to proceed to execution, or provide final feedback."
|
|
274
|
+
|
|
275
|
+
- **Wait** — User final approval or feedback.
|
|
276
|
+
|
|
277
|
+
- **If feedback preserves canonical scope** — apply the smallest edits to `plan.md`/`tasks.md`, re-run `plan_review {OUT_DIR} --auto-apply scope-safe` if the feedback changes implementation approach, verification, dependencies, task sequencing, or references, then present the Final Gate again.
|
|
278
|
+
- **If feedback changes canonical scope** — stop and route back to `scope` (or explicitly update the canonical scope artifact if the user directs it). Do not silently update plan/tasks against stale scope.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
256
282
|
- **Action** — RenderFooter: Use `Skill(spectre-guide)` skill for Next Steps
|
|
@@ -16,8 +16,15 @@ Treat the current command arguments as this workflow's input. When invoked from
|
|
|
16
16
|
|
|
17
17
|
- **What** — Independent review of any available planning artifacts (`plan.md`, `tasks.md`, and optional `task_context.md`) from four specialized lenses, dispatched in parallel
|
|
18
18
|
- **Outcome** — Structured findings with concrete edit suggestions; optional write-back to update the available artifacts
|
|
19
|
+
- **Artifact** — Always save a Markdown review report before any write-back so pre-integration findings are auditable
|
|
19
20
|
- **Role** — Senior staff engineer + reviewer panel; bias toward pragmatic problem-solving, YAGNI enforcement, and verifiability
|
|
20
21
|
|
|
22
|
+
## Canonical Scope Invariant
|
|
23
|
+
|
|
24
|
+
`concepts/scope.md` is canonical when present. If absent, use `specs/prd.md`, `specs/ux.md`, and explicit requirements in `task_context.md` as the scope source, in that order.
|
|
25
|
+
|
|
26
|
+
Reviewers may recommend deleting unrequested implementation details, unnecessary abstractions, weak verification, hallucinated references, bad dependencies, or task sequencing problems. They MUST NOT cut, narrow, expand, or reinterpret agreed scope. If a reviewer believes the agreed scope itself is too large, internally inconsistent, or missing a requirement, phrase that as a **Scope Change Required** recommendation for the user. Do not apply it to `plan.md` or `tasks.md` during write-back.
|
|
27
|
+
|
|
21
28
|
## ARGUMENTS Input
|
|
22
29
|
|
|
23
30
|
<ARGUMENTS>
|
|
@@ -46,12 +53,15 @@ A single reviewer biases toward the issues it notices first. Published practice
|
|
|
46
53
|
- `PLAN=${TASK_DIR}/specs/plan.md` (or scoped name)
|
|
47
54
|
- `TASKS=${TASK_DIR}/specs/tasks.md` (or scoped name)
|
|
48
55
|
- `CONTEXT=${TASK_DIR}/task_context.md`
|
|
56
|
+
- `SCOPE=${TASK_DIR}/concepts/scope.md` when present; otherwise use `specs/prd.md` / `specs/ux.md` as available
|
|
57
|
+
- `REVIEWS_DIR=${TASK_DIR}/reviews`
|
|
58
|
+
- `REVIEW_REPORT=${REVIEWS_DIR}/plan_review.md`; if that exists, use `plan_review_{YYYY-MM-DD_HHMMSS}.md` to avoid overwriting prior review evidence.
|
|
49
59
|
- `plan.md` and `tasks.md` are independently reviewable. It is valid to review only `plan.md`, only `tasks.md`, or both.
|
|
50
60
|
- `task_context.md` is helpful context but is not required. If it is missing, continue and note that requirements traceability is limited.
|
|
51
61
|
- If both `plan.md` and `tasks.md` are missing, stop and suggest the user run `plan` or `create_tasks` first.
|
|
52
62
|
- If exactly one of `plan.md` or `tasks.md` is missing, list it as absent context and continue. Do not decline, stop, or ask the user to create the missing artifact.
|
|
53
63
|
|
|
54
|
-
- **Action** — ReadAvailable: Read each available file completely into context before dispatching reviewers. Reviewers receive curated excerpts plus an artifact manifest that says which files are present and absent. Every reviewer must review the artifacts that exist and must not treat absent artifacts as a blocker.
|
|
64
|
+
- **Action** — ReadAvailable: Read each available file completely into context before dispatching reviewers. Reviewers receive curated excerpts plus an artifact manifest that says which files are present and absent. Every reviewer must review the artifacts that exist and must not treat absent artifacts as a blocker. The manifest must label the canonical scope source and state that review findings may not remove or narrow scope.
|
|
55
65
|
|
|
56
66
|
## Step 2 — Dispatch Four Parallel Reviewers
|
|
57
67
|
|
|
@@ -64,13 +74,15 @@ Missing-artifact rule for every lens: review what exists. If a finding depends o
|
|
|
64
74
|
> Review the available plan and/or task list for unrequested complexity. Agents have a documented "familiar-shape bias": shown a feature, they reproduce the mature-system shape from their training data (auth → adds rate-limiting; CRUD → adds soft-delete; form → adds optimistic UI; service → adds telemetry; module → adds feature flags). Your job is to find that bias here.
|
|
65
75
|
>
|
|
66
76
|
> Find:
|
|
67
|
-
> 1. When `plan.md` is present: anything in Technical Approach that isn't traceable to a requirement in available context (`task_context.md` /
|
|
77
|
+
> 1. When `plan.md` is present: anything in Technical Approach that isn't traceable to a requirement in available context (`scope.md` / `task_context.md` / PRD / UX). If context is absent, use the plan's own requirements and boundaries.
|
|
68
78
|
> 2. When `tasks.md` is present: tasks that implement something the available requirements don't ask for. If requirements context is absent, use the task list's stated goals and boundaries.
|
|
69
79
|
> 3. Abstractions, interfaces, or layers introduced for a single concrete caller.
|
|
70
80
|
> 4. Generality (config files, plugin points, factories) where the actual need is one specific behavior.
|
|
71
81
|
> 5. Overlap with the `Out-of-Bounds — DO NOT add` list (if anything violates that list, it's a hard fail).
|
|
72
82
|
>
|
|
73
|
-
>
|
|
83
|
+
> Scope guard: you may nominate implementation detail to delete only when it is not required by canonical scope. Do not nominate an agreed requirement, user-approved behavior, or required task as the thing to delete. If the best "cut" would change canonical scope, label it **Scope Change Required** and do not include it as an auto-applicable deletion.
|
|
84
|
+
>
|
|
85
|
+
> Required output: nominate the SINGLE highest-leverage implementation detail to delete and justify it. You must pick one unless every possible deletion would change canonical scope; in that case, say "No scope-safe deletion found" and provide the nearest Scope Change Required recommendation separately. Then list other simplifications ranked by impact. For each finding, cite the exact file:line or section header it lives in.
|
|
74
86
|
|
|
75
87
|
### Lens 2 — Verifiability (`@analyst`)
|
|
76
88
|
|
|
@@ -118,6 +130,7 @@ Missing-artifact rule for every lens: review what exists. If a finding depends o
|
|
|
118
130
|
- **High** — meaningfully reduces output quality (missing RED test, weak canonical reference, prose criterion)
|
|
119
131
|
- **Medium** — overengineering or reuse miss without functional blast radius
|
|
120
132
|
- **Low** — stylistic or nice-to-have
|
|
133
|
+
- **Scope Change Required** — may be valid feedback, but would cut, expand, or reinterpret canonical scope and therefore needs explicit user approval before any artifact edit
|
|
121
134
|
|
|
122
135
|
- **Action** — RenderFindingsTable: Output a single structured table. Schema is fixed.
|
|
123
136
|
|
|
@@ -143,11 +156,24 @@ Missing-artifact rule for every lens: review what exists. If a finding depends o
|
|
|
143
156
|
- Low: {N}
|
|
144
157
|
```
|
|
145
158
|
|
|
159
|
+
- **Action** — SaveReviewArtifact: Before applying any edits to `plan.md` or `tasks.md`, save the pre-integration review findings as a Markdown report.
|
|
160
|
+
- Create `${REVIEWS_DIR}` if missing.
|
|
161
|
+
- Write `${REVIEW_REPORT}` using the RenderFindingsTable content plus:
|
|
162
|
+
- Reviewed artifacts: exact plan/tasks/context/scope paths present and absent.
|
|
163
|
+
- Canonical scope source used.
|
|
164
|
+
- Auto-apply mode: enabled/disabled.
|
|
165
|
+
- Timestamp.
|
|
166
|
+
- Explicit note: "This report captures plan_review findings before any write-back to plan.md or tasks.md."
|
|
167
|
+
- Do not overwrite an existing report. Use the timestamped filename if the default already exists.
|
|
168
|
+
- Include the saved report path in all subsequent summaries and in `ReportApplied`.
|
|
169
|
+
|
|
146
170
|
## Step 4 — Surface Findings & Apply Edits
|
|
147
171
|
|
|
148
|
-
- **Action** — PresentFindings: Render the findings table inline
|
|
172
|
+
- **Action** — PresentFindings: Render the findings table inline and include `Review report saved: {REVIEW_REPORT}`.
|
|
173
|
+
|
|
174
|
+
- **Action** — DetectAutoApplyMode: If ARGUMENTS contains `--auto-apply scope-safe`, skip the user selection prompt and apply all scope-safe Blocker and High findings, plus Medium/Low findings only when the Suggested Edit is unambiguous and cannot change canonical scope. Do not apply findings marked Scope Change Required. Continue to ApplyEdits and SelfCheck, then return the applied/skipped summary to the invoking workflow.
|
|
149
175
|
|
|
150
|
-
- **Action** — OfferWriteBack:
|
|
176
|
+
- **Action** — OfferWriteBack: Unless `--auto-apply scope-safe` is present, after the table prompt:
|
|
151
177
|
|
|
152
178
|
> Reply with which findings to apply:
|
|
153
179
|
> - `all` — apply every suggested edit
|
|
@@ -163,17 +189,21 @@ Missing-artifact rule for every lens: review what exists. If a finding depends o
|
|
|
163
189
|
- Open the named artifact (`plan.md` or `tasks.md`)
|
|
164
190
|
- Apply the Suggested Edit verbatim where possible; if the edit needs adaptation, make the minimum change consistent with the finding's intent
|
|
165
191
|
- Track which findings were applied
|
|
192
|
+
- Before writing, confirm the edit preserves every requirement and boundary in the canonical scope source. If it would remove, narrow, expand, or reinterpret scope, skip it and record it as "skipped: requires scope change."
|
|
166
193
|
|
|
167
194
|
- **Action** — SelfCheck: After edits, run a fast pass over the modified sections:
|
|
168
195
|
- Re-verify any file:line refs touched
|
|
169
196
|
- Re-verify acceptance criteria are still executable
|
|
170
197
|
- Confirm no edit introduced a new Out-of-Bounds violation
|
|
198
|
+
- Confirm canonical scope is still fully represented by the resulting plan/tasks
|
|
171
199
|
- If any check fails, surface it and ask the user before continuing
|
|
172
200
|
|
|
173
201
|
- **Action** — ReportApplied:
|
|
174
202
|
|
|
175
203
|
> Applied: {list of finding numbers}. Skipped: {list}.
|
|
204
|
+
> Review report: {REVIEW_REPORT}.
|
|
176
205
|
> {Path to updated artifact(s)}.
|
|
206
|
+
> Scope-change recommendations not applied: {list or "none"}.
|
|
177
207
|
|
|
178
208
|
## Step 5 — Next Steps
|
|
179
209
|
|