opencodekit 0.16.15 → 0.16.17
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/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +1 -1
- package/dist/template/.opencode/agent/plan.md +77 -161
- package/dist/template/.opencode/command/create.md +75 -307
- package/dist/template/.opencode/command/design.md +53 -589
- package/dist/template/.opencode/command/handoff.md +76 -180
- package/dist/template/.opencode/command/init.md +45 -211
- package/dist/template/.opencode/command/plan.md +62 -514
- package/dist/template/.opencode/command/pr.md +56 -226
- package/dist/template/.opencode/command/research.md +55 -266
- package/dist/template/.opencode/command/resume.md +33 -138
- package/dist/template/.opencode/command/review-codebase.md +54 -202
- package/dist/template/.opencode/command/ship.md +78 -127
- package/dist/template/.opencode/command/start.md +47 -577
- package/dist/template/.opencode/command/status.md +55 -354
- package/dist/template/.opencode/command/ui-review.md +52 -298
- package/dist/template/.opencode/command/verify.md +36 -250
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/plugin/README.md +8 -4
- package/dist/template/.opencode/plugin/swarm-enforcer.ts +182 -27
- package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +112 -0
- package/dist/template/.opencode/skill/augment-context-engine/mcp.json +6 -0
- package/dist/template/.opencode/skill/core-data-expert/SKILL.md +82 -0
- package/dist/template/.opencode/skill/core-data-expert/references/batch-operations.md +543 -0
- package/dist/template/.opencode/skill/core-data-expert/references/cloudkit-integration.md +259 -0
- package/dist/template/.opencode/skill/core-data-expert/references/concurrency.md +522 -0
- package/dist/template/.opencode/skill/core-data-expert/references/fetch-requests.md +643 -0
- package/dist/template/.opencode/skill/core-data-expert/references/glossary.md +233 -0
- package/dist/template/.opencode/skill/core-data-expert/references/migration.md +393 -0
- package/dist/template/.opencode/skill/core-data-expert/references/model-configuration.md +597 -0
- package/dist/template/.opencode/skill/core-data-expert/references/performance.md +300 -0
- package/dist/template/.opencode/skill/core-data-expert/references/persistent-history.md +553 -0
- package/dist/template/.opencode/skill/core-data-expert/references/project-audit.md +60 -0
- package/dist/template/.opencode/skill/core-data-expert/references/saving.md +574 -0
- package/dist/template/.opencode/skill/core-data-expert/references/stack-setup.md +625 -0
- package/dist/template/.opencode/skill/core-data-expert/references/testing.md +300 -0
- package/dist/template/.opencode/skill/core-data-expert/references/threading.md +589 -0
- package/dist/template/.opencode/skill/swift-concurrency/SKILL.md +246 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/actors.md +640 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/async-algorithms.md +822 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/async-await-basics.md +249 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/async-sequences.md +670 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/core-data.md +533 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/glossary.md +128 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/linting.md +142 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/memory-management.md +542 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/migration.md +1076 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/performance.md +574 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/sendable.md +578 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/tasks.md +604 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/testing.md +565 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/threading.md +452 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/SKILL.md +290 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-advanced.md +351 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-basics.md +284 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-transitions.md +326 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/image-optimization.md +286 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/layout-best-practices.md +312 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/liquid-glass.md +377 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/list-patterns.md +153 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/modern-apis.md +400 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/performance-patterns.md +377 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/scroll-patterns.md +305 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/sheet-navigation-patterns.md +292 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/state-management.md +447 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/text-formatting.md +285 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/view-structure.md +276 -0
- package/package.json +1 -1
|
@@ -1,251 +1,147 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Save progress and context for next session
|
|
3
3
|
argument-hint: "<bead-id> [instructions]"
|
|
4
4
|
agent: build
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Handoff: $ARGUMENTS
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Save state so the next session can pick up cleanly.
|
|
10
|
+
|
|
11
|
+
> **Workflow:** Run this when pausing work. Resume with `/resume $ARGUMENTS`.
|
|
12
|
+
|
|
13
|
+
## Parse Arguments
|
|
14
|
+
|
|
15
|
+
| Argument | Default | Description |
|
|
16
|
+
| ---------------- | -------- | ---------------------------------- |
|
|
17
|
+
| `<bead-id>` | required | The bead to hand off |
|
|
18
|
+
| `[instructions]` | none | Extra context for the next session |
|
|
10
19
|
|
|
11
20
|
## Load Skills
|
|
12
21
|
|
|
13
22
|
```typescript
|
|
14
23
|
skill({ name: "beads" });
|
|
15
|
-
skill({ name: "session-management" });
|
|
16
24
|
skill({ name: "memory-system" });
|
|
17
|
-
skill({ name: "compaction" }); // Context compaction strategies before handoff
|
|
18
25
|
```
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
---
|
|
21
28
|
|
|
22
|
-
|
|
29
|
+
## Phase 1: Gather State (Parallel)
|
|
23
30
|
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
```bash
|
|
32
|
+
br show $ARGUMENTS
|
|
33
|
+
git status --porcelain
|
|
34
|
+
git branch --show-current
|
|
35
|
+
git rev-parse --short HEAD
|
|
36
|
+
ls .beads/artifacts/$ARGUMENTS/ 2>/dev/null
|
|
30
37
|
```
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## Why Handoff?
|
|
35
|
-
|
|
36
|
-
- Context window getting full
|
|
37
|
-
- Hit budget limit
|
|
38
|
-
- Blocked on something external
|
|
39
|
-
- End of work session
|
|
40
|
-
- Switching to different task
|
|
41
|
-
|
|
42
|
-
Don't grind past diminishing returns. A clean handoff beats degraded output.
|
|
39
|
+
---
|
|
43
40
|
|
|
44
|
-
##
|
|
41
|
+
## Phase 2: Handle Uncommitted Changes
|
|
45
42
|
|
|
46
|
-
|
|
43
|
+
If `git status` shows uncommitted changes, ask the user:
|
|
47
44
|
|
|
48
45
|
```typescript
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// Distill any read/grep/lsp outputs that contain findings worth preserving
|
|
60
|
-
{ id: "<tool-id>", distillation: "<high-fidelity technical summary>" },
|
|
46
|
+
question({
|
|
47
|
+
questions: [
|
|
48
|
+
{
|
|
49
|
+
header: "Uncommitted work",
|
|
50
|
+
question: "You have uncommitted changes. What should we do?",
|
|
51
|
+
options: [
|
|
52
|
+
{ label: "Commit as WIP (Recommended)", description: "git commit -m 'WIP: $ARGUMENTS'" },
|
|
53
|
+
{ label: "Leave uncommitted", description: "Skip commit, just write handoff" },
|
|
54
|
+
],
|
|
55
|
+
},
|
|
61
56
|
],
|
|
62
57
|
});
|
|
63
|
-
|
|
64
|
-
// Step 2: Compress completed conversation phases
|
|
65
|
-
compress({
|
|
66
|
-
topic: "<phase name>",
|
|
67
|
-
content: {
|
|
68
|
-
startString: "<unique start>",
|
|
69
|
-
endString: "<unique end>",
|
|
70
|
-
summary: "<exhaustive technical summary of what transpired>",
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// Step 3: Prune noise (failed attempts, irrelevant outputs)
|
|
75
|
-
prune({ ids: ["<noise-tool-ids>"] });
|
|
76
58
|
```
|
|
77
59
|
|
|
78
|
-
|
|
60
|
+
If user chooses commit:
|
|
79
61
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
62
|
+
```bash
|
|
63
|
+
git add -A
|
|
64
|
+
git commit -m "WIP: $ARGUMENTS - [brief description of where you stopped]"
|
|
65
|
+
```
|
|
83
66
|
|
|
84
|
-
|
|
67
|
+
---
|
|
85
68
|
|
|
86
|
-
|
|
69
|
+
## Phase 3: Write Handoff
|
|
87
70
|
|
|
88
|
-
|
|
89
|
-
!`git branch --show-current`
|
|
90
|
-
!`git rev-parse --short HEAD`
|
|
91
|
-
!`git status --porcelain`
|
|
71
|
+
Write the handoff to the memory system:
|
|
92
72
|
|
|
93
|
-
|
|
73
|
+
```typescript
|
|
74
|
+
memory_update({
|
|
75
|
+
file: "handoffs/$ARGUMENTS",
|
|
76
|
+
content: `# Handoff: $ARGUMENTS
|
|
94
77
|
|
|
95
|
-
|
|
78
|
+
**Date:** [timestamp]
|
|
79
|
+
**Branch:** [from git branch]
|
|
80
|
+
**Commit:** [from git rev-parse]
|
|
96
81
|
|
|
97
|
-
##
|
|
82
|
+
## Done
|
|
83
|
+
- [completed work]
|
|
98
84
|
|
|
99
|
-
|
|
85
|
+
## In Progress
|
|
86
|
+
- [current step] — stopped because [reason]
|
|
100
87
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
git commit -m "WIP: $ARGUMENTS - [where you stopped]"
|
|
104
|
-
```
|
|
88
|
+
## Remaining
|
|
89
|
+
- [next steps]
|
|
105
90
|
|
|
106
|
-
|
|
91
|
+
## Files Touched
|
|
92
|
+
- \`path/to/file.ts\` — [what changed]
|
|
107
93
|
|
|
108
|
-
##
|
|
94
|
+
## Decisions
|
|
95
|
+
- [decision]: [why]
|
|
109
96
|
|
|
110
|
-
|
|
97
|
+
## Blockers
|
|
98
|
+
[any blockers, or "None"]
|
|
111
99
|
|
|
112
|
-
|
|
113
|
-
|
|
100
|
+
## Resume Instructions
|
|
101
|
+
1. [first thing to do]
|
|
102
|
+
2. [second thing to do]
|
|
114
103
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
action: "status",
|
|
119
|
-
team_name: teamName,
|
|
104
|
+
Resume with: \`/resume $ARGUMENTS\`
|
|
105
|
+
`,
|
|
106
|
+
mode: "replace",
|
|
120
107
|
});
|
|
121
|
-
|
|
122
|
-
const stats = JSON.parse(status);
|
|
123
|
-
if (stats.summary?.total_workers > 0) {
|
|
124
|
-
// Render current state for handoff
|
|
125
|
-
const ui = await swarm({
|
|
126
|
-
operation: "monitor",
|
|
127
|
-
action: "render_block",
|
|
128
|
-
team_name: teamName,
|
|
129
|
-
});
|
|
130
|
-
console.log(`✓ Swarm active (${stats.summary.total_workers} workers)`);
|
|
131
|
-
console.log(ui);
|
|
132
|
-
|
|
133
|
-
// Note in handoff that swarm was active
|
|
134
|
-
console.log("⚠️ Swarm is active - next session can resume with /resume");
|
|
135
|
-
}
|
|
136
108
|
```
|
|
137
109
|
|
|
138
|
-
|
|
110
|
+
---
|
|
139
111
|
|
|
140
|
-
## Record
|
|
112
|
+
## Phase 4: Record Learnings (If Any)
|
|
141
113
|
|
|
142
|
-
If you discovered
|
|
114
|
+
If you discovered patterns or gotchas worth remembering:
|
|
143
115
|
|
|
144
116
|
```typescript
|
|
145
117
|
observation({
|
|
146
|
-
type: "learning",
|
|
118
|
+
type: "learning",
|
|
147
119
|
title: "[concise, searchable title]",
|
|
148
|
-
|
|
120
|
+
narrative: "[what you learned — specific and actionable]",
|
|
149
121
|
bead_id: "$ARGUMENTS",
|
|
150
|
-
|
|
151
|
-
concepts: "[keywords for semantic search]",
|
|
122
|
+
concepts: "[keywords for search]",
|
|
152
123
|
});
|
|
153
|
-
````
|
|
154
|
-
|
|
155
|
-
**This auto-embeds** into the vector store. The next `/resume` will find it.
|
|
156
|
-
|
|
157
|
-
## Create The Handoff
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
mkdir -p .beads/artifacts/$ARGUMENTS/handoffs
|
|
161
124
|
```
|
|
162
125
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
```markdown
|
|
166
|
-
# Handoff: $ARGUMENTS
|
|
167
|
-
|
|
168
|
-
**Created:** [timestamp]
|
|
169
|
-
**Branch:** [branch]
|
|
170
|
-
**Commit:** [hash]
|
|
171
|
-
|
|
172
|
-
## Progress
|
|
173
|
-
|
|
174
|
-
What's done:
|
|
175
|
-
|
|
176
|
-
- [completed step]
|
|
177
|
-
- [completed step]
|
|
178
|
-
|
|
179
|
-
What's in progress:
|
|
180
|
-
|
|
181
|
-
- [current step] - stopped here because [reason]
|
|
182
|
-
|
|
183
|
-
What's remaining:
|
|
184
|
-
|
|
185
|
-
- [next step]
|
|
186
|
-
- [future step]
|
|
187
|
-
|
|
188
|
-
## Context
|
|
189
|
-
|
|
190
|
-
Key files touched:
|
|
191
|
-
|
|
192
|
-
- `src/foo.ts` - [what was changed]
|
|
193
|
-
- `src/bar.ts` - [what was changed]
|
|
194
|
-
|
|
195
|
-
Decisions made:
|
|
196
|
-
|
|
197
|
-
- [decision]: [why]
|
|
198
|
-
|
|
199
|
-
## Swarm State
|
|
200
|
-
|
|
201
|
-
[If swarm was active: "Swarm persisted - workers and progress will be restored"]
|
|
202
|
-
[Otherwise: "No active swarm"]
|
|
203
|
-
|
|
204
|
-
## Blockers
|
|
205
|
-
|
|
206
|
-
[If any blockers, list them. Otherwise "None"]
|
|
207
|
-
|
|
208
|
-
## Resume Instructions
|
|
209
|
-
|
|
210
|
-
1. [First thing to do]
|
|
211
|
-
2. [Second thing to do]
|
|
212
|
-
3. [Third thing to do]
|
|
213
|
-
|
|
214
|
-
Start next session with: `/resume $ARGUMENTS`
|
|
215
|
-
```
|
|
126
|
+
---
|
|
216
127
|
|
|
217
|
-
## Sync
|
|
128
|
+
## Phase 5: Sync
|
|
218
129
|
|
|
219
130
|
```bash
|
|
220
131
|
br sync --flush-only
|
|
221
132
|
```
|
|
222
133
|
|
|
223
|
-
|
|
134
|
+
---
|
|
224
135
|
|
|
225
136
|
## Output
|
|
226
137
|
|
|
227
138
|
```
|
|
228
139
|
Handoff: $ARGUMENTS
|
|
140
|
+
━━━━━━━━━━━━━━━━━━━
|
|
229
141
|
|
|
230
142
|
Branch: [branch]
|
|
231
143
|
Commit: [hash]
|
|
232
|
-
|
|
233
|
-
Saved: .beads/artifacts/$ARGUMENTS/handoffs/[timestamp].md
|
|
144
|
+
Saved: handoffs/$ARGUMENTS (memory system)
|
|
234
145
|
|
|
235
146
|
Next session: /resume $ARGUMENTS
|
|
236
147
|
```
|
|
237
|
-
|
|
238
|
-
## Record Learnings (If Any)
|
|
239
|
-
|
|
240
|
-
If you discovered something worth remembering:
|
|
241
|
-
|
|
242
|
-
```typescript
|
|
243
|
-
observation({
|
|
244
|
-
type: "learning",
|
|
245
|
-
title: "[what you learned]",
|
|
246
|
-
content: "[details]",
|
|
247
|
-
bead_id: "$ARGUMENTS",
|
|
248
|
-
});
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
Start fresh session for best performance. Context accumulation degrades output quality.
|
|
@@ -17,253 +17,87 @@ skill({ name: "index-knowledge" });
|
|
|
17
17
|
|
|
18
18
|
## Options
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
| Argument | Default | Description |
|
|
21
|
+
| ------------------ | ------- | ----------------------------------------- |
|
|
22
|
+
| `--deep` | false | Comprehensive research (~100+ tool calls) |
|
|
23
|
+
| `--skip-questions` | false | Infer from git config, skip prompts |
|
|
24
24
|
|
|
25
25
|
## Phase 1: Upfront Questions
|
|
26
26
|
|
|
27
27
|
Unless `--skip-questions`, ask in one message:
|
|
28
28
|
|
|
29
|
-
1. **Identity**: "Which git contributor are you?" (show top 5 from
|
|
29
|
+
1. **Identity**: "Which git contributor are you?" (show top 5 from `git shortlog -sn --all`)
|
|
30
30
|
2. **Communication**: "Terse or detailed responses?"
|
|
31
31
|
3. **Workflow**: "Auto-commit or ask-first?"
|
|
32
32
|
4. **Rules**: "Any rules I should always follow?"
|
|
33
|
-
5. **Beads**: "Use beads for task tracking?
|
|
33
|
+
5. **Beads**: "Use beads for task tracking?"
|
|
34
34
|
|
|
35
35
|
If skipped, infer identity from `git config user.name` and `git config user.email`.
|
|
36
36
|
|
|
37
37
|
## Phase 2: Detect Project
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
- `package.json`, `go.mod`, `pyproject.toml`, `Cargo.toml` - tech stack WITH VERSIONS
|
|
42
|
-
- `README.md` - project description
|
|
43
|
-
- `.github/workflows/`, `.gitlab-ci.yml` - CI/CD
|
|
44
|
-
- `Makefile`, `justfile` - build commands
|
|
45
|
-
- Existing rules: `.cursor/rules/`, `.cursorrules`, `.github/copilot-instructions.md`
|
|
46
|
-
- Top-level directories - identify structure
|
|
47
|
-
|
|
48
|
-
### Validate Commands
|
|
49
|
-
|
|
50
|
-
!`npm run build 2>&1 | head -5` # Check for errors
|
|
51
|
-
!`npm test -- --help 2>&1 | head -3` # Verify test syntax
|
|
52
|
-
|
|
53
|
-
### With --deep
|
|
54
|
-
|
|
55
|
-
!`git shortlog -sn --all | head -10` # contributors
|
|
56
|
-
!`git log --format="%s" -50` # commit conventions
|
|
57
|
-
!`git branch -a` # branching strategy
|
|
58
|
-
|
|
59
|
-
- Source file analysis for patterns
|
|
60
|
-
- Identify subsystems needing nested AGENTS.md
|
|
61
|
-
|
|
62
|
-
## Phase 3: Create Project-Root AGENTS.md
|
|
63
|
-
|
|
64
|
-
Create `./AGENTS.md` - **TARGET: <60 lines** (max 150 lines).
|
|
65
|
-
|
|
66
|
-
Research shows: Frontier LLMs reliably follow ~150-200 instructions. More = degraded quality across ALL instructions.
|
|
67
|
-
|
|
68
|
-
```markdown
|
|
69
|
-
# [Project Name]
|
|
70
|
-
|
|
71
|
-
## Tech Stack
|
|
72
|
-
|
|
73
|
-
- [Language] [version] with [framework] [version]
|
|
74
|
-
- [Key dependencies with versions]
|
|
75
|
-
- [Build tool]: [tool name]
|
|
76
|
-
|
|
77
|
-
## File Structure
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
src/ # Source code
|
|
81
|
-
tests/ # Test files
|
|
82
|
-
docs/ # Documentation
|
|
83
|
-
scripts/ # Build/deploy scripts
|
|
84
|
-
|
|
85
|
-
````
|
|
86
|
-
|
|
87
|
-
## Commands
|
|
88
|
-
|
|
89
|
-
**Build**: `[detected command]`
|
|
90
|
-
**Test**: `[detected command]` (single test: `[syntax]`)
|
|
91
|
-
**Lint**: `[detected command]`
|
|
92
|
-
**Dev**: `[detected command]`
|
|
93
|
-
|
|
94
|
-
## Code Examples
|
|
95
|
-
|
|
96
|
-
Good pattern (from your codebase):
|
|
39
|
+
Detect and validate:
|
|
97
40
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
41
|
+
- Package manager and dependencies (with versions)
|
|
42
|
+
- Build, test, lint, dev commands — **validate each actually works**
|
|
43
|
+
- CI/CD configuration
|
|
44
|
+
- Existing AI rules (`.cursor/rules/`, `.cursorrules`, `.github/copilot-instructions.md`)
|
|
45
|
+
- Top-level directory structure
|
|
101
46
|
|
|
102
|
-
|
|
47
|
+
With `--deep`: Also analyze git history (contributors, commit conventions, branching strategy), source patterns, and subsystem candidates.
|
|
103
48
|
|
|
104
|
-
|
|
105
|
-
- Run single test: `[command]`
|
|
106
|
-
- Verify changes: `[command]`
|
|
49
|
+
## Phase 3: Create AGENTS.md
|
|
107
50
|
|
|
108
|
-
|
|
51
|
+
Create `./AGENTS.md` — **target <60 lines** (max 150). Follow the `index-knowledge` skill format:
|
|
109
52
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
53
|
+
- Tech stack with versions
|
|
54
|
+
- File structure
|
|
55
|
+
- Commands (validated)
|
|
56
|
+
- Code example from actual codebase (5-10 lines)
|
|
57
|
+
- Testing conventions
|
|
58
|
+
- Boundaries (always/ask-first/never)
|
|
59
|
+
- Gotchas
|
|
113
60
|
|
|
114
|
-
|
|
61
|
+
**Principles**: Examples > explanations. Pointers > copies. If AGENTS.md already exists, improve it — don't overwrite blindly.
|
|
115
62
|
|
|
116
|
-
|
|
117
|
-
- [Thing that will waste 2+ hours if forgotten]
|
|
63
|
+
## Phase 4: Populate Memory Files
|
|
118
64
|
|
|
119
|
-
|
|
65
|
+
Read templates from `.opencode/memory/_templates/`, then create:
|
|
120
66
|
|
|
121
|
-
|
|
122
|
-
-
|
|
123
|
-
- Pointers > Copies ("See docs/architecture.md" not inline everything)
|
|
124
|
-
- If AGENTS.md exists, improve it - don't overwrite blindly
|
|
67
|
+
- `.opencode/memory/project/user.md` — from Phase 1 answers
|
|
68
|
+
- `.opencode/memory/project/tech-stack.md` — from Phase 2 detection
|
|
125
69
|
|
|
126
|
-
|
|
70
|
+
Use `write()` for markdown files on disk (not `memory-update()` which writes to SQLite).
|
|
127
71
|
|
|
128
|
-
|
|
72
|
+
## Phase 5: Subsystems (--deep only)
|
|
129
73
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
Suggest nested AGENTS.md for:
|
|
74
|
+
Identify candidates for nested AGENTS.md:
|
|
133
75
|
|
|
134
76
|
- `packages/*/` in monorepos
|
|
135
|
-
- `src/` vs `tests/` if patterns differ significantly
|
|
136
77
|
- `frontend/` vs `backend/` directories
|
|
78
|
+
- Significantly different subsystem patterns
|
|
137
79
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
```
|
|
141
|
-
Detected subsystems that may benefit from nested AGENTS.md:
|
|
142
|
-
- packages/api/ - API server patterns
|
|
143
|
-
- packages/web/ - Frontend patterns
|
|
144
|
-
- tests/ - Testing conventions
|
|
145
|
-
|
|
146
|
-
Create nested AGENTS.md files? (y/n)
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Optional Follow-Up: Index Knowledge
|
|
150
|
-
|
|
151
|
-
If the repo is large or keeps changing (monorepos especially), generate/refresh hierarchical `AGENTS.md` using:
|
|
152
|
-
|
|
153
|
-
- `/index-knowledge`
|
|
154
|
-
|
|
155
|
-
## Phase 5: Populate Memory Files
|
|
156
|
-
|
|
157
|
-
Read templates, then use `write` tool to create actual markdown files:
|
|
158
|
-
|
|
159
|
-
```typescript
|
|
160
|
-
// 1. Read templates to understand structure
|
|
161
|
-
read({ filePath: ".opencode/memory/_templates/user.md" });
|
|
162
|
-
read({ filePath: ".opencode/memory/_templates/tech-stack.md" });
|
|
163
|
-
|
|
164
|
-
// 2. Use WRITE tool to create/update actual markdown files
|
|
165
|
-
// ⚠️ IMPORTANT: memory-update writes to SQLite, NOT markdown files!
|
|
166
|
-
// Use write() for .md files, memory-update() for SQLite storage
|
|
167
|
-
|
|
168
|
-
write({
|
|
169
|
-
filePath: ".opencode/memory/project/user.md",
|
|
170
|
-
content: "..." // Populated from Phase 1 answers
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
write({
|
|
174
|
-
filePath: ".opencode/memory/project/tech-stack.md",
|
|
175
|
-
content: "..." // Populated from Phase 2 detection
|
|
176
|
-
});
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
**Critical distinction:**
|
|
180
|
-
- `write()` → Updates **markdown files** on disk
|
|
181
|
-
- `memory-update()` → Writes to **SQLite database** (memory system)
|
|
182
|
-
|
|
183
|
-
### .opencode/memory/project/user.md
|
|
184
|
-
|
|
185
|
-
Populate from Phase 1 answers:
|
|
186
|
-
- Identity (name, git contributor)
|
|
187
|
-
- Communication preferences (terse/detailed)
|
|
188
|
-
- Workflow preferences (auto-commit/ask-first)
|
|
189
|
-
- Custom rules
|
|
190
|
-
|
|
191
|
-
### .opencode/memory/project/tech-stack.md
|
|
192
|
-
|
|
193
|
-
Populate from Phase 2 detection:
|
|
194
|
-
- Framework & version
|
|
195
|
-
- Language & runtime
|
|
196
|
-
- Key dependencies with versions
|
|
197
|
-
- Key constraints
|
|
198
|
-
|
|
199
|
-
**Note:** AI discovers commands, architecture, conventions, and gotchas organically and saves via `observation` tool.
|
|
80
|
+
Ask user before creating nested files.
|
|
200
81
|
|
|
201
82
|
## Phase 6: Initialize Beads (if requested)
|
|
202
83
|
|
|
203
|
-
If user said yes to beads:
|
|
204
|
-
|
|
205
84
|
```bash
|
|
206
|
-
br init
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
Create `.beads/` directory structure for task tracking.
|
|
210
|
-
|
|
211
|
-
## Phase 7: Reflection
|
|
212
|
-
|
|
213
|
-
Before finishing, verify:
|
|
214
|
-
|
|
215
|
-
1. [ ] AGENTS.md is <60 lines (or has good reason to be longer)?
|
|
216
|
-
2. [ ] Commands were validated and actually work?
|
|
217
|
-
3. [ ] Boundaries section includes Never rules?
|
|
218
|
-
4. [ ] At least one code example from actual codebase?
|
|
219
|
-
5. [ ] Memory files created with accurate info?
|
|
220
|
-
|
|
221
|
-
Fix any issues found.
|
|
222
|
-
|
|
223
|
-
## Phase 8: Summary
|
|
224
|
-
|
|
225
|
-
Report:
|
|
226
|
-
|
|
85
|
+
br init
|
|
227
86
|
```
|
|
228
|
-
Initialization Complete
|
|
229
|
-
━━━━━━━━━━━━━━━━━━━━━━━
|
|
230
|
-
|
|
231
|
-
Files created:
|
|
232
|
-
- ./AGENTS.md ([N] lines)
|
|
233
|
-
- .opencode/memory/user.md
|
|
234
|
-
- .opencode/memory/project/tech-stack.md
|
|
235
|
-
[- .beads/ (if initialized)]
|
|
236
87
|
|
|
237
|
-
|
|
238
|
-
Commands validated: [yes/no]
|
|
88
|
+
## Phase 7: Verify and Report
|
|
239
89
|
|
|
240
|
-
|
|
241
|
-
organically and saved via the observation tool as the AI works.
|
|
242
|
-
|
|
243
|
-
Suggested next steps:
|
|
244
|
-
1. Review AGENTS.md and adjust boundaries
|
|
245
|
-
2. Run /review-codebase to check conventions
|
|
246
|
-
3. [If --deep suggested subsystems] Create nested AGENTS.md files
|
|
247
|
-
```
|
|
90
|
+
Verify:
|
|
248
91
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
.opencode/memory/_templates/user.md # User template
|
|
255
|
-
.opencode/memory/_templates/tech-stack.md # Tech stack template
|
|
256
|
-
.opencode/memory/project/user.md # User preferences (created from template)
|
|
257
|
-
.opencode/memory/project/tech-stack.md # Tech stack (created from template)
|
|
258
|
-
.opencode/memory/observations/ # Learnings captured organically by AI
|
|
259
|
-
[packages/*/AGENTS.md] # Subsystem rules (--deep, if requested)
|
|
260
|
-
```
|
|
92
|
+
- [ ] AGENTS.md is <60 lines (or justified if longer)
|
|
93
|
+
- [ ] Commands validated and work
|
|
94
|
+
- [ ] Boundaries include Never rules
|
|
95
|
+
- [ ] At least one code example from actual codebase
|
|
96
|
+
- [ ] Memory files created with accurate info
|
|
261
97
|
|
|
262
|
-
|
|
98
|
+
Output:
|
|
263
99
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
- ❌ Code snippets that go stale (use pointers)
|
|
269
|
-
````
|
|
100
|
+
1. Files created (with line counts)
|
|
101
|
+
2. Tech stack detected
|
|
102
|
+
3. Commands validated (yes/no)
|
|
103
|
+
4. Suggested next steps: review AGENTS.md, run `/review-codebase`
|