opencodekit 0.12.6 → 0.12.7

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 (44) hide show
  1. package/dist/index.js +5 -17
  2. package/dist/template/.opencode/agent/build.md +32 -21
  3. package/dist/template/.opencode/agent/explore.md +27 -16
  4. package/dist/template/.opencode/agent/planner.md +103 -63
  5. package/dist/template/.opencode/agent/review.md +31 -23
  6. package/dist/template/.opencode/agent/rush.md +27 -19
  7. package/dist/template/.opencode/agent/scout.md +27 -19
  8. package/dist/template/.opencode/agent/vision.md +29 -19
  9. package/dist/template/.opencode/command/accessibility-check.md +1 -0
  10. package/dist/template/.opencode/command/analyze-mockup.md +1 -0
  11. package/dist/template/.opencode/command/analyze-project.md +2 -1
  12. package/dist/template/.opencode/command/brainstorm.md +2 -1
  13. package/dist/template/.opencode/command/design-audit.md +1 -0
  14. package/dist/template/.opencode/command/finish.md +39 -4
  15. package/dist/template/.opencode/command/implement.md +26 -6
  16. package/dist/template/.opencode/command/init.md +1 -0
  17. package/dist/template/.opencode/command/pr.md +28 -1
  18. package/dist/template/.opencode/command/research-ui.md +1 -0
  19. package/dist/template/.opencode/command/research.md +1 -0
  20. package/dist/template/.opencode/command/review-codebase.md +1 -0
  21. package/dist/template/.opencode/command/status.md +3 -2
  22. package/dist/template/.opencode/command/summarize.md +2 -1
  23. package/dist/template/.opencode/command/ui-review.md +1 -0
  24. package/dist/template/.opencode/memory/project/architecture.md +59 -6
  25. package/dist/template/.opencode/memory/project/commands.md +20 -164
  26. package/dist/template/.opencode/memory/user.md +24 -7
  27. package/dist/template/.opencode/opencode.json +496 -496
  28. package/dist/template/.opencode/package.json +1 -1
  29. package/dist/template/.opencode/skill/condition-based-waiting/example.ts +71 -65
  30. package/dist/template/.opencode/tool/memory-read.ts +57 -57
  31. package/dist/template/.opencode/tool/memory-update.ts +53 -53
  32. package/dist/template/.opencode/tsconfig.json +19 -19
  33. package/package.json +4 -16
  34. package/dist/template/.opencode/command.backup/analyze-project.md +0 -465
  35. package/dist/template/.opencode/command.backup/finish.md +0 -167
  36. package/dist/template/.opencode/command.backup/implement.md +0 -143
  37. package/dist/template/.opencode/command.backup/pr.md +0 -252
  38. package/dist/template/.opencode/command.backup/status.md +0 -376
  39. package/dist/template/.opencode/lib/lsp/client.ts +0 -614
  40. package/dist/template/.opencode/lib/lsp/config.ts +0 -199
  41. package/dist/template/.opencode/lib/lsp/constants.ts +0 -339
  42. package/dist/template/.opencode/lib/lsp/types.ts +0 -138
  43. package/dist/template/.opencode/lib/lsp/utils.ts +0 -190
  44. package/dist/template/.opencode/memory/project/SHELL_OUTPUT_MIGRATION_PLAN.md +0 -551
@@ -1,465 +0,0 @@
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` |
@@ -1,167 +0,0 @@
1
- ---
2
- description: Finish a bead - verify, commit, close
3
- argument-hint: "<bead-id>"
4
- agent: build
5
- ---
6
-
7
- # Finish: $ARGUMENTS
8
-
9
- You're closing out a task. This is the quality gate. No shortcuts.
10
-
11
- ## Load Skills
12
-
13
- ```typescript
14
- skill({ name: "beads" });
15
- skill({ name: "verification-before-completion" });
16
- ```
17
-
18
- ## Verify The Task Exists
19
-
20
- ```bash
21
- bd show $ARGUMENTS
22
- ```
23
-
24
- If not found, stop. Check `bd list --status=all` for the correct ID.
25
-
26
- ## Run All Gates
27
-
28
- Detect your project type and run everything:
29
-
30
- ```bash
31
- ls package.json Cargo.toml pyproject.toml go.mod Makefile 2>/dev/null
32
- ```
33
-
34
- **Node/TypeScript:**
35
-
36
- ```bash
37
- npm run build 2>/dev/null || true
38
- npm test
39
- npm run lint 2>/dev/null || true
40
- npm run type-check 2>/dev/null || true
41
- ```
42
-
43
- **Rust:**
44
-
45
- ```bash
46
- cargo build
47
- cargo test
48
- cargo clippy -- -D warnings
49
- ```
50
-
51
- **Python:**
52
-
53
- ```bash
54
- pytest
55
- ruff check .
56
- mypy . 2>/dev/null || true
57
- ```
58
-
59
- **Go:**
60
-
61
- ```bash
62
- go build ./...
63
- go test ./...
64
- golangci-lint run
65
- ```
66
-
67
- If ANY gate fails, stop. Fix it first. Don't close broken work.
68
-
69
- ## Verify Success Criteria
70
-
71
- Read the spec and check each criterion:
72
-
73
- ```bash
74
- cat .beads/artifacts/$ARGUMENTS/spec.md
75
- ```
76
-
77
- For each success criterion listed, run its verification. All must pass. If something's missing, go back and implement it.
78
-
79
- ## Commit Everything
80
-
81
- ```bash
82
- git add -A
83
- git status
84
- git commit -m "$ARGUMENTS: [what was done]
85
-
86
- - [change 1]
87
- - [change 2]
88
-
89
- Closes: $ARGUMENTS"
90
- ```
91
-
92
- ## Close The Task
93
-
94
- ```bash
95
- bd close $ARGUMENTS --reason "Completed: [1-line summary]"
96
- ```
97
-
98
- This closes the task. Sync separately if needed.
99
-
100
- ## Create Review (Optional But Recommended)
101
-
102
- If this was non-trivial work, document what happened:
103
-
104
- ```bash
105
- mkdir -p .beads/artifacts/$ARGUMENTS
106
- ```
107
-
108
- Write `.beads/artifacts/$ARGUMENTS/review.md`:
109
-
110
- ```markdown
111
- # Review: $ARGUMENTS
112
-
113
- **Completed:** [date]
114
-
115
- ## What Changed
116
-
117
- - [file]: [what and why]
118
-
119
- ## What Worked
120
-
121
- - [thing that went smoothly]
122
-
123
- ## What Was Hard
124
-
125
- - [challenge and how you solved it]
126
-
127
- ## Lessons
128
-
129
- - [anything worth remembering]
130
- ```
131
-
132
- ## Record Learnings
133
-
134
- If you discovered patterns or gotchas worth remembering:
135
-
136
- ```typescript
137
- observation({
138
- type: "learning",
139
- title: "[concise title]",
140
- content: "[what you learned]",
141
- bead_id: "$ARGUMENTS",
142
- });
143
- ```
144
-
145
- ## Output
146
-
147
- ```
148
- Closed: $ARGUMENTS
149
-
150
- Gates: All passed
151
- Commit: [hash]
152
- Branch: [branch]
153
-
154
- Next:
155
- - /pr $ARGUMENTS # Create pull request
156
- - Or merge directly: git checkout main && git merge $ARGUMENTS
157
- ```
158
-
159
- ## If Work Is Incomplete
160
-
161
- Don't close incomplete work. Instead:
162
-
163
- ```
164
- /handoff $ARGUMENTS "Stopped at [step]. Remaining: [what's left]"
165
- ```
166
-
167
- Then start fresh session and `/resume $ARGUMENTS` later.