opencodekit 0.10.0 → 0.11.1

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 (47) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/agent/planner.md +3 -2
  3. package/dist/template/.opencode/command/accessibility-check.md +297 -30
  4. package/dist/template/.opencode/command/analyze-mockup.md +412 -20
  5. package/dist/template/.opencode/command/analyze-project.md +445 -30
  6. package/dist/template/.opencode/command/brainstorm.md +294 -5
  7. package/dist/template/.opencode/command/commit.md +231 -17
  8. package/dist/template/.opencode/command/create.md +415 -77
  9. package/dist/template/.opencode/command/design-audit.md +483 -29
  10. package/dist/template/.opencode/command/design.md +615 -6
  11. package/dist/template/.opencode/command/edit-image.md +223 -20
  12. package/dist/template/.opencode/command/finish.md +163 -71
  13. package/dist/template/.opencode/command/fix-ci.md +297 -24
  14. package/dist/template/.opencode/command/fix-types.md +351 -13
  15. package/dist/template/.opencode/command/fix-ui.md +299 -13
  16. package/dist/template/.opencode/command/fix.md +262 -9
  17. package/dist/template/.opencode/command/generate-diagram.md +327 -26
  18. package/dist/template/.opencode/command/generate-icon.md +266 -22
  19. package/dist/template/.opencode/command/generate-image.md +232 -12
  20. package/dist/template/.opencode/command/generate-pattern.md +234 -20
  21. package/dist/template/.opencode/command/generate-storyboard.md +231 -21
  22. package/dist/template/.opencode/command/handoff.md +208 -31
  23. package/dist/template/.opencode/command/implement.md +163 -50
  24. package/dist/template/.opencode/command/import-plan.md +253 -52
  25. package/dist/template/.opencode/command/init.md +154 -35
  26. package/dist/template/.opencode/command/integration-test.md +410 -24
  27. package/dist/template/.opencode/command/issue.md +177 -21
  28. package/dist/template/.opencode/command/new-feature.md +390 -54
  29. package/dist/template/.opencode/command/plan.md +394 -107
  30. package/dist/template/.opencode/command/pr.md +235 -29
  31. package/dist/template/.opencode/command/quick-build.md +234 -5
  32. package/dist/template/.opencode/command/research-and-implement.md +442 -12
  33. package/dist/template/.opencode/command/research-ui.md +444 -34
  34. package/dist/template/.opencode/command/research.md +179 -45
  35. package/dist/template/.opencode/command/restore-image.md +416 -22
  36. package/dist/template/.opencode/command/resume.md +447 -63
  37. package/dist/template/.opencode/command/revert-feature.md +347 -65
  38. package/dist/template/.opencode/command/review-codebase.md +199 -4
  39. package/dist/template/.opencode/command/skill-create.md +506 -14
  40. package/dist/template/.opencode/command/skill-optimize.md +487 -16
  41. package/dist/template/.opencode/command/status.md +326 -60
  42. package/dist/template/.opencode/command/summarize.md +374 -33
  43. package/dist/template/.opencode/command/triage.md +361 -0
  44. package/dist/template/.opencode/command/ui-review.md +296 -25
  45. package/dist/template/.opencode/skill/beads/SKILL.md +108 -3
  46. package/dist/template/.opencode/skill/playwriter/SKILL.md +148 -0
  47. package/package.json +1 -1
@@ -1,20 +1,281 @@
1
1
  ---
2
- description: Analyze project structure, status, and ready work
2
+ description: Analyze project health, status, and ready work with metrics
3
+ argument-hint: "[--quick|--deep|--health|--security]"
3
4
  agent: planner
4
5
  ---
5
6
 
6
7
  # Analyze Project
7
8
 
8
- **For large codebases:** `skill({ name: "gemini-large-context" })`
9
+ ## Load Beads Skill
9
10
 
10
- ## Quick Status
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({ include_agents: false })
27
+ bd_ls({ status: "open", limit: 5, offset: 0 })
28
+ bd_ls({ status: "ready", limit: 5, offset: 0 })
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
11
219
 
12
- 1. **Git:** `git status` - current branch, changes
13
- 2. **Tasks:** `bd_ls({ status: "open" })` - active beads
14
- 3. **CI:** Check build status
15
- 4. **Dependencies:** Check for outdated packages
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
+ ```
16
265
 
17
- ## Ready Work
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
18
279
 
19
280
  Find actionable tasks with no blockers:
20
281
 
@@ -22,41 +283,195 @@ Find actionable tasks with no blockers:
22
283
  bd_ls({ status: "ready", limit: 10, offset: 0 });
23
284
  ```
24
285
 
25
- This shows beads that are unblocked and ready to start. Use `/implement <bead-id>` to begin work on any of these.
286
+ ### Ready Work Table
26
287
 
27
- ## Detailed Analysis (On Request)
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 |
28
293
 
29
- ### Task Overview
294
+ **Blocked Work:**
30
295
 
31
296
  ```typescript
32
- bd_ls({ status: "open", limit: 10, offset: 0 });
33
- bd_ls({ status: "ready", limit: 10, offset: 0 });
297
+ bd_ls({ status: "blocked", limit: 5, offset: 0 });
34
298
  ```
35
299
 
36
- For active beads, read spec from `.beads/artifacts/<bead-id>/spec.md`
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
37
359
 
38
- ### Blocked Work
360
+ Based on analysis, generate actionable recommendations:
39
361
 
40
- Check what's blocking progress:
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:
41
373
 
42
374
  ```typescript
43
- bd_ls({ status: "blocked", limit: 10, offset: 0 });
375
+ // For security vulnerabilities
376
+ bd_add({
377
+ title: "[Security] Fix npm audit vulnerabilities",
378
+ desc: "npm audit found 2 high severity vulnerabilities:\n- lodash: prototype pollution\n- axios: SSRF\n\nRun: npm audit fix --force",
379
+ type: "bug",
380
+ pri: 1,
381
+ tags: ["security", "dependencies"],
382
+ });
383
+
384
+ // For test coverage
385
+ bd_add({
386
+ title: "[Quality] Increase test coverage to 80%",
387
+ desc: "Current coverage: 78%\nTarget: 80%\n\nUncovered files:\n- src/auth/login.ts\n- src/api/users.ts",
388
+ type: "task",
389
+ pri: 2,
390
+ tags: ["testing", "quality"],
391
+ });
392
+ ```
393
+
394
+ ### Suggested Follow-up Commands
395
+
396
+ Based on findings:
397
+
398
+ | Finding | Suggested Command |
399
+ | --------------------- | ------------------------------------- |
400
+ | Ready tasks available | `/implement <bead-id>` |
401
+ | Test coverage low | `/research test coverage strategies` |
402
+ | Security issues | `/fix security` |
403
+ | Outdated deps | `npm update` or `/research migration` |
404
+ | Architecture unclear | `/research architecture` |
405
+ | Design system issues | `/design-audit codebase` |
406
+
407
+ ---
408
+
409
+ ## Output Modes
410
+
411
+ ### --quick (Default)
412
+
413
+ - Status dashboard only
414
+ - Ready work list
415
+ - ~30 seconds
416
+
417
+ ### --health
418
+
419
+ - Quick status + health metrics
420
+ - Dependency/security scan
421
+ - Health score
422
+ - ~2-3 minutes
423
+
424
+ ### --deep
425
+
426
+ - Full analysis including Gemini-powered insights
427
+ - Architecture, test gaps, code smells
428
+ - ~10-15 minutes
429
+
430
+ ### --security
431
+
432
+ - Security-focused analysis
433
+ - npm audit, secret detection, pattern analysis
434
+ - Gemini security review
435
+ - ~5-10 minutes
436
+
437
+ ---
438
+
439
+ ## Examples
440
+
441
+ ```bash
442
+ # Quick status check
443
+ /analyze-project
444
+
445
+ # Full health assessment
446
+ /analyze-project --health
447
+
448
+ # Deep analysis for large codebase
449
+ /analyze-project --deep
450
+
451
+ # Security audit
452
+ /analyze-project --security
44
453
  ```
45
454
 
46
- For each blocked bead, identify the blocker and either resolve it or escalate.
455
+ ---
456
+
457
+ ## Storage
47
458
 
48
- ### Project Structure
459
+ Save analysis to `.opencode/memory/project/analysis-[YYYY-MM-DD].md` for trend tracking.
49
460
 
50
- - Key directories
51
- - Recent modifications
52
- - Architecture patterns
53
- - Build configuration
54
- - Testing setup
461
+ Compare with previous analysis:
462
+
463
+ ```bash
464
+ read .opencode/memory/project/analysis-*.md
465
+ ```
466
+
467
+ ---
55
468
 
56
- ### Recommendations
469
+ ## Related Commands
57
470
 
58
- - **Immediate:** Tasks from `bd_ls({ status: "ready" })` to start now
59
- - **Blocked:** Dependencies preventing progress
60
- - **Attention:** Areas needing cleanup or refactoring
61
- - **Updates:** Dependency updates needed
62
- - **Patterns:** Code patterns to follow
471
+ | Need | Command |
472
+ | ------------------- | ------------------------------------- |
473
+ | Start ready work | `/implement <bead-id>` |
474
+ | Review codebase | `/review-codebase` |
475
+ | Check design system | `/design-audit` |
476
+ | Security deep dive | `/research security best practices` |
477
+ | Dependency update | `/research migration to [package] vX` |