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,227 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: doctor
|
|
3
|
+
description: Validate project setup and diagnose issues with actionable fixes
|
|
4
|
+
model: haiku
|
|
5
|
+
tools: Read, Bash, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /doctor — Project Health Check
|
|
9
|
+
|
|
10
|
+
Diagnose codecruise setup and provide actionable fixes.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
/doctor # Full health check
|
|
16
|
+
/doctor --fix # Auto-fix where possible
|
|
17
|
+
/doctor --validate # Include plan consistency checks
|
|
18
|
+
/doctor --validate-schema # Schema validation only
|
|
19
|
+
/doctor --validate-plan # Plan consistency only
|
|
20
|
+
/doctor --validate-steering # Steering docs validation only
|
|
21
|
+
/doctor --json # Machine-readable output
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Check Categories
|
|
25
|
+
|
|
26
|
+
### 1. Project Setup
|
|
27
|
+
|
|
28
|
+
| Check | Pass | Fail |
|
|
29
|
+
|-------|------|------|
|
|
30
|
+
| CLAUDE.md exists | File in root | Missing |
|
|
31
|
+
| .claude/settings.json | File present | Missing (auto-create) |
|
|
32
|
+
| .codecruise/ directory | Exists | Missing (auto-create) |
|
|
33
|
+
| .codecruise/progress.yaml | File present | Missing |
|
|
34
|
+
| .codecruise/roadmap/ | Has .yaml files | Empty or missing |
|
|
35
|
+
|
|
36
|
+
### 2. Schema Validation
|
|
37
|
+
|
|
38
|
+
| Check | Pass | Fail |
|
|
39
|
+
|-------|------|------|
|
|
40
|
+
| .codecruise/progress.yaml schema | Valid v2 | Invalid or v1 (warn) |
|
|
41
|
+
| .codecruise/roadmap/*.yaml schema | Valid | Missing required fields |
|
|
42
|
+
| TODO ID pattern | `todo-N.Na-NNN` | Invalid format |
|
|
43
|
+
| Feature ID pattern | `feature-N.N` | Invalid format |
|
|
44
|
+
|
|
45
|
+
### 3. Hook Installation
|
|
46
|
+
|
|
47
|
+
| Check | Pass | Fail |
|
|
48
|
+
|-------|------|------|
|
|
49
|
+
| settings.json exists | Present | Missing |
|
|
50
|
+
| Referenced hooks exist | All found | Missing files |
|
|
51
|
+
| Hooks executable | chmod +x | Not executable |
|
|
52
|
+
| Required hooks enabled | enforce-tdd, verify-todo-completion | Disabled |
|
|
53
|
+
|
|
54
|
+
### 4. Git State
|
|
55
|
+
|
|
56
|
+
| Check | Pass | Warn | Fail |
|
|
57
|
+
|-------|------|------|------|
|
|
58
|
+
| Is git repo | .git exists | — | Not a repo |
|
|
59
|
+
| Uncommitted changes | Clean | Modified files | — |
|
|
60
|
+
| On expected branch | Matches TODO scope | Different branch | — |
|
|
61
|
+
| Remote configured | origin exists | — | No remote |
|
|
62
|
+
|
|
63
|
+
### 5. Quality Command Speed
|
|
64
|
+
|
|
65
|
+
| Check | Pass | Warn | Fail |
|
|
66
|
+
|-------|------|------|------|
|
|
67
|
+
| quality_command defined | In CLAUDE.md | — | Missing |
|
|
68
|
+
| Execution time | < 10s | 10-30s | > 30s |
|
|
69
|
+
| Tools installed | All pass | — | Missing deps |
|
|
70
|
+
|
|
71
|
+
### 6. Steering Docs (--validate-steering)
|
|
72
|
+
|
|
73
|
+
| Check | Pass | Warn | Fail |
|
|
74
|
+
|-------|------|------|------|
|
|
75
|
+
| CLAUDE.md exists | In root | — | Missing |
|
|
76
|
+
| CLAUDE.md size | < 150 lines | 150-300 lines | > 300 lines |
|
|
77
|
+
| .codecruise/steering/ | Directory exists | — | Missing |
|
|
78
|
+
| product.md exists | In .codecruise/steering/ | — | Missing |
|
|
79
|
+
| tech.md exists | In .codecruise/steering/ | — | Missing |
|
|
80
|
+
| structure.md exists | In .codecruise/steering/ | — | Missing |
|
|
81
|
+
| Docs freshness | < 30 days | 30-90 days | > 90 days |
|
|
82
|
+
| Quality command works | Passes | — | Fails |
|
|
83
|
+
| Required sections | All present | Some missing | Critical missing |
|
|
84
|
+
|
|
85
|
+
### 7. Plan Consistency (--validate)
|
|
86
|
+
|
|
87
|
+
| Check | Pass | Warn | Fail |
|
|
88
|
+
|-------|------|------|------|
|
|
89
|
+
| Orphan TODOs | None | — | In queue, not in roadmap |
|
|
90
|
+
| Missing TODOs | None | New in roadmap | — |
|
|
91
|
+
| depends_on refs | All valid | — | Invalid TODO ID |
|
|
92
|
+
| Circular deps | None | — | Cycle detected |
|
|
93
|
+
| Stale state | Active | Paused > 24h | Paused > 7d |
|
|
94
|
+
|
|
95
|
+
## Output Format
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
╔═══════════════════════════════════════════════════════════════╗
|
|
99
|
+
║ DOCTOR DIAGNOSIS ║
|
|
100
|
+
╠═══════════════════════════════════════════════════════════════╣
|
|
101
|
+
║ ✓ Project Setup [PASS] ║
|
|
102
|
+
║ ⚠ Schema Validation [WARN] ║
|
|
103
|
+
║ └─ .codecruise/progress.yaml: schema_version missing (v1 format) ║
|
|
104
|
+
║ ✓ Hook Installation [PASS] ║
|
|
105
|
+
║ ✗ Git State [FAIL] ║
|
|
106
|
+
║ └─ 3 uncommitted changes ║
|
|
107
|
+
║ ⚠ Quality Command Speed [WARN] ║
|
|
108
|
+
║ └─ 18s execution — consider Biome instead of ESLint ║
|
|
109
|
+
║ ✓ Plan Consistency [PASS] ║
|
|
110
|
+
╠═══════════════════════════════════════════════════════════════╣
|
|
111
|
+
║ Summary: 3 PASS | 2 WARN | 1 FAIL ║
|
|
112
|
+
╚═══════════════════════════════════════════════════════════════╝
|
|
113
|
+
|
|
114
|
+
Fixes:
|
|
115
|
+
1. Run: git add . && git commit -m "wip"
|
|
116
|
+
2. Run: /init --upgrade-schema (migrate to v2)
|
|
117
|
+
3. Consider: npm install -D @biomejs/biome
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Auto-Fix Actions (--fix)
|
|
121
|
+
|
|
122
|
+
| Issue | Auto-Fix Action |
|
|
123
|
+
|-------|-----------------|
|
|
124
|
+
| Missing .codecruise/ | Create directory |
|
|
125
|
+
| Missing settings.json | Copy from template |
|
|
126
|
+
| Non-executable hooks | `chmod +x` |
|
|
127
|
+
| Orphaned queue entries | Remove from queue |
|
|
128
|
+
| Unknown schema fields | Remove (with backup) |
|
|
129
|
+
| Stale pause state | Clear paused_at |
|
|
130
|
+
|
|
131
|
+
**Cannot auto-fix**:
|
|
132
|
+
- Uncommitted git changes (user must decide)
|
|
133
|
+
- Circular dependencies (requires manual refactor)
|
|
134
|
+
- Missing quality_command (user must define)
|
|
135
|
+
|
|
136
|
+
## Process
|
|
137
|
+
|
|
138
|
+
1. **Detect**: Scan project for codecruise files
|
|
139
|
+
2. **Check**: Run all applicable checks
|
|
140
|
+
3. **Report**: Display results with severity
|
|
141
|
+
4. **Suggest**: Provide actionable fix commands
|
|
142
|
+
5. **Fix** (if --fix): Apply auto-fixes, report changes
|
|
143
|
+
|
|
144
|
+
## Validation Details (--validate)
|
|
145
|
+
|
|
146
|
+
### Orphan TODO Detection
|
|
147
|
+
|
|
148
|
+
TODOs in `.codecruise/progress.yaml` queue but not in `.codecruise/roadmap/*.yaml`:
|
|
149
|
+
|
|
150
|
+
```yaml
|
|
151
|
+
# .codecruise/progress.yaml
|
|
152
|
+
queue:
|
|
153
|
+
completed: [todo-1.1a-001, todo-1.1a-099] # 099 is orphan
|
|
154
|
+
|
|
155
|
+
# roadmap/phase-01.yaml
|
|
156
|
+
# Only has todo-1.1a-001, todo-1.1a-002, etc.
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Fix**: Remove from queue or add to roadmap.
|
|
160
|
+
|
|
161
|
+
### Circular Dependency Detection
|
|
162
|
+
|
|
163
|
+
```yaml
|
|
164
|
+
# roadmap/phase-01.yaml
|
|
165
|
+
- id: todo-1.1a-001
|
|
166
|
+
depends_on: [todo-1.1a-002] # A depends on B
|
|
167
|
+
- id: todo-1.1a-002
|
|
168
|
+
depends_on: [todo-1.1a-001] # B depends on A — CYCLE!
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Fix**: Manual refactor required.
|
|
172
|
+
|
|
173
|
+
### Stale State Detection
|
|
174
|
+
|
|
175
|
+
| Condition | Severity | Suggestion |
|
|
176
|
+
|-----------|----------|------------|
|
|
177
|
+
| Paused < 24h | OK | — |
|
|
178
|
+
| Paused 1-7 days | Warn | "Consider resuming or resetting" |
|
|
179
|
+
| Paused > 7 days | Fail | "Stale state, run /init --reset" |
|
|
180
|
+
| Orphaned blockers | Warn | "Blocker resolved but still listed" |
|
|
181
|
+
|
|
182
|
+
## JSON Output (--json)
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"timestamp": "2026-02-20T14:30:00Z",
|
|
187
|
+
"summary": {
|
|
188
|
+
"pass": 4,
|
|
189
|
+
"warn": 2,
|
|
190
|
+
"fail": 1
|
|
191
|
+
},
|
|
192
|
+
"checks": {
|
|
193
|
+
"project_setup": { "status": "pass", "details": [] },
|
|
194
|
+
"schema_validation": {
|
|
195
|
+
"status": "warn",
|
|
196
|
+
"details": [
|
|
197
|
+
{ "file": ".codecruise/progress.yaml", "issue": "schema_version missing" }
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
"git_state": {
|
|
201
|
+
"status": "fail",
|
|
202
|
+
"details": [
|
|
203
|
+
{ "issue": "uncommitted_changes", "count": 3 }
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"fixes": [
|
|
208
|
+
{ "action": "git commit", "auto": false },
|
|
209
|
+
{ "action": "upgrade-schema", "auto": true }
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Integration
|
|
215
|
+
|
|
216
|
+
| Command | Relationship |
|
|
217
|
+
|---------|--------------|
|
|
218
|
+
| `/init` | Use `/doctor` after init to verify setup |
|
|
219
|
+
| `/run` | Run `/doctor` if experiencing failures |
|
|
220
|
+
| `/status` | `/doctor` provides deeper diagnostics |
|
|
221
|
+
|
|
222
|
+
## Quality Bar
|
|
223
|
+
|
|
224
|
+
- All checks complete in < 5 seconds (excluding quality_command timing)
|
|
225
|
+
- Clear, actionable output
|
|
226
|
+
- No false positives (only report real issues)
|
|
227
|
+
- Exit code: 0 (all pass), 1 (has warnings), 2 (has failures)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dogfood-report
|
|
3
|
+
description: Generate analysis report answering Boris & Peter's questions about codecruise effectiveness
|
|
4
|
+
model: sonnet
|
|
5
|
+
tools: Read, Bash, Glob
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /dogfood-report — Analyze Codecruise Effectiveness
|
|
9
|
+
|
|
10
|
+
Generate a report that answers the critical questions from the Boris/Peter analysis:
|
|
11
|
+
|
|
12
|
+
1. **Agent Usage**: Which of the 12 agents actually get used? What's the 80/20?
|
|
13
|
+
2. **Enforcement Effectiveness**: How many TDD violations blocked? Rationalizations caught? False dones prevented?
|
|
14
|
+
3. **OODA Reality**: Is confidence calculation meaningful? Does ORIENT actually inform decisions?
|
|
15
|
+
4. **Command Usage**: Which of the 34 commands are actually used?
|
|
16
|
+
5. **Overall**: Is the complexity justified by the value?
|
|
17
|
+
|
|
18
|
+
## Data Sources
|
|
19
|
+
|
|
20
|
+
Read from `.codecruise/metrics/`:
|
|
21
|
+
- `enforcement.jsonl` — Hook blocks and warnings
|
|
22
|
+
- `agents.jsonl` — Agent delegations
|
|
23
|
+
- `commands.jsonl` — Command invocations
|
|
24
|
+
- `ooda.jsonl` — OODA phase tracking
|
|
25
|
+
- `events.jsonl` — General activity (tests, commits, etc.)
|
|
26
|
+
|
|
27
|
+
## Report Structure
|
|
28
|
+
|
|
29
|
+
```markdown
|
|
30
|
+
# Codecruise Dogfood Report
|
|
31
|
+
Generated: {date}
|
|
32
|
+
Projects analyzed: {list}
|
|
33
|
+
Time period: {start} to {end}
|
|
34
|
+
|
|
35
|
+
## Executive Summary
|
|
36
|
+
{2-3 sentence verdict on whether complexity is justified}
|
|
37
|
+
|
|
38
|
+
## 1. Agent Usage (Boris Q1)
|
|
39
|
+
Total delegations: N
|
|
40
|
+
By agent:
|
|
41
|
+
- developer: X (Y%)
|
|
42
|
+
- tester: X (Y%)
|
|
43
|
+
- ...
|
|
44
|
+
80/20: {which 2-3 agents do 80% of work}
|
|
45
|
+
Unused agents: {list}
|
|
46
|
+
Verdict: {keep all 12 / trim to N}
|
|
47
|
+
|
|
48
|
+
## 2. Enforcement Effectiveness (Peter Q1)
|
|
49
|
+
TDD violations blocked: N
|
|
50
|
+
- Files that would have been written without tests
|
|
51
|
+
Rationalizations caught: N
|
|
52
|
+
- Patterns: "good enough", "out of scope", etc.
|
|
53
|
+
Quality gate blocks: N
|
|
54
|
+
- TODOs that tried to mark done with failing tests
|
|
55
|
+
State machine blocks: N
|
|
56
|
+
- Invalid state transitions prevented
|
|
57
|
+
Value: {high/medium/low} — {explanation}
|
|
58
|
+
|
|
59
|
+
## 3. OODA Reality (Boris Q2, Peter Q2)
|
|
60
|
+
ORIENT phases logged: N
|
|
61
|
+
Confidence calculated: N times
|
|
62
|
+
- High: X, Medium: Y, Low: Z
|
|
63
|
+
Decisions influenced by confidence:
|
|
64
|
+
- Executes at high confidence: X
|
|
65
|
+
- Asks at medium confidence: Y
|
|
66
|
+
- Skips/replans at low confidence: Z
|
|
67
|
+
Verdict: {OODA is load-bearing / OODA is theater}
|
|
68
|
+
|
|
69
|
+
## 4. Command Usage (Boris Q2)
|
|
70
|
+
Total command invocations: N
|
|
71
|
+
By command:
|
|
72
|
+
- /run: X
|
|
73
|
+
- /status: X
|
|
74
|
+
- ...
|
|
75
|
+
80/20: {which 5 commands do 80% of work}
|
|
76
|
+
Unused commands: {list}
|
|
77
|
+
Verdict: {keep all 34 / trim to N}
|
|
78
|
+
|
|
79
|
+
## 5. Overall Verdict
|
|
80
|
+
|
|
81
|
+
Complexity justified: {yes/no/partially}
|
|
82
|
+
|
|
83
|
+
Evidence:
|
|
84
|
+
- {point 1}
|
|
85
|
+
- {point 2}
|
|
86
|
+
- {point 3}
|
|
87
|
+
|
|
88
|
+
Recommendations:
|
|
89
|
+
- {rec 1}
|
|
90
|
+
- {rec 2}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Execution
|
|
94
|
+
|
|
95
|
+
1. Find all `.codecruise/metrics/` directories across projects
|
|
96
|
+
2. Aggregate all JSONL files
|
|
97
|
+
3. Calculate statistics
|
|
98
|
+
4. Generate the report
|
|
99
|
+
5. Save to `docs/DOGFOOD-REPORT.md`
|
|
100
|
+
|
|
101
|
+
If no data exists yet, output instructions on what to do first.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# /run --autonomous — Autonomous Mode Details
|
|
2
|
+
|
|
3
|
+
Load this content when `--autonomous` flag is detected.
|
|
4
|
+
|
|
5
|
+
## Autonomous Behavior
|
|
6
|
+
|
|
7
|
+
| Aspect | Interactive | Autonomous |
|
|
8
|
+
|--------|-------------|------------|
|
|
9
|
+
| Low confidence | Asks user | Auto-skip, log blocker |
|
|
10
|
+
| Replan trigger | Asks user | Log, continue unblocked |
|
|
11
|
+
| Checkpoints | Pauses | Logs only |
|
|
12
|
+
| Blockers | Waits | Notifies, skips dependents |
|
|
13
|
+
|
|
14
|
+
## Required Options
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
/run --autonomous --max-turns 100
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
| Option | Required | Default | Description |
|
|
21
|
+
|--------|----------|---------|-------------|
|
|
22
|
+
| `--max-turns` | Yes | 100 | Safety limit for API calls |
|
|
23
|
+
| `--notify` | No | none | Notification channel (slack, webhook) |
|
|
24
|
+
| `--on-limit` | No | pause | What happens at max-turns (pause, abort) |
|
|
25
|
+
|
|
26
|
+
## OODA in Autonomous Mode
|
|
27
|
+
|
|
28
|
+
### OBSERVE
|
|
29
|
+
- Same environment sensing
|
|
30
|
+
- Logs findings to activity.log
|
|
31
|
+
|
|
32
|
+
### ORIENT
|
|
33
|
+
- Same confidence calculation
|
|
34
|
+
- Logs confidence and patterns
|
|
35
|
+
|
|
36
|
+
### DECIDE
|
|
37
|
+
- Low confidence → auto-skip (not ask)
|
|
38
|
+
- Blockers → notify, skip dependents
|
|
39
|
+
- Replan needed → log, skip module
|
|
40
|
+
|
|
41
|
+
### ACT
|
|
42
|
+
- Same TDD cycle
|
|
43
|
+
- Failures → auto-retry up to limit
|
|
44
|
+
- Success → commit, continue
|
|
45
|
+
|
|
46
|
+
## Blocker Handling
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
execution_state:
|
|
50
|
+
blockers:
|
|
51
|
+
- todo: todo-1.2a-005
|
|
52
|
+
reason: "Redis not running"
|
|
53
|
+
pattern: external_dep_down
|
|
54
|
+
notified: true
|
|
55
|
+
resolved: false
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
When blocker detected:
|
|
59
|
+
1. Mark TODO as blocked
|
|
60
|
+
2. Skip dependents (mark blocked_by)
|
|
61
|
+
3. Send notification (if configured)
|
|
62
|
+
4. Continue with unblocked TODOs
|
|
63
|
+
|
|
64
|
+
## Notification Format
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"event": "blocker_detected",
|
|
69
|
+
"todo": "todo-1.2a-005",
|
|
70
|
+
"reason": "Redis not running",
|
|
71
|
+
"affected": ["todo-1.2a-006", "todo-1.2a-007"],
|
|
72
|
+
"action": "skipped_dependents",
|
|
73
|
+
"resume": "resolve blocker, run /retry --all-blocked"
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Output (activity.log)
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
[2026-02-20 10:30:15] ━━━ AUTONOMOUS SESSION ━━━
|
|
81
|
+
[2026-02-20 10:30:16] 👁 OBSERVE todo-1.1b-004
|
|
82
|
+
[2026-02-20 10:30:18] 🧭 ORIENT confidence=0.85
|
|
83
|
+
[2026-02-20 10:30:19] ⚡ DECIDE execute
|
|
84
|
+
[2026-02-20 10:33:50] ✓ COMPLETE todo-1.1b-004
|
|
85
|
+
[2026-02-20 10:35:20] 🔴 BLOCKER external_dep_down
|
|
86
|
+
[2026-02-20 10:35:21] └─ Redis not running, skipping 2 dependents
|
|
87
|
+
[2026-02-20 10:35:22] ⏭ SKIP todo-1.1b-005 (blocked)
|
|
88
|
+
[2026-02-20 11:45:00] ━━━ MAX TURNS REACHED (100) ━━━
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Session End Report
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
═══════════════════════════════════════════════════════════
|
|
95
|
+
AUTONOMOUS SESSION COMPLETE
|
|
96
|
+
|
|
97
|
+
Duration: 1h 15m
|
|
98
|
+
Turns: 100 (limit reached)
|
|
99
|
+
|
|
100
|
+
Results:
|
|
101
|
+
✓ Completed: 12 TODOs
|
|
102
|
+
⏭ Skipped: 3 (blocked)
|
|
103
|
+
✗ Failed: 1
|
|
104
|
+
|
|
105
|
+
Blockers (need attention):
|
|
106
|
+
- Redis not running (affects 2 TODOs)
|
|
107
|
+
|
|
108
|
+
Next: /retry --all-blocked after resolving blockers
|
|
109
|
+
═══════════════════════════════════════════════════════════
|
|
110
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# /run Pause/Resume Integration
|
|
2
|
+
|
|
3
|
+
Load this content when pause/resume behavior details are needed.
|
|
4
|
+
|
|
5
|
+
## Pause Points in OODA
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
OBSERVE → ORIENT → DECIDE → ACT
|
|
9
|
+
↓
|
|
10
|
+
checkpoint
|
|
11
|
+
↓
|
|
12
|
+
⏸ pause possible
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Pause occurs at **checkpoints** (configurable):
|
|
16
|
+
|
|
17
|
+
| Checkpoint | When | Frequency |
|
|
18
|
+
|------------|------|-----------|
|
|
19
|
+
| `subfeature` | After each subfeature completes | Default |
|
|
20
|
+
| `feature` | After each feature completes | Less frequent |
|
|
21
|
+
| `none` | Only on explicit /pause | Continuous |
|
|
22
|
+
|
|
23
|
+
## State Preservation
|
|
24
|
+
|
|
25
|
+
When paused, all OODA state is preserved:
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
execution_state:
|
|
29
|
+
status: paused
|
|
30
|
+
paused_at: 2026-02-20T12:30:00Z
|
|
31
|
+
pause_phase: act # Where in OODA we paused
|
|
32
|
+
|
|
33
|
+
ooda:
|
|
34
|
+
confidence: 0.75
|
|
35
|
+
last_observation: 2026-02-20T12:29:00Z
|
|
36
|
+
patterns_detected: []
|
|
37
|
+
consecutive_failures: 0
|
|
38
|
+
|
|
39
|
+
current_todo: todo-1.1b-004
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Resume Behavior
|
|
43
|
+
|
|
44
|
+
Resume always enters at **OBSERVE**, not where we left off:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
/resume
|
|
48
|
+
↓
|
|
49
|
+
OBSERVE (fresh sensing)
|
|
50
|
+
↓
|
|
51
|
+
ORIENT (recalculate confidence)
|
|
52
|
+
↓
|
|
53
|
+
DECIDE → ACT → loop
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Why? Environment may have changed during pause.
|
|
57
|
+
|
|
58
|
+
## Drift Detection
|
|
59
|
+
|
|
60
|
+
If paused > 1 hour:
|
|
61
|
+
|
|
62
|
+
1. Check git status (new commits?)
|
|
63
|
+
2. Check dependencies (versions changed?)
|
|
64
|
+
3. Check spec (requirements changed?)
|
|
65
|
+
|
|
66
|
+
If drift detected, user chooses:
|
|
67
|
+
- Continue with fresh OBSERVE
|
|
68
|
+
- Re-plan affected section
|
|
69
|
+
- Abort for manual review
|
|
70
|
+
|
|
71
|
+
## Interrupted Sessions
|
|
72
|
+
|
|
73
|
+
If session ended without clean pause (crash, ctrl-c):
|
|
74
|
+
|
|
75
|
+
1. Detect `status: running` but no active session
|
|
76
|
+
2. Treat as dirty pause
|
|
77
|
+
3. Offer recovery options:
|
|
78
|
+
- Continue (assess partial work)
|
|
79
|
+
- Restart TODO
|
|
80
|
+
- Skip and continue
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ingest
|
|
3
|
+
description: Process documents, free text, or mixed sources into structured summaries
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
tools: Read, Write, Bash, Glob, Grep, Task
|
|
6
|
+
model: sonnet
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /ingest — Multi-Source Document Processor
|
|
10
|
+
|
|
11
|
+
Process files, free text, or mixed sources into structured summaries.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
/ingest .codecruise/inventory # Files only
|
|
17
|
+
/ingest "User requirements go here..." # Free text only
|
|
18
|
+
/ingest "context" .codecruise/inventory/ # Mixed: text + files
|
|
19
|
+
/ingest --detail .codecruise/inventory # Deep extraction (recommended)
|
|
20
|
+
/ingest --dry-run .codecruise/inventory # Preview
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Input Types
|
|
24
|
+
|
|
25
|
+
| Input | Example | Stored As |
|
|
26
|
+
|-------|---------|-----------|
|
|
27
|
+
| **Directory** | `.codecruise/inventory/` | Process files in place |
|
|
28
|
+
| **Free text** | `"Users need to reset passwords..."` | `.codecruise/inventory/user-input-{timestamp}.md` |
|
|
29
|
+
| **Mixed** | `"context" .codecruise/inventory/` | Text saved, then all processed together |
|
|
30
|
+
| **Stdin** | `pbpaste \| /ingest --stdin` | `.codecruise/inventory/stdin-{timestamp}.md` |
|
|
31
|
+
|
|
32
|
+
## Free Text Guidelines
|
|
33
|
+
|
|
34
|
+
Good free text input:
|
|
35
|
+
```
|
|
36
|
+
/ingest "Users should reset passwords via email. Link expires in 1 hour.
|
|
37
|
+
PM said 3 attempts/day is too restrictive - make it 5.
|
|
38
|
+
Mobile app is out of scope for v1.
|
|
39
|
+
We discussed Redis for sessions but final decision pending."
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The system will:
|
|
43
|
+
1. Save to `.codecruise/inventory/user-input-{timestamp}.md`
|
|
44
|
+
2. Extract requirements, decisions, open questions
|
|
45
|
+
3. Attribute as `source: user-input-{timestamp}.md`
|
|
46
|
+
4. Process alongside any file sources
|
|
47
|
+
|
|
48
|
+
## Detail Levels
|
|
49
|
+
|
|
50
|
+
| Mode | Extracts | Cost | Use When |
|
|
51
|
+
|------|----------|------|----------|
|
|
52
|
+
| Standard | Features, requirements | $0.005/file | Quick overview |
|
|
53
|
+
| **Detailed** | Everything + edge cases, flows, examples | $0.008/file | **Production** |
|
|
54
|
+
|
|
55
|
+
Always use `--detail` for production specs.
|
|
56
|
+
|
|
57
|
+
## Outputs
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
.codecruise/inventory/
|
|
61
|
+
├── user-input-{timestamp}.md # Saved free text (if provided)
|
|
62
|
+
├── stdin-{timestamp}.md # Saved stdin (if --stdin)
|
|
63
|
+
|
|
64
|
+
.codecruise/ingested/
|
|
65
|
+
├── summaries/ # Individual file analyses
|
|
66
|
+
├── extracted/ # Raw text from PDFs
|
|
67
|
+
├── combined.md # Final combined output
|
|
68
|
+
└── source-map.yaml # Feature-to-source index
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Process
|
|
72
|
+
|
|
73
|
+
1. **Capture Free Text**: If text provided, save to `.codecruise/inventory/user-input-{timestamp}.md`
|
|
74
|
+
2. **Discover**: Find .md, .txt, .pdf files (including newly saved text)
|
|
75
|
+
3. **Extract PDFs**: pdftotext or fallbacks
|
|
76
|
+
4. **Analyze Parallel**: Task agents with Haiku (batches of 5)
|
|
77
|
+
5. **Combine**: Merge all summaries
|
|
78
|
+
6. **Source Map**: Build feature → source index (includes user-input sources)
|
|
79
|
+
|
|
80
|
+
## Stop Conditions
|
|
81
|
+
|
|
82
|
+
| Condition | Action |
|
|
83
|
+
|-----------|--------|
|
|
84
|
+
| > 100 files | Ask confirmation |
|
|
85
|
+
| > 50MB | Ask confirmation |
|
|
86
|
+
| Cost > $5 | Ask confirmation |
|
|
87
|
+
|
|
88
|
+
## Source Map (Detailed Mode)
|
|
89
|
+
|
|
90
|
+
```yaml
|
|
91
|
+
features:
|
|
92
|
+
auth:
|
|
93
|
+
sources:
|
|
94
|
+
- file: "Auth Guide.pdf"
|
|
95
|
+
pages: [2, 5-7]
|
|
96
|
+
key_points: ["Session timeout: 1hr"]
|
|
97
|
+
decisions: ["httpOnly cookies"]
|
|
98
|
+
open_questions: ["MFA for v1?"]
|
|
99
|
+
|
|
100
|
+
architecture:
|
|
101
|
+
patterns:
|
|
102
|
+
- pattern: "JWT + Refresh"
|
|
103
|
+
sources: [{file, pages}]
|
|
104
|
+
rationale: "Stateless auth"
|
|
105
|
+
tech_choices:
|
|
106
|
+
- decision: "PostgreSQL"
|
|
107
|
+
rationale: "ACID compliance"
|
|
108
|
+
|
|
109
|
+
discussions:
|
|
110
|
+
- file: "Discussion 2.pdf"
|
|
111
|
+
topics: [rate-limiting, budget]
|
|
112
|
+
conclusions: ["Sliding window rate limits"]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Standard vs Detailed
|
|
116
|
+
|
|
117
|
+
| Without --detail | With --detail |
|
|
118
|
+
|------------------|---------------|
|
|
119
|
+
| "Rate limiting required" | "100 req/min free, 1000 premium, sliding window" |
|
|
120
|
+
| "User can create groups" | "Groups: max 200 members, 3 admin limit" |
|
|
121
|
+
| "Handle errors" | "On OCR fail: retry 3x, fallback to manual" |
|
|
122
|
+
|
|
123
|
+
## Output
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
✓ Ingestion Complete (DETAILED)
|
|
127
|
+
|
|
128
|
+
Sources:
|
|
129
|
+
- Files: 50 (25 PDF, 15 txt, 10 md)
|
|
130
|
+
- Free text: 1 (saved as user-input-20260220-143052.md)
|
|
131
|
+
- Content: ~150,000 lines
|
|
132
|
+
|
|
133
|
+
Extracted:
|
|
134
|
+
- Features: 127
|
|
135
|
+
- Thresholds: 45
|
|
136
|
+
- Edge cases: 38
|
|
137
|
+
- User flows: 22
|
|
138
|
+
|
|
139
|
+
Source Map:
|
|
140
|
+
- Features: 12
|
|
141
|
+
- Decisions: 19
|
|
142
|
+
- Architecture patterns: 5
|
|
143
|
+
|
|
144
|
+
Next: /spec-forge .codecruise/ingested/combined.md
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Free Text Examples
|
|
148
|
+
|
|
149
|
+
**Quick requirements dump:**
|
|
150
|
+
```
|
|
151
|
+
/ingest "Login with email/password. OAuth later. Session timeout 1hr.
|
|
152
|
+
Password reset via email, link expires 1hr. Max 5 reset attempts/day."
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Meeting notes:**
|
|
156
|
+
```
|
|
157
|
+
/ingest "Meeting with PM 2026-02-20:
|
|
158
|
+
- Decided against SMS auth for v1 (cost)
|
|
159
|
+
- Redis for sessions confirmed
|
|
160
|
+
- Open question: rate limit numbers
|
|
161
|
+
- Mobile app pushed to v2"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Mixed sources:**
|
|
165
|
+
```
|
|
166
|
+
/ingest "Additional context from call: auth must support SSO for enterprise" .codecruise/inventory/
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Error Handling
|
|
170
|
+
|
|
171
|
+
- PDF extraction fail → try alternatives, log
|
|
172
|
+
- File too large → chunk processing
|
|
173
|
+
- Agent timeout → retry at end
|