codecruise 0.1.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/LICENSE +21 -0
- package/README.md +111 -0
- package/bin/codecruise.js +68 -0
- package/config/CLAUDE.md +107 -0
- package/config/agents/analyst.md +48 -0
- package/config/agents/architect-reviewer.md +161 -0
- package/config/agents/architect.md +119 -0
- package/config/agents/critic.md +63 -0
- package/config/agents/developer.md +96 -0
- package/config/agents/devops.md +81 -0
- package/config/agents/orchestrator.md +91 -0
- package/config/agents/planner.md +139 -0
- package/config/agents/retro.md +52 -0
- package/config/agents/reviewer.md +101 -0
- package/config/agents/security-reviewer.md +57 -0
- package/config/agents/stack/expo/AGENT.md +473 -0
- package/config/agents/stack/expo/rules/critical.md +427 -0
- package/config/agents/stack/expo/rules/native.md +455 -0
- package/config/agents/stack/expo/rules/navigation.md +445 -0
- package/config/agents/stack/expo/rules/performance.md +415 -0
- package/config/agents/stack/fastify/AGENT.md +397 -0
- package/config/agents/stack/fastify/rules/api-design.md +283 -0
- package/config/agents/stack/fastify/rules/critical.md +232 -0
- package/config/agents/stack/fastify/rules/queues.md +303 -0
- package/config/agents/stack/fastify/rules/security.md +384 -0
- package/config/agents/stack/index.yaml +48 -0
- package/config/agents/stack/nextjs/AGENT.md +421 -0
- package/config/agents/stack/nextjs/rules/components.md +413 -0
- package/config/agents/stack/nextjs/rules/critical.md +391 -0
- package/config/agents/stack/nextjs/rules/performance.md +403 -0
- package/config/agents/stack/nextjs/rules/styling.md +334 -0
- package/config/agents/stack/shared-ts/AGENT.md +384 -0
- package/config/agents/stack/shared-ts/rules/critical.md +315 -0
- package/config/agents/stack/shared-ts/rules/patterns.md +384 -0
- package/config/agents/stack/shared-ts/rules/zod.md +427 -0
- package/config/agents/tester.md +79 -0
- package/config/commands/architect-discuss.md +366 -0
- package/config/commands/architect-list.md +160 -0
- package/config/commands/architect-review.md +111 -0
- package/config/commands/architect.md +118 -0
- package/config/commands/compact.md +118 -0
- package/config/commands/companion.md +279 -0
- package/config/commands/dashboard.md +152 -0
- package/config/commands/doctor.md +227 -0
- package/config/commands/dogfood-report.md +101 -0
- package/config/commands/flags/run-autonomous.md +110 -0
- package/config/commands/flags/run-pause.md +80 -0
- package/config/commands/ingest.md +173 -0
- package/config/commands/init.md +128 -0
- package/config/commands/metrics.md +87 -0
- package/config/commands/parallel.md +320 -0
- package/config/commands/pause.md +55 -0
- package/config/commands/plan-review.md +130 -0
- package/config/commands/plan.md +216 -0
- package/config/commands/production-check.md +308 -0
- package/config/commands/refine.md +323 -0
- package/config/commands/resume.md +72 -0
- package/config/commands/retro.md +121 -0
- package/config/commands/retry.md +75 -0
- package/config/commands/role.md +310 -0
- package/config/commands/run.md +417 -0
- package/config/commands/scope.md +85 -0
- package/config/commands/setup-permissions.md +104 -0
- package/config/commands/skip.md +75 -0
- package/config/commands/spec-forge.md +213 -0
- package/config/commands/spec-help.md +194 -0
- package/config/commands/spec-patch.md +342 -0
- package/config/commands/spec-resolve.md +110 -0
- package/config/commands/spec-review.md +153 -0
- package/config/commands/status.md +114 -0
- package/config/commands/sync.md +131 -0
- package/config/commands/task.md +138 -0
- package/config/commands/verify.md +124 -0
- package/config/hooks/README.md +632 -0
- package/config/hooks/activity-log.sh +187 -0
- package/config/hooks/anti-rationalize.sh +52 -0
- package/config/hooks/capture-verification.sh +112 -0
- package/config/hooks/collect-metrics.sh +135 -0
- package/config/hooks/enforce-file-scope.sh +75 -0
- package/config/hooks/enforce-state-machine.sh +161 -0
- package/config/hooks/enforce-tdd.sh +180 -0
- package/config/hooks/format.sh +40 -0
- package/config/hooks/lib/activity-helpers.sh +162 -0
- package/config/hooks/lib/read-settings.sh +71 -0
- package/config/hooks/load-context-skills.sh +95 -0
- package/config/hooks/notify.sh +81 -0
- package/config/hooks/pre-commit.sample +35 -0
- package/config/hooks/protect-files.sh +63 -0
- package/config/hooks/track-agents.sh +41 -0
- package/config/hooks/track-commands.sh +37 -0
- package/config/hooks/track-enforcement.sh +44 -0
- package/config/hooks/track-ooda.sh +77 -0
- package/config/hooks/validate-commit-msg.sh +35 -0
- package/config/hooks/validate-plan.sh +213 -0
- package/config/hooks/verify-criteria.sh +46 -0
- package/config/hooks/verify-todo-completion.sh +140 -0
- package/config/rules/comments.md +25 -0
- package/config/rules/decision-rules.md +308 -0
- package/config/rules/hygiene.md +247 -0
- package/config/rules/pattern-detection.md +372 -0
- package/config/rules/profiles.md +193 -0
- package/config/rules/recovery.md +83 -0
- package/config/rules/scope-detection.md +213 -0
- package/config/rules/standards.md +127 -0
- package/config/rules/workflow.md +121 -0
- package/config/schemas.md +767 -0
- package/config/settings.json +195 -0
- package/config/skills/backend/SKILL.md +734 -0
- package/config/skills/database/SKILL.md +426 -0
- package/config/skills/frontend/SKILL.md +434 -0
- package/config/skills/git/SKILL.md +396 -0
- package/config/skills/index.yaml +36 -0
- package/config/skills/observability/SKILL.md +430 -0
- package/config/skills/package-dev/SKILL.md +498 -0
- package/config/skills/performance/SKILL.md +378 -0
- package/config/skills/resilience/SKILL.md +573 -0
- package/config/skills/testing/SKILL.md +398 -0
- package/config/skills/testing-patterns/SKILL.md +276 -0
- package/config/skills/typescript/SKILL.md +152 -0
- package/config/templates/CLAUDE.md +70 -0
- package/config/templates/README.md +117 -0
- package/config/templates/steering/adr-template.md +102 -0
- package/config/templates/steering/product.md +60 -0
- package/config/templates/steering/rfc-template.md +159 -0
- package/config/templates/steering/structure.md +146 -0
- package/config/templates/steering/tech.md +85 -0
- package/package.json +40 -0
- package/src/install.js +163 -0
- package/src/report.js +310 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-patch
|
|
3
|
+
description: Patch a specific section of the canonical spec (surgical update)
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
tools: Read, Write, Edit, Grep, Glob, Bash
|
|
6
|
+
model: sonnet
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /spec-patch <topic> — Surgical Spec Update
|
|
10
|
+
|
|
11
|
+
## Goal
|
|
12
|
+
|
|
13
|
+
Update ONLY the requested section of the spec, preserving everything else.
|
|
14
|
+
Use inventory docs + existing canon docs as sources.
|
|
15
|
+
Minimal, focused changes.
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
`/spec-forge` → `/spec-resolve` → `/spec-review` ⟷ **`/spec-patch`** ← YOU ARE HERE → `/plan`
|
|
20
|
+
|
|
21
|
+
## When to Use
|
|
22
|
+
|
|
23
|
+
| Situation | Use /spec-patch? |
|
|
24
|
+
|-----------|------------------|
|
|
25
|
+
| Fix specific section after audit | ✅ Yes |
|
|
26
|
+
| Apply patches from spec-audit.md | ✅ Yes |
|
|
27
|
+
| Resolve specific conflict | ✅ Yes |
|
|
28
|
+
| Add single missing requirement | ✅ Yes |
|
|
29
|
+
| Major rewrite needed | ❌ Use /spec-forge |
|
|
30
|
+
| Full audit needed | ❌ Use /spec-review |
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
/spec-patch <topic> # Patch specific section
|
|
36
|
+
/spec-patch auth # Update authentication
|
|
37
|
+
/spec-patch --dry-run <topic> # Preview changes
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Cost Estimate
|
|
41
|
+
|
|
42
|
+
| Patch Scope | Estimated Cost |
|
|
43
|
+
|-------------|----------------|
|
|
44
|
+
| Single requirement (FR-XXX) | $0.03 - $0.08 |
|
|
45
|
+
| Small section (auth, pricing) | $0.08 - $0.15 |
|
|
46
|
+
| Large section (data-model) | $0.15 - $0.25 |
|
|
47
|
+
|
|
48
|
+
*Sonnet model used for scoped updates. Most cost-effective spec command.*
|
|
49
|
+
|
|
50
|
+
## Arguments
|
|
51
|
+
|
|
52
|
+
`<topic>` — The section or topic to patch
|
|
53
|
+
|
|
54
|
+
**Examples:**
|
|
55
|
+
|
|
56
|
+
- `/spec-patch auth` — Update authentication section
|
|
57
|
+
- `/spec-patch pricing` — Update pricing/billing requirements
|
|
58
|
+
- `/spec-patch edge-cases` — Update edge case handling
|
|
59
|
+
- `/spec-patch data-model` — Update entities/data section
|
|
60
|
+
- `/spec-patch integrations` — Update integrations section
|
|
61
|
+
- `/spec-patch nfrs` — Update non-functional requirements
|
|
62
|
+
- `/spec-patch FR-003` — Update specific requirement
|
|
63
|
+
|
|
64
|
+
## Inputs (read-only)
|
|
65
|
+
|
|
66
|
+
- `.codecruise/canon/spec.md` (required)
|
|
67
|
+
- `.codecruise/canon/issues.md` (if exists)
|
|
68
|
+
- `.codecruise/canon/spec-audit.md` (if exists, check for related patches)
|
|
69
|
+
- `.codecruise/canon/decisions.md` (if exists)
|
|
70
|
+
- `.codecruise/roadmap/future.md` (if exists)
|
|
71
|
+
- `.codecruise/context/{topic}.yaml` (if exists, preferred source)
|
|
72
|
+
- Relevant `.codecruise/inventory/**` files (fallback if no context)
|
|
73
|
+
|
|
74
|
+
**Rule**: NEVER edit `.codecruise/inventory/**`
|
|
75
|
+
|
|
76
|
+
## Outputs
|
|
77
|
+
|
|
78
|
+
| File | Action |
|
|
79
|
+
|------|--------|
|
|
80
|
+
| `.codecruise/canon/spec.md` | Edit only `<topic>` section |
|
|
81
|
+
| `.codecruise/canon/issues.md` | Update if conflicts resolved or new issues found |
|
|
82
|
+
| `.codecruise/canon/decisions.md` | Append if decision made |
|
|
83
|
+
| `.codecruise/canon/changelog.md` | Append patch entry |
|
|
84
|
+
| `.codecruise/context/{topic}.yaml` | Update if new decisions/constraints added |
|
|
85
|
+
|
|
86
|
+
## Process
|
|
87
|
+
|
|
88
|
+
### 1) Locate Target Section
|
|
89
|
+
|
|
90
|
+
Find the exact section(s) in spec.md for `<topic>`:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Example for "auth"
|
|
94
|
+
Grep -i "auth|authentication|login|session" .codecruise/canon/spec.md
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**If section missing**: Create it in the appropriate location in spec.md.
|
|
98
|
+
|
|
99
|
+
**Section mapping:**
|
|
100
|
+
|
|
101
|
+
| Topic | Likely Sections |
|
|
102
|
+
|-------|-----------------|
|
|
103
|
+
| auth | 4.1 Functional (auth reqs), 6.3 Auth Model |
|
|
104
|
+
| pricing | 4.1 Functional (billing reqs) |
|
|
105
|
+
| data-model | 6.1 Key Entities |
|
|
106
|
+
| integrations | 6.2 Integrations |
|
|
107
|
+
| nfrs | 4.2 Non-Functional Requirements |
|
|
108
|
+
| edge-cases | Link to appendix/edge-cases.md |
|
|
109
|
+
| FR-XXX | 4.1 Functional Requirements |
|
|
110
|
+
| NFR-XXX | 4.2 Non-Functional Requirements |
|
|
111
|
+
|
|
112
|
+
### 2) Gather Topic-Relevant Sources
|
|
113
|
+
|
|
114
|
+
**Preferred: Read context file (fast, pre-extracted)**
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Check if context file exists
|
|
118
|
+
Read .codecruise/context/{topic}.yaml
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
If context file exists:
|
|
122
|
+
- Use `sources` for file references
|
|
123
|
+
- Use `decisions` for existing decisions
|
|
124
|
+
- Use `constraints` for known limitations
|
|
125
|
+
- Use `open_questions` for unresolved items
|
|
126
|
+
|
|
127
|
+
**Fallback: Grep inventory (slower, more tokens)**
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Only if no context file exists
|
|
131
|
+
Grep -i "<topic>" .codecruise/inventory/
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Read relevant files. Extract:
|
|
135
|
+
|
|
136
|
+
- Requirements related to `<topic>`
|
|
137
|
+
- Business rules
|
|
138
|
+
- Constraints
|
|
139
|
+
- Edge cases
|
|
140
|
+
- Decisions made
|
|
141
|
+
|
|
142
|
+
### 3) Check for Existing Patches
|
|
143
|
+
|
|
144
|
+
If `.codecruise/canon/spec-audit.md` exists:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
Grep -i "<topic>" .codecruise/canon/spec-audit.md
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Look for proposed patches to apply.
|
|
151
|
+
|
|
152
|
+
### 4) Check for Related Issues
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
Grep -i "<topic>" .codecruise/canon/issues.md
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Identify conflicts/questions to resolve.
|
|
159
|
+
|
|
160
|
+
### 5) Apply Updates
|
|
161
|
+
|
|
162
|
+
**For requirements:**
|
|
163
|
+
|
|
164
|
+
```markdown
|
|
165
|
+
#### FR-XXX: {Requirement Name}
|
|
166
|
+
- **Description**: {Clear description}
|
|
167
|
+
- **User Story**: As a {role}, I want {goal}, so that {benefit}
|
|
168
|
+
- **Acceptance Criteria**:
|
|
169
|
+
- [ ] {Testable criterion 1}
|
|
170
|
+
- [ ] {Testable criterion 2}
|
|
171
|
+
- **Source**: {inventory file(s)}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Acceptance criteria rules:**
|
|
175
|
+
|
|
176
|
+
- Must be testable (measurable, observable)
|
|
177
|
+
- No vague words ("fast", "easy", "secure")
|
|
178
|
+
- Include edge cases if known
|
|
179
|
+
|
|
180
|
+
**For NFRs:**
|
|
181
|
+
|
|
182
|
+
```markdown
|
|
183
|
+
#### NFR-XXX: {Requirement Name}
|
|
184
|
+
- **Category**: Performance | Security | Reliability | Observability
|
|
185
|
+
- **Requirement**: {Specific requirement}
|
|
186
|
+
- **Threshold**: {Measurable target}
|
|
187
|
+
- **Source**: {inventory file(s)}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 6) Handle Conflicts
|
|
191
|
+
|
|
192
|
+
If patching resolves a conflict:
|
|
193
|
+
|
|
194
|
+
1. Update issues.md:
|
|
195
|
+
|
|
196
|
+
```yaml
|
|
197
|
+
- id: conflict-XXX
|
|
198
|
+
...
|
|
199
|
+
status: resolved
|
|
200
|
+
resolution: "{How it was resolved}"
|
|
201
|
+
resolved_by: "/spec-patch <topic>"
|
|
202
|
+
resolved_date: 2024-01-24
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
2. Add to decisions.md:
|
|
206
|
+
|
|
207
|
+
```markdown
|
|
208
|
+
### D-XXX: {Decision Title}
|
|
209
|
+
- **Date**: 2024-01-24
|
|
210
|
+
- **Decision**: {What was decided}
|
|
211
|
+
- **Rationale**: {Why}
|
|
212
|
+
- **Related**: conflict-XXX
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### 7) Handle New Issues
|
|
216
|
+
|
|
217
|
+
If patch reveals new conflicts/questions:
|
|
218
|
+
|
|
219
|
+
1. Append to issues.md with next available ID
|
|
220
|
+
2. Note in output summary
|
|
221
|
+
3. Do NOT silently resolve — surface explicitly
|
|
222
|
+
|
|
223
|
+
### 7.5) Update Context File
|
|
224
|
+
|
|
225
|
+
If `.codecruise/context/{topic}.yaml` exists, update it:
|
|
226
|
+
|
|
227
|
+
```yaml
|
|
228
|
+
# Add new decision
|
|
229
|
+
decisions:
|
|
230
|
+
- id: D-XXX # from decisions.md
|
|
231
|
+
summary: "{decision made during patch}"
|
|
232
|
+
source: "/spec-patch {topic}"
|
|
233
|
+
|
|
234
|
+
# Add new constraint if discovered
|
|
235
|
+
constraints:
|
|
236
|
+
- "{new constraint}"
|
|
237
|
+
|
|
238
|
+
# Remove resolved open question
|
|
239
|
+
open_questions:
|
|
240
|
+
# Remove oq-XXX if resolved by this patch
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
If context file doesn't exist but should (topic is a major feature):
|
|
244
|
+
- Create `.codecruise/context/{topic}.yaml` with info gathered during patch
|
|
245
|
+
- Note in output: "Created context/{topic}.yaml for future efficiency"
|
|
246
|
+
|
|
247
|
+
### 8) Scope Check
|
|
248
|
+
|
|
249
|
+
If content belongs in future.md instead of spec.md:
|
|
250
|
+
|
|
251
|
+
1. Add to `.codecruise/roadmap/future.md`
|
|
252
|
+
2. Note in output: "Moved {item} to future.md (not v1 scope)"
|
|
253
|
+
|
|
254
|
+
### 9) Update Changelog
|
|
255
|
+
|
|
256
|
+
Append to `.codecruise/canon/changelog.md`:
|
|
257
|
+
|
|
258
|
+
```markdown
|
|
259
|
+
## [0.2.2] - 2024-01-24
|
|
260
|
+
### Patched: {topic}
|
|
261
|
+
- Updated FR-003 acceptance criteria
|
|
262
|
+
- Added FR-016: Password reset
|
|
263
|
+
- Resolved conflict-004
|
|
264
|
+
- Added NFR-009: Input validation
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### 10) Update Version
|
|
268
|
+
|
|
269
|
+
In spec.md frontmatter:
|
|
270
|
+
|
|
271
|
+
- Increment patch version (0.2.1 → 0.2.2)
|
|
272
|
+
- **Never** auto-increment major version (0→1, 1→2) without human approval
|
|
273
|
+
- Update `generated_hash` with new hash
|
|
274
|
+
|
|
275
|
+
## Output
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
✓ Spec patched: {topic}
|
|
279
|
+
|
|
280
|
+
Version: 0.2.1 → 0.2.2
|
|
281
|
+
|
|
282
|
+
Changes:
|
|
283
|
+
- Updated: FR-003 (acceptance criteria)
|
|
284
|
+
- Added: FR-016 (password reset)
|
|
285
|
+
- Added: NFR-009 (input validation)
|
|
286
|
+
|
|
287
|
+
Issues resolved:
|
|
288
|
+
- conflict-004: Auth mechanism → JWT for API, sessions for web
|
|
289
|
+
|
|
290
|
+
New issues found:
|
|
291
|
+
- oq-015: Password complexity requirements undefined
|
|
292
|
+
|
|
293
|
+
Scope changes:
|
|
294
|
+
- Moved "SSO integration" to future.md
|
|
295
|
+
|
|
296
|
+
Files modified:
|
|
297
|
+
- .codecruise/canon/spec.md (section 4.1, 4.2)
|
|
298
|
+
- .codecruise/canon/issues.md (1 resolved, 1 added)
|
|
299
|
+
- .codecruise/canon/decisions.md (1 added)
|
|
300
|
+
- .codecruise/canon/changelog.md (1.3 entry)
|
|
301
|
+
|
|
302
|
+
Next: Review changes, then /spec-review for full audit
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## Dry Run Mode
|
|
306
|
+
|
|
307
|
+
When `--dry-run` flag is passed:
|
|
308
|
+
|
|
309
|
+
```
|
|
310
|
+
🔍 Dry Run: /spec-patch auth
|
|
311
|
+
|
|
312
|
+
Topic Analysis:
|
|
313
|
+
- Sections found: 2 (4.1 Functional, 6.3 Auth Model)
|
|
314
|
+
- Related inventory files: 3
|
|
315
|
+
- Related issues: 2 (conflict-004, oq-012)
|
|
316
|
+
|
|
317
|
+
Would Change:
|
|
318
|
+
- spec.md:
|
|
319
|
+
- Update: FR-003 (acceptance criteria)
|
|
320
|
+
- Add: FR-016 (password reset)
|
|
321
|
+
- Add: NFR-009 (input validation)
|
|
322
|
+
- issues.md:
|
|
323
|
+
- Resolve: conflict-004
|
|
324
|
+
- Add: oq-015 (new question found)
|
|
325
|
+
- decisions.md:
|
|
326
|
+
- Add: D-005 (auth mechanism decision)
|
|
327
|
+
- changelog.md:
|
|
328
|
+
- Add: v0.2.2 entry
|
|
329
|
+
|
|
330
|
+
Estimated cost: $0.12
|
|
331
|
+
|
|
332
|
+
Run without --dry-run to apply patch.
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Quality Bar
|
|
336
|
+
|
|
337
|
+
- Only touch sections related to `<topic>`
|
|
338
|
+
- Preserve all unrelated content exactly
|
|
339
|
+
- All new requirements have testable criteria
|
|
340
|
+
- Conflicts resolved explicitly, not silently
|
|
341
|
+
- Changes are minimal and focused
|
|
342
|
+
- v1 scope strictly maintained
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-resolve
|
|
3
|
+
description: Apply user-provided resolutions from issues.md to spec and decisions
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
tools: Read, Write, Edit, Grep, Glob
|
|
6
|
+
model: sonnet
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /spec-resolve — Apply Issue Resolutions
|
|
10
|
+
|
|
11
|
+
Apply user-provided resolutions from issues.md to spec.md and decisions.md.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
/spec-resolve conflict-001 # Single issue
|
|
17
|
+
/spec-resolve conflict-001 oq-003 # Multiple issues
|
|
18
|
+
/spec-resolve --all # All with resolution field
|
|
19
|
+
/spec-resolve --dry-run <ids> # Preview
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Resolution Format
|
|
23
|
+
|
|
24
|
+
User adds `resolution:` field to issues.md:
|
|
25
|
+
|
|
26
|
+
**Conflict**:
|
|
27
|
+
```yaml
|
|
28
|
+
- id: conflict-001
|
|
29
|
+
description: "Auth timeout: 30min vs 1hr"
|
|
30
|
+
status: open
|
|
31
|
+
resolution: "Use 1hr with re-auth for sensitive actions"
|
|
32
|
+
rationale: "Balances UX with security"
|
|
33
|
+
apply_to:
|
|
34
|
+
- section: "6.3 Auth Model"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Open Question**:
|
|
38
|
+
```yaml
|
|
39
|
+
- id: oq-001
|
|
40
|
+
question: "Rate limit behavior?"
|
|
41
|
+
status: open
|
|
42
|
+
resolution: "Return 429 with Retry-After header"
|
|
43
|
+
apply_to:
|
|
44
|
+
- new_requirement: NFR-010
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Assumption**:
|
|
48
|
+
```yaml
|
|
49
|
+
- id: assumption-001
|
|
50
|
+
assumption: "Free tier = no premium API"
|
|
51
|
+
status: open
|
|
52
|
+
resolution: "confirmed" # or "revised: <new>"
|
|
53
|
+
validated_by: "PM confirmed"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Process
|
|
57
|
+
|
|
58
|
+
1. **Parse IDs**: Validate format (conflict-XXX, oq-XXX, assumption-XXX)
|
|
59
|
+
2. **Validate**: Check resolution exists, status is open
|
|
60
|
+
3. **Determine Updates**: Use apply_to hints or infer from keywords
|
|
61
|
+
4. **Update spec.md**: Modify sections, add requirements
|
|
62
|
+
5. **Create Decision**: Append D-XXX to decisions.md
|
|
63
|
+
6. **Update Context**: Add decision to docs/context/{feature}.yaml
|
|
64
|
+
7. **Mark Resolved**: Set status = resolved in issues.md
|
|
65
|
+
8. **Changelog**: Increment patch version
|
|
66
|
+
|
|
67
|
+
## Outputs
|
|
68
|
+
|
|
69
|
+
| File | Action |
|
|
70
|
+
|------|--------|
|
|
71
|
+
| `spec.md` | Update sections/requirements |
|
|
72
|
+
| `decisions.md` | Append D-XXX entries |
|
|
73
|
+
| `issues.md` | Mark resolved |
|
|
74
|
+
| `changelog.md` | Append version entry |
|
|
75
|
+
| `context/{feature}.yaml` | Update decisions |
|
|
76
|
+
|
|
77
|
+
## Versioning
|
|
78
|
+
|
|
79
|
+
- Increment patch (0.2.2 → 0.2.3)
|
|
80
|
+
- Never auto-increment major version
|
|
81
|
+
|
|
82
|
+
## Output
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
✓ Issues resolved: 3
|
|
86
|
+
|
|
87
|
+
Processed:
|
|
88
|
+
✓ conflict-001 → D-005: Auth timeout
|
|
89
|
+
✓ oq-003 → D-006: Rate limit behavior
|
|
90
|
+
✓ assumption-001 → Confirmed
|
|
91
|
+
|
|
92
|
+
Skipped:
|
|
93
|
+
⚠️ oq-002: No resolution provided
|
|
94
|
+
|
|
95
|
+
Spec updates:
|
|
96
|
+
- Section 6.3 (updated)
|
|
97
|
+
- NFR-010 (added)
|
|
98
|
+
|
|
99
|
+
Version: 0.2.2 → 0.2.3
|
|
100
|
+
|
|
101
|
+
Next: /spec-review to validate
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Quality Bar
|
|
105
|
+
|
|
106
|
+
- Only process explicit resolutions
|
|
107
|
+
- Never assume or infer
|
|
108
|
+
- Preserve unrelated spec content
|
|
109
|
+
- Create audit trail in decisions.md
|
|
110
|
+
- Idempotent: re-running = no change
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-review
|
|
3
|
+
description: Audit canonical spec vs inventory; surface gaps, contradictions, and fixes
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
tools: Glob, Read, Write, Edit, Grep, Bash
|
|
6
|
+
model: opus
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /spec-review — Spec Audit
|
|
10
|
+
|
|
11
|
+
Deep audit of canonical spec against inventory. Find gaps, contradictions, propose fixes.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
| Situation | Use /spec-review? |
|
|
16
|
+
|-----------|-------------------|
|
|
17
|
+
| Before sprint planning | ✅ Yes |
|
|
18
|
+
| After adding inventory docs | ✅ Yes |
|
|
19
|
+
| Quick section fix | ❌ Use /spec-patch |
|
|
20
|
+
| No spec exists | ❌ Use /spec-forge |
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
/spec-review # Review against .codecruise/inventory/
|
|
26
|
+
/spec-review .codecruise/ingested/combined.md # After /ingest
|
|
27
|
+
/spec-review --dry-run # Preview findings
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Size Check (Auto)
|
|
31
|
+
|
|
32
|
+
| Condition | Action |
|
|
33
|
+
|-----------|--------|
|
|
34
|
+
| > 50 files | STOP → Suggest `/ingest` first |
|
|
35
|
+
| > 2MB | STOP → Suggest `/ingest` first |
|
|
36
|
+
|
|
37
|
+
## Inputs (read-only)
|
|
38
|
+
|
|
39
|
+
- `.codecruise/canon/spec.md` (required)
|
|
40
|
+
- `.codecruise/canon/issues.md`, `decisions.md` (existing state)
|
|
41
|
+
- `.codecruise/context/*.yaml` (for efficient validation)
|
|
42
|
+
- `.codecruise/inventory/**` or argument path
|
|
43
|
+
|
|
44
|
+
## Outputs
|
|
45
|
+
|
|
46
|
+
| File | Action |
|
|
47
|
+
|------|--------|
|
|
48
|
+
| `spec-audit.md` | Create/update (main report) |
|
|
49
|
+
| `issues.md` | Update if new issues |
|
|
50
|
+
| `spec.md` | Update ONLY for unambiguous fixes |
|
|
51
|
+
|
|
52
|
+
## Process
|
|
53
|
+
|
|
54
|
+
1. **Load Canonical State**: spec version, existing issues, decisions
|
|
55
|
+
2. **Load Context**: .codecruise/context/*.yaml for known decisions
|
|
56
|
+
3. **Deduplication**: Index existing issues (open AND resolved)
|
|
57
|
+
4. **Cross-Check**: Scan inventory for issues
|
|
58
|
+
5. **Classify**: Conflict, Question, Gap, Weak Criteria, Security
|
|
59
|
+
6. **Grade**: A-F based on completeness, clarity, consistency
|
|
60
|
+
7. **Propose Patches**: Concrete, copy-pastable fixes
|
|
61
|
+
|
|
62
|
+
## Deduplication Rules
|
|
63
|
+
|
|
64
|
+
| Existing Status | New Finding | Action |
|
|
65
|
+
|-----------------|-------------|--------|
|
|
66
|
+
| `resolved` | Same issue | **SKIP** |
|
|
67
|
+
| `open` | Same issue | **SKIP** |
|
|
68
|
+
| `open` | More detail | Update existing |
|
|
69
|
+
| none | New | Add with next ID |
|
|
70
|
+
|
|
71
|
+
## Issue Classification
|
|
72
|
+
|
|
73
|
+
| Type | What to Look For |
|
|
74
|
+
|------|------------------|
|
|
75
|
+
| Missing requirement | Feature implied but not in spec |
|
|
76
|
+
| Conflicting rule | Contradicts spec |
|
|
77
|
+
| Scope confusion | v1 in future or vice versa |
|
|
78
|
+
| Weak criteria | Not testable ("should be fast") |
|
|
79
|
+
| Security gap | Missing validation, auth |
|
|
80
|
+
|
|
81
|
+
## Audit Report Structure
|
|
82
|
+
|
|
83
|
+
```markdown
|
|
84
|
+
# Spec Audit Report
|
|
85
|
+
|
|
86
|
+
## Executive Summary
|
|
87
|
+
Grade: B
|
|
88
|
+
| Category | Score | Notes |
|
|
89
|
+
|----------|-------|-------|
|
|
90
|
+
| Completeness | 7/10 | 3 missing reqs |
|
|
91
|
+
| Consistency | 6/10 | 4 conflicts |
|
|
92
|
+
|
|
93
|
+
## Top 5 Blockers
|
|
94
|
+
1. conflict-004: Auth undefined (P0)
|
|
95
|
+
...
|
|
96
|
+
|
|
97
|
+
## Coverage Analysis
|
|
98
|
+
| Source | Found | In Spec | Missing |
|
|
99
|
+
...
|
|
100
|
+
|
|
101
|
+
## Conflicts Found
|
|
102
|
+
...
|
|
103
|
+
|
|
104
|
+
## Proposed Patches
|
|
105
|
+
### Patch 1: Add FR-016
|
|
106
|
+
Location: Section 4.1
|
|
107
|
+
```markdown
|
|
108
|
+
#### FR-016: Password Reset
|
|
109
|
+
- **Acceptance Criteria**:
|
|
110
|
+
- [ ] Reset link expires in 1hr
|
|
111
|
+
```
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Grade Criteria
|
|
115
|
+
|
|
116
|
+
| Grade | Meaning |
|
|
117
|
+
|-------|---------|
|
|
118
|
+
| A | Ship-ready |
|
|
119
|
+
| B | 3-5 issues to resolve |
|
|
120
|
+
| C | Significant gaps |
|
|
121
|
+
| D | Major conflicts |
|
|
122
|
+
| F | Contradicts itself, restart |
|
|
123
|
+
|
|
124
|
+
## Output
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
✓ Spec audit complete
|
|
128
|
+
|
|
129
|
+
Grade: B
|
|
130
|
+
Version: 0.2.1
|
|
131
|
+
|
|
132
|
+
Context validation:
|
|
133
|
+
- Decisions honored: 12/14
|
|
134
|
+
- Violations: 2
|
|
135
|
+
|
|
136
|
+
Issues:
|
|
137
|
+
- New conflicts: 2 (1 blocking)
|
|
138
|
+
- New questions: 3
|
|
139
|
+
- Existing unresolved: 4
|
|
140
|
+
|
|
141
|
+
Patches proposed: 5
|
|
142
|
+
|
|
143
|
+
Next:
|
|
144
|
+
1. Resolve conflict-004 (BLOCKING)
|
|
145
|
+
2. /spec-patch auth
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Quality Bar
|
|
149
|
+
|
|
150
|
+
- Every finding has actionable recommendation
|
|
151
|
+
- Patches are copy-pastable
|
|
152
|
+
- Blockers clearly marked
|
|
153
|
+
- No duplicate issues (resolved never recreated)
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: status
|
|
3
|
+
description: Show current project state and progress
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
model: haiku
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /status Command
|
|
9
|
+
|
|
10
|
+
Display current project state and progress.
|
|
11
|
+
|
|
12
|
+
## Read First
|
|
13
|
+
|
|
14
|
+
1. `progress.yaml`
|
|
15
|
+
2. `roadmap/project.yaml`
|
|
16
|
+
3. Current phase file
|
|
17
|
+
|
|
18
|
+
## Process
|
|
19
|
+
|
|
20
|
+
### 1. Load State
|
|
21
|
+
|
|
22
|
+
Read `progress.yaml` for:
|
|
23
|
+
- Current phase, feature, TODO
|
|
24
|
+
- Active TODOs
|
|
25
|
+
- Statistics
|
|
26
|
+
- Blocked items
|
|
27
|
+
|
|
28
|
+
### 2. Display Status
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
32
|
+
║ PROJECT STATUS ║
|
|
33
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
34
|
+
║ Project: {name} ║
|
|
35
|
+
║ Progress: [{████████░░░░░░░░░░░░}] 40% ║
|
|
36
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
37
|
+
║ Current Work ║
|
|
38
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
39
|
+
║ Phase: {phase_name} ║
|
|
40
|
+
║ Feature: {feature_name} ║
|
|
41
|
+
║ TODO: {todo_id} - {description} ║
|
|
42
|
+
║ Branch: {branch_name} ║
|
|
43
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
44
|
+
║ Statistics ║
|
|
45
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
46
|
+
║ Phases: {done}/{total} ║
|
|
47
|
+
║ Features: {done}/{total} ║
|
|
48
|
+
║ TODOs: {done}/{total} ║
|
|
49
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
50
|
+
║ Active TODOs ║
|
|
51
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
52
|
+
║ • {todo_id}: {description} ({owner}) - {status} ║
|
|
53
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
54
|
+
║ Blocked ║
|
|
55
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
56
|
+
║ • {todo_id}: {reason} ║
|
|
57
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 3. Upcoming Work
|
|
61
|
+
|
|
62
|
+
Show next 3 TODOs after current:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Next Up:
|
|
66
|
+
1. {todo_id}: {description}
|
|
67
|
+
2. {todo_id}: {description}
|
|
68
|
+
3. {todo_id}: {description}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 4. Token Usage
|
|
72
|
+
|
|
73
|
+
Show token consumption for transparency:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
77
|
+
║ Token Usage ║
|
|
78
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
79
|
+
║ Session: {input} in / {output} out = {total} tokens ║
|
|
80
|
+
║ Cumulative: {total} tokens (~${cost} USD) ║
|
|
81
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 5. Recent Activity
|
|
85
|
+
|
|
86
|
+
If git available, show recent commits:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
Recent Commits:
|
|
90
|
+
• 2h ago: feat(auth): implement login validation
|
|
91
|
+
• 3h ago: test(auth): add login tests
|
|
92
|
+
• 5h ago: chore: setup project structure
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Variations
|
|
96
|
+
|
|
97
|
+
### `/status --phase`
|
|
98
|
+
Show detailed phase breakdown
|
|
99
|
+
|
|
100
|
+
### `/status --blocked`
|
|
101
|
+
Show only blocked items with context
|
|
102
|
+
|
|
103
|
+
### `/status --next`
|
|
104
|
+
Show just the next TODO to work on
|
|
105
|
+
|
|
106
|
+
## No Project State
|
|
107
|
+
|
|
108
|
+
If `progress.yaml` doesn't exist:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
No project state found.
|
|
112
|
+
|
|
113
|
+
Run /plan to create a roadmap and initialize tracking.
|
|
114
|
+
```
|