opencodekit 0.12.3 → 0.12.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/index.js +2 -2
  2. package/dist/template/.opencode/agent/build.md +66 -9
  3. package/dist/template/.opencode/agent/rush.md +43 -19
  4. package/dist/template/.opencode/command/accessibility-check.md +7 -10
  5. package/dist/template/.opencode/command/analyze-mockup.md +3 -16
  6. package/dist/template/.opencode/command/analyze-project.md +57 -69
  7. package/dist/template/.opencode/command/brainstorm.md +3 -11
  8. package/dist/template/.opencode/command/commit.md +10 -18
  9. package/dist/template/.opencode/command/create.md +4 -8
  10. package/dist/template/.opencode/command/design-audit.md +24 -51
  11. package/dist/template/.opencode/command/design.md +10 -17
  12. package/dist/template/.opencode/command/finish.md +9 -9
  13. package/dist/template/.opencode/command/fix-ci.md +7 -28
  14. package/dist/template/.opencode/command/fix-types.md +3 -7
  15. package/dist/template/.opencode/command/fix-ui.md +5 -11
  16. package/dist/template/.opencode/command/fix.md +4 -10
  17. package/dist/template/.opencode/command/handoff.md +8 -14
  18. package/dist/template/.opencode/command/implement.md +13 -16
  19. package/dist/template/.opencode/command/import-plan.md +20 -38
  20. package/dist/template/.opencode/command/init.md +9 -13
  21. package/dist/template/.opencode/command/integration-test.md +11 -13
  22. package/dist/template/.opencode/command/issue.md +4 -8
  23. package/dist/template/.opencode/command/new-feature.md +20 -40
  24. package/dist/template/.opencode/command/plan.md +8 -12
  25. package/dist/template/.opencode/command/pr.md +29 -38
  26. package/dist/template/.opencode/command/quick-build.md +3 -7
  27. package/dist/template/.opencode/command/research-and-implement.md +4 -6
  28. package/dist/template/.opencode/command/research.md +10 -7
  29. package/dist/template/.opencode/command/resume.md +12 -24
  30. package/dist/template/.opencode/command/revert-feature.md +21 -56
  31. package/dist/template/.opencode/command/review-codebase.md +21 -23
  32. package/dist/template/.opencode/command/skill-create.md +1 -5
  33. package/dist/template/.opencode/command/skill-optimize.md +3 -10
  34. package/dist/template/.opencode/command/status.md +28 -25
  35. package/dist/template/.opencode/command/triage.md +19 -31
  36. package/dist/template/.opencode/command/ui-review.md +6 -13
  37. package/dist/template/.opencode/command.backup/analyze-project.md +465 -0
  38. package/dist/template/.opencode/command.backup/finish.md +167 -0
  39. package/dist/template/.opencode/command.backup/implement.md +143 -0
  40. package/dist/template/.opencode/command.backup/pr.md +252 -0
  41. package/dist/template/.opencode/command.backup/status.md +376 -0
  42. package/dist/template/.opencode/memory/project/SHELL_OUTPUT_MIGRATION_PLAN.md +551 -0
  43. package/dist/template/.opencode/memory/project/gotchas.md +33 -28
  44. package/dist/template/.opencode/opencode.json +542 -510
  45. package/dist/template/.opencode/package.json +1 -3
  46. package/dist/template/.opencode/plugin/compaction.ts +51 -129
  47. package/dist/template/.opencode/plugin/handoff.ts +18 -163
  48. package/dist/template/.opencode/plugin/notification.ts +1 -1
  49. package/dist/template/.opencode/plugin/package.json +7 -0
  50. package/dist/template/.opencode/plugin/sessions.ts +185 -651
  51. package/dist/template/.opencode/plugin/skill-mcp.ts +2 -1
  52. package/dist/template/.opencode/plugin/truncator.ts +19 -41
  53. package/dist/template/.opencode/plugin/tsconfig.json +14 -13
  54. package/dist/template/.opencode/tool/bd-inbox.ts +109 -0
  55. package/dist/template/.opencode/tool/bd-msg.ts +62 -0
  56. package/dist/template/.opencode/tool/bd-release.ts +71 -0
  57. package/dist/template/.opencode/tool/bd-reserve.ts +120 -0
  58. package/package.json +2 -2
  59. package/dist/template/.opencode/plugin/beads.ts +0 -1419
  60. package/dist/template/.opencode/plugin/compactor.ts +0 -107
  61. package/dist/template/.opencode/plugin/enforcer.ts +0 -190
  62. package/dist/template/.opencode/plugin/injector.ts +0 -150
@@ -20,16 +20,9 @@ skill({ name: "writing-skills" });
20
20
 
21
21
  ### Find Skill Location
22
22
 
23
- ```bash
24
- # Check local skills first
25
- ls -la .opencode/skill/$ARGUMENTS/ 2>/dev/null
26
-
27
- # Check superpowers (shared skills)
28
- ls -la .opencode/superpowers/skills/$ARGUMENTS/ 2>/dev/null
29
-
30
- # Check installed skills
31
- ls -la ~/.opencode/skills/$ARGUMENTS/ 2>/dev/null
32
- ```
23
+ !`ls -la .opencode/skill/$ARGUMENTS/ 2>/dev/null`
24
+ !`ls -la .opencode/superpowers/skills/$ARGUMENTS/ 2>/dev/null`
25
+ !`ls -la ~/.opencode/skills/$ARGUMENTS/ 2>/dev/null`
33
26
 
34
27
  ### Load Current Content
35
28
 
@@ -18,27 +18,29 @@ Generate a comprehensive project status report covering tasks, sessions, git sta
18
18
 
19
19
  Run all status checks simultaneously:
20
20
 
21
+ ```
22
+ # Beads CLI commands
23
+ !`bd status`
24
+ !`bd list --status in_progress --limit 10`
25
+ !`bd list --status ready --limit 10`
26
+
27
+ # Git state
28
+ !`git status --porcelain`
29
+ !`git branch --show-current`
30
+ !`git log --oneline -5`
31
+ ```
32
+
21
33
  ```typescript
22
- // Beads state
23
- bd_status({ include_agents: true });
24
- bd_ls({ status: "in_progress", limit: 10, offset: 0 });
25
- bd_ls({ status: "ready", limit: 10, offset: 0 });
26
- bd_inbox({ n: 5, unread: true, global: true });
27
- bd_doctor({ reason: "Health check" });
28
- bd_reservations();
29
-
30
- // Sessions
31
- list_sessions({ project: "current", since: "today", limit: 5, _: true });
32
-
33
- // Search for recent activity on current work (if bead in progress)
34
- search_session({ query: "<current-bead-id>", limit: 5 });
35
-
36
- // Git state
37
- bash("git status --porcelain");
38
- bash("git branch --show-current");
39
- bash("git log --oneline -5");
34
+ // Custom tools (message inbox, locks)
35
+ bd-inbox({ n: 5, unread: true, to: "all" });
36
+ bd-release(); // Lists active locks when called with no args
37
+
38
+ // Built-in tools
39
+ list_sessions({ project: "current", since: "today", limit: 5 });
40
40
  ```
41
41
 
42
+ ````
43
+
42
44
  ## Phase 2: Health Score Calculation
43
45
 
44
46
  Calculate overall project health (0-100):
@@ -215,7 +217,7 @@ REQUIRED ACTIONS
215
217
  ━━━━━━━━━━━━━━━━
216
218
  Priority │ Action │ Command
217
219
  ─────────┼─────────────────────────────────────┼────────────────────
218
- HIGH │ Reply to build-1 question │ bd_msg(...)
220
+ HIGH │ Reply to build-1 question │ bd-msg --to "build-1" --subj "Re:" --body "..."
219
221
  HIGH │ Add plan for bd-ghi56 │ /plan bd-ghi56
220
222
  MEDIUM │ Review 2 stale tasks │ /triage --stale
221
223
  LOW │ Push 2 local commits │ git push
@@ -286,13 +288,13 @@ if (incompleteSessions.length > 0) {
286
288
 
287
289
  ## Phase 6: CI/CD Status (if available)
288
290
 
289
- ```bash
291
+ ```
290
292
  # GitHub Actions
291
- gh run list --limit 3 --json status,conclusion,name,createdAt
293
+ !`gh run list --limit 3 --json status,conclusion,name,createdAt`
292
294
 
293
295
  # Or check for common CI files
294
- ls .github/workflows/ 2>/dev/null
295
- cat .github/workflows/*.yml | grep -A5 "name:"
296
+ !`ls .github/workflows/ 2>/dev/null`
297
+ !`cat .github/workflows/*.yml | grep -A5 "name:"`
296
298
  ```
297
299
 
298
300
  **Output:**
@@ -332,7 +334,7 @@ RECOMMENDED NEXT STEPS
332
334
  Based on current status:
333
335
 
334
336
  1. High Priority Messages:
335
- → Reply to build-1: bd_msg({ to: "build-1", subj: "Re: API spec", body: "..." })
337
+ → Reply to build-1: bd-msg --to "build-1" --subj "Re: API spec" --body "..."
336
338
 
337
339
  2. Continue In-Progress Work:
338
340
  → /implement bd-abc12 (P0, 2h old)
@@ -364,7 +366,7 @@ Handle gracefully:
364
366
  ```
365
367
  [If beads unavailable:]
366
368
  ⚠️ Beads database not initialized
367
- Run: bd_init() to connect
369
+ Run: bd status to check connection
368
370
 
369
371
  [If git not available:]
370
372
  ⚠️ Not a git repository
@@ -374,3 +376,4 @@ Handle gracefully:
374
376
  ⚠️ CI status unavailable
375
377
  Check: GitHub Actions permissions
376
378
  ```
379
+ ````
@@ -16,19 +16,19 @@ Analyze open tasks and optimize prioritization using dependency graph analysis,
16
16
 
17
17
  ## Phase 1: Initialize Beads Connection
18
18
 
19
- ```typescript
20
- bd_init({ team: "project", role: "build" });
21
- ```
19
+ !`bd status`
22
20
 
23
21
  ## Phase 2: Gather Workspace State
24
22
 
25
23
  Run in parallel:
26
24
 
25
+ !`bd status`
26
+ !`bd list --status open --limit 50`
27
+
27
28
  ```typescript
28
- bd_status({ include_agents: true });
29
- bd_ls({ status: "open", limit: 50, offset: 0 });
30
- bd_reservations();
31
- bd_inbox({ n: 10, unread: true, global: true });
29
+ // Custom tools (not shell commands)
30
+ bd-release(); // Lists active locks when called with no args
31
+ bd-inbox({ n: 10, unread: true, to: "all" });
32
32
 
33
33
  // Search for past discussions on recurring issues
34
34
  search_session({ query: "blocked OR regression OR urgent", limit: 10 });
@@ -47,10 +47,7 @@ Capture:
47
47
 
48
48
  Use `bd dep tree` to understand blocking relationships:
49
49
 
50
- ```typescript
51
- // For each high-priority open task, check its dependency tree
52
- bd_dep({ action: "tree", child: "<task-id>", type: "blocks" });
53
- ```
50
+ !`bd dep tree <task-id>`
54
51
 
55
52
  This provides:
56
53
 
@@ -244,7 +241,8 @@ function selectAgent(role: string, agents: Agent[]): Agent {
244
241
  // For each unassigned high-priority ready task
245
242
  for (const task of readyTasks.filter((t) => !t.assignee && t.priority <= 2)) {
246
243
  const role = detectRole(task);
247
- bd_assign({ id: task.id, role, notify: true });
244
+ // Use bd CLI to update assignment
245
+ // bd update <task.id> --assignee <role>
248
246
  }
249
247
  ```
250
248
 
@@ -267,13 +265,10 @@ Skipped:
267
265
 
268
266
  ### Bulk Priority Update
269
267
 
270
- ```typescript
271
- // Escalate all breached SLA tasks
272
- for (const task of breachedTasks) {
273
- if (task.priority > 1) {
274
- bd_update({ id: task.id, priority: task.priority - 1 });
275
- }
276
- }
268
+ ```bash
269
+ # Escalate all breached SLA tasks
270
+ for each breached task:
271
+ bd update <task-id> --priority <new-priority>
277
272
  ```
278
273
 
279
274
  ### Stale Task Cleanup
@@ -298,18 +293,11 @@ console.log("3. Review individually");
298
293
  ```
299
294
 
300
295
  ```typescript
301
- bd_sync({ reason: "Sync triage changes" });
302
-
303
- // Broadcast triage summary if significant changes
304
- if (assignmentsMade > 0 || priorityChanges > 0) {
305
- bd_msg({
306
- subj: "Triage Complete",
307
- body: `Assigned ${assignmentsMade} tasks, updated ${priorityChanges} priorities`,
308
- to: "all",
309
- global: true,
310
- importance: "normal",
311
- });
312
- }
296
+ bd sync
297
+
298
+ # Broadcast triage summary if significant changes
299
+ if assignments or priority changes:
300
+ bd-msg --subj "Triage Complete" --body "Assigned X tasks, updated Y priorities" --to "all" --importance normal
313
301
  ```
314
302
 
315
303
  ## Alternative: Manual Triage
@@ -266,19 +266,12 @@ Info (Nice to Have):
266
266
 
267
267
  If `--bead=<id>` provided:
268
268
 
269
- ```typescript
270
- // Create issues for critical findings
271
- bd_add({
272
- title: "[UI] Fix invisible focus states",
273
- desc: "Focus states not visible on primary buttons.\n\nFix: Add focus-visible ring classes",
274
- type: "bug",
275
- pri: 1,
276
- parent: "<bead-id>",
277
- tags: ["accessibility", "ui"],
278
- });
279
-
280
- // Update review.md
281
- write(".beads/artifacts/<bead-id>/review.md", reviewContent);
269
+ ```bash
270
+ # Create issues for critical findings
271
+ bd create "[UI] Fix invisible focus states" -t bug -p 1
272
+
273
+ # Then link to parent bead
274
+ bd dep add <task-id> <bead-id>
282
275
  ```
283
276
 
284
277
  ---
@@ -0,0 +1,465 @@
1
+ ---
2
+ description: Analyze project health, status, and ready work with metrics
3
+ argument-hint: "[--quick|--deep|--health|--security]"
4
+ agent: planner
5
+ ---
6
+
7
+ # Analyze Project
8
+
9
+ ## Load Beads Skill
10
+
11
+ ```typescript
12
+ skill({ name: "beads" });
13
+ ```
14
+
15
+ ## Phase 1: Quick Status Dashboard
16
+
17
+ Run these checks in parallel for speed:
18
+
19
+ ```bash
20
+ # Git status
21
+ git status --short
22
+ git branch --show-current
23
+ git log --oneline -3
24
+
25
+ # Beads status
26
+ bd status
27
+ bd list --status open --limit 5
28
+ bd list --status ready --limit 5
29
+
30
+ # CI/CD status (GitHub Actions)
31
+ gh run list --limit 5
32
+
33
+ # Last commit info
34
+ git log -1 --format="%h %s (%cr by %an)"
35
+ ```
36
+
37
+ ### Status Dashboard Output
38
+
39
+ ```markdown
40
+ ## Project Status Dashboard
41
+
42
+ | Category | Status | Details |
43
+ | ---------------- | --------------------- | ------------------------------ |
44
+ | **Branch** | `main` | 3 commits ahead of origin |
45
+ | **Working Tree** | Clean / Dirty | X files modified |
46
+ | **Last Commit** | `abc123` | "feat: add auth" (2 hours ago) |
47
+ | **CI Status** | Pass / Fail / Running | Last run: 2h ago |
48
+ | **Open Tasks** | X beads | Y ready, Z blocked |
49
+ | **Dependencies** | X outdated | Y security issues |
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Phase 2: Tech Stack Detection
55
+
56
+ Detect project technology:
57
+
58
+ ```bash
59
+ # Package manager & framework
60
+ ls package.json pyproject.toml Cargo.toml go.mod pom.xml build.gradle
61
+
62
+ # Read main config
63
+ read package.json # or equivalent
64
+ ```
65
+
66
+ ### Tech Stack Analysis
67
+
68
+ | Aspect | Detection Method | Example Output |
69
+ | --------------------- | ------------------------- | -------------------------------- |
70
+ | **Language** | File extensions, config | TypeScript, Python, Rust |
71
+ | **Framework** | package.json dependencies | Next.js 14, FastAPI, Axum |
72
+ | **Package Manager** | Lock file presence | npm, pnpm, yarn, bun |
73
+ | **Testing** | Test framework in deps | Jest, Vitest, pytest, cargo test |
74
+ | **Linting** | Config files | ESLint, Biome, Ruff |
75
+ | **Formatting** | Config files | Prettier, Biome, Black |
76
+ | **CI/CD** | Workflow files | GitHub Actions, GitLab CI |
77
+ | **Database** | Dependencies, .env | PostgreSQL, SQLite, MongoDB |
78
+ | **UI Framework** | Dependencies | React, Vue, Svelte |
79
+ | **Component Library** | components.json, deps | shadcn/ui, MUI, Chakra |
80
+
81
+ ```markdown
82
+ ## Tech Stack
83
+
84
+ | Category | Technology | Version |
85
+ | --------------- | ---------- | ------- |
86
+ | Language | TypeScript | 5.3.x |
87
+ | Runtime | Node.js | 20.x |
88
+ | Framework | Next.js | 14.2 |
89
+ | Package Manager | pnpm | 8.x |
90
+ | Testing | Vitest | 1.x |
91
+ | Linting | Biome | 1.x |
92
+ | UI | shadcn/ui | latest |
93
+ | Database | PostgreSQL | 16 |
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Phase 3: Health Metrics
99
+
100
+ ### 3.1 Dependency Health
101
+
102
+ ```bash
103
+ # Node.js
104
+ npm outdated --json || pnpm outdated --json
105
+ npm audit --json
106
+
107
+ # Python
108
+ pip list --outdated
109
+ pip-audit
110
+
111
+ # Rust
112
+ cargo outdated
113
+ cargo audit
114
+ ```
115
+
116
+ **Dependency Dashboard:**
117
+
118
+ | Metric | Value | Status | Threshold |
119
+ | ------------------------ | ----- | ------- | --------- |
120
+ | Total dependencies | 45 | - | - |
121
+ | Outdated (major) | 3 | Warning | < 5 |
122
+ | Outdated (minor) | 8 | OK | < 20 |
123
+ | Security vulnerabilities | 0 | OK | 0 |
124
+ | High/Critical vulns | 0 | OK | 0 |
125
+
126
+ ### 3.2 Test Coverage
127
+
128
+ ```bash
129
+ # Node.js
130
+ npm test -- --coverage --json
131
+
132
+ # Python
133
+ pytest --cov --cov-report=json
134
+
135
+ # Check for coverage config
136
+ glob pattern="**/jest.config.*"
137
+ glob pattern="**/vitest.config.*"
138
+ glob pattern="**/pytest.ini"
139
+ glob pattern="**/pyproject.toml"
140
+ ```
141
+
142
+ **Coverage Dashboard:**
143
+
144
+ | Metric | Value | Status | Threshold |
145
+ | --------------- | ----- | ------- | --------- |
146
+ | Line coverage | 78% | Warning | > 80% |
147
+ | Branch coverage | 65% | Warning | > 70% |
148
+ | Uncovered files | 12 | - | - |
149
+ | Test count | 156 | - | - |
150
+ | Test pass rate | 100% | OK | 100% |
151
+
152
+ ### 3.3 Code Quality
153
+
154
+ ```bash
155
+ # TypeScript type errors
156
+ npx tsc --noEmit 2>&1 | wc -l
157
+
158
+ # Linting issues
159
+ npm run lint -- --format json 2>/dev/null || npx biome check --reporter=json
160
+
161
+ # TODO/FIXME count
162
+ grep -r "TODO\|FIXME\|HACK\|XXX" src/ --include="*.ts" --include="*.tsx" | wc -l
163
+ ```
164
+
165
+ **Quality Dashboard:**
166
+
167
+ | Metric | Value | Status | Threshold |
168
+ | ---------------------- | ----- | ------- | --------- |
169
+ | Type errors | 0 | OK | 0 |
170
+ | Lint errors | 5 | Warning | 0 |
171
+ | Lint warnings | 23 | OK | < 50 |
172
+ | TODO/FIXME | 15 | Info | < 30 |
173
+ | Console.log statements | 3 | Warning | 0 |
174
+
175
+ ### 3.4 Documentation Status
176
+
177
+ ```bash
178
+ # Check for docs
179
+ ls README.md CHANGELOG.md CONTRIBUTING.md docs/ 2>/dev/null
180
+
181
+ # README freshness
182
+ git log -1 --format="%cr" -- README.md
183
+
184
+ # API docs
185
+ ls docs/api/ openapi.yaml swagger.json 2>/dev/null
186
+ ```
187
+
188
+ **Documentation Dashboard:**
189
+
190
+ | Document | Status | Last Updated |
191
+ | --------------- | ------- | ------------ |
192
+ | README.md | Present | 5 days ago |
193
+ | CHANGELOG.md | Present | 2 days ago |
194
+ | CONTRIBUTING.md | Missing | - |
195
+ | API docs | Present | 1 week ago |
196
+ | AGENTS.md | Present | 3 days ago |
197
+
198
+ ---
199
+
200
+ ## Phase 4: Detailed Analysis (--deep)
201
+
202
+ **For large codebases (>100KB of source):**
203
+
204
+ skill({ name: "gemini-large-context" })
205
+
206
+ ### 4.1 Architecture Analysis
207
+
208
+ ```bash
209
+ gemini -p "@src/
210
+ Describe:
211
+ 1. Overall architecture pattern (MVC, Clean, Hexagonal, etc.)
212
+ 2. Key modules and their responsibilities
213
+ 3. Data flow between components
214
+ 4. External dependencies and integrations
215
+ 5. Areas of high complexity"
216
+ ```
217
+
218
+ ### 4.2 Test Gap Analysis
219
+
220
+ ```bash
221
+ gemini -p "@src/ @tests/
222
+ Assess test coverage:
223
+ - Which modules have tests?
224
+ - Which are missing tests?
225
+ - Test quality (unit vs integration)
226
+ - Edge cases covered
227
+ - Critical paths without tests"
228
+ ```
229
+
230
+ ### 4.3 Code Smell Detection
231
+
232
+ ```bash
233
+ gemini -p "@src/
234
+ Identify code smells:
235
+ - Duplicated code
236
+ - Long functions (>50 lines)
237
+ - Deep nesting (>4 levels)
238
+ - God objects/files
239
+ - Dead code
240
+ - Inconsistent patterns"
241
+ ```
242
+
243
+ ### 4.4 Security Analysis (--security)
244
+
245
+ ```bash
246
+ # Automated scans
247
+ npm audit
248
+ npx snyk test 2>/dev/null || true
249
+
250
+ # Pattern-based detection
251
+ grep -r "password\s*=" src/ --include="*.ts" || true
252
+ grep -r "api_key\s*=" src/ --include="*.ts" || true
253
+ grep -r "secret" src/ --include="*.ts" || true
254
+
255
+ # Deep analysis with Gemini
256
+ gemini -p "@src/ @api/
257
+ Security review:
258
+ - Input validation practices
259
+ - Authentication/authorization patterns
260
+ - SQL injection protections
261
+ - XSS prevention measures
262
+ - Secrets in code
263
+ - CORS configuration"
264
+ ```
265
+
266
+ **Security Dashboard:**
267
+
268
+ | Check | Status | Issues |
269
+ | ----------------- | ------- | ------------------------- |
270
+ | npm audit | Pass | 0 vulnerabilities |
271
+ | Hardcoded secrets | Warning | 2 potential matches |
272
+ | Auth patterns | OK | Using established library |
273
+ | Input validation | Warning | 5 unvalidated endpoints |
274
+ | CORS | OK | Properly configured |
275
+
276
+ ---
277
+
278
+ ## Phase 5: Ready Work
279
+
280
+ Find actionable tasks with no blockers:
281
+
282
+ ```bash
283
+ bd list --status ready --limit 10
284
+ ```
285
+
286
+ ### Ready Work Table
287
+
288
+ | ID | Title | Type | Priority | Tags |
289
+ | ------ | ------------- | ------- | -------- | ----------- |
290
+ | bd-123 | Add user auth | feature | P1 | backend |
291
+ | bd-124 | Fix login bug | bug | P0 | urgent |
292
+ | bd-125 | Update deps | task | P2 | maintenance |
293
+
294
+ **Blocked Work:**
295
+
296
+ ```bash
297
+ bd list --status blocked --limit 5
298
+ ```
299
+
300
+ | ID | Title | Blocked By | Action Needed |
301
+ | ------ | -------------- | ---------- | ------------------- |
302
+ | bd-130 | Deploy to prod | bd-124 | Fix login bug first |
303
+
304
+ ---
305
+
306
+ ## Phase 6: Health Score
307
+
308
+ Calculate overall project health:
309
+
310
+ ```
311
+ Health Score = 100 - (penalties)
312
+
313
+ Penalties:
314
+ - Each high/critical vulnerability: -10 (max -30)
315
+ - Each major outdated dependency: -2 (max -10)
316
+ - Type errors present: -15
317
+ - Test coverage < 80%: -10
318
+ - Test coverage < 60%: -20
319
+ - CI failing: -20
320
+ - No README: -5
321
+ - No CHANGELOG: -3
322
+ - Lint errors > 0: -5
323
+ - TODO count > 50: -5
324
+
325
+ Score interpretation:
326
+ 90-100: Excellent - Ship with confidence
327
+ 75-89: Good - Minor issues to address
328
+ 60-74: Fair - Technical debt accumulating
329
+ < 60: Poor - Significant attention needed
330
+ ```
331
+
332
+ ### Health Score Output
333
+
334
+ ```markdown
335
+ ## Project Health Score: 82/100 (Good)
336
+
337
+ ### Score Breakdown
338
+
339
+ | Category | Score | Notes |
340
+ | ------------- | ----- | ------------------------ |
341
+ | Security | 20/20 | No vulnerabilities |
342
+ | Dependencies | 18/20 | 2 major outdated |
343
+ | Tests | 15/20 | 78% coverage (below 80%) |
344
+ | Code Quality | 15/20 | 5 lint errors |
345
+ | CI/CD | 10/10 | Passing |
346
+ | Documentation | 4/10 | Missing CONTRIBUTING.md |
347
+
348
+ ### Priority Actions
349
+
350
+ 1. **Fix 5 lint errors** → `npm run lint -- --fix`
351
+ 2. **Increase test coverage** → Focus on uncovered files
352
+ 3. **Update 2 major deps** → `npm update`
353
+ 4. **Add CONTRIBUTING.md** → Document contribution process
354
+ ```
355
+
356
+ ---
357
+
358
+ ## Phase 7: Recommendations & Actions
359
+
360
+ Based on analysis, generate actionable recommendations:
361
+
362
+ ### Immediate Actions
363
+
364
+ | Priority | Issue | Command | Bead Created |
365
+ | -------- | ---------------- | ----------------------- | ------------ |
366
+ | P0 | CI failing | Check `gh run view` | - |
367
+ | P1 | 2 security vulns | `npm audit fix` | bd-xxx |
368
+ | P2 | 5 lint errors | `npm run lint -- --fix` | - |
369
+
370
+ ### Create Beads for Issues
371
+
372
+ For significant findings, create tracking issues:
373
+
374
+ ```bash
375
+ # For security vulnerabilities
376
+ bd create "[Security] Fix npm audit vulnerabilities" -t bug -p 1
377
+
378
+ # For test coverage
379
+ bd create "[Quality] Increase test coverage to 80%" -t task -p 2
380
+ ```
381
+
382
+ ### Suggested Follow-up Commands
383
+
384
+ Based on findings:
385
+
386
+ | Finding | Suggested Command |
387
+ | --------------------- | ------------------------------------- |
388
+ | Ready tasks available | `/implement <bead-id>` |
389
+ | Test coverage low | `/research test coverage strategies` |
390
+ | Security issues | `/fix security` |
391
+ | Outdated deps | `npm update` or `/research migration` |
392
+ | Architecture unclear | `/research architecture` |
393
+ | Design system issues | `/design-audit codebase` |
394
+
395
+ ---
396
+
397
+ ## Output Modes
398
+
399
+ ### --quick (Default)
400
+
401
+ - Status dashboard only
402
+ - Ready work list
403
+ - ~30 seconds
404
+
405
+ ### --health
406
+
407
+ - Quick status + health metrics
408
+ - Dependency/security scan
409
+ - Health score
410
+ - ~2-3 minutes
411
+
412
+ ### --deep
413
+
414
+ - Full analysis including Gemini-powered insights
415
+ - Architecture, test gaps, code smells
416
+ - ~10-15 minutes
417
+
418
+ ### --security
419
+
420
+ - Security-focused analysis
421
+ - npm audit, secret detection, pattern analysis
422
+ - Gemini security review
423
+ - ~5-10 minutes
424
+
425
+ ---
426
+
427
+ ## Examples
428
+
429
+ ```bash
430
+ # Quick status check
431
+ /analyze-project
432
+
433
+ # Full health assessment
434
+ /analyze-project --health
435
+
436
+ # Deep analysis for large codebase
437
+ /analyze-project --deep
438
+
439
+ # Security audit
440
+ /analyze-project --security
441
+ ```
442
+
443
+ ---
444
+
445
+ ## Storage
446
+
447
+ Save analysis to `.opencode/memory/project/analysis-[YYYY-MM-DD].md` for trend tracking.
448
+
449
+ Compare with previous analysis:
450
+
451
+ ```bash
452
+ read .opencode/memory/project/analysis-*.md
453
+ ```
454
+
455
+ ---
456
+
457
+ ## Related Commands
458
+
459
+ | Need | Command |
460
+ | ------------------- | ------------------------------------- |
461
+ | Start ready work | `/implement <bead-id>` |
462
+ | Review codebase | `/review-codebase` |
463
+ | Check design system | `/design-audit` |
464
+ | Security deep dive | `/research security best practices` |
465
+ | Dependency update | `/research migration to [package] vX` |