opencodekit 0.12.2 → 0.12.3
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 +40 -417
- package/dist/template/.opencode/agent/build.md +53 -0
- package/dist/template/.opencode/agent/planner.md +0 -1
- package/dist/template/.opencode/agent/rush.md +38 -0
- package/dist/template/.opencode/command/accessibility-check.md +1 -1
- package/dist/template/.opencode/command/commit.md +1 -1
- package/dist/template/.opencode/command/create.md +68 -441
- package/dist/template/.opencode/command/finish.md +82 -252
- package/dist/template/.opencode/command/fix-ci.md +52 -247
- package/dist/template/.opencode/command/fix-types.md +32 -292
- package/dist/template/.opencode/command/fix-ui.md +49 -234
- package/dist/template/.opencode/command/fix.md +57 -194
- package/dist/template/.opencode/command/handoff.md +66 -243
- package/dist/template/.opencode/command/implement.md +67 -231
- package/dist/template/.opencode/command/issue.md +42 -190
- package/dist/template/.opencode/command/plan.md +86 -442
- package/dist/template/.opencode/command/pr.md +3 -1
- package/dist/template/.opencode/command/research-and-implement.md +69 -370
- package/dist/template/.opencode/command/research.md +72 -197
- package/dist/template/.opencode/command/resume.md +70 -438
- package/dist/template/.opencode/command/status.md +11 -11
- package/dist/template/.opencode/command/triage.md +23 -18
- package/dist/template/.opencode/memory/project/commands.md +139 -7
- package/dist/template/.opencode/memory/project/gotchas.md +85 -0
- package/dist/template/.opencode/plugin/beads.ts +181 -16
- package/dist/template/.opencode/skill/beads/SKILL.md +15 -0
- package/dist/template/.opencode/skill/context-engineering/SKILL.md +94 -0
- package/dist/template/.opencode/skill/memory-system/SKILL.md +107 -0
- package/dist/template/.opencode/skill/session-management/SKILL.md +111 -0
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +115 -0
- package/package.json +1 -1
|
@@ -1,325 +1,130 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
3
|
-
argument-hint: "<
|
|
2
|
+
description: Fix CI failures
|
|
3
|
+
argument-hint: "<run-id or url>"
|
|
4
4
|
agent: build
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Fix CI: $ARGUMENTS
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
CI failures are P0 bugs. Fix fast.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
skill({ name: "beads" }); // Session protocol
|
|
15
|
-
skill({ name: "systematic-debugging" });
|
|
16
|
-
skill({ name: "root-cause-tracing" });
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
**CI failures are P0 bugs.** Create bead immediately:
|
|
20
|
-
|
|
21
|
-
```typescript
|
|
22
|
-
bd_add({
|
|
23
|
-
title: "Fix CI: [failure summary]",
|
|
24
|
-
type: "bug",
|
|
25
|
-
pri: 0,
|
|
26
|
-
tags: ["ci", "bug"],
|
|
27
|
-
});
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**Reserve workflow files:**
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
bd_reserve({
|
|
34
|
-
paths: [".github/workflows/**", "package.json", "tsconfig.json"],
|
|
35
|
-
reason: "Fixing CI: $ARGUMENTS",
|
|
36
|
-
ttl: 600,
|
|
37
|
-
});
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Phase 2: Fetch CI Logs
|
|
41
|
-
|
|
42
|
-
**From URL:**
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
# Extract run ID from URL
|
|
46
|
-
# https://github.com/owner/repo/actions/runs/12345678
|
|
47
|
-
gh run view 12345678 --log-failed
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**From run ID:**
|
|
11
|
+
## Get The Logs
|
|
51
12
|
|
|
52
13
|
```bash
|
|
14
|
+
# From URL: extract run ID from https://github.com/owner/repo/actions/runs/12345
|
|
15
|
+
# From run ID: use directly
|
|
53
16
|
gh run view $ARGUMENTS --log-failed
|
|
54
17
|
```
|
|
55
18
|
|
|
56
|
-
|
|
19
|
+
List recent failures:
|
|
57
20
|
|
|
58
21
|
```bash
|
|
59
22
|
gh run list --status=failure --limit=5
|
|
60
23
|
```
|
|
61
24
|
|
|
62
|
-
|
|
25
|
+
## Extract The Error
|
|
63
26
|
|
|
64
27
|
```bash
|
|
65
|
-
gh run view $ARGUMENTS --log > /tmp/ci-log.txt
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Phase 3: Extract Errors
|
|
69
|
-
|
|
70
|
-
Parse the CI log for errors:
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
# Find error lines
|
|
74
|
-
grep -i "error\|failed\|exception" /tmp/ci-log.txt | head -30
|
|
75
|
-
|
|
76
28
|
# Find the failing step
|
|
77
|
-
gh run view $ARGUMENTS --json jobs --jq '.jobs[] | select(.conclusion=="failure")
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
**Extract key information:**
|
|
29
|
+
gh run view $ARGUMENTS --json jobs --jq '.jobs[] | select(.conclusion=="failure")'
|
|
81
30
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
| **Failing step** | Which step in the job |
|
|
86
|
-
| **Error message** | Exact error text |
|
|
87
|
-
| **Exit code** | Process exit code if available |
|
|
88
|
-
| **Context** | Lines before/after error |
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
CI Failure Analysis:
|
|
92
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
93
|
-
|
|
94
|
-
Job: [job name]
|
|
95
|
-
Step: [step name]
|
|
96
|
-
Error: [error message]
|
|
97
|
-
|
|
98
|
-
Context:
|
|
99
|
-
[relevant log lines]
|
|
31
|
+
# Get error context
|
|
32
|
+
gh run view $ARGUMENTS --log > /tmp/ci-log.txt
|
|
33
|
+
grep -i "error\|failed" /tmp/ci-log.txt | head -30
|
|
100
34
|
```
|
|
101
35
|
|
|
102
|
-
|
|
36
|
+
Identify:
|
|
103
37
|
|
|
104
|
-
|
|
38
|
+
- **Job** that failed
|
|
39
|
+
- **Step** in that job
|
|
40
|
+
- **Error message** exact text
|
|
105
41
|
|
|
106
|
-
|
|
107
|
-
| ------------------------ | ---------------------------------- | ----------------------------------- |
|
|
108
|
-
| **Dependency issue** | "module not found", npm/yarn error | Update lockfile, check versions |
|
|
109
|
-
| **Environment mismatch** | Works locally, fails in CI | Check Node/Python version, env vars |
|
|
110
|
-
| **Test flakiness** | Intermittent failures | Add retries, fix race conditions |
|
|
111
|
-
| **Build timeout** | Job cancelled after N minutes | Optimize build, increase timeout |
|
|
112
|
-
| **Type error** | TypeScript compilation failed | Fix type errors locally first |
|
|
113
|
-
| **Lint error** | ESLint/Prettier failures | Run lint locally, fix issues |
|
|
114
|
-
| **Secret missing** | "secret not found" | Check repository secrets config |
|
|
115
|
-
| **Permission denied** | GITHUB_TOKEN issues | Check workflow permissions |
|
|
116
|
-
| **Cache issue** | Stale cache causing failures | Clear cache, update cache key |
|
|
117
|
-
| **Docker issue** | Image pull/build failures | Check Dockerfile, registry auth |
|
|
42
|
+
## Common Patterns
|
|
118
43
|
|
|
119
|
-
|
|
44
|
+
| Pattern | Symptoms | Fix |
|
|
45
|
+
| -------------- | ----------------------- | ---------------------------------- |
|
|
46
|
+
| Dependency | "module not found" | `rm -rf node_modules && npm ci` |
|
|
47
|
+
| Environment | Works locally, fails CI | Check Node version, env vars |
|
|
48
|
+
| Type error | "tsc" failed | `npm run type-check` locally first |
|
|
49
|
+
| Lint error | ESLint failed | `npm run lint -- --fix` |
|
|
50
|
+
| Test flaky | Intermittent | Add retries, fix race condition |
|
|
51
|
+
| Secret missing | "secret not found" | Check repo settings |
|
|
120
52
|
|
|
121
|
-
|
|
122
|
-
| ----------------------------------- | -------- | ------------------ |
|
|
123
|
-
| Single config change, obvious fix | S (~10) | Quick fix |
|
|
124
|
-
| Dependency update, env var fix | M (~30) | Systematic |
|
|
125
|
-
| Flaky tests, race conditions | L (~100) | Deep investigation |
|
|
126
|
-
| Workflow restructure, cross-cutting | XL | Plan first |
|
|
127
|
-
|
|
128
|
-
## Phase 6: Reproduce Locally (if possible)
|
|
129
|
-
|
|
130
|
-
Try to reproduce the failure locally:
|
|
53
|
+
## Reproduce Locally
|
|
131
54
|
|
|
132
55
|
```bash
|
|
133
|
-
# Run the same commands as CI
|
|
134
56
|
npm ci
|
|
135
57
|
npm run build
|
|
136
58
|
npm test
|
|
137
59
|
npm run lint
|
|
138
60
|
```
|
|
139
61
|
|
|
140
|
-
If
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
# Check for environment differences
|
|
144
|
-
node --version # Compare to CI
|
|
145
|
-
npm --version # Compare to CI
|
|
146
|
-
cat .nvmrc # If exists
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
## Phase 7: Fix
|
|
150
|
-
|
|
151
|
-
**For complex fixes (≥3 phases):**
|
|
152
|
-
|
|
153
|
-
```typescript
|
|
154
|
-
task({
|
|
155
|
-
subagent_type: "planner",
|
|
156
|
-
description: "Plan CI fix",
|
|
157
|
-
prompt: "Create implementation plan for fixing CI: [failure description]",
|
|
158
|
-
});
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Save plan to `.beads/artifacts/<bead-id>/spec.md`
|
|
162
|
-
|
|
163
|
-
**Common fixes:**
|
|
62
|
+
If passes locally but fails in CI, check environment differences.
|
|
164
63
|
|
|
165
|
-
|
|
166
|
-
# Dependency issues
|
|
167
|
-
rm -rf node_modules package-lock.json
|
|
168
|
-
npm install
|
|
169
|
-
|
|
170
|
-
# Type errors
|
|
171
|
-
npm run type-check # Fix locally first
|
|
64
|
+
## Fix And Verify
|
|
172
65
|
|
|
173
|
-
|
|
174
|
-
npm run lint -- --fix
|
|
175
|
-
|
|
176
|
-
# Cache issues (add to workflow)
|
|
177
|
-
# - uses: actions/cache@v3
|
|
178
|
-
# with:
|
|
179
|
-
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## Phase 8: Verify Locally
|
|
183
|
-
|
|
184
|
-
Before pushing:
|
|
66
|
+
Make the fix. Verify locally:
|
|
185
67
|
|
|
186
68
|
```bash
|
|
187
|
-
npm run build
|
|
188
|
-
npm test
|
|
189
|
-
npm run lint
|
|
190
|
-
npm run type-check
|
|
69
|
+
npm run build && npm test && npm run lint && npm run type-check
|
|
191
70
|
```
|
|
192
71
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
## Phase 9: Push & Re-trigger CI
|
|
72
|
+
## Push And Watch
|
|
196
73
|
|
|
197
74
|
```bash
|
|
198
75
|
git add <files>
|
|
199
|
-
git commit -m "fix(ci):
|
|
76
|
+
git commit -m "fix(ci): [description]
|
|
200
77
|
|
|
201
|
-
Root cause: [
|
|
202
|
-
<bead-id>"
|
|
78
|
+
Root cause: [brief]"
|
|
203
79
|
|
|
204
80
|
git push
|
|
205
|
-
```
|
|
206
81
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
```bash
|
|
210
|
-
gh workflow run <workflow-name>
|
|
211
|
-
# or
|
|
212
|
-
gh run rerun $ARGUMENTS --failed
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
**Watch CI status:**
|
|
216
|
-
|
|
217
|
-
```bash
|
|
82
|
+
# Watch the new run
|
|
218
83
|
gh run watch
|
|
219
84
|
```
|
|
220
85
|
|
|
221
|
-
|
|
222
|
-
CI Verification:
|
|
223
|
-
━━━━━━━━━━━━━━━━
|
|
224
|
-
|
|
225
|
-
Run ID: [new run id]
|
|
226
|
-
Status: [pending/success/failure]
|
|
227
|
-
URL: [run url]
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
## Phase 10: Handle Results
|
|
231
|
-
|
|
232
|
-
**If CI passes:**
|
|
233
|
-
|
|
234
|
-
```typescript
|
|
235
|
-
observation({
|
|
236
|
-
type: "bugfix",
|
|
237
|
-
title: "CI fix: [summary]",
|
|
238
|
-
content: `
|
|
239
|
-
## Root Cause
|
|
240
|
-
[What was actually wrong]
|
|
241
|
-
|
|
242
|
-
## Fix
|
|
243
|
-
[What we changed]
|
|
244
|
-
|
|
245
|
-
## Prevention
|
|
246
|
-
[How to avoid in future]
|
|
247
|
-
`,
|
|
248
|
-
concepts: "ci, github-actions, [specific issue]",
|
|
249
|
-
bead_id: "<bead-id>",
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
bd_done({ id: "<bead-id>", msg: "CI fixed: [summary]" });
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
**If CI still fails:**
|
|
86
|
+
## If Still Failing
|
|
256
87
|
|
|
257
88
|
Iterate:
|
|
258
89
|
|
|
259
90
|
1. Fetch new logs
|
|
260
|
-
2. Identify
|
|
91
|
+
2. Identify remaining error
|
|
261
92
|
3. Fix and push again
|
|
262
|
-
4.
|
|
93
|
+
4. Max 3 iterations, then escalate
|
|
263
94
|
|
|
264
|
-
|
|
95
|
+
If fix makes things worse:
|
|
265
96
|
|
|
266
97
|
```bash
|
|
267
98
|
git revert HEAD
|
|
268
99
|
git push
|
|
269
100
|
```
|
|
270
101
|
|
|
271
|
-
|
|
102
|
+
## Document
|
|
272
103
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
If this was a recurring CI issue:
|
|
104
|
+
If it's a recurring issue:
|
|
276
105
|
|
|
277
106
|
```typescript
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
**Symptom:** [What you see in CI logs]
|
|
285
|
-
**Cause:** [Root cause]
|
|
286
|
-
**Fix:** [How to resolve]
|
|
287
|
-
**Prevention:** [Config to prevent recurrence]
|
|
288
|
-
`,
|
|
289
|
-
mode: "append",
|
|
290
|
-
});
|
|
107
|
+
observation({
|
|
108
|
+
type: "bugfix",
|
|
109
|
+
title: "CI: [issue]",
|
|
110
|
+
content: "Root cause: [what]\nFix: [how]\nPrevention: [future]",
|
|
111
|
+
});
|
|
291
112
|
```
|
|
292
113
|
|
|
293
|
-
##
|
|
114
|
+
## Sync
|
|
294
115
|
|
|
295
116
|
```typescript
|
|
296
|
-
|
|
297
|
-
bd_sync({ reason: "Fixed CI: $ARGUMENTS" });
|
|
117
|
+
bd_sync({ reason: "Sync CI fix" });
|
|
298
118
|
```
|
|
299
119
|
|
|
120
|
+
## Output
|
|
121
|
+
|
|
300
122
|
```
|
|
301
123
|
CI Fixed: $ARGUMENTS
|
|
302
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
303
124
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
Pattern: [which common pattern]
|
|
125
|
+
Root cause: [brief]
|
|
126
|
+
Changes: [files]
|
|
307
127
|
|
|
308
|
-
|
|
309
|
-
- [file] - [change]
|
|
310
|
-
|
|
311
|
-
CI Run: [new run URL]
|
|
128
|
+
New run: [url]
|
|
312
129
|
Status: Passed ✓
|
|
313
|
-
|
|
314
|
-
Observation: Created ✓
|
|
315
|
-
Gotcha: [Added/Not needed]
|
|
316
|
-
|
|
317
|
-
Commit: [hash]
|
|
318
130
|
```
|
|
319
|
-
|
|
320
|
-
## Notes
|
|
321
|
-
|
|
322
|
-
- If `gh` CLI is not available: `brew install gh && gh auth login`
|
|
323
|
-
- If fix reveals systemic issues, create follow-up beads
|
|
324
|
-
- For flaky tests, consider adding retry logic or fixing race conditions
|
|
325
|
-
- Check if same failure happened before: `gh run list --status=failure --limit=20`
|