opencodekit 0.14.6 → 0.15.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.
- package/README.md +2 -2
- package/dist/index.js +435 -57
- package/dist/template/.opencode/.env.example +1 -0
- package/dist/template/.opencode/AGENTS.md +13 -24
- package/dist/template/.opencode/README.md +8 -119
- package/dist/template/.opencode/agent/explore.md +2 -3
- package/dist/template/.opencode/agent/general.md +56 -0
- package/dist/template/.opencode/agent/plan.md +54 -0
- package/dist/template/.opencode/agent/scout.md +15 -5
- package/dist/template/.opencode/command/analyze-project.md +2 -2
- package/dist/template/.opencode/command/brainstorm.md +1 -1
- package/dist/template/.opencode/command/design-audit.md +4 -5
- package/dist/template/.opencode/command/design.md +4 -13
- package/dist/template/.opencode/command/generate-pattern.md +2 -9
- package/dist/template/.opencode/command/implement.md +4 -4
- package/dist/template/.opencode/command/init.md +1 -1
- package/dist/template/.opencode/command/new-feature.md +2 -3
- package/dist/template/.opencode/command/plan.md +1 -1
- package/dist/template/.opencode/command/pr.md +0 -1
- package/dist/template/.opencode/command/research.md +20 -6
- package/dist/template/.opencode/command/restore-image.md +1 -9
- package/dist/template/.opencode/command/revert-feature.md +1 -1
- package/dist/template/.opencode/command/review-codebase.md +4 -4
- package/dist/template/.opencode/command/status.md +1 -2
- package/dist/template/.opencode/command/summarize.md +1 -2
- package/dist/template/.opencode/command/triage.md +4 -32
- package/dist/template/.opencode/dcp.jsonc +68 -68
- package/dist/template/.opencode/memory/_templates/README.md +35 -0
- package/dist/template/.opencode/memory/_templates/project/architecture.md +60 -0
- package/dist/template/.opencode/memory/_templates/project/commands.md +72 -0
- package/dist/template/.opencode/memory/_templates/project/conventions.md +68 -0
- package/dist/template/.opencode/memory/_templates/project/gotchas.md +41 -0
- package/dist/template/.opencode/memory/beads-workflow.md +30 -29
- package/dist/template/.opencode/memory/project/architecture.md +31 -50
- package/dist/template/.opencode/memory/project/commands.md +41 -22
- package/dist/template/.opencode/memory/project/conventions.md +39 -177
- package/dist/template/.opencode/memory/project/gotchas.md +21 -177
- package/dist/template/.opencode/memory/user.example.md +5 -0
- package/dist/template/.opencode/opencode.json +628 -579
- package/dist/template/.opencode/package.json +18 -21
- package/dist/template/.opencode/plugin/compaction.ts +79 -85
- package/dist/template/.opencode/plugin/env-ctx.ts +19 -19
- package/dist/template/.opencode/plugin/lib/notify.ts +41 -45
- package/dist/template/.opencode/plugin/lsp.ts +197 -200
- package/dist/template/.opencode/plugin/memory.ts +14 -112
- package/dist/template/.opencode/plugin/package.json +5 -5
- package/dist/template/.opencode/plugin/sessions.ts +1 -1
- package/dist/template/.opencode/plugin/skill-mcp.ts +486 -521
- package/dist/template/.opencode/plugin/truncator.ts +47 -50
- package/dist/template/.opencode/plugin/tsconfig.json +14 -14
- package/dist/template/.opencode/skill/chrome-devtools/mcp.json +17 -17
- package/dist/template/.opencode/skill/condition-based-waiting/SKILL.md +17 -12
- package/dist/template/.opencode/skill/condition-based-waiting/example.ts +63 -69
- package/dist/template/.opencode/skill/defense-in-depth/SKILL.md +14 -8
- package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +14 -3
- package/dist/template/.opencode/skill/playwright/mcp.json +14 -14
- package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +21 -8
- package/dist/template/.opencode/skill/requesting-code-review/review.md +14 -0
- package/dist/template/.opencode/skill/root-cause-tracing/SKILL.md +18 -4
- package/dist/template/.opencode/skill/source-code-research/SKILL.md +9 -7
- package/dist/template/.opencode/skill/test-driven-development/SKILL.md +49 -32
- package/dist/template/.opencode/skill/testing-anti-patterns/SKILL.md +40 -22
- package/dist/template/.opencode/skill/testing-skills-with-subagents/SKILL.md +46 -26
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +117 -44
- package/dist/template/.opencode/skill/v0/SKILL.md +1 -7
- package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +27 -19
- package/dist/template/.opencode/skill/writing-skills/anthropic-best-practices.md +171 -148
- package/dist/template/.opencode/skill/writing-skills/persuasion-principles.md +39 -6
- package/dist/template/.opencode/tool/memory-read.ts +44 -56
- package/dist/template/.opencode/tool/memory-search.ts +8 -291
- package/dist/template/.opencode/tool/memory-update.ts +47 -51
- package/dist/template/.opencode/tool/observation.ts +6 -180
- package/dist/template/.opencode/tsconfig.json +19 -19
- package/package.json +19 -15
- package/dist/template/.opencode/.background-tasks.json +0 -114
- package/dist/template/.opencode/.ralph-state.json +0 -12
- package/dist/template/.opencode/agent/build.md +0 -327
- package/dist/template/.opencode/agent/ninja.md +0 -351
- package/dist/template/.opencode/agent/planner.md +0 -281
- package/dist/template/.opencode/agent/rush.md +0 -223
- package/dist/template/.opencode/memory/handoffs/README.md +0 -83
- package/dist/template/.opencode/memory/observations/.gitkeep +0 -0
- package/dist/template/.opencode/memory/observations/2026-01-09-pattern-ampcode-mcp-json-includetools-pattern.md +0 -42
- package/dist/template/.opencode/memory/vector_db/memories.lance/_transactions/0-0d25ba80-ba3b-4209-9046-b45d6093b4da.txn +0 -0
- package/dist/template/.opencode/memory/vector_db/memories.lance/_versions/1.manifest +0 -0
- package/dist/template/.opencode/memory/vector_db/memories.lance/data/1111100101010101011010004a9ef34df6b29f36a9a53a2892.lance +0 -0
- package/dist/template/.opencode/tool/ast-grep.ts +0 -245
- package/dist/template/.opencode/tool/background.ts +0 -509
- package/dist/template/.opencode/tool/bd-inbox.ts +0 -110
- package/dist/template/.opencode/tool/bd-msg.ts +0 -62
- package/dist/template/.opencode/tool/bd-release.ts +0 -71
- package/dist/template/.opencode/tool/bd-reserve.ts +0 -121
- package/dist/template/.opencode/tool/memory-embed.ts +0 -183
- package/dist/template/.opencode/tool/memory-index.ts +0 -769
- package/dist/template/.opencode/tool/repo-map.ts +0 -451
|
@@ -325,7 +325,7 @@ git checkout --ours [file] # Use reverted
|
|
|
325
325
|
## Phase 10: Update Bead Status
|
|
326
326
|
|
|
327
327
|
```bash
|
|
328
|
-
bd
|
|
328
|
+
bd close [bead-id] --reason "Reverted: [brief reason]"
|
|
329
329
|
```
|
|
330
330
|
|
|
331
331
|
---
|
|
@@ -39,11 +39,11 @@ lsp_lsp_diagnostics(); // for each changed file
|
|
|
39
39
|
!`npm run lint || true`
|
|
40
40
|
|
|
41
41
|
```typescript
|
|
42
|
-
// Anti-pattern detection with
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
// Anti-pattern detection with grep
|
|
43
|
+
grep({ pattern: "console\\.log" }); // Debug statements
|
|
44
|
+
grep({ pattern: "any" }); // TypeScript any
|
|
45
45
|
grep({ pattern: "TODO|FIXME|HACK|XXX" });
|
|
46
|
-
|
|
46
|
+
grep({ pattern: "password\\s*=" }); // Hardcoded secrets
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
!`npm test || pytest || cargo test`
|
|
@@ -215,10 +215,9 @@ Recommendation: Prune completed tool outputs before next major task
|
|
|
215
215
|
|
|
216
216
|
|
|
217
217
|
REQUIRED ACTIONS
|
|
218
|
-
|
|
218
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
219
219
|
Priority │ Action │ Command
|
|
220
220
|
─────────┼─────────────────────────────────────┼────────────────────
|
|
221
|
-
HIGH │ Reply to build-1 question │ bd-msg --to "build-1" --subj "Re:" --body "..."
|
|
222
221
|
HIGH │ Add plan for bd-ghi56 │ /plan bd-ghi56
|
|
223
222
|
MEDIUM │ Review 2 stale tasks │ /triage --stale
|
|
224
223
|
LOW │ Push 2 local commits │ git push
|
|
@@ -22,8 +22,7 @@ const parseReference = (ref: string) => {
|
|
|
22
22
|
|
|
23
23
|
// Relative references
|
|
24
24
|
if (ref === "last") return { type: "relative", offset: 0 };
|
|
25
|
-
if (ref.match(/^\d+ ago$/))
|
|
26
|
-
return { type: "relative", offset: parseInt(ref) };
|
|
25
|
+
if (ref.match(/^\d+ ago$/)) return { type: "relative", offset: parseInt(ref) };
|
|
27
26
|
|
|
28
27
|
// Time-based
|
|
29
28
|
if (ref === "today") return { type: "time", period: "today" };
|
|
@@ -147,12 +147,7 @@ const ageHours = (now - created) / (1000 * 60 * 60);
|
|
|
147
147
|
const slaByPriority = { 0: 4, 1: 24, 2: 168, 3: 336, 4: Infinity };
|
|
148
148
|
const slaHours = slaByPriority[task.priority];
|
|
149
149
|
const slaRemaining = slaHours - ageHours;
|
|
150
|
-
const slaStatus =
|
|
151
|
-
slaRemaining < 0
|
|
152
|
-
? "BREACHED"
|
|
153
|
-
: slaRemaining < slaHours * 0.2
|
|
154
|
-
? "AT_RISK"
|
|
155
|
-
: "OK";
|
|
150
|
+
const slaStatus = slaRemaining < 0 ? "BREACHED" : slaRemaining < slaHours * 0.2 ? "AT_RISK" : "OK";
|
|
156
151
|
```
|
|
157
152
|
|
|
158
153
|
## Phase 6: Bottleneck Analysis
|
|
@@ -272,9 +267,7 @@ const assignmentRules = {
|
|
|
272
267
|
|
|
273
268
|
// Load balancing: prefer agent with lowest active count
|
|
274
269
|
function selectAgent(role: string, agents: Agent[]): Agent {
|
|
275
|
-
return agents
|
|
276
|
-
.filter((a) => a.role === role)
|
|
277
|
-
.sort((a, b) => a.activeCount - b.activeCount)[0];
|
|
270
|
+
return agents.filter((a) => a.role === role).sort((a, b) => a.activeCount - b.activeCount)[0];
|
|
278
271
|
}
|
|
279
272
|
```
|
|
280
273
|
|
|
@@ -318,9 +311,7 @@ for each breached task:
|
|
|
318
311
|
|
|
319
312
|
```typescript
|
|
320
313
|
// Find tasks with no activity > 14 days
|
|
321
|
-
const staleTasks = openTasks.filter(
|
|
322
|
-
(t) => daysSince(t.updated_at) > 14 && t.status === "open",
|
|
323
|
-
);
|
|
314
|
+
const staleTasks = openTasks.filter((t) => daysSince(t.updated_at) > 14 && t.status === "open");
|
|
324
315
|
|
|
325
316
|
// Prompt for action
|
|
326
317
|
console.log(`Found ${staleTasks.length} stale tasks. Options:`);
|
|
@@ -340,22 +331,7 @@ bd list --status=closed --json | wc -l # Check closed count
|
|
|
340
331
|
|
|
341
332
|
**Best Practice (from Steve Yegge):** Run `bd cleanup` every few days to prevent database bloat.
|
|
342
333
|
|
|
343
|
-
## Phase 10:
|
|
344
|
-
|
|
345
|
-
```typescript
|
|
346
|
-
memory - index({ action: "status" });
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
If documents count is low or index is stale:
|
|
350
|
-
|
|
351
|
-
```
|
|
352
|
-
⚠️ Vector store may be stale.
|
|
353
|
-
Run: memory-index rebuild
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
Optionally trigger background reindex if many observations were created recently.
|
|
357
|
-
|
|
358
|
-
## Phase 11: Sync and Notify
|
|
334
|
+
## Phase 10: Sync and Notify
|
|
359
335
|
|
|
360
336
|
```typescript
|
|
361
337
|
|
|
@@ -363,10 +339,6 @@ Optionally trigger background reindex if many observations were created recently
|
|
|
363
339
|
|
|
364
340
|
```typescript
|
|
365
341
|
bd sync
|
|
366
|
-
|
|
367
|
-
# Broadcast triage summary if significant changes
|
|
368
|
-
if assignments or priority changes:
|
|
369
|
-
bd-msg --subj "Triage Complete" --body "Assigned X tasks, updated Y priorities" --to "all" --importance normal
|
|
370
342
|
```
|
|
371
343
|
|
|
372
344
|
## Alternative: Manual Triage
|
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
2
|
+
"enabled": true,
|
|
3
|
+
"debug": false,
|
|
4
|
+
// "minimal" shows prune activity without noise; "off" if you want silence
|
|
5
|
+
"pruneNotification": "off",
|
|
6
|
+
"turnProtection": {
|
|
7
|
+
"enabled": true,
|
|
8
|
+
// 3 turns = faster cleanup while still protecting recent context
|
|
9
|
+
"turns": 3,
|
|
10
|
+
},
|
|
11
|
+
"tools": {
|
|
12
|
+
"settings": {
|
|
13
|
+
"nudgeEnabled": true,
|
|
14
|
+
// Nudge every 8 tool calls (slightly more aggressive than default 10)
|
|
15
|
+
"nudgeFrequency": 8,
|
|
16
|
+
// Protect state-modifying and critical workflow tools
|
|
17
|
+
// Updated for v1.1.8: Added question tool, removed legacy bd_* (use CLI)
|
|
18
|
+
"protectedTools": [
|
|
19
|
+
"write",
|
|
20
|
+
"edit",
|
|
21
|
+
"question",
|
|
22
|
+
"memory-read",
|
|
23
|
+
"memory-update",
|
|
24
|
+
"memory-search",
|
|
25
|
+
"observation",
|
|
26
|
+
"skill",
|
|
27
|
+
"skill_mcp",
|
|
28
|
+
"task",
|
|
29
|
+
"batch",
|
|
30
|
+
"todowrite",
|
|
31
|
+
"todoread",
|
|
32
|
+
"lsp",
|
|
33
|
+
"lsp_lsp_rename",
|
|
34
|
+
"lsp_lsp_find_references",
|
|
35
|
+
"lsp_lsp_goto_definition",
|
|
36
|
+
"lsp_lsp_code_actions",
|
|
37
|
+
"lsp_lsp_code_action_apply",
|
|
38
|
+
"lsp_lsp_organize_imports",
|
|
39
|
+
"bd-reserve",
|
|
40
|
+
"bd-release",
|
|
41
|
+
"bd-msg",
|
|
42
|
+
"bd-inbox",
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
"discard": {
|
|
46
|
+
"enabled": true,
|
|
47
|
+
},
|
|
48
|
+
"extract": {
|
|
49
|
+
"enabled": true,
|
|
50
|
+
"showDistillation": false,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
"strategies": {
|
|
54
|
+
// Dedup = zero LLM cost, high impact - always enable
|
|
55
|
+
"deduplication": {
|
|
56
|
+
"enabled": true,
|
|
57
|
+
"protectedTools": [],
|
|
58
|
+
},
|
|
59
|
+
// Supersede writes = zero cost, removes redundant write inputs after read
|
|
60
|
+
"supersedeWrites": {
|
|
61
|
+
"enabled": true,
|
|
62
|
+
},
|
|
63
|
+
// Purge error inputs after 3 turns
|
|
64
|
+
"purgeErrors": {
|
|
65
|
+
"enabled": true,
|
|
66
|
+
"turns": 3,
|
|
67
|
+
"protectedTools": [],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
70
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: Index of available memory templates
|
|
3
|
+
updated: 2026-01-12
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory Templates
|
|
7
|
+
|
|
8
|
+
Copy these templates to `.opencode/memory/project/` when starting a new project.
|
|
9
|
+
|
|
10
|
+
## Available Templates
|
|
11
|
+
|
|
12
|
+
| Template | Purpose |
|
|
13
|
+
| ----------------- | ---------------------------------------------- |
|
|
14
|
+
| `architecture.md` | Document project structure, modules, data flow |
|
|
15
|
+
| `conventions.md` | Code style, naming, patterns, commit rules |
|
|
16
|
+
| `gotchas.md` | Known issues, edge cases, troubleshooting |
|
|
17
|
+
| `commands.md` | Build, test, lint, deploy commands |
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Copy template (replace DATE)
|
|
23
|
+
cp _templates/architecture.md ../project/architecture.md
|
|
24
|
+
sed -i '' "s/{{DATE}}/$(date +%Y-%m-%d)/g" ../project/architecture.md
|
|
25
|
+
|
|
26
|
+
# Or create your own from scratch
|
|
27
|
+
touch ../project/architecture.md
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Tips
|
|
31
|
+
|
|
32
|
+
- Fill out templates when you first learn about a project
|
|
33
|
+
- Update as you discover new patterns or issues
|
|
34
|
+
- Use `observation` tool for quick notes during work
|
|
35
|
+
- Use `memory-search` to find relevant context later
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: Key modules, directory structure, architectural decisions
|
|
3
|
+
updated: { { DATE } }
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Project Architecture
|
|
7
|
+
|
|
8
|
+
## Directory Structure
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
src/ # Source code
|
|
12
|
+
index.ts # Entry point
|
|
13
|
+
commands/ # CLI commands
|
|
14
|
+
utils/ # Utilities
|
|
15
|
+
|
|
16
|
+
dist/ # Built output
|
|
17
|
+
.opencode/ # OpenCode configuration
|
|
18
|
+
.beads/ # Task tracking
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Key Modules
|
|
22
|
+
|
|
23
|
+
### Module Name
|
|
24
|
+
|
|
25
|
+
**Purpose**: Brief description
|
|
26
|
+
|
|
27
|
+
**Files**:
|
|
28
|
+
|
|
29
|
+
- `src/module/file.ts`
|
|
30
|
+
|
|
31
|
+
**Dependencies**:
|
|
32
|
+
|
|
33
|
+
- External libs
|
|
34
|
+
- Internal modules
|
|
35
|
+
|
|
36
|
+
## Data Flow
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
User Action
|
|
40
|
+
→ Module A
|
|
41
|
+
→ Module B
|
|
42
|
+
→ External Service
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## External Dependencies
|
|
46
|
+
|
|
47
|
+
- **Library**: Version, purpose
|
|
48
|
+
- **Service**: API endpoint, auth method
|
|
49
|
+
|
|
50
|
+
## Architectural Decisions
|
|
51
|
+
|
|
52
|
+
| Decision | Rationale | Trade-offs |
|
|
53
|
+
| -------- | ------------ | ------------ |
|
|
54
|
+
| Choice 1 | Why this way | Limitation 1 |
|
|
55
|
+
|
|
56
|
+
## TODO
|
|
57
|
+
|
|
58
|
+
- [ ] Document missing modules
|
|
59
|
+
- [ ] Add dependency diagram
|
|
60
|
+
- [ ] Map data flow diagrams
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: Build, test, lint, deploy commands discovered for this project
|
|
3
|
+
updated: { { DATE } }
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Project Commands
|
|
7
|
+
|
|
8
|
+
## Development
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm run dev # Start development server
|
|
12
|
+
bun run src/index.ts # Run CLI directly
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Build
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm run build # Build for production
|
|
19
|
+
bun build ... # Additional build options
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Test
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
bun test # Run all tests
|
|
26
|
+
bun test --watch # Watch mode
|
|
27
|
+
bun test file.ts # Run single file
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Lint
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm run lint # Check for issues
|
|
34
|
+
npm run lint:fix # Auto-fix issues
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Typecheck
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm run typecheck # TypeScript checking only
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Database
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm run db:push # Push schema changes
|
|
47
|
+
npm run db:studio # Open database UI
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Deployment
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm run deploy # Deploy to production
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## CI/CD
|
|
57
|
+
|
|
58
|
+
- **Lint**: Runs on push
|
|
59
|
+
- **Test**: Runs on push
|
|
60
|
+
- **Deploy**: Triggers on main branch
|
|
61
|
+
|
|
62
|
+
## Beads (Task Tracking)
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
bd ready # Find unblocked tasks
|
|
66
|
+
bd list --status=open # All open issues
|
|
67
|
+
bd show <id> # Full details
|
|
68
|
+
bd create "Title" -p 2 # Create task
|
|
69
|
+
bd update <id> --status in_progress # Claim
|
|
70
|
+
bd close <id> --reason "Done" # Complete
|
|
71
|
+
bd sync # Push to git
|
|
72
|
+
```
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: Code patterns, commit style, team conventions
|
|
3
|
+
updated: { { DATE } }
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Project Conventions
|
|
7
|
+
|
|
8
|
+
## Code Style
|
|
9
|
+
|
|
10
|
+
### TypeScript
|
|
11
|
+
|
|
12
|
+
- **Module**: ESNext, bundler moduleResolution
|
|
13
|
+
- **Strict**: Disabled
|
|
14
|
+
- **Imports**: Group stdlib, third-party, local
|
|
15
|
+
|
|
16
|
+
### Python
|
|
17
|
+
|
|
18
|
+
- **Version**: 3.10+
|
|
19
|
+
- **Style**: type hints required, dataclasses for config
|
|
20
|
+
|
|
21
|
+
## Naming Conventions
|
|
22
|
+
|
|
23
|
+
| Type | Convention | Example |
|
|
24
|
+
| --------- | ---------- | ----------------- |
|
|
25
|
+
| Classes | PascalCase | `UserService` |
|
|
26
|
+
| Functions | snake_case | `get_user_data()` |
|
|
27
|
+
| Variables | snake_case | `user_data` |
|
|
28
|
+
| Constants | UPPER_CASE | `MAX_RETRIES` |
|
|
29
|
+
| Files | kebab-case | `user-service.ts` |
|
|
30
|
+
|
|
31
|
+
## Import Order
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// 1. Node.js stdlib
|
|
35
|
+
import fs from "node:fs/promises";
|
|
36
|
+
import path from "node:path";
|
|
37
|
+
|
|
38
|
+
// 2. Third-party
|
|
39
|
+
import { cli } from "cac";
|
|
40
|
+
import { log } from "@clack/prompts";
|
|
41
|
+
|
|
42
|
+
// 3. Local
|
|
43
|
+
import { initCommand } from "./commands/init.js";
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Commit Messages
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
type(scope): subject
|
|
50
|
+
|
|
51
|
+
body (optional)
|
|
52
|
+
|
|
53
|
+
footer (optional)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Types**: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
|
|
57
|
+
|
|
58
|
+
## Code Review
|
|
59
|
+
|
|
60
|
+
- **Self-review**: Run lint/typecheck before PR
|
|
61
|
+
- **Test coverage**: Add tests for new features
|
|
62
|
+
- **Docs**: Update README for user-facing changes
|
|
63
|
+
|
|
64
|
+
## Patterns to Avoid
|
|
65
|
+
|
|
66
|
+
- Premature abstraction
|
|
67
|
+
- Circular dependencies
|
|
68
|
+
- Magic numbers/strings
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: Footguns, edge cases, and "don't forget this" warnings
|
|
3
|
+
updated: { { DATE } }
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Project Gotchas
|
|
7
|
+
|
|
8
|
+
## Configuration Quirks
|
|
9
|
+
|
|
10
|
+
### Field Name
|
|
11
|
+
|
|
12
|
+
**Issue**: What goes wrong
|
|
13
|
+
**Fix**: How to handle it
|
|
14
|
+
|
|
15
|
+
## Dependencies
|
|
16
|
+
|
|
17
|
+
### Package Name
|
|
18
|
+
|
|
19
|
+
**Version**: x.y.z
|
|
20
|
+
**Why Required**: Purpose
|
|
21
|
+
**Gotcha**: Edge case or limitation
|
|
22
|
+
|
|
23
|
+
## Time Wasters
|
|
24
|
+
|
|
25
|
+
### Issue Description
|
|
26
|
+
|
|
27
|
+
**Symptoms**: What you'll see
|
|
28
|
+
**Cause**: Root cause
|
|
29
|
+
**Fix**: Solution
|
|
30
|
+
|
|
31
|
+
## Common Errors
|
|
32
|
+
|
|
33
|
+
| Error Message | Cause | Fix |
|
|
34
|
+
| ------------- | ------ | --------- |
|
|
35
|
+
| "Error: ..." | Reason | Fix steps |
|
|
36
|
+
|
|
37
|
+
## TODO
|
|
38
|
+
|
|
39
|
+
- [ ] Document more edge cases
|
|
40
|
+
- [ ] Add troubleshooting section
|
|
41
|
+
- [ ] List known issues
|
|
@@ -147,27 +147,28 @@ git worktree prune
|
|
|
147
147
|
```
|
|
148
148
|
Leader Agents (touch beads, sync, coordinate)
|
|
149
149
|
├── build - Primary implementation agent
|
|
150
|
-
└──
|
|
150
|
+
└── plan - Architecture and planning agent
|
|
151
151
|
|
|
152
152
|
Subagents (read-only, stateless workers)
|
|
153
|
+
├── general - Fast, well-defined tasks
|
|
153
154
|
├── explore - Codebase search, patterns
|
|
154
155
|
├── scout - External docs, best practices
|
|
155
|
-
├── planner - Architecture, decomposition
|
|
156
156
|
├── review - Code review, debugging
|
|
157
157
|
└── vision - UI/UX, visual analysis
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
### Delegation Rules
|
|
161
161
|
|
|
162
|
-
| Agent | Can Do
|
|
163
|
-
| --------- |
|
|
164
|
-
| `build` | All beads ops, `bd sync`
|
|
165
|
-
| `
|
|
166
|
-
| `
|
|
167
|
-
| `
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
170
|
-
| `
|
|
162
|
+
| Agent | Can Do | Cannot Do |
|
|
163
|
+
| --------- | ------------------------ | ---------------------- |
|
|
164
|
+
| `build` | All beads ops, `bd sync` | - |
|
|
165
|
+
| `plan` | All beads ops, `bd sync` | - |
|
|
166
|
+
| `general` | Read, small edits | `bd sync`, beads write |
|
|
167
|
+
| `explore` | Read, grep, glob | Edit, write, `bd sync` |
|
|
168
|
+
| `scout` | Fetch, search, Context7 | Edit, write, `bd sync` |
|
|
169
|
+
| `plan` | Read, create artifacts | Edit files, `bd sync` |
|
|
170
|
+
| `review` | Read, analyze, suggest | Edit files, `bd sync` |
|
|
171
|
+
| `vision` | Analyze images, mockups | All beads operations |
|
|
171
172
|
|
|
172
173
|
### Parallel Research Pattern
|
|
173
174
|
|
|
@@ -203,9 +204,9 @@ Task({
|
|
|
203
204
|
|
|
204
205
|
| Situation | Delegate To | Why |
|
|
205
206
|
| ------------------------ | ----------- | -------------------------- |
|
|
206
|
-
| Need codebase patterns | `@explore` | Fast grep/glob
|
|
207
|
+
| Need codebase patterns | `@explore` | Fast grep/glob |
|
|
207
208
|
| Need library docs | `@scout` | Context7, GitHub patterns |
|
|
208
|
-
| Complex planning | `@
|
|
209
|
+
| Complex planning | `@plan` | Structured decomposition |
|
|
209
210
|
| Code review before merge | `@review` | Fresh eyes, evidence-based |
|
|
210
211
|
| UI/mockup analysis | `@vision` | Visual expertise |
|
|
211
212
|
| Stuck on implementation | `@explore` | Fresh search perspective |
|
|
@@ -229,7 +230,7 @@ Based on [OpenCode Command Docs](https://opencode.ai/docs/commands/).
|
|
|
229
230
|
---
|
|
230
231
|
description: Short description shown in TUI command list
|
|
231
232
|
argument-hint: "<required> [optional] [--flag]"
|
|
232
|
-
agent: build |
|
|
233
|
+
agent: build | plan | scout | explore | review | vision
|
|
233
234
|
subtask: true # Run as subagent (doesn't pollute primary context)
|
|
234
235
|
model: gemini-2.5-pro # Override default model
|
|
235
236
|
---
|
|
@@ -302,11 +303,11 @@ model: gemini-2.5-pro # Override default model
|
|
|
302
303
|
| `/start <id> --worktree` | build | + Create git worktree | Isolated feature work |
|
|
303
304
|
| `/start <id> --research` | build | + Parallel subagent research | Complex task preparation |
|
|
304
305
|
| `/create` | build | `bd create`, `bd sync` | Create new tracked task |
|
|
305
|
-
| `/new-feature` |
|
|
306
|
-
| `/new-feature --worktree` |
|
|
306
|
+
| `/new-feature` | plan | `bd create` (epic + subtasks), `bd dep add`, `bd sync` | Complex feature with phases |
|
|
307
|
+
| `/new-feature --worktree` | plan | + Create git worktree for epic | Isolated feature branch |
|
|
307
308
|
| `/issue <num>` | build | `bd create`, `bd sync`, `gh issue comment` | Import GitHub issue |
|
|
308
|
-
| `/plan <id>` |
|
|
309
|
-
| `/plan <id> --create-beads` |
|
|
309
|
+
| `/plan <id>` | plan | `bd create` (subtasks), `bd dep add`, `bd sync` | Break down task |
|
|
310
|
+
| `/plan <id> --create-beads` | plan | Create child beads after planning | Auto-hierarchy creation |
|
|
310
311
|
| `/implement <id>` | build | `bd update --status in_progress`, `bd sync` | Do the work |
|
|
311
312
|
| `/implement <id> --parallel` | build | + Aggressive subagent research | Complex implementation |
|
|
312
313
|
| `/commit [id]` | build | `bd sync` (if bead-id provided) | Commit with traceability |
|
|
@@ -322,21 +323,21 @@ model: gemini-2.5-pro # Override default model
|
|
|
322
323
|
| Command | Agent | Beads Operations | Notes |
|
|
323
324
|
| ------------------ | ------- | --------------------- | -------------------------- |
|
|
324
325
|
| `/research <id>` | scout | `bd show` (read-only) | NO `bd sync` - subagent |
|
|
325
|
-
| `/brainstorm` |
|
|
326
|
+
| `/brainstorm` | plan | None | Pure planning, no tracking |
|
|
326
327
|
| `/analyze-project` | explore | None | Codebase exploration |
|
|
327
328
|
| `/summarize` | explore | None | Session/code summary |
|
|
328
329
|
| `/review-codebase` | review | None | Code review |
|
|
329
330
|
|
|
330
331
|
### Non-Beads Commands
|
|
331
332
|
|
|
332
|
-
| Command | Agent
|
|
333
|
-
| ---------------------- |
|
|
334
|
-
| `/quick-build` | build
|
|
335
|
-
| `/design` |
|
|
336
|
-
| `/ui-review` | vision
|
|
337
|
-
| `/accessibility-check` | vision
|
|
338
|
-
| `/fix-ci` | build
|
|
339
|
-
| `/fix-types` | build
|
|
333
|
+
| Command | Agent | Purpose |
|
|
334
|
+
| ---------------------- | ------ | ------------------------------ |
|
|
335
|
+
| `/quick-build` | build | Trivial fixes, no bead created |
|
|
336
|
+
| `/design` | plan | Architecture design |
|
|
337
|
+
| `/ui-review` | vision | UI/UX analysis |
|
|
338
|
+
| `/accessibility-check` | vision | A11y audit |
|
|
339
|
+
| `/fix-ci` | build | CI pipeline fixes |
|
|
340
|
+
| `/fix-types` | build | TypeScript errors |
|
|
340
341
|
|
|
341
342
|
## Workflow Patterns
|
|
342
343
|
|
|
@@ -486,13 +487,13 @@ bd sync
|
|
|
486
487
|
| Agent | Can Do | Cannot Do |
|
|
487
488
|
| ------- | ------------------------------- | --------- |
|
|
488
489
|
| `build` | All beads operations, `bd sync` | - |
|
|
489
|
-
| `
|
|
490
|
+
| `plan` | All beads operations, `bd sync` | - |
|
|
490
491
|
|
|
491
492
|
### Subagents (Read-Only Beads)
|
|
492
493
|
|
|
493
494
|
| Agent | Can Do | Cannot Do |
|
|
494
495
|
| --------- | -------------------------------------- | --------------------- |
|
|
495
|
-
| `
|
|
496
|
+
| `plan` | `bd show`, `bd list`, create artifacts | `bd sync`, `bd close` |
|
|
496
497
|
| `scout` | `bd show` (read context) | Any writes |
|
|
497
498
|
| `explore` | `bd show`, `bd list` | Any writes |
|
|
498
499
|
| `review` | `bd show` | Any writes |
|