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,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architect
|
|
3
|
+
description: Generate comprehensive Engineering Design Documents from spec and context
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
tools: Read, Write, Edit, Glob, Grep, Bash, Task
|
|
6
|
+
model: opus
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /architect — EDD Generator
|
|
10
|
+
|
|
11
|
+
Transform approved specs into architecture documents (WHAT → HOW).
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
| Situation | Use /architect? |
|
|
16
|
+
|-----------|-----------------|
|
|
17
|
+
| After spec-review, before planning | ✅ Yes |
|
|
18
|
+
| New major feature needs design | ✅ Yes |
|
|
19
|
+
| Database schema or API contracts needed | ✅ Yes |
|
|
20
|
+
| Quick architecture question | ❌ Use architect agent |
|
|
21
|
+
| Spec not complete | ❌ Finish spec workflow first |
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
/architect # Full EDD from spec + context
|
|
27
|
+
/architect "payment integration" # Feature-specific EDD
|
|
28
|
+
/architect --section database # Generate specific section
|
|
29
|
+
/architect --dry-run # Preview without writing
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
| Argument | Description |
|
|
33
|
+
|----------|-------------|
|
|
34
|
+
| `--section` | Generate: `database`, `api`, `security`, `components` |
|
|
35
|
+
| `--stack` | Tech stack preferences |
|
|
36
|
+
| `--scale` | Scale hints: "10k users, 100 req/s" |
|
|
37
|
+
| `--compliance` | Requirements: "GDPR, PCI-DSS" |
|
|
38
|
+
|
|
39
|
+
## Inputs (read-only)
|
|
40
|
+
|
|
41
|
+
**Required**: `docs/canon/spec.md`, `docs/context/architecture.yaml`
|
|
42
|
+
|
|
43
|
+
**Optional**: `docs/context/*.yaml`, `docs/canon/issues.md`, `docs/canon/decisions.md`
|
|
44
|
+
|
|
45
|
+
**Stop conditions**:
|
|
46
|
+
- No spec.md → STOP, run `/spec-forge`
|
|
47
|
+
- P0 blocking issues → WARN, list them
|
|
48
|
+
|
|
49
|
+
## Outputs
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
docs/architecture/
|
|
53
|
+
├── overview.md # C4 diagrams, principles, tech stack, phases
|
|
54
|
+
├── database.md # ERD, Prisma schema, SQL, indexes
|
|
55
|
+
├── api.md # tRPC/REST routing, OpenAPI, error codes
|
|
56
|
+
├── components.md # Module structure, dependencies
|
|
57
|
+
├── security.md # Auth flow, tokens, encryption, RBAC
|
|
58
|
+
├── data-flow.md # Flow diagrams per feature
|
|
59
|
+
├── integrations.md # External services, webhooks
|
|
60
|
+
├── decisions.md # ADRs with rationale
|
|
61
|
+
└── extensibility.md # Where future features plug in
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Process
|
|
65
|
+
|
|
66
|
+
1. **Load Context**: Extract FRs, NFRs, entities, decisions from spec + context files
|
|
67
|
+
2. **Overview**: C4 diagrams, design principles, tech stack with rationale, phases & features
|
|
68
|
+
3. **Database**: Extract entities, relationships, generate Prisma + SQL, index strategy
|
|
69
|
+
4. **API**: Map use cases to endpoints, tRPC vs REST routing rules, OpenAPI for REST
|
|
70
|
+
5. **Components**: Module structure, dependency rules, layered access
|
|
71
|
+
6. **Security**: Auth flow (sequence diagram), token strategy, encryption, RBAC
|
|
72
|
+
7. **Data Flow**: Per-feature flow diagrams
|
|
73
|
+
8. **Integrations**: External services with fallbacks
|
|
74
|
+
9. **ADRs**: Decision + rationale + alternatives + consequences
|
|
75
|
+
10. **Extensibility**: Where v2 features plug in
|
|
76
|
+
|
|
77
|
+
## Output Structures
|
|
78
|
+
|
|
79
|
+
**overview.md**: C4Context + C4Container diagrams, principles list, stack table, phases table
|
|
80
|
+
|
|
81
|
+
**database.md**: ERD (Mermaid), Prisma schema, SQL DDL, index strategy table
|
|
82
|
+
|
|
83
|
+
**api.md**: Routing strategy table, endpoint reference tables, OpenAPI YAML, error codes table
|
|
84
|
+
|
|
85
|
+
**security.md**: Auth sequence diagram, token table, encryption table, RBAC model
|
|
86
|
+
|
|
87
|
+
**decisions.md**: ADR format: Status, Context, Decision, Alternatives, Consequences
|
|
88
|
+
|
|
89
|
+
## Final Report
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
✓ Architecture documentation complete
|
|
93
|
+
|
|
94
|
+
Spec version: {from spec.md}
|
|
95
|
+
Documents created: 9
|
|
96
|
+
|
|
97
|
+
Coverage:
|
|
98
|
+
- Entities: {N}
|
|
99
|
+
- API endpoints: {N}
|
|
100
|
+
- ADRs: {N}
|
|
101
|
+
|
|
102
|
+
Traceability:
|
|
103
|
+
- FR covered: {N}/{total}
|
|
104
|
+
- NFR covered: {N}/{total}
|
|
105
|
+
|
|
106
|
+
Next:
|
|
107
|
+
/architect-review → Validate architecture
|
|
108
|
+
/plan → Create roadmap
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Quality Bar
|
|
112
|
+
|
|
113
|
+
- All spec requirements traceable to architecture
|
|
114
|
+
- No orphan components
|
|
115
|
+
- Diagrams render (valid Mermaid)
|
|
116
|
+
- Prisma schema valid
|
|
117
|
+
- OpenAPI spec valid
|
|
118
|
+
- ADRs have clear rationale
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: compact
|
|
3
|
+
description: Compress context and prepare for session handoff
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
tools: Bash, Read
|
|
6
|
+
model: sonnet
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /compact Command
|
|
10
|
+
|
|
11
|
+
Safely compress context while preserving state.
|
|
12
|
+
|
|
13
|
+
## Read First
|
|
14
|
+
|
|
15
|
+
1. `~/.claude/rules/hygiene.md`
|
|
16
|
+
|
|
17
|
+
## Process
|
|
18
|
+
|
|
19
|
+
### 1. Verify State Persistence
|
|
20
|
+
|
|
21
|
+
Check that all work is persisted:
|
|
22
|
+
|
|
23
|
+
- [ ] `progress.yaml` is up to date
|
|
24
|
+
- [ ] Current TODO status reflects reality
|
|
25
|
+
- [ ] All changes committed
|
|
26
|
+
- [ ] No uncommitted work in progress
|
|
27
|
+
|
|
28
|
+
If any check fails, complete it before compacting.
|
|
29
|
+
|
|
30
|
+
### 2. Summarize Session
|
|
31
|
+
|
|
32
|
+
Create session summary:
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
## Session Summary
|
|
36
|
+
|
|
37
|
+
### Completed
|
|
38
|
+
- {todo_id}: {description}
|
|
39
|
+
- {todo_id}: {description}
|
|
40
|
+
|
|
41
|
+
### In Progress
|
|
42
|
+
- {todo_id}: {description} - {current state}
|
|
43
|
+
|
|
44
|
+
### Blocked
|
|
45
|
+
- {todo_id}: {reason}
|
|
46
|
+
|
|
47
|
+
### Decisions Made
|
|
48
|
+
- {decision 1}
|
|
49
|
+
- {decision 2}
|
|
50
|
+
|
|
51
|
+
### Notes for Next Session
|
|
52
|
+
- {important context}
|
|
53
|
+
- {gotcha discovered}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 3. Report Status
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
✓ Ready for compact
|
|
60
|
+
|
|
61
|
+
State persisted:
|
|
62
|
+
- progress.yaml ✓
|
|
63
|
+
- Commits: 3 new ✓
|
|
64
|
+
- Branch: feature/auth-login
|
|
65
|
+
|
|
66
|
+
Session summary:
|
|
67
|
+
- Completed: 2 TODOs
|
|
68
|
+
- In progress: 1 TODO
|
|
69
|
+
- Next: {todo_id} - {description}
|
|
70
|
+
|
|
71
|
+
Safe to compact. Context will be cleared.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 4. Handoff Notes
|
|
75
|
+
|
|
76
|
+
Include in summary any context the next session needs:
|
|
77
|
+
|
|
78
|
+
- Unusual patterns discovered
|
|
79
|
+
- Workarounds implemented
|
|
80
|
+
- Open questions
|
|
81
|
+
- Suggested approach for next TODO
|
|
82
|
+
|
|
83
|
+
## When to Compact
|
|
84
|
+
|
|
85
|
+
Suggest compacting when:
|
|
86
|
+
- TODO completed
|
|
87
|
+
- 15+ exchanges in conversation
|
|
88
|
+
- Switching to different feature
|
|
89
|
+
- Context feels "fuzzy" or responses degrade
|
|
90
|
+
- Before taking a break
|
|
91
|
+
|
|
92
|
+
## Safety Checks
|
|
93
|
+
|
|
94
|
+
Before allowing compact:
|
|
95
|
+
|
|
96
|
+
1. **Uncommitted changes?**
|
|
97
|
+
```
|
|
98
|
+
⚠️ You have uncommitted changes:
|
|
99
|
+
- src/auth/login.ts
|
|
100
|
+
|
|
101
|
+
Commit these before compacting?
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
2. **TODO in progress?**
|
|
105
|
+
```
|
|
106
|
+
⚠️ TODO-003 is in progress.
|
|
107
|
+
|
|
108
|
+
Options:
|
|
109
|
+
1. Complete it first
|
|
110
|
+
2. Save state and continue later
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
3. **State not synced?**
|
|
114
|
+
```
|
|
115
|
+
⚠️ progress.yaml shows TODO-002 but roadmap shows TODO-003.
|
|
116
|
+
|
|
117
|
+
Sync state before compacting.
|
|
118
|
+
```
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: companion
|
|
3
|
+
description: Pattern detection engine integrated with OODA loop and standalone advisor mode
|
|
4
|
+
model: sonnet
|
|
5
|
+
tools: Read, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /companion — OODA Pattern Engine
|
|
9
|
+
|
|
10
|
+
Real-time pattern detection for ORIENT phase + standalone advisor mode.
|
|
11
|
+
|
|
12
|
+
## Dual Role
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
┌─────────────────────────────────────────────────────────┐
|
|
16
|
+
│ COMPANION │
|
|
17
|
+
├─────────────────────────────────────────────────────────┤
|
|
18
|
+
│ │
|
|
19
|
+
│ 1. IN-LOOP (called by /run ORIENT phase) │
|
|
20
|
+
│ → Real-time pattern detection │
|
|
21
|
+
│ → Confidence adjustment │
|
|
22
|
+
│ → Routing recommendations │
|
|
23
|
+
│ │
|
|
24
|
+
│ 2. STANDALONE (/companion command) │
|
|
25
|
+
│ → Session analysis │
|
|
26
|
+
│ → Actionable insights │
|
|
27
|
+
│ → Skill effectiveness review │
|
|
28
|
+
│ │
|
|
29
|
+
└─────────────────────────────────────────────────────────┘
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## In-Loop Mode (ORIENT Integration)
|
|
33
|
+
|
|
34
|
+
Called automatically during `/run` ORIENT phase.
|
|
35
|
+
|
|
36
|
+
### Input (from OBSERVE)
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
observation:
|
|
40
|
+
todo_id: todo-1.2a-004
|
|
41
|
+
module: auth
|
|
42
|
+
retry_count: 2
|
|
43
|
+
last_error: "JWT validation failed"
|
|
44
|
+
last_3_todos:
|
|
45
|
+
- id: todo-1.2a-003
|
|
46
|
+
status: failed
|
|
47
|
+
retries: 3
|
|
48
|
+
error_type: auth_error
|
|
49
|
+
- id: todo-1.2a-002
|
|
50
|
+
status: done
|
|
51
|
+
retries: 1
|
|
52
|
+
- id: todo-1.2a-001
|
|
53
|
+
status: done
|
|
54
|
+
retries: 0
|
|
55
|
+
context_exchanges: 12
|
|
56
|
+
external_deps:
|
|
57
|
+
docker: up
|
|
58
|
+
redis: down
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Output (to ORIENT)
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
orientation:
|
|
65
|
+
confidence: low # high | medium | low
|
|
66
|
+
|
|
67
|
+
patterns:
|
|
68
|
+
- id: retry_spike
|
|
69
|
+
severity: warning
|
|
70
|
+
message: "3 retries in last 3 TODOs"
|
|
71
|
+
|
|
72
|
+
- id: module_failing
|
|
73
|
+
severity: critical
|
|
74
|
+
message: "auth module: 2/3 failed"
|
|
75
|
+
recommendation: replan
|
|
76
|
+
|
|
77
|
+
- id: external_dep_down
|
|
78
|
+
severity: blocker
|
|
79
|
+
message: "Redis unavailable"
|
|
80
|
+
affected_todos: [todo-1.2a-004, todo-1.2a-005]
|
|
81
|
+
|
|
82
|
+
confidence_factors:
|
|
83
|
+
base: 0.8
|
|
84
|
+
retry_penalty: -0.2 # high retries recently
|
|
85
|
+
module_penalty: -0.3 # module failing
|
|
86
|
+
dep_penalty: -0.2 # external dep down
|
|
87
|
+
final: 0.1 # low confidence
|
|
88
|
+
|
|
89
|
+
recommendation: escalate # proceed | proceed_cautious | replan | escalate | skip
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Pattern Detection Rules
|
|
93
|
+
|
|
94
|
+
| Pattern | Detection | Confidence Impact | Recommendation |
|
|
95
|
+
|---------|-----------|-------------------|----------------|
|
|
96
|
+
| `retry_spike` | 3+ retries in last 5 TODOs | -0.1 per retry above 2 | proceed_cautious |
|
|
97
|
+
| `error_cluster` | Same error type 3+ times | -0.2 | replan |
|
|
98
|
+
| `module_failing` | 3+ failures in module | -0.3 | replan |
|
|
99
|
+
| `external_dep_down` | Connection/timeout errors | -0.3 | skip dependents |
|
|
100
|
+
| `context_bloat` | 20+ exchanges | -0.1 | suggest /compact |
|
|
101
|
+
| `skill_mismatch` | No skill for TODO type | -0.1 | proceed_cautious |
|
|
102
|
+
|
|
103
|
+
### Confidence Calculation
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
confidence = base(0.8)
|
|
107
|
+
- retry_penalty
|
|
108
|
+
- module_penalty
|
|
109
|
+
- dep_penalty
|
|
110
|
+
- skill_penalty
|
|
111
|
+
|
|
112
|
+
high: confidence >= 0.7
|
|
113
|
+
medium: confidence >= 0.4
|
|
114
|
+
low: confidence < 0.4
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Routing Logic
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
routing:
|
|
121
|
+
high_confidence:
|
|
122
|
+
ship-fast: proceed
|
|
123
|
+
balanced: proceed
|
|
124
|
+
careful: proceed
|
|
125
|
+
|
|
126
|
+
medium_confidence:
|
|
127
|
+
ship-fast: proceed
|
|
128
|
+
balanced: proceed_cautious
|
|
129
|
+
careful: escalate
|
|
130
|
+
|
|
131
|
+
low_confidence:
|
|
132
|
+
ship-fast: skip
|
|
133
|
+
balanced: escalate
|
|
134
|
+
careful: replan
|
|
135
|
+
|
|
136
|
+
blocker_detected:
|
|
137
|
+
all_tempos: skip_dependents + notify
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Standalone Mode
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
/companion # Current insights
|
|
144
|
+
/companion --detailed # With evidence
|
|
145
|
+
/companion --skills # Skill effectiveness
|
|
146
|
+
/companion --history # Insight history
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Data Sources
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
.codecruise/
|
|
153
|
+
├─ execution_history.yaml # Session history
|
|
154
|
+
├─ scorecards/ # TODO results
|
|
155
|
+
└─ insights.yaml # Persisted insights
|
|
156
|
+
|
|
157
|
+
.codecruise/progress.yaml # Current OODA state
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Insight Categories
|
|
161
|
+
|
|
162
|
+
**🔴 BLOCKER** — Fix now
|
|
163
|
+
```
|
|
164
|
+
🔴 BLOCKER: Redis not running
|
|
165
|
+
Last 2 TODOs failed with "connection refused"
|
|
166
|
+
→ docker compose up -d redis
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**🟡 FRICTION** — Slowing you down
|
|
170
|
+
```
|
|
171
|
+
🟡 FRICTION: TypeScript retries high (2.1 avg)
|
|
172
|
+
Pattern: Missing return types
|
|
173
|
+
→ Add stricter eslint rules
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**🟢 OPPORTUNITY** — Could be better
|
|
177
|
+
```
|
|
178
|
+
🟢 OPPORTUNITY: Context at 18 exchanges
|
|
179
|
+
→ Run /compact soon
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**✓ WIN** — What's working
|
|
183
|
+
```
|
|
184
|
+
✓ WIN: Frontend quality at 0.94
|
|
185
|
+
React skill highly effective
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Standalone Output
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
═══════════════════════════════════════════════════════════
|
|
192
|
+
COMPANION INSIGHTS
|
|
193
|
+
═══════════════════════════════════════════════════════════
|
|
194
|
+
|
|
195
|
+
Session: feature-1.2 | 8 TODOs | 34 minutes
|
|
196
|
+
Avg Confidence: 0.72
|
|
197
|
+
|
|
198
|
+
🔴 BLOCKERS (1)
|
|
199
|
+
─────────────────────────────────────────────────────────
|
|
200
|
+
Redis connection failing
|
|
201
|
+
→ docker compose up -d redis
|
|
202
|
+
|
|
203
|
+
🟡 FRICTION (1)
|
|
204
|
+
─────────────────────────────────────────────────────────
|
|
205
|
+
Auth module: 2/4 TODOs needed replan
|
|
206
|
+
→ Review auth architecture
|
|
207
|
+
|
|
208
|
+
✓ WINS (1)
|
|
209
|
+
─────────────────────────────────────────────────────────
|
|
210
|
+
Frontend TODOs: 0.93 quality, 0.3 avg retries
|
|
211
|
+
|
|
212
|
+
═══════════════════════════════════════════════════════════
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Skills View
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
═══════════════════════════════════════════════════════════
|
|
219
|
+
SKILL EFFECTIVENESS (OODA metrics)
|
|
220
|
+
═══════════════════════════════════════════════════════════
|
|
221
|
+
|
|
222
|
+
Skill TODOs Avg Conf Avg Retries Replans
|
|
223
|
+
───────────────────────────────────────────────────────
|
|
224
|
+
typescript 23 0.84 1.8 0 ⚠
|
|
225
|
+
react 18 0.93 0.4 0 ✓
|
|
226
|
+
auth 12 0.52 2.8 2 🔴
|
|
227
|
+
database 8 0.71 2.5 1 ⚠
|
|
228
|
+
|
|
229
|
+
Auth skill needs improvement (low confidence, high replans)
|
|
230
|
+
|
|
231
|
+
═══════════════════════════════════════════════════════════
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Persistence
|
|
235
|
+
|
|
236
|
+
```yaml
|
|
237
|
+
# .codecruise/insights.yaml
|
|
238
|
+
generated: 2026-02-20T14:30:00Z
|
|
239
|
+
|
|
240
|
+
# Real-time pattern state (for ORIENT)
|
|
241
|
+
pattern_state:
|
|
242
|
+
retry_window: [2, 3, 1, 0, 2] # last 5 TODOs
|
|
243
|
+
error_types:
|
|
244
|
+
auth_error: 3
|
|
245
|
+
type_error: 1
|
|
246
|
+
module_failures:
|
|
247
|
+
auth: 2
|
|
248
|
+
api: 0
|
|
249
|
+
|
|
250
|
+
# Standalone insights
|
|
251
|
+
active_insights:
|
|
252
|
+
- id: insight-001
|
|
253
|
+
type: friction
|
|
254
|
+
pattern: module_failing
|
|
255
|
+
module: auth
|
|
256
|
+
message: "Auth module averaging 0.52 confidence"
|
|
257
|
+
first_seen: 2026-02-20
|
|
258
|
+
occurrences: 4
|
|
259
|
+
status: active
|
|
260
|
+
|
|
261
|
+
dismissed_insights: []
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Integration
|
|
265
|
+
|
|
266
|
+
| Command | Integration |
|
|
267
|
+
|---------|-------------|
|
|
268
|
+
| `/run` | Calls companion during ORIENT for pattern detection |
|
|
269
|
+
| `/status` | Shows active blocker count from companion |
|
|
270
|
+
| `/retro` | Uses companion data for retrospective |
|
|
271
|
+
| `/dashboard` | Displays confidence trends |
|
|
272
|
+
|
|
273
|
+
## Quality Bar
|
|
274
|
+
|
|
275
|
+
- In-loop detection: < 100ms response
|
|
276
|
+
- Patterns updated after every TODO
|
|
277
|
+
- Confidence calculation deterministic
|
|
278
|
+
- Recommendations actionable
|
|
279
|
+
- No false positives on blockers
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dashboard
|
|
3
|
+
description: Real-time progress dashboard with OODA state, blockers, costs, and recommendations
|
|
4
|
+
tools: Read, Write, Glob
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /dashboard — Real-Time Progress View
|
|
9
|
+
|
|
10
|
+
Live project status. Shows OODA state, progress, blockers, costs, recommendations.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
/dashboard # Snapshot view
|
|
16
|
+
/dashboard --live # Real-time updates (auto-refresh every 5s)
|
|
17
|
+
/dashboard --watch # Continuous tail of activity.log + progress
|
|
18
|
+
/dashboard --json # Machine-readable
|
|
19
|
+
/dashboard --html # Generate HTML report
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Philosophy
|
|
23
|
+
|
|
24
|
+
Answer: Where are we? What's the OODA state? What's blocking? What should change?
|
|
25
|
+
|
|
26
|
+
## Live Mode
|
|
27
|
+
|
|
28
|
+
`/dashboard --live` provides real-time task tracking:
|
|
29
|
+
- Auto-refreshes every 5 seconds
|
|
30
|
+
- Shows current TODO and OODA phase
|
|
31
|
+
- Updates progress bar as TODOs complete
|
|
32
|
+
- Surfaces new blockers immediately
|
|
33
|
+
- Ctrl+C to exit
|
|
34
|
+
|
|
35
|
+
## Terminal Output
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
39
|
+
│ {PROJECT} {date} {time}│
|
|
40
|
+
├─────────────────────────────────────────────────────────────┤
|
|
41
|
+
│ PROGRESS ════════════════════════════════════════ 68% │
|
|
42
|
+
│ Phase 2/4 · Feature 3/8 · 12 TODOs remaining │
|
|
43
|
+
├─────────────────────────────────────────────────────────────┤
|
|
44
|
+
│ CURRENT │
|
|
45
|
+
│ ▶ todo-1.2b-007: Implement rate limiting │
|
|
46
|
+
│ OODA: 🧭 ORIENT · Confidence: 0.82 · Tempo: balanced │
|
|
47
|
+
│ Patterns: none · Retries: 0/3 │
|
|
48
|
+
├─────────────────────────────────────────────────────────────┤
|
|
49
|
+
│ BLOCKERS & NOTES │
|
|
50
|
+
│ 🔴 Redis failing - blocks feature-2.3 │
|
|
51
|
+
│ 📝 Rate limits hit - added retry logic │
|
|
52
|
+
├─────────────────────────────────────────────────────────────┤
|
|
53
|
+
│ SESSION │
|
|
54
|
+
│ Duration: 1h 23m · TODOs: 8 · Retries: 2 │
|
|
55
|
+
│ Tokens: ~45K in · ~12K out · Est: $0.42 │
|
|
56
|
+
│ Speed: quality_command 8.2s ✅ │
|
|
57
|
+
├─────────────────────────────────────────────────────────────┤
|
|
58
|
+
│ RECOMMENDATIONS │
|
|
59
|
+
│ → Run /compact - context large (18 exchanges) │
|
|
60
|
+
│ → Blocker aged 2 days - escalate? │
|
|
61
|
+
│ → TypeScript retries high - review patterns │
|
|
62
|
+
└─────────────────────────────────────────────────────────────┘
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Live Mode Output
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
69
|
+
│ {PROJECT} LIVE 🔴 {date} {time}│
|
|
70
|
+
├─────────────────────────────────────────────────────────────┤
|
|
71
|
+
│ ▶ todo-1.2b-007: Implement rate limiting │
|
|
72
|
+
│ └─ ⚡ ACT (green) · Writing implementation... │
|
|
73
|
+
│ │
|
|
74
|
+
│ PROGRESS ═══════════════════════════════════════ 68% │
|
|
75
|
+
│ ✓✓✓✓✓✓✓✓✓✓✓✓○○○○○○ 12/18 TODOs │
|
|
76
|
+
│ │
|
|
77
|
+
│ RECENT ACTIVITY │
|
|
78
|
+
│ 10:33:50 ✓ todo-1.2b-006 complete (3m 30s) │
|
|
79
|
+
│ 10:33:51 → Started todo-1.2b-007 │
|
|
80
|
+
│ 10:33:52 👁 OBSERVE: git clean, deps ok │
|
|
81
|
+
│ 10:33:53 🧭 ORIENT: confidence 0.82 │
|
|
82
|
+
│ 10:33:54 ⚡ DECIDE: execute │
|
|
83
|
+
│ 10:34:01 ▶ ACT: red phase (writing tests) │
|
|
84
|
+
└─────────────────────────────────────────────────────────────┘
|
|
85
|
+
[Ctrl+C to exit]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Sections
|
|
89
|
+
|
|
90
|
+
### Progress
|
|
91
|
+
- Current phase/feature/TODO
|
|
92
|
+
- Percentage complete
|
|
93
|
+
- Visual progress bar
|
|
94
|
+
|
|
95
|
+
### Current TODO & OODA State
|
|
96
|
+
From `.codecruise/progress.yaml`:
|
|
97
|
+
- Current TODO ID and description
|
|
98
|
+
- OODA phase: OBSERVE / ORIENT / DECIDE / ACT
|
|
99
|
+
- Confidence score
|
|
100
|
+
- Tempo setting
|
|
101
|
+
- Patterns detected
|
|
102
|
+
- Retry count
|
|
103
|
+
|
|
104
|
+
### Blockers & Notes
|
|
105
|
+
From `.codecruise/progress.yaml`:
|
|
106
|
+
- `blockers[]` - Issues (🔴)
|
|
107
|
+
- `notes[]` - Observations (📝)
|
|
108
|
+
|
|
109
|
+
### Session Stats
|
|
110
|
+
- Duration, TODOs completed, retries
|
|
111
|
+
- Token usage, estimated cost
|
|
112
|
+
- quality_command speed (✅ <10s, ⚠️ 10-30s, 🐢 >30s)
|
|
113
|
+
|
|
114
|
+
### Recommendations
|
|
115
|
+
Max 3, prioritized by impact:
|
|
116
|
+
|
|
117
|
+
| Signal | Recommendation |
|
|
118
|
+
|--------|----------------|
|
|
119
|
+
| Context > 15 | "Run /compact" |
|
|
120
|
+
| Blocker > 2 days | "Escalate or descope?" |
|
|
121
|
+
| High retry rate | "Review patterns" |
|
|
122
|
+
| Session > 2 hours | "Take a break" |
|
|
123
|
+
| Feature complete | "Good PR checkpoint" |
|
|
124
|
+
|
|
125
|
+
## Token Tracking
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
# .codecruise/progress.yaml
|
|
129
|
+
session:
|
|
130
|
+
tokens: {input: 45000, output: 12000}
|
|
131
|
+
estimated_cost: 0.42
|
|
132
|
+
|
|
133
|
+
cumulative:
|
|
134
|
+
total_tokens: 1250000
|
|
135
|
+
total_cost: 12.50
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Cost = (input × $3 + output × $15) / 1M
|
|
139
|
+
|
|
140
|
+
## Data Sources
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
.codecruise/progress.yaml: current, stats, blockers, notes, session
|
|
144
|
+
.codecruise/: execution_history, insights
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Output Files
|
|
148
|
+
|
|
149
|
+
| File | Purpose |
|
|
150
|
+
|------|---------|
|
|
151
|
+
| `dashboard/dashboard.html` | Shareable report |
|
|
152
|
+
| `dashboard/dashboard.md` | Markdown version |
|