@codename_inc/spectre 3.7.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -7
- package/package.json +3 -2
- package/plugins/spectre/.claude-plugin/plugin.json +1 -1
- package/plugins/spectre/bin/spectre-register +5 -0
- package/plugins/spectre/hooks/hooks.json +3 -14
- package/plugins/spectre/hooks/scripts/bootstrap.mjs +98 -0
- package/plugins/spectre/hooks/scripts/handoff-resume.mjs +404 -0
- package/plugins/spectre/hooks/scripts/lib.mjs +82 -0
- package/plugins/spectre/hooks/scripts/load-knowledge.mjs +189 -0
- package/plugins/spectre/hooks/scripts/register_learning.mjs +264 -0
- package/plugins/spectre/hooks/scripts/{test_bootstrap.cjs → test_bootstrap.mjs} +12 -7
- package/plugins/spectre/hooks/scripts/{test_handoff-resume.cjs → test_handoff-resume.mjs} +13 -11
- package/plugins/spectre/hooks/scripts/{test_load-knowledge.cjs → test_load-knowledge.mjs} +103 -22
- package/plugins/spectre/hooks/scripts/test_register-learning.mjs +335 -0
- package/plugins/spectre/skills/apply/SKILL.md +87 -0
- package/plugins/spectre/{commands/architecture_review.md → skills/architecture_review/SKILL.md} +9 -0
- package/plugins/spectre/{commands/clean.md → skills/clean/SKILL.md} +9 -0
- package/plugins/spectre/{commands/code_review.md → skills/code_review/SKILL.md} +9 -0
- package/plugins/spectre/{commands/create_plan.md → skills/create_plan/SKILL.md} +9 -0
- package/plugins/spectre/{commands/create_tasks.md → skills/create_tasks/SKILL.md} +9 -0
- package/plugins/spectre/{commands/create_test_guide.md → skills/create_test_guide/SKILL.md} +9 -0
- package/plugins/spectre/{commands/evaluate.md → skills/evaluate/SKILL.md} +11 -2
- package/plugins/spectre/{commands/execute.md → skills/execute/SKILL.md} +12 -3
- package/plugins/spectre/{commands/fix.md → skills/fix/SKILL.md} +9 -0
- package/plugins/spectre/{commands/forget.md → skills/forget/SKILL.md} +9 -0
- package/plugins/spectre/skills/{spectre-guide → guide}/SKILL.md +6 -5
- package/plugins/spectre/{commands/handoff.md → skills/handoff/SKILL.md} +9 -0
- package/plugins/spectre/{commands/kickoff.md → skills/kickoff/SKILL.md} +9 -0
- package/plugins/spectre/skills/{spectre-learn → learn}/SKILL.md +19 -59
- package/plugins/spectre/skills/learn/references/recall-template.md +34 -0
- package/plugins/spectre/{commands/plan.md → skills/plan/SKILL.md} +66 -25
- package/plugins/spectre/{commands/plan_review.md → skills/plan_review/SKILL.md} +9 -0
- package/plugins/spectre/skills/prototype/SKILL.md +314 -0
- package/plugins/spectre/{commands/quick_dev.md → skills/quick_dev/SKILL.md} +9 -0
- package/plugins/spectre/{commands/rebase.md → skills/rebase/SKILL.md} +9 -0
- package/plugins/spectre/skills/recall/SKILL.md +17 -0
- package/plugins/spectre/{commands/research.md → skills/research/SKILL.md} +9 -0
- package/plugins/spectre/skills/scope/SKILL.md +174 -0
- package/plugins/spectre/{commands/ship.md → skills/ship/SKILL.md} +9 -0
- package/plugins/spectre/{commands/sweep.md → skills/sweep/SKILL.md} +9 -0
- package/plugins/spectre/skills/tdd/SKILL.md +111 -0
- package/plugins/spectre/{commands/test.md → skills/test/SKILL.md} +9 -0
- package/plugins/spectre/skills/ux/SKILL.md +121 -0
- package/plugins/spectre/{commands/validate.md → skills/validate/SKILL.md} +9 -0
- package/plugins/spectre-codex/agents/analyst.toml +117 -0
- package/plugins/spectre-codex/agents/dev.toml +65 -0
- package/plugins/spectre-codex/agents/finder.toml +101 -0
- package/plugins/spectre-codex/agents/patterns.toml +203 -0
- package/plugins/spectre-codex/agents/reviewer.toml +123 -0
- package/plugins/spectre-codex/agents/sync.toml +146 -0
- package/plugins/spectre-codex/agents/tester.toml +205 -0
- package/plugins/spectre-codex/agents/web-research.toml +104 -0
- package/plugins/spectre-codex/hooks/hooks.json +23 -0
- package/plugins/{spectre/hooks/scripts/bootstrap.cjs → spectre-codex/hooks/scripts/bootstrap.mjs} +15 -16
- package/plugins/{spectre/hooks/scripts/handoff-resume.cjs → spectre-codex/hooks/scripts/handoff-resume.mjs} +21 -27
- package/plugins/{spectre/hooks/scripts/lib.cjs → spectre-codex/hooks/scripts/lib.mjs} +3 -4
- package/plugins/spectre-codex/hooks/scripts/load-knowledge.mjs +189 -0
- package/plugins/spectre-codex/hooks/scripts/register_learning.mjs +264 -0
- package/plugins/spectre-codex/skills/apply/SKILL.md +87 -0
- package/plugins/spectre-codex/skills/architecture_review/SKILL.md +129 -0
- package/plugins/spectre-codex/skills/clean/SKILL.md +322 -0
- package/plugins/spectre-codex/skills/code_review/SKILL.md +417 -0
- package/plugins/spectre-codex/skills/create_plan/SKILL.md +126 -0
- package/plugins/spectre-codex/skills/create_tasks/SKILL.md +383 -0
- package/plugins/spectre-codex/skills/create_test_guide/SKILL.md +129 -0
- package/plugins/spectre-codex/skills/evaluate/SKILL.md +59 -0
- package/plugins/spectre-codex/skills/execute/SKILL.md +96 -0
- package/plugins/spectre-codex/skills/fix/SKILL.md +70 -0
- package/plugins/spectre-codex/skills/forget/SKILL.md +67 -0
- package/plugins/spectre-codex/skills/guide/SKILL.md +359 -0
- package/plugins/spectre-codex/skills/handoff/SKILL.md +170 -0
- package/plugins/spectre-codex/skills/kickoff/SKILL.md +124 -0
- package/plugins/spectre-codex/skills/learn/SKILL.md +595 -0
- package/plugins/{spectre/skills/spectre-learn → spectre-codex/skills/learn}/references/recall-template.md +4 -1
- package/plugins/spectre-codex/skills/plan/SKILL.md +211 -0
- package/plugins/spectre-codex/skills/plan_review/SKILL.md +42 -0
- package/plugins/spectre-codex/skills/prototype/SKILL.md +314 -0
- package/plugins/spectre-codex/skills/quick_dev/SKILL.md +110 -0
- package/plugins/spectre-codex/skills/rebase/SKILL.md +82 -0
- package/plugins/spectre-codex/skills/recall/SKILL.md +17 -0
- package/plugins/spectre-codex/skills/research/SKILL.md +168 -0
- package/plugins/spectre-codex/skills/scope/SKILL.md +174 -0
- package/plugins/spectre-codex/skills/ship/SKILL.md +181 -0
- package/plugins/spectre-codex/skills/sweep/SKILL.md +91 -0
- package/plugins/{spectre/skills/spectre-tdd → spectre-codex/skills/tdd}/SKILL.md +1 -1
- package/plugins/spectre-codex/skills/test/SKILL.md +389 -0
- package/plugins/spectre-codex/skills/ux/SKILL.md +121 -0
- package/plugins/spectre-codex/skills/validate/SKILL.md +352 -0
- package/src/config.test.js +6 -5
- package/src/install.test.js +100 -11
- package/src/lib/config.js +107 -54
- package/src/lib/constants.js +17 -23
- package/src/lib/doctor.js +19 -22
- package/src/lib/install.js +98 -313
- package/src/lib/knowledge.js +7 -37
- package/src/lib/paths.js +0 -12
- package/src/pack.test.js +87 -0
- package/plugins/spectre/commands/learn.md +0 -15
- package/plugins/spectre/commands/recall.md +0 -5
- package/plugins/spectre/commands/scope.md +0 -119
- package/plugins/spectre/commands/ux_spec.md +0 -91
- package/plugins/spectre/hooks/scripts/load-knowledge.cjs +0 -120
- package/plugins/spectre/hooks/scripts/precompact-warning.cjs +0 -19
- package/plugins/spectre/hooks/scripts/register_learning.cjs +0 -144
- package/plugins/spectre/hooks/scripts/test_register-learning.cjs +0 -146
- package/plugins/spectre/skills/spectre-apply/SKILL.md +0 -189
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "code_review"
|
|
3
|
+
description: "👻 | Independent LLM Code Review - subagent"
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# code_review
|
|
8
|
+
|
|
9
|
+
## Input Handling
|
|
10
|
+
|
|
11
|
+
Treat the current command arguments as this workflow's input. When invoked from a slash command, use the forwarded `$ARGUMENTS` value.
|
|
12
|
+
|
|
13
|
+
# code_review: Comprehensive Code Analysis
|
|
14
|
+
|
|
15
|
+
## Description
|
|
16
|
+
|
|
17
|
+
- Description — Conduct thorough, comprehensive code analysis covering all aspects of code quality, security, and production readiness. Provides comprehensive analysis in single review session with severity-based findings and actionable recommendations.
|
|
18
|
+
- Desired Outcome — Complete code review report with severity-categorized findings (CRITICAL/HIGH/MEDIUM/LOW), comprehensive scores, prioritized action plan, saved to a scoped report file (default `comprehensive_code_review.md`, but use a scoped filename if one already exists).
|
|
19
|
+
|
|
20
|
+
## ARGUMENTS Input
|
|
21
|
+
|
|
22
|
+
Optional user input to seed this workflow.
|
|
23
|
+
|
|
24
|
+
<ARGUMENTS> $ARGUMENTS </ARGUMENTS>
|
|
25
|
+
|
|
26
|
+
## Step (1/4) - Define Review Scope
|
|
27
|
+
|
|
28
|
+
- **Action** — ProcessGuidance: Check for ARGUMENTS and extract guidance.
|
|
29
|
+
- **If** ARGUMENTS exists → acknowledge guidance; extract specific focus areas;
|
|
30
|
+
- Proceed with comprehensive review while honoring context
|
|
31
|
+
- **Action** — SpecifyScope: Define exact scope using completed work and modified files to prevent scope creep.
|
|
32
|
+
- **CRITICAL**: Before dispatching review agent, provide what was actually implemented and files touched/modified; gives concrete scope boundaries regardless of work origin
|
|
33
|
+
|
|
34
|
+
**Review Scope Specification - Choose Appropriate Scenario:**
|
|
35
|
+
|
|
36
|
+
**Common File Format (All Scenarios):**
|
|
37
|
+
|
|
38
|
+
```plaintext
|
|
39
|
+
**Files Modified/Created:**
|
|
40
|
+
- `path/to/file.ext` ({created|modified|deleted} - {purpose/what changed})
|
|
41
|
+
|
|
42
|
+
**Related Files for Review:**
|
|
43
|
+
- `path/to/related.ext` ({imports|dependencies|tests|config})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### **Scenario A: Work from Task List** (when `tasks.md` exists and was followed)
|
|
47
|
+
|
|
48
|
+
```plaintext
|
|
49
|
+
**Work Completed (from Task List):**
|
|
50
|
+
- Task 1.1: [exact task description from tasks.md]
|
|
51
|
+
- Task 1.2: [exact task description from tasks.md]
|
|
52
|
+
- Task 2.1: [exact task description from tasks.md]
|
|
53
|
+
|
|
54
|
+
[Use common file format above]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### **Scenario B: Work from Plan** (working from `plan.md` without formal tasks)
|
|
58
|
+
|
|
59
|
+
```plaintext
|
|
60
|
+
**Work Completed (from Plan Implementation):**
|
|
61
|
+
- Implemented: [specific functionality completed, referencing plan.md sections]
|
|
62
|
+
- Delivered: [specific features/capabilities built]
|
|
63
|
+
- Completed: [specific plan items addressed]
|
|
64
|
+
|
|
65
|
+
[Use common file format above]
|
|
66
|
+
|
|
67
|
+
**Plan Context:**
|
|
68
|
+
- Plan Section: [specific sections of plan.md implemented]
|
|
69
|
+
- Plan Requirements: [requirements from plan this work addresses]
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### **Scenario C: Ad-hoc/Independent Work** (work without formal tasks or detailed plan)
|
|
73
|
+
|
|
74
|
+
```plaintext
|
|
75
|
+
**Work Completed (Independent Implementation):**
|
|
76
|
+
- Implemented: [specific functionality completed]
|
|
77
|
+
- Purpose: [why this work was done - bug fix, feature addition, etc.]
|
|
78
|
+
- Scope: [what was intended to be delivered]
|
|
79
|
+
|
|
80
|
+
[Use common file format above]
|
|
81
|
+
|
|
82
|
+
**Requirements Context:**
|
|
83
|
+
- Original Requirements: [extract from task_summary.md, PRD, or user request]
|
|
84
|
+
- Acceptance Criteria: [how success is defined for this work]
|
|
85
|
+
- Constraints: [any technical or scope constraints that applied]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
- **Action** — ExtractWorkContext: Extract requirements and context from appropriate documentation based on scenario.
|
|
89
|
+
- All scenarios: Extract work requirements → trace to origin docs (PRD/task_summary) → pull technical details → identify file context → document out-of-scope
|
|
90
|
+
- **Scenario A**: Source from `tasks.md`
|
|
91
|
+
- **Scenario B**: Source from `plan.md`/`quick_task_plan.md`
|
|
92
|
+
- **Scenario C**: Source from task_summary.md/PRD/user comms; define acceptance criteria
|
|
93
|
+
|
|
94
|
+
## Step (2/4) - Dispatch Review Agent
|
|
95
|
+
|
|
96
|
+
- **Action** — GenerateReviewPrompt: Create comprehensive @reviewer subagent prompt replacing bracketed placeholders:
|
|
97
|
+
|
|
98
|
+
────────────────────────────────────
|
|
99
|
+
|
|
100
|
+
### 🔍 Comprehensive Code Review Agent Prompt
|
|
101
|
+
|
|
102
|
+
**Review Type:** Comprehensive Analysis (All Aspects)
|
|
103
|
+
|
|
104
|
+
**Work Completed for Review:**\[Choose appropriate format based on work origin - Scenario A, B, or C from Step 2\]
|
|
105
|
+
|
|
106
|
+
**Files Modified/Created:**\[Complete list of files touched during implementation\]
|
|
107
|
+
|
|
108
|
+
- `path/to/file1.py` (created - \[brief purpose\])
|
|
109
|
+
- `path/to/file2.py` (modified - \[what was changed\])
|
|
110
|
+
- `path/to/file3.py` (deleted - \[reason\])
|
|
111
|
+
|
|
112
|
+
**Related Files to Review:**\[Dependencies, tests, config files that may be impacted\]
|
|
113
|
+
|
|
114
|
+
- `path/to/related1.py` (imports/dependencies)
|
|
115
|
+
- `path/to/test_file.py` (test coverage)
|
|
116
|
+
- `config/settings.py` (configuration changes)
|
|
117
|
+
|
|
118
|
+
**Requirements & Context:**\[Specific requirements and acceptance criteria for work completed - extracted from appropriate documentation based on scenario\]
|
|
119
|
+
|
|
120
|
+
**Project Overview:**\[High‑level feature/bug description, requirements, acceptance criteria\]
|
|
121
|
+
|
|
122
|
+
**Documentation Context:**`docs/tasks/{task_name}/` (if available)
|
|
123
|
+
|
|
124
|
+
- Available docs: \[list which exist: task_summary.md, prd.md, plan.md, tasks.md\]
|
|
125
|
+
- Missing docs: \[list which expected docs are missing\]
|
|
126
|
+
|
|
127
|
+
**Guidelines & Preferences:**\[Style guides, architecture rules, naming conventions, test expectations\]
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
#### Step 1: Context Collection & Code Identification
|
|
132
|
+
|
|
133
|
+
**FIRST: Gather Task Context**
|
|
134
|
+
|
|
135
|
+
1. **Read Task Documentation**: Locate and read files in `docs/tasks/{task_name}/`:
|
|
136
|
+
|
|
137
|
+
- `scope.md` or `ux.md` or `prd.md` or `spec.md` or any other scope artifact
|
|
138
|
+
- `initial_plan.md` or `plan.md` or `quick_task_plan.md` - Implementation approach
|
|
139
|
+
- `tasks.md` or `{task_name}_tasks.md` - Specific work items and progress
|
|
140
|
+
|
|
141
|
+
2. **Identify Code Scope**: Based on task documentation:
|
|
142
|
+
|
|
143
|
+
- **Primary Files**: Files directly mentioned in plans and task lists
|
|
144
|
+
- **Related Files**: Dependencies, imports, related modules
|
|
145
|
+
- **Test Files**: Associated unit tests and integration tests
|
|
146
|
+
- **Configuration**: Any config changes related to feature
|
|
147
|
+
|
|
148
|
+
3. **Explore Codebase**: Use codebase search tools to:
|
|
149
|
+
|
|
150
|
+
- Find implementations mentioned in task documentation
|
|
151
|
+
- Locate related functions, classes, modules
|
|
152
|
+
- Identify recent changes related to task scope
|
|
153
|
+
|
|
154
|
+
**Code Review Scope Decision**: Focus review on code that:
|
|
155
|
+
|
|
156
|
+
- ✅ Is directly mentioned in task documentation
|
|
157
|
+
- ✅ Implements features described in plan
|
|
158
|
+
- ✅ Contains recent changes related to task objectives
|
|
159
|
+
- ✅ Has dependencies or impacts from primary implementation
|
|
160
|
+
|
|
161
|
+
**THEN: Proceed with Comprehensive Review**
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
#### Step 2: Comprehensive Code Review Analysis
|
|
166
|
+
|
|
167
|
+
**Severity Scale Reference:**
|
|
168
|
+
|
|
169
|
+
- **CRITICAL**: Prevents execution, security vulnerabilities, auth bypasses, data exposure
|
|
170
|
+
- **HIGH**: Affects maintainability, core functionality, user experience, resource leaks
|
|
171
|
+
- **MEDIUM**: Quality improvements, test coverage, configuration, performance (non-critical)
|
|
172
|
+
- **LOW**: Documentation, polish, cleanup
|
|
173
|
+
|
|
174
|
+
**Perform comprehensive analysis covering all aspects:**
|
|
175
|
+
|
|
176
|
+
### 🔧 Foundation & Correctness
|
|
177
|
+
|
|
178
|
+
**1. Compile/Run Readiness** → CRITICAL if prevents execution
|
|
179
|
+
|
|
180
|
+
- Syntax errors, unresolved references, missing imports/modules
|
|
181
|
+
- Misconfigured build / dependency files
|
|
182
|
+
|
|
183
|
+
**2. Structural Soundness** → HIGH if affects maintainability
|
|
184
|
+
|
|
185
|
+
- File & class organization, directory layout, module boundaries
|
|
186
|
+
|
|
187
|
+
**3. Implementation Completeness** → HIGH if core functionality missing
|
|
188
|
+
|
|
189
|
+
- Stubbed functions, TODO/FIXME markers, unhandled edge paths
|
|
190
|
+
- Absence of required unit tests or placeholders for them
|
|
191
|
+
|
|
192
|
+
**4. Logic Validation** → CRITICAL if breaks functionality
|
|
193
|
+
|
|
194
|
+
- Off‑by‑one mistakes, null handling, obvious condition errors
|
|
195
|
+
- End‑to‑end scenario walkthroughs against requirements
|
|
196
|
+
- State transitions and error flows for all inputs
|
|
197
|
+
|
|
198
|
+
### 🛡️ Security & Safety
|
|
199
|
+
|
|
200
|
+
**Input Validation & Injection Prevention** → CRITICAL
|
|
201
|
+
|
|
202
|
+
- SQL injection: Parameterized queries, input sanitization
|
|
203
|
+
- XSS: Output encoding, Content Security Policy, input validation
|
|
204
|
+
- Command injection: Avoid system calls with user input
|
|
205
|
+
- Path traversal: Validate file paths, use safe path operations
|
|
206
|
+
|
|
207
|
+
**Authentication & Authorization** → CRITICAL for auth bypasses
|
|
208
|
+
|
|
209
|
+
- Broken authentication: Session management, password policies
|
|
210
|
+
- Privilege escalation: Role-based access control validation
|
|
211
|
+
- JWT security: Proper signing, expiration, secure storage
|
|
212
|
+
- API authentication: Rate limiting, token validation
|
|
213
|
+
|
|
214
|
+
**Data Protection** → CRITICAL for data exposure
|
|
215
|
+
|
|
216
|
+
- Sensitive data exposure: Encryption at rest and in transit
|
|
217
|
+
- PII handling: Data minimization, proper anonymization
|
|
218
|
+
- Hard-coded secrets: Environment variables, secret management
|
|
219
|
+
- Insecure randomness: Cryptographically secure random generation
|
|
220
|
+
|
|
221
|
+
**API & Network Security** → HIGH
|
|
222
|
+
|
|
223
|
+
- SSRF: URL validation, allowlist external requests
|
|
224
|
+
- CORS misconfiguration: Proper origin validation
|
|
225
|
+
- API rate limiting: Prevent abuse and DoS
|
|
226
|
+
- HTTPS enforcement: Secure transport, HSTS headers
|
|
227
|
+
|
|
228
|
+
### 🎯 Quality & Robustness
|
|
229
|
+
|
|
230
|
+
**5. Error Handling & User Safety** → HIGH if affects user experience
|
|
231
|
+
|
|
232
|
+
- Ensure graceful degradation and clear, user‑appropriate messages
|
|
233
|
+
- Detect error states that could block users or leak internal details
|
|
234
|
+
|
|
235
|
+
**6. Test Coverage & Quality** → MEDIUM if adequate coverage exists
|
|
236
|
+
|
|
237
|
+
- Measure unit/integration test breadth, branch coverage, boundary cases
|
|
238
|
+
- Point out missing negative tests and flaky patterns
|
|
239
|
+
|
|
240
|
+
**7. Performance Considerations** → HIGH if affects UX, MEDIUM otherwise
|
|
241
|
+
|
|
242
|
+
- O(n²) loops on large data, excessive network/DB calls, synchronous waits
|
|
243
|
+
- N+1 queries, blocking I/O on hot paths
|
|
244
|
+
- Inefficient algorithms, caching opportunities
|
|
245
|
+
|
|
246
|
+
**8. Code Quality & Maintainability** → MEDIUM
|
|
247
|
+
|
|
248
|
+
- Duplication & reusability: Copy‑pasted blocks, redundant utility functions
|
|
249
|
+
- Design consistency: Architecture layers, API contracts, dependency inversion
|
|
250
|
+
- Naming coherence, comment accuracy, adherence to style guides
|
|
251
|
+
|
|
252
|
+
### 🚀 Production Readiness
|
|
253
|
+
|
|
254
|
+
**9. Resource Management** → HIGH if causes leaks, MEDIUM otherwise
|
|
255
|
+
|
|
256
|
+
- Memory & resource leaks: Unclosed files/streams, lingering timers, event listeners, DB cursors
|
|
257
|
+
- Repeated allocations in tight loops, large object retention
|
|
258
|
+
|
|
259
|
+
**10. Infrastructure & Configuration** → MEDIUM
|
|
260
|
+
|
|
261
|
+
- Insecure dependencies: Known CVEs, outdated packages
|
|
262
|
+
- Security headers: CSP, X-Frame-Options, etc.
|
|
263
|
+
- Error handling: No sensitive info in error messages
|
|
264
|
+
- Logging security: No credentials in logs, log injection prevention
|
|
265
|
+
|
|
266
|
+
**11. Documentation & Developer UX** → LOW
|
|
267
|
+
|
|
268
|
+
- Up‑to‑date README, code comments, public API docs
|
|
269
|
+
- Log levels appropriate, no PII in logs, actionable messages
|
|
270
|
+
|
|
271
|
+
**12. Final Polish** → LOW
|
|
272
|
+
|
|
273
|
+
- Remove unused functions, constants, feature flags, debug prints
|
|
274
|
+
- Ensure commit history or diff is clean and scoped
|
|
275
|
+
|
|
276
|
+
**Critical Rule for Review Recommendations:**
|
|
277
|
+
|
|
278
|
+
- **Flag as Issues**: Only problems that prevent delivering **Work Completed** requirements
|
|
279
|
+
- **Suggest Improvements**: Only changes that directly support **Work Completed** acceptance criteria
|
|
280
|
+
- **DO NOT Flag**: Missing functionality from incomplete work, future plans, or different scopes
|
|
281
|
+
- **DO NOT Suggest**: Enhancements beyond minimal viable implementation for completed work
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
### Response Format
|
|
286
|
+
|
|
287
|
+
**Structure your review report with these sections:**
|
|
288
|
+
|
|
289
|
+
1. **Work & File Scope Boundary Validation** – Confirmation that review aligns with completed work and modified files
|
|
290
|
+
|
|
291
|
+
- Completed work parsed and understood (tasks/plan/independent work with specifics)
|
|
292
|
+
- Modified/created files identified and their purposes understood
|
|
293
|
+
- Work-specific requirements extracted from available documentation
|
|
294
|
+
- In-scope vs out-of-scope work/files for THIS review clearly identified
|
|
295
|
+
- Other work not completed or out of scope explicitly excluded from this review
|
|
296
|
+
|
|
297
|
+
2. **Context Collection Summary** – Brief overview of task documentation reviewed and code scope identified
|
|
298
|
+
|
|
299
|
+
3. **Files Reviewed** – List of specific files and code areas examined
|
|
300
|
+
|
|
301
|
+
4. **Summary Assessment** – Overall readiness, security posture, and risk level
|
|
302
|
+
|
|
303
|
+
5. **Detailed Findings by Severity**:
|
|
304
|
+
|
|
305
|
+
**🚨 CRITICAL Issues** - Must fix before any deployment
|
|
306
|
+
|
|
307
|
+
- `[File:Line]` **Security/Functionality**: \[Description and fix\]
|
|
308
|
+
|
|
309
|
+
**🔥 HIGH Priority** - Should fix before next stage
|
|
310
|
+
|
|
311
|
+
- `[File:Line]` **Logic/Performance**: \[Description and fix\]
|
|
312
|
+
|
|
313
|
+
**⚠️ MEDIUM Priority** - Quality improvements
|
|
314
|
+
|
|
315
|
+
- `[File:Line]` **Code Quality**: \[Description and fix\]
|
|
316
|
+
|
|
317
|
+
**💡 LOW Priority** - Nice-to-have improvements
|
|
318
|
+
|
|
319
|
+
- `[File:Line]` **Polish/Documentation**: \[Description and fix\]
|
|
320
|
+
|
|
321
|
+
6. **Comprehensive Scores (0‑10)**:
|
|
322
|
+
|
|
323
|
+
- **Security Posture**: \[Score\] - Vulnerability assessment
|
|
324
|
+
- **Logic Correctness**: \[Score\] - Functionality validation
|
|
325
|
+
- **Code Quality**: \[Score\] - Maintainability and structure
|
|
326
|
+
- **Production Readiness**: \[Score\] - Overall deployment readiness
|
|
327
|
+
|
|
328
|
+
7. **Prioritized Action Plan** – Ordered list of fixes by severity and impact
|
|
329
|
+
|
|
330
|
+
Save the report as **Markdown Document** (default `docs/tasks/{task_name}/reviews/comprehensive_code_review.md`; if it already exists, create a scoped variant like `docs/tasks/{task_name}/reviews/{task_name}_comprehensive_code_review_{timestamp}.md` to avoid overwriting). Create `docs/tasks/{task_name}` if it does not exist.
|
|
331
|
+
|
|
332
|
+
Respond to user with summary of only high priority items and point to file. Do not perform fixes yourself.
|
|
333
|
+
|
|
334
|
+
### Final Important Note
|
|
335
|
+
|
|
336
|
+
We are a startup building an early stage product hoping to find Product Market Fit. We must avoid over-engineering like the plague. Stick to YAGNI + SOLID + KISS + DRY principles. All recommendations, while comprehensive, should not over complicate the product or architecture for the stage that we're in.
|
|
337
|
+
|
|
338
|
+
**CRITICAL**: DO NOT flag missing features from incomplete work or different scopes. DO NOT suggest improvements beyond what is explicitly requested in completed work. Focus only on ensuring code delivers what was specifically asked for in completed work, not entire project scope.
|
|
339
|
+
|
|
340
|
+
────────────────────────────────────
|
|
341
|
+
|
|
342
|
+
- **Action** — DispatchAgent: Deploy @reviewer subagent code review agent with comprehensive prompt above.
|
|
343
|
+
|
|
344
|
+
## Step (3/4) - Process Review & Create Action Plan
|
|
345
|
+
|
|
346
|
+
- **Action** — CollectReview: Monitor and receive comprehensive code review analysis.
|
|
347
|
+
|
|
348
|
+
- Wait for review agent completion
|
|
349
|
+
- Receive comprehensive report with severity-based findings
|
|
350
|
+
- Verify report covers all required areas (foundation, security, quality, production readiness)
|
|
351
|
+
|
|
352
|
+
- **Action** — ProcessFindings: Create actionable next steps.
|
|
353
|
+
|
|
354
|
+
- Summarize by severity: Extract CRITICAL, identify HIGH, note MEDIUM, catalog LOW
|
|
355
|
+
- Create action plan: Prioritize by severity and impact; suggest implementation order (CRITICAL → HIGH → MEDIUM → LOW); identify additional resources needed; group related fixes
|
|
356
|
+
|
|
357
|
+
- **Action** — PresentSummary: Present findings to user with numbered, severity‑based summary.
|
|
358
|
+
|
|
359
|
+
> **🔍 Comprehensive Code Review Complete**
|
|
360
|
+
**> **Overall Assessment**: \[Brief headline on code readiness, security posture, risk level\]
|
|
361
|
+
**> **Review Report Location**: `{REVIEW_FILE}`
|
|
362
|
+
>
|
|
363
|
+
> ## Key Findings (Numbered for User Selection)
|
|
364
|
+
>
|
|
365
|
+
> ### 🚨 Critical Issues (Must Fix Immediately)
|
|
366
|
+
>
|
|
367
|
+
> 1. **\[Security/Functionality\]**: \[Brief description with file/line reference\]
|
|
368
|
+
>
|
|
369
|
+
> - **Impact**: \[Why this is critical\]
|
|
370
|
+
> - **Recommendation**: \[Specific fix needed\]
|
|
371
|
+
>
|
|
372
|
+
> 2. **\[Security/Functionality\]**: \[Brief description with file/line reference\]
|
|
373
|
+
>
|
|
374
|
+
> - **Impact**: \[Why this is critical\]
|
|
375
|
+
> - **Recommendation**: \[Specific fix needed\]
|
|
376
|
+
>
|
|
377
|
+
> ### 🔥 High Priority (Should Fix Next)
|
|
378
|
+
>
|
|
379
|
+
> 3. **\[Logic/Performance\]**: \[Brief description with file/line reference\]
|
|
380
|
+
>
|
|
381
|
+
> - **Impact**: \[Quality/performance impact\]
|
|
382
|
+
> - **Effort**: \[Estimated complexity\]
|
|
383
|
+
>
|
|
384
|
+
> 4. **\[Error Handling\]**: \[Brief description with file/line reference\]
|
|
385
|
+
>
|
|
386
|
+
> - **Impact**: \[User experience impact\]
|
|
387
|
+
> - **Effort**: \[Estimated complexity\]
|
|
388
|
+
>
|
|
389
|
+
> ### ⚠️ Medium Priority (Quality Improvements)
|
|
390
|
+
>
|
|
391
|
+
> 5. **\[Code Quality\]**: \[Brief description with file/line reference\]
|
|
392
|
+
>
|
|
393
|
+
> - **Benefit**: \[Maintainability improvement\]
|
|
394
|
+
> - **Effort**: \[Low/Medium complexity\]
|
|
395
|
+
>
|
|
396
|
+
> 6. **\[Test Coverage\]**: \[Brief description with file/line reference\]
|
|
397
|
+
>
|
|
398
|
+
> - **Benefit**: \[Quality assurance improvement\]
|
|
399
|
+
> - **Effort**: \[Low/Medium complexity\]
|
|
400
|
+
>
|
|
401
|
+
> ### 💡 Low Priority (Polish & Documentation)
|
|
402
|
+
>
|
|
403
|
+
> 7. **\[Documentation\]**: \[Brief description\]
|
|
404
|
+
> - **Benefit**: \[Developer experience improvement\]
|
|
405
|
+
> - **Effort**: \[Low complexity\]
|
|
406
|
+
|
|
407
|
+
## Step (4/4) - Handoff
|
|
408
|
+
|
|
409
|
+
- **Action** — RenderFooter: Render Next Steps using `Skill(spectre-guide)` skill.
|
|
410
|
+
|
|
411
|
+
## Output Location
|
|
412
|
+
|
|
413
|
+
```bash
|
|
414
|
+
branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)
|
|
415
|
+
OUT_DIR=${target_dir:-docs/tasks/$branch_name}
|
|
416
|
+
mkdir -p "$OUT_DIR/reviews"
|
|
417
|
+
```
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "create_plan"
|
|
3
|
+
description: "👻 | Create implementation plan from PRD - primary agent"
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# create_plan
|
|
8
|
+
|
|
9
|
+
## Input Handling
|
|
10
|
+
|
|
11
|
+
Treat the current command arguments as this workflow's input. When invoked from a slash command, use the forwarded `$ARGUMENTS` value.
|
|
12
|
+
|
|
13
|
+
# create_plan: Transform PRD into Technical Implementation Plan
|
|
14
|
+
|
|
15
|
+
## Description
|
|
16
|
+
|
|
17
|
+
- **What** — Conduct codebase research, collect clarifications, generate implementation plan
|
|
18
|
+
- **Outcome** — Complete `plan.md` with technical approach, phases, and architecture; ready for task breakdown
|
|
19
|
+
- **Role** — Sr. staff engineer biasing to YAGNI + SOLID + KISS + DRY
|
|
20
|
+
|
|
21
|
+
## ARGUMENTS Input
|
|
22
|
+
|
|
23
|
+
<ARGUMENTS> $ARGUMENTS </ARGUMENTS>
|
|
24
|
+
|
|
25
|
+
## Step (1/4) - Codebase Architecture Research
|
|
26
|
+
|
|
27
|
+
- **Action** — CheckExistingResearch: Check if technical research already completed.
|
|
28
|
+
- Read `TASK_DIR/task_context.md`; look for "## Technical Research" section.
|
|
29
|
+
- **If** found with comprehensive analysis → use existing research; skip to Step 3.
|
|
30
|
+
- **Else** → proceed with new research below.
|
|
31
|
+
- **Action** — AutomatedResearch: Spawn parallel research agents for comprehensive analysis.
|
|
32
|
+
- Use `codebase-locator` to find all files related to feature area.
|
|
33
|
+
- Dispatch multiple parallel `codebase-analyzer` subagents to understand current implementation patterns. Pay particular attention to how and where data is accessed that will be needed for this feature.
|
|
34
|
+
- Wait for ALL agents to complete before proceeding.
|
|
35
|
+
- Read ALL identified files into context.
|
|
36
|
+
- **Action** — TraceCodePaths: Trace through relevant execution paths.
|
|
37
|
+
- Identify the key entry points for the feature area (routes, handlers, event listeners, CLI commands).
|
|
38
|
+
- Follow the data flow end-to-end: from input → processing → storage → output.
|
|
39
|
+
- Find similar features already implemented in the codebase and study how they work — these are your implementation reference.
|
|
40
|
+
- Read the actual code at each step; do not rely on file names or agent summaries alone.
|
|
41
|
+
- **Action** — DocumentationReview: Review core architecture documentation.
|
|
42
|
+
- Review `CLAUDE.md` for rules and key patterns.
|
|
43
|
+
- Review `README.md` for major components.
|
|
44
|
+
- Cross-reference automated findings with documentation.
|
|
45
|
+
- **Action** — PatternAnalysis: Synthesize findings.
|
|
46
|
+
- Synthesize agent findings with manual code path analysis.
|
|
47
|
+
- Identify reusable components and utilities from research.
|
|
48
|
+
- Note integration patterns with existing systems.
|
|
49
|
+
- Validate agent discoveries through code inspection.
|
|
50
|
+
- **Output Location** — DetermineOutputDir: Decide where to save artifacts for this workflow.
|
|
51
|
+
- `branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)`
|
|
52
|
+
- **If** user specifies `target_dir/path` → `OUT_DIR={that value}`
|
|
53
|
+
- **Else** → `OUT_DIR=docs/tasks/{branch_name}`
|
|
54
|
+
- `mkdir -p "OUT_DIR/specs"` && `mkdir -p "OUT_DIR/clarifications"`
|
|
55
|
+
- **Action** — SaveResearch: Save technical research to task context (if newly completed).
|
|
56
|
+
- **If** research was just completed → update `{OUT_DIR}/task_context.md` with a "## Technical Research" section summarizing architecture patterns, dependencies, similar features found, and integration requirements.
|
|
57
|
+
- **Else** → skip (existing research already in context).
|
|
58
|
+
|
|
59
|
+
## Step (2/4) - Technical Clarifications
|
|
60
|
+
|
|
61
|
+
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.
|
|
62
|
+
|
|
63
|
+
- **Action** — DetectClarificationMethod: Check if `AskUserQuestion` tool is available.
|
|
64
|
+
- **If available** → use inline clarification flow (Path A).
|
|
65
|
+
- **If not available** → use file-based clarification flow (Path B).
|
|
66
|
+
|
|
67
|
+
### Path A: Inline Clarifications (AskUserQuestion available)
|
|
68
|
+
|
|
69
|
+
- **Action** — AskInline: Present questions directly using AskUserQuestion.
|
|
70
|
+
- Ask the most critical questions (up to 4 at a time, the tool limit).
|
|
71
|
+
- For approach decisions, present options as choices.
|
|
72
|
+
- If more than 4 questions, ask in batches — most important first.
|
|
73
|
+
- Use responses (and intelligent defaults for any skipped) to proceed.
|
|
74
|
+
|
|
75
|
+
### Path B: File-Based Clarifications (no AskUserQuestion)
|
|
76
|
+
|
|
77
|
+
- **Action** — GenerateClarifications: Create targeted technical questions document.
|
|
78
|
+
- Create directory if missing: `{OUT_DIR}/clarifications/`
|
|
79
|
+
- Create file: `{OUT_DIR}/clarifications/plan_clarifications_{YYYY-MM-DD_HHMMSS}.md`
|
|
80
|
+
- Format each question with `<response></response>` blocks for user answers.
|
|
81
|
+
- For approach decisions, list options inline with Pros/Cons/Trade-offs/Impact.
|
|
82
|
+
- **Action** — RequestUserInput: Direct user to answer clarifications.
|
|
83
|
+
- Message: "I saved technical clarifications here: `{clarifications_file_path}`. Please add answers inside `<response></response>` blocks. Leave blocks empty for me to proceed with intelligent assumptions. When ready, reply 'Read it'."
|
|
84
|
+
- Render ACTION REQUIRED footer (see Next Steps section for format).
|
|
85
|
+
- **Wait** — User replies "Read it" after updating clarifications document.
|
|
86
|
+
- **Action** — ReadClarifications: Re-open clarifications file from disk.
|
|
87
|
+
- **If** user provides path → use it.
|
|
88
|
+
- **Else** → open most recent `{OUT_DIR}/clarifications/plan_clarifications_*.md`.
|
|
89
|
+
- Read entire file; use responses when provided; proceed with assumptions if empty.
|
|
90
|
+
|
|
91
|
+
## Step (3/4) - Create Implementation Plan
|
|
92
|
+
|
|
93
|
+
- **Action** — DetermineDepth: Read `--depth` from ARGUMENTS
|
|
94
|
+
|
|
95
|
+
- Default: `standard` if not specified
|
|
96
|
+
- Options: `standard`, `comprehensive`
|
|
97
|
+
|
|
98
|
+
- **Action** — DesignTechnicalApproach: Create the implementation plan.
|
|
99
|
+
|
|
100
|
+
**STANDARD** depth — Focused plan for contained changes. Include the sections that matter for THIS feature. Typical sections: Overview, Desired End State, Out of Scope, Technical Approach.
|
|
101
|
+
|
|
102
|
+
**COMPREHENSIVE** depth — Full technical design for complex/risky changes. Consider all of the following, but only include sections relevant to the feature: Overview, Current State (with file:line refs), Desired End State, Out of Scope, Technical Approach, System Architecture, Implementation Phases, Component/Data Architecture, API Design, Testing Strategy.
|
|
103
|
+
|
|
104
|
+
Use your judgment — the goal is a plan that gives a developer everything they need to implement, not a template with empty sections.
|
|
105
|
+
|
|
106
|
+
- **Action** — AppendCriticalFiles: End the plan with a "Critical Files for Implementation" section.
|
|
107
|
+
|
|
108
|
+
- List 3-7 files most critical for implementing this plan.
|
|
109
|
+
- Format: `path/to/file.ts` — brief reason (e.g., "Core logic to modify", "Pattern to follow", "Interface to implement").
|
|
110
|
+
- These should be specific files discovered during research, not guesses.
|
|
111
|
+
|
|
112
|
+
- **Action** — DocumentPlan: Save to `{OUT_DIR}/specs/plan.md` (use scoped name if exists)
|
|
113
|
+
|
|
114
|
+
- **Action** — RequestReview:
|
|
115
|
+
|
|
116
|
+
> "Implementation plan saved to `{path}`. Review and reply with feedback or 'Approved' to proceed."
|
|
117
|
+
|
|
118
|
+
- **Wait** — User provides feedback or approval
|
|
119
|
+
|
|
120
|
+
## Step (4/4) - Finalize and Present Next Steps
|
|
121
|
+
|
|
122
|
+
- **Action** — ConfirmCompletion:
|
|
123
|
+
|
|
124
|
+
> "🎯 Implementation Planning Complete. Documents: {plan_path}, task_context.md"
|
|
125
|
+
|
|
126
|
+
- **Action** — RenderFooter: Use `Skill(spectre-guide)` skill for Next Steps footer
|