@codename_inc/spectre 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +411 -0
  3. package/bin/spectre.js +8 -0
  4. package/package.json +23 -0
  5. package/plugins/spectre/.claude-plugin/plugin.json +5 -0
  6. package/plugins/spectre/agents/analyst.md +122 -0
  7. package/plugins/spectre/agents/dev.md +70 -0
  8. package/plugins/spectre/agents/finder.md +105 -0
  9. package/plugins/spectre/agents/patterns.md +207 -0
  10. package/plugins/spectre/agents/reviewer.md +128 -0
  11. package/plugins/spectre/agents/sync.md +151 -0
  12. package/plugins/spectre/agents/tester.md +209 -0
  13. package/plugins/spectre/agents/web-research.md +109 -0
  14. package/plugins/spectre/commands/architecture_review.md +120 -0
  15. package/plugins/spectre/commands/clean.md +313 -0
  16. package/plugins/spectre/commands/code_review.md +408 -0
  17. package/plugins/spectre/commands/create_plan.md +117 -0
  18. package/plugins/spectre/commands/create_tasks.md +374 -0
  19. package/plugins/spectre/commands/create_test_guide.md +120 -0
  20. package/plugins/spectre/commands/evaluate.md +50 -0
  21. package/plugins/spectre/commands/execute.md +87 -0
  22. package/plugins/spectre/commands/fix.md +61 -0
  23. package/plugins/spectre/commands/forget.md +58 -0
  24. package/plugins/spectre/commands/handoff.md +161 -0
  25. package/plugins/spectre/commands/kickoff.md +115 -0
  26. package/plugins/spectre/commands/learn.md +15 -0
  27. package/plugins/spectre/commands/plan.md +170 -0
  28. package/plugins/spectre/commands/plan_review.md +33 -0
  29. package/plugins/spectre/commands/quick_dev.md +101 -0
  30. package/plugins/spectre/commands/rebase.md +73 -0
  31. package/plugins/spectre/commands/recall.md +5 -0
  32. package/plugins/spectre/commands/research.md +159 -0
  33. package/plugins/spectre/commands/scope.md +119 -0
  34. package/plugins/spectre/commands/ship.md +172 -0
  35. package/plugins/spectre/commands/sweep.md +82 -0
  36. package/plugins/spectre/commands/test.md +380 -0
  37. package/plugins/spectre/commands/ux_spec.md +91 -0
  38. package/plugins/spectre/commands/validate.md +343 -0
  39. package/plugins/spectre/hooks/hooks.json +34 -0
  40. package/plugins/spectre/hooks/scripts/bootstrap.cjs +99 -0
  41. package/plugins/spectre/hooks/scripts/handoff-resume.cjs +410 -0
  42. package/plugins/spectre/hooks/scripts/lib.cjs +83 -0
  43. package/plugins/spectre/hooks/scripts/load-knowledge.cjs +120 -0
  44. package/plugins/spectre/hooks/scripts/precompact-warning.cjs +19 -0
  45. package/plugins/spectre/hooks/scripts/register_learning.cjs +144 -0
  46. package/plugins/spectre/hooks/scripts/test_bootstrap.cjs +84 -0
  47. package/plugins/spectre/hooks/scripts/test_handoff-resume.cjs +858 -0
  48. package/plugins/spectre/hooks/scripts/test_load-knowledge.cjs +285 -0
  49. package/plugins/spectre/hooks/scripts/test_register-learning.cjs +146 -0
  50. package/plugins/spectre/skills/spectre-apply/SKILL.md +189 -0
  51. package/plugins/spectre/skills/spectre-guide/SKILL.md +358 -0
  52. package/plugins/spectre/skills/spectre-learn/SKILL.md +635 -0
  53. package/plugins/spectre/skills/spectre-learn/references/recall-template.md +31 -0
  54. package/plugins/spectre/skills/spectre-tdd/SKILL.md +111 -0
  55. package/src/config.test.js +134 -0
  56. package/src/install.test.js +273 -0
  57. package/src/lib/config.js +516 -0
  58. package/src/lib/constants.js +60 -0
  59. package/src/lib/doctor.js +168 -0
  60. package/src/lib/install.js +482 -0
  61. package/src/lib/knowledge.js +217 -0
  62. package/src/lib/paths.js +98 -0
  63. package/src/lib/project.js +473 -0
  64. package/src/main.js +150 -0
@@ -0,0 +1,374 @@
1
+ ---
2
+ description: 👻 | Transform requirements into executable tasks - primary agent
3
+ ---
4
+
5
+ # create_tasks: Unified Task Breakdown
6
+
7
+ ## Description
8
+ - Transform requirements into detailed, actionable task lists with dependency analysis and execution options.
9
+ - Adapts to available context: uses existing research when sufficient, conducts research when needed.
10
+ - Outputs both sequential and parallel execution strategies.
11
+ - Scales naturally: generates as many phases and tasks as the scope requires.
12
+
13
+ ## ARGUMENTS Input
14
+
15
+ <ARGUMENTS>
16
+ $ARGUMENTS
17
+ </ARGUMENTS>
18
+
19
+ ---
20
+
21
+ ## Step 1 - Establish Context
22
+
23
+ ### 1a. Determine Output Location
24
+ - `branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)`
25
+ - **If** user specifies path → `TASK_DIR={that value}`
26
+ - **Else** → `TASK_DIR=docs/tasks/{branch_name}`
27
+ - Ensure dirs exist: `mkdir -p "${TASK_DIR}/specs" "${TASK_DIR}/research" "${TASK_DIR}/clarifications"`
28
+
29
+ ### 1b. Scan Available Artifacts
30
+ Inventory what exists in `TASK_DIR/`:
31
+ - [ ] `task_summary.md` — scope/objectives
32
+ - [ ] `prd.md` — detailed requirements
33
+ - [ ] `ux.md` — user experience specs
34
+ - [ ] `plan.md` — technical approach
35
+ - [ ] `task_context.md` — technical research
36
+ - [ ] `research/*.md` — analysis docs
37
+
38
+ Also note: thread context, user-provided docs, ARGUMENTS content.
39
+
40
+ ### 1c. Assess Complexity
41
+ **Simple task** (research likely unnecessary):
42
+ - Single file/component change
43
+ - Clear pattern already exists in codebase
44
+ - Scope explicitly stated, no ambiguity
45
+
46
+ **Complex task** (research likely needed):
47
+ - Multi-component or cross-cutting
48
+ - New patterns or integrations
49
+ - Unclear technical approach
50
+
51
+ ---
52
+
53
+ ## Step 2 - Research Decision
54
+
55
+ ### 2a. Do We NEED Research?
56
+ Based on complexity assessment from 1c:
57
+ - **If** simple task with clear scope → `NEED_RESEARCH=false`
58
+ - **If** complex task or unclear approach → `NEED_RESEARCH=true`
59
+
60
+ ### 2b. Do We HAVE Research? (if NEED_RESEARCH=true)
61
+ Assess existing artifacts with judgment:
62
+
63
+ | Artifact | Check For |
64
+ |----------|-----------|
65
+ | `task_context.md` | "## Technical Research" section with relevant analysis |
66
+ | `research/*.md` | Docs covering codebase patterns, integration points |
67
+ | `plan.md` | Technical approach, file locations, architecture decisions |
68
+
69
+ **Judgment call**: Do existing artifacts sufficiently cover:
70
+ - Codebase patterns relevant to this scope?
71
+ - Integration points and dependencies?
72
+ - Technical approach and target files?
73
+
74
+ - **If** sufficient coverage → `HAVE_RESEARCH=true`
75
+ - **If** gaps exist → `HAVE_RESEARCH=false` (note specific gaps)
76
+
77
+ ### 2c. Action
78
+ - **If** `NEED_RESEARCH=false` → proceed to Step 3
79
+ - **If** `NEED_RESEARCH=true` AND `HAVE_RESEARCH=true` → read existing, proceed to Step 3
80
+ - **If** `NEED_RESEARCH=true` AND `HAVE_RESEARCH=false` → conduct research (Step 2d)
81
+
82
+ ### 2d. Conduct Research (conditional)
83
+ - Spawn parallel agents: @codebase-locator, @codebase-analyzer, @codebase-pattern-finder
84
+ - Review: `CLAUDE.md`, `README.md`, architecture docs
85
+ - Identify: patterns, integration points, technical constraints
86
+ - Save to `${TASK_DIR}/task_context.md` under "## Technical Research"
87
+
88
+ ---
89
+
90
+ ## Step 3 - Extract Requirements
91
+
92
+ ### 3a. Gather From All Sources
93
+ Read completely (no limits):
94
+ - Planning docs: `task_summary.md`, `prd.md`, `plan.md`, `ux.md`
95
+ - Thread context: discussed requirements, user goals
96
+ - ARGUMENTS: any provided scope
97
+
98
+ ### 3b. Synthesize Requirements
99
+ - Extract: what must be built, who uses it, success criteria
100
+ - Extract: out of scope, constraints, boundaries
101
+ - Number each: REQ-001, REQ-002, etc.
102
+ - Categorize: Core functionality, UX, Technical constraints
103
+
104
+ ### 3c. Requirements Boundary Check
105
+ - [ ] Clear on what IS explicitly requested?
106
+ - [ ] Clear on what is NOT mentioned (exclude)?
107
+ - [ ] **Scope Litmus Test**: Would user recognize this as exactly what they asked?
108
+
109
+ **STRICT COMPLIANCE**: Tasks deliver ONLY what's explicitly stated. No performance optimizations, extra features, future-proofing, or "best practices" unless requested.
110
+
111
+ ---
112
+
113
+ ## Step 4 - Generate Tasks
114
+
115
+ ### 4a. Synthesize Architecture Context
116
+ - **Action** — SynthesizeArchitectureContext: Based on research findings, document where this work fits and how we'll approach it.
117
+ - **Where This Fits**: Which system/component this extends, how it connects to existing architecture (with file references)
118
+ - **Technical Approach**: Key pattern we're following, why this approach vs alternatives, what existing code we're leveraging
119
+ - **Key Decisions**: Important technical decisions made and their rationale
120
+ - This section helps the user understand how the work integrates with the product before diving into tasks
121
+
122
+ ### Task Hierarchy (4 Levels)
123
+ - **📦 Phase**: Organizational header (no checkbox) — groups related parent tasks
124
+ - **📋 Parent Task**: Cohesive deliverable (small-medium scope) — one component/file
125
+ - **✓ Sub-task**: Atomic work (single focused change) — single action, 2-3 acceptance criteria
126
+ - **✓ Acceptance Criteria**: Verifiable outcomes (not implementation steps)
127
+
128
+ **Numbering**: Phase 1 → Parent 1.1, 1.2 → Sub-tasks 1.1.1, 1.1.2 → Criteria ✓
129
+
130
+ ### Integration-Aware Task Principle
131
+
132
+ > **"A feature isn't done when pieces exist. It's done when data flows from user action to rendered pixels."**
133
+
134
+ Every task that creates something must specify:
135
+ 1. **What it produces** — exact output (variable, return value, prop, event)
136
+ 2. **What consumes it** — exact consumer (component, hook, handler) that uses the output
137
+ 3. **What it replaces** — old code path being deprecated (if any)
138
+
139
+ Tasks without consumers are incomplete. Tasks that don't address old code paths leave dead/duplicate logic.
140
+
141
+ **Task Types**:
142
+ - **Build tasks**: Create a component/hook/utility/function
143
+ - **Integration tasks**: Wire producer output to consumer input (MANDATORY for every build task)
144
+ - **Cleanup tasks**: Remove/redirect old code paths (MANDATORY when replacing patterns)
145
+
146
+ ### 4b. Create Parent Tasks
147
+ - **Action** — CreateParentTasks: Draft as many phases as needed to logically organize work, each with as many parent tasks (📋) as required to cover complete scope.
148
+ - Each parent task = single cohesive deliverable (small-medium scope)
149
+ - Cover ALL extracted requirements with no gaps
150
+ - Group related work into phases for clarity
151
+ - Align with technical approach (from research or existing docs)
152
+
153
+ ### 4c. Break Down Sub-tasks
154
+ - **Action** — BreakdownSubTasks: For each parent, generate as many detailed sub-tasks as needed to complete the parent.
155
+ - **Sub-task structure**:
156
+ - Start with action verb (Create, Implement, Add, Update, Configure, Enable)
157
+ - Use technical language freely (components, endpoints, middleware, hooks, schemas)
158
+ - Specify technical patterns and architecture decisions
159
+ - Name specific files, components, or modules when helpful
160
+ - Describe technical behavior and integration points
161
+ - Be specific enough for junior dev to know where to start
162
+ - Completable as a single focused change
163
+
164
+ - **What to INCLUDE in sub-tasks:**
165
+ - ✅ Technical terms (JWT, REST, WebSocket, React hooks, SQL queries)
166
+ - ✅ Architecture patterns (middleware, pub/sub, observer, factory)
167
+ - ✅ Integration points (which components connect, API contracts)
168
+ - ✅ File/component names (UserProfileComponent, authMiddleware.ts)
169
+ - ✅ Technical constraints (max file size, timeout duration, data format)
170
+ - ✅ **Produces**: What output this creates (variable name, return value, prop)
171
+ - ✅ **Consumed by**: What uses this output (component, hook, render path)
172
+ - ✅ **Replaces**: What old code path this supersedes (if any)
173
+
174
+ - **What to AVOID in sub-tasks:**
175
+ - ❌ Code snippets or pseudo-code
176
+ - ❌ Exact function signatures or variable names
177
+ - ❌ Line-by-line implementation steps
178
+ - ❌ Specific library API calls (unless architecturally significant)
179
+
180
+ - **Acceptance criteria**:
181
+ - Describe technical behaviors and observable outcomes
182
+ - Include integration expectations and error handling
183
+ - 2-3 verifiable outcomes per sub-task
184
+ - Be specific about technical requirements
185
+
186
+ - **Decomposition**: Split if 5+ criteria or multiple concerns
187
+
188
+ ### 4d. Validate Task Structure
189
+ - **Action** — VerifyCoverage: Cross-reference tasks against extracted requirements.
190
+ - Map each requirement from Step 3 to at least one task
191
+ - Flag any uncovered requirements → add missing tasks
192
+ - Flag any tasks without requirement justification → remove or justify
193
+
194
+ - **Action** — ValidateTasks: Validate complete task structure.
195
+ - **Coverage Validation**:
196
+ - [ ] All extracted requirements from Step 3 addressed by tasks?
197
+ - [ ] No gaps in requirement coverage?
198
+ - **Exclusion Validation**:
199
+ - [ ] Adding anything beyond explicit requests?
200
+ - [ ] Avoiding "nice-to-have" additions not requested?
201
+ - **Structure Validation**:
202
+ - [ ] Parent tasks are small-medium scope, sub-tasks are atomic?
203
+ - [ ] Each sub-task has 2-3 acceptance criteria?
204
+ - [ ] Acceptance criteria verifiable (not implementation steps)?
205
+
206
+ - **Action** — ValidateIntegration: Verify every build task is wired to consumers.
207
+ - **Consumer Specified**:
208
+ - [ ] Does every "create X" task specify what consumes X?
209
+ - [ ] No orphaned computations (values produced but never used)?
210
+ - **Integration Explicit**:
211
+ - [ ] Is there a task for wiring producer output → consumer input?
212
+ - [ ] For UI features: is there a task verifying data reaches the render path?
213
+ - **Old Paths Addressed**:
214
+ - [ ] If replacing old code, is removal/redirect a task?
215
+ - [ ] No duplicate data sources for the same concern?
216
+ - **Last Mile Covered**:
217
+ - [ ] For every feature affecting what users SEE: task exists to wire to JSX render?
218
+
219
+ ---
220
+
221
+ ## Step 5 - Dependency Analysis & Execution Strategies
222
+
223
+ ### 5a. Map Dependencies
224
+ - Review parent tasks (📋 level) for dependencies
225
+ - Identify which parent tasks can be completed in parallel vs sequential
226
+ - Dependency rules:
227
+ - Parent tasks requiring output from other parents must be sequenced
228
+ - Tasks modifying same files need sequencing or coordination
229
+ - Testing tasks run after implementation tasks
230
+ - Setup/configuration tasks complete before dependent work
231
+
232
+ ### 5b. Generate Sequential Execution Order
233
+ Define step-by-step execution order based on dependencies:
234
+ ```markdown
235
+ ## Sequential Execution
236
+ 1. 1.1 - [Name] (no dependencies)
237
+ 2. 1.2 - [Name] (depends on 1.1)
238
+ 3. 2.1 - [Name] (depends on 1.1)
239
+ 4. 2.2 - [Name] (depends on 1.2, 2.1)
240
+ ...
241
+ ```
242
+
243
+ ### 5c. Generate Parallel Execution Waves
244
+ Group independent parent tasks into waves for parallel execution:
245
+ ```markdown
246
+ ## Parallel Execution
247
+
248
+ ### Wave 1 (concurrent)
249
+ - 1.1, 2.1 — no dependencies, can start immediately
250
+ - Rationale: {why these can run concurrently}
251
+
252
+ ### Wave 2 (after Wave 1)
253
+ - 1.2, 2.2 — depend on Wave 1 outputs
254
+ - Rationale: {why these depend on Wave 1}
255
+
256
+ ### Wave 3 (after Wave 2)
257
+ - 3.1 — integration, needs prior waves complete
258
+ - Rationale: {why this needs prior waves}
259
+ ```
260
+
261
+ **Note**: Phases (📦) are organizational; execution planning happens at parent task (📋) level.
262
+
263
+ ---
264
+
265
+ ## Step 6 - Document & Output
266
+
267
+ ### 6a. Write tasks.md
268
+ - Determine `TASKS_FILE` (default `${TASK_DIR}/specs/tasks.md`; if it already exists, create a scoped name like `${TASK_DIR}/specs/{task_name}_tasks.md` or `tasks_{timestamp}.md` to avoid overwriting).
269
+ Save to `${TASKS_FILE}`:
270
+
271
+ ```markdown
272
+ # Tasks — {feature name}
273
+ *Generated by create_tasks on {timestamp}*
274
+
275
+ ## Objective
276
+ {single sentence describing outcome}
277
+
278
+ ## Scope
279
+ - **In Scope**: {bullet list}
280
+ - **Out of Scope**: {bullet list}
281
+
282
+ ## Requirements Traced
283
+ | ID | Description | Source | Tasks |
284
+ |----|-------------|--------|-------|
285
+ | REQ-001 | ... | prd.md | 1.1, 1.2 |
286
+ | REQ-002 | ... | task_summary.md | 2.1 |
287
+
288
+ ---
289
+
290
+ ## Architecture Context
291
+
292
+ ### Where This Fits
293
+ - {Which system/component this work extends or modifies}
294
+ - {How it connects to existing architecture — with file references}
295
+
296
+ ### Technical Approach
297
+ - {Key pattern/approach we're following — reference existing code if applicable}
298
+ - {Why this approach vs alternatives}
299
+ - {What existing code we're leveraging}
300
+
301
+ ### Key Decisions
302
+ - {Decision 1 and rationale}
303
+ - {Decision 2 and rationale}
304
+
305
+ ---
306
+
307
+ ## Tasks
308
+
309
+ ### Phase 1: {Phase Name}
310
+
311
+ #### [1.1] {Parent Task Title}
312
+ - [ ] **1.1.1** {Sub-task with technical specifics}
313
+ - **Produces**: {output variable/value/prop}
314
+ - **Consumed by**: {component/hook that uses this}
315
+ - **Replaces**: {old code path, or "N/A" if new}
316
+ - [ ] {Technical outcome 1}
317
+ - [ ] {Technical outcome 2}
318
+ - [ ] {Technical outcome 3}
319
+
320
+ - [ ] **1.1.2** {Sub-task with technical specifics}
321
+ - **Produces**: {output variable/value/prop}
322
+ - **Consumed by**: {component/hook that uses this}
323
+ - [ ] {Technical outcome 1}
324
+ - [ ] {Technical outcome 2}
325
+
326
+ #### [1.2] {Parent Task Title} — Integration
327
+ *This task wires outputs from 1.1 to consumers*
328
+ - [ ] **1.2.1** {Wire X to Y}
329
+ - **Wires**: {1.1.1 output} → {consumer component/render}
330
+ - **Removes**: {old code path being replaced}
331
+ - [ ] {Consumer uses new data source}
332
+ - [ ] {Old data source removed/redirected}
333
+
334
+ ### Phase 2: {Phase Name}
335
+ ...
336
+
337
+ ---
338
+
339
+ ## Execution Strategies
340
+
341
+ ### Sequential Execution
342
+ 1. Task 1.1 - [Name] (no dependencies)
343
+ 2. Task 1.2 - [Name] (depends on 1.1)
344
+ 3. Task 2.1 - [Name] (depends on 1.1)
345
+ ...
346
+
347
+ ### Parallel Execution
348
+
349
+ **Wave 1 (concurrent)**: 1.1, 2.1
350
+ - Rationale: {why concurrent}
351
+
352
+ **Wave 2 (after Wave 1)**: 1.2, 2.2
353
+ - Rationale: {why sequenced}
354
+
355
+ **Wave 3 (after Wave 2)**: 3.1
356
+ - Rationale: {why sequenced}
357
+
358
+ ---
359
+
360
+ ## Coverage Summary
361
+ - Total Requirements Extracted: [X]
362
+ - Requirements with Task Coverage: [X] (100%)
363
+ - Phases: [N]
364
+ - Parent Tasks: [Y]
365
+ - Sub-tasks: [Z]
366
+ ```
367
+
368
+ ### 6b. Present Summary
369
+
370
+ - **Action** — SummarizeStructure: "Task Breakdown Complete. Structure: {X} phases, {Y} parents, {Z} sub-tasks. \[List phases with parent titles\]. Execution: Sequential ({N} steps) | Parallel ({M} waves). Saved to: {path}"
371
+
372
+ ### 6c. Next Steps Footer
373
+
374
+ Action — RenderFooter: Use @skill-spectre:spectre-guide skill for Next Steps footer
@@ -0,0 +1,120 @@
1
+ ---
2
+ description: 👻 | Generate right-sized manual test guides - primary agent
3
+ ---
4
+
5
+ # create_test_guide: Right-sized manual testing documentation
6
+
7
+ ### Description
8
+ - Description — Generate appropriately scoped manual testing guides that validate completed work, highlight key risks, and keep quality efforts aligned with tas scope. Scale complexity to match change size.
9
+ - Desired Outcome — Feature-based testing guide with actionable checklists organized by user workflows, saved to `docs/tasks/{task_name}/testing/{task_name}_test_guide.md`.
10
+
11
+ ## ARGUMENTS Input
12
+
13
+ Optional user input to seed this workflow.
14
+
15
+ <ARGUMENTS>
16
+ $ARGUMENTS
17
+ </ARGUMENTS>
18
+
19
+ ## Step (1/3) - Analyze Context & Determine Testing Strategy
20
+
21
+ - **Action** — AssessScope: Analyze current task to understand changes and determine complexity.
22
+ - Extract from task documentation: features/functionality added/modified/removed, technical stack/environment, user personas/use cases, integration points/dependencies
23
+ - Process ARGUMENTS for specific focus areas (if provided)
24
+ - **Change Complexity Assessment**:
25
+ - **Simple**: Basic smoke tests, happy path validation, quick regression check of related features
26
+ - **Medium**: Edge case testing, error handling validation, basic integration testing
27
+ - **Complex**: Advanced user scenarios, performance considerations, cross-feature interactions, security implications
28
+ - **Action** — DetermineStrategy: Select required and optional sections based on complexity.
29
+ - **Required Sections (Always)**:
30
+ - Testing Overview (scope, environment, prerequisites)
31
+ - Environment Setup (step-by-step setup and verification)
32
+ - Core Test Cases (primary functionality validation)
33
+ - Results Documentation (how to record and report findings)
34
+ - **Optional Sections (Include Based on Relevance)**:
35
+ - Known Issues & Limitations (if documented bugs/workarounds)
36
+ - Rollback Procedures (high-risk changes/production deployments)
37
+ - Performance Testing (changes affecting load times/resource usage)
38
+ - Accessibility Testing (UI/UX changes)
39
+ - Cross-Browser/Device Testing (frontend changes)
40
+ - Data Validation Testing (changes affecting data handling)
41
+ - Security Testing (authentication/permissions/data access changes)
42
+
43
+ ## Step (2/3) - Generate Test Guide
44
+
45
+ - **Output Location** — DetermineOutputDir: Decide where to save artifacts for this workflow.
46
+ - `branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)`
47
+ - **If** user specifies `target_dir/path` → `OUT_DIR={that value}`
48
+ - **Else** → `OUT_DIR=docs/tasks/{branch_name}`
49
+ - `mkdir -p "OUT_DIR/testing"`
50
+ - **Action** — CreateGuide: Generate comprehensive testing guide with feature-based organization.
51
+ - Save to `{OUT_DIR}/testing/{branch_name}_test_guide.md`
52
+ - **Guiding Principles**:
53
+ - Scale appropriately (CSS color change ≠ payment system)
54
+ - Focus on risk (prioritize areas most likely to break or impact users)
55
+ - Be practical (completable in reasonable timeframe)
56
+ - Stay relevant (only include sections that add value)
57
+ - **Primary Structure**: Organize by user workflows/features (not procedural sections)
58
+ - **Feature-Based Format**:
59
+ ```markdown
60
+ ### 1. Feature Name (User Action/Context)
61
+ - [ ] Step 1: Action to perform
62
+ - [ ] Step 2: What to verify/expect
63
+ - [ ] Step 3: Additional validation
64
+ - [ ] Step 4: Edge case or error handling
65
+ ```
66
+ - **Content Standards**:
67
+ - **Complete Scenarios**: Structure around complete scenarios (user workflows or technical capabilities); each section validates specific capability end-to-end
68
+ - **Actionable Steps**: Each checkbox = complete action + verification pair (e.g., "Send POST to /api/users and verify 201 with user ID returned")
69
+ - **Logical Grouping**: Group related test steps under scenarios (e.g., all "API Rate Limiting" aspects in one section)
70
+ - **Appropriate Depth**: Scale complexity to match changes (simple UI updates need basic workflows; new features need comprehensive coverage)
71
+ - **Formatting Requirements**:
72
+ - Headers: Descriptive feature names explaining user goal
73
+ - Steps: Combine action and expected result in each checkbox
74
+ - Grouping: Organize related functionality under same feature section
75
+ - Checkboxes: Use `[ ]` for progress tracking
76
+ - Context: Include keyboard shortcuts, button names, UI elements in parentheses
77
+ - Examples: Provide specific test data (branch names, file paths)
78
+ - Write instructions clear enough for unfamiliar users; don't over-engineer for straightforward changes
79
+
80
+ ## Step (3/3) - Deliver
81
+
82
+ - **Action** — PresentDelivery: Present guide with testing coverage summary.
83
+ > **📋 Test Guide Created**
84
+ >
85
+ > **Location**: `docs/tasks/{task_name}/testing/{task_name}_test_guide.md`
86
+ >
87
+ > **Coverage**:
88
+ > - {X} feature workflows/scenarios
89
+ > - {Y} total test steps
90
+ > - Estimated time: {Z} minutes
91
+ >
92
+ > **Testing Strategy**: {Simple/Medium/Complex} - {brief rationale}
93
+ >
94
+ > The guide is organized by user workflows with actionable checklists ready for execution.
95
+ - **Action** — RenderFooter: Render Next Steps footer using `@skill-spectre:spectre-guide` skill (contains format template and spectre command options)
96
+
97
+ ## Next Steps
98
+
99
+ See `@skill-spectre:spectre-guide` skill for footer format and command options.
100
+
101
+ ## Success Criteria
102
+
103
+ - [ ] Output directory determined inline (`OUT_DIR`) using branch name or user-specified path
104
+ - [ ] Task context analyzed (features changed, stack, personas, integration points)
105
+ - [ ] ARGUMENTS processed for specific focus areas (if provided)
106
+ - [ ] Change complexity assessed (Simple/Medium/Complex)
107
+ - [ ] Testing strategy determined with required and optional sections identified
108
+ - [ ] Test guide created with feature-based organization
109
+ - [ ] Required sections included (Overview, Setup, Core Tests, Results)
110
+ - [ ] Optional sections evaluated and included based on relevance
111
+ - [ ] Tests organized by user workflows/features with descriptive headers
112
+ - [ ] Steps combine actions with expected results using checklist format
113
+ - [ ] Related functionality logically grouped under coherent scenarios
114
+ - [ ] Keyboard shortcuts and UI elements included as relevant
115
+ - [ ] Guide complexity scaled appropriately to change size
116
+ - [ ] Instructions clear enough for unfamiliar users
117
+ - [ ] Guide saved to `{OUT_DIR}/testing/{branch_name}_test_guide.md`
118
+
119
+ - [ ] Testing coverage summary presented to user
120
+ - [ ] Next steps guide read and relevant options sourced for footer
@@ -0,0 +1,50 @@
1
+ ---
2
+ description: "\ud83d\udc7b | Architecture review + knowledge capture"
3
+ ---
4
+
5
+ # evaluate: Review architecture and capture learnings
6
+
7
+ ## Description
8
+ - **What** — Meta command that runs an architecture review in the background while you capture learnings from the session
9
+ - **Outcome** — Architecture review report + captured knowledge for future sessions
10
+
11
+ ## ARGUMENTS
12
+
13
+ <ARGUMENTS>
14
+ $ARGUMENTS
15
+ </ARGUMENTS>
16
+
17
+ ## Instructions
18
+
19
+ This command runs two activities in parallel:
20
+
21
+ 1. **Architecture Review** — dispatched as a background Opus 4.6 subagent via `/spectre:architecture_review`
22
+ 2. **Learn** — run directly by loading the `spectre-learn` skill
23
+
24
+ ## Step (1/2) - Dispatch Architecture Review
25
+
26
+ - **Action** — DispatchReview: Launch architecture review as a background subagent
27
+ - Use the Task tool with `subagent_type="general-purpose"`, `model="opus"`, `run_in_background=true`
28
+ - The subagent prompt should include the full architecture_review command instructions
29
+ - Pass ARGUMENTS to the subagent as the review scope (feature description, paths, context)
30
+ - **If** ARGUMENTS is empty: instruct the subagent to infer the review scope from recent work in the repository (e.g., git diff, recent commits)
31
+ - Note the background task ID so the user can check results later
32
+
33
+ - **Output**: Inform the user that the architecture review is running in the background and they'll be notified when it completes.
34
+
35
+ ## Step (2/2) - Capture Learnings
36
+
37
+ - **Action** — Learn: Load the spectre-learn skill and follow its workflow
38
+ - Load skill: `Skill(spectre-learn)`
39
+ - **If** ARGUMENTS is provided: use it as the learning topic
40
+ - **If** ARGUMENTS is empty: the skill will analyze recent conversation to identify what's worth capturing
41
+ - Follow the full learning workflow from the skill (categorize, propose, write, register)
42
+
43
+ ## Completion
44
+
45
+ When the learn flow completes:
46
+ 1. Check if the background architecture review has finished (read the output file)
47
+ 2. **If finished**: Present the architecture review report to the user
48
+ 3. **If still running**: Let the user know they can check back later or continue working
49
+
50
+ - **Action** — RenderFooter: Use @skill-spectre:spectre-guide for Next Steps
@@ -0,0 +1,87 @@
1
+ ---
2
+ description: 👻 | Adaptive Wave-Based Build -> Code_Review -> Validate Flow
3
+ ---
4
+
5
+ # execute: Adaptive Task Execution with Quality Gates
6
+
7
+ Execute tasks in parallel waves with full scope context, adapt based on learnings, code review loop, validate requirements. Outcome: complete implementation with verified quality and E2E requirement coverage.
8
+
9
+ ## ARGUMENTS
10
+
11
+ <ARGUMENTS>
12
+ $ARGUMENTS
13
+ </ARGUMENTS>
14
+
15
+ ## Step 1 - Adaptive Wave Execution
16
+
17
+ - **Action** — LoadScopeContext: Identify available scope docs in `{OUT_DIR}/`:
18
+ - `concepts/scope.md`, `specs/prd.md`, `specs/ux.md`, `specs/plan.md`, `specs/tasks.md`, `task_summary.md`
19
+ - Store existing paths as `SCOPE_DOCS` for subagent dispatch
20
+
21
+ - **Action** — LoadTaskList: Read `docs/tasks/{branch}/specs/tasks.md` or Beads tasks
22
+ - Identify wave structure and first wave
23
+
24
+ - **Action** — ExecuteAdaptiveLoop: Until all tasks complete:
25
+
26
+ 1. **Batch Tasks**: Assign up to 3 sequential parent tasks per subagent
27
+ - **Batching Rule**: Group sequential tasks (e.g., 1.1→1.2→1.3) to one agent
28
+ - **Parallelization Boundary**: If task N must complete before parallel wave W starts, end the batch at N
29
+ - Example: Tasks 1.1-1.5 sequential, then 2.1-2.3 parallel → Agent A: 1.1-1.3, Agent B: 1.4-1.5, then parallel dispatch for wave 2
30
+
31
+ 2. **Dispatch Wave**: Launch parallel @dev subagents (1 per task batch)
32
+ - **CRITICAL**: Each subagent MUST read `SCOPE_DOCS` before executing
33
+ - Each receives: task batch assignment, dependency completion reports, SCOPE_DOCS paths
34
+ - Instruct: "Read scope docs first to understand E2E UX and integration points. Load @skill-spectre:spectre-tdd, then execute tasks sequentially using its TDD methodology. **Commit after each parent task** with conventional commit format (e.g., `feat(module): add X`, `fix(module): resolve Y`). Return completion report with **Implementation Insights** + **E2E Completeness Check**."
35
+
36
+ **E2E Completeness Check** (subagent returns one per batch):
37
+ - ⚪ Complete — tasks sufficient to deliver spec intent
38
+ - 🟡 Gap — [specific functionality missing for E2E UX]
39
+ - 🔴 Blocker — [cannot deliver spec without changes to other tasks]
40
+
41
+ 3. **Mark Complete**: Update tasks doc with `[x]` for completed tasks
42
+
43
+ 4. **Reflect**: Review completion reports for:
44
+ - Scope signals (🟡/🟠/🔴) from implementation insights
45
+ - E2E completeness gaps (🟡/🔴) from completeness checks
46
+ - **If** all ⚪ across both → skip to step 6
47
+ - **Else** → adapt tasks
48
+
49
+ 5. **Adapt** (only if triggered):
50
+ - Modify future tasks with learned context
51
+ - Add tasks for E2E gaps with `[ADDED - E2E gap]` prefix
52
+ - Add required sub-tasks with `[ADDED]` prefix
53
+ - Mark obsoleted with `[SKIPPED - reason]`
54
+ - Flag cross-task integration issues to remaining waves
55
+ - **Guardrails**: ❌ No "nice-to-have" additions, ❌ No scope expansion, ✅ Only adapt for spec compliance
56
+
57
+ 6. **Next Wave**: Identify next tasks, gather relevant completion reports, return to step 1
58
+
59
+ ## Step 2 - Code Review Loop
60
+
61
+ - **Action** — ExecutedeveviewLoop: Until no critical/high feedback:
62
+
63
+ 1. **Spawn Review**: @dev subagent runs `/spectre:code_review`
64
+ 2. **Analyze**: Identify critical/high items
65
+ - **If** none → exit loop
66
+ 3. **Address**: Parallel @dev subagents fix feedback
67
+ 4. **Re-verify**: Return to step 1
68
+
69
+ ## Step 3 - Validate Requirements
70
+
71
+ - **Action** — SpawnValidation: @reviewer runs `/spectre:validate` with task list
72
+ - **Action** — AddressGaps: If high priority gaps → dispatch @dev subagents to fix
73
+
74
+ ## Step 4 - Prepare for QA
75
+
76
+ - **Action** — GenerateTestGuide: @dev runs `/spectre:create_test_guide`
77
+ - Save to `{OUT_DIR}/test_guide.md`
78
+
79
+ ## Step 5 - Report
80
+
81
+ - **Action** — SummarizeCompletion:
82
+ - Tasks completed, waves executed, code review iterations, validation status
83
+ - Test guide location
84
+ - **Task Evolution Summary**: Adaptations made (or "None - original plan executed")
85
+ - **E2E Gaps Addressed**: Summary of completeness issues found and resolved
86
+
87
+ - **Action** — RenderFooter: Use `@skill-spectre:spectre-guide` skill for Next Steps