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.
- package/dist/index.js +1 -1
- package/dist/template/.opencode/agent/planner.md +3 -2
- package/dist/template/.opencode/command/accessibility-check.md +297 -30
- package/dist/template/.opencode/command/analyze-mockup.md +412 -20
- package/dist/template/.opencode/command/analyze-project.md +445 -30
- package/dist/template/.opencode/command/brainstorm.md +294 -5
- package/dist/template/.opencode/command/commit.md +231 -17
- package/dist/template/.opencode/command/create.md +415 -77
- package/dist/template/.opencode/command/design-audit.md +483 -29
- package/dist/template/.opencode/command/design.md +615 -6
- package/dist/template/.opencode/command/edit-image.md +223 -20
- package/dist/template/.opencode/command/finish.md +163 -71
- package/dist/template/.opencode/command/fix-ci.md +297 -24
- package/dist/template/.opencode/command/fix-types.md +351 -13
- package/dist/template/.opencode/command/fix-ui.md +299 -13
- package/dist/template/.opencode/command/fix.md +262 -9
- package/dist/template/.opencode/command/generate-diagram.md +327 -26
- package/dist/template/.opencode/command/generate-icon.md +266 -22
- package/dist/template/.opencode/command/generate-image.md +232 -12
- package/dist/template/.opencode/command/generate-pattern.md +234 -20
- package/dist/template/.opencode/command/generate-storyboard.md +231 -21
- package/dist/template/.opencode/command/handoff.md +208 -31
- package/dist/template/.opencode/command/implement.md +163 -50
- package/dist/template/.opencode/command/import-plan.md +253 -52
- package/dist/template/.opencode/command/init.md +154 -35
- package/dist/template/.opencode/command/integration-test.md +410 -24
- package/dist/template/.opencode/command/issue.md +177 -21
- package/dist/template/.opencode/command/new-feature.md +390 -54
- package/dist/template/.opencode/command/plan.md +394 -107
- package/dist/template/.opencode/command/pr.md +235 -29
- package/dist/template/.opencode/command/quick-build.md +234 -5
- package/dist/template/.opencode/command/research-and-implement.md +442 -12
- package/dist/template/.opencode/command/research-ui.md +444 -34
- package/dist/template/.opencode/command/research.md +179 -45
- package/dist/template/.opencode/command/restore-image.md +416 -22
- package/dist/template/.opencode/command/resume.md +447 -63
- package/dist/template/.opencode/command/revert-feature.md +347 -65
- package/dist/template/.opencode/command/review-codebase.md +199 -4
- package/dist/template/.opencode/command/skill-create.md +506 -14
- package/dist/template/.opencode/command/skill-optimize.md +487 -16
- package/dist/template/.opencode/command/status.md +326 -60
- package/dist/template/.opencode/command/summarize.md +374 -33
- package/dist/template/.opencode/command/triage.md +361 -0
- package/dist/template/.opencode/command/ui-review.md +296 -25
- package/dist/template/.opencode/skill/beads/SKILL.md +108 -3
- package/dist/template/.opencode/skill/playwriter/SKILL.md +148 -0
- package/package.json +1 -1
|
@@ -1,52 +1,325 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Analyze
|
|
3
|
-
argument-hint: "
|
|
2
|
+
description: Analyze GitHub Actions logs and fix issues with bead tracking
|
|
3
|
+
argument-hint: "<github-actions-url or run-id>"
|
|
4
|
+
agent: build
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
# Fix CI: $ARGUMENTS
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
## Phase 1: Load Skills & Create Bead
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
**Load skills:**
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
```typescript
|
|
14
|
+
skill({ name: "beads" }); // Session protocol
|
|
15
|
+
skill({ name: "systematic-debugging" });
|
|
16
|
+
skill({ name: "root-cause-tracing" });
|
|
17
|
+
```
|
|
15
18
|
|
|
16
|
-
CI failures are P0 bugs
|
|
19
|
+
**CI failures are P0 bugs.** Create bead immediately:
|
|
17
20
|
|
|
18
21
|
```typescript
|
|
19
22
|
bd_add({
|
|
20
|
-
title: "Fix CI:
|
|
21
|
-
type: "
|
|
23
|
+
title: "Fix CI: [failure summary]",
|
|
24
|
+
type: "bug",
|
|
22
25
|
pri: 0,
|
|
23
|
-
tags: ["bug"],
|
|
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:**
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
gh run view $ARGUMENTS --log-failed
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**List recent failed runs:**
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
gh run list --status=failure --limit=5
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Get full logs:**
|
|
63
|
+
|
|
64
|
+
```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
|
+
# Find the failing step
|
|
77
|
+
gh run view $ARGUMENTS --json jobs --jq '.jobs[] | select(.conclusion=="failure") | {name, steps: [.steps[] | select(.conclusion=="failure")]}'
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Extract key information:**
|
|
81
|
+
|
|
82
|
+
| Field | Extract |
|
|
83
|
+
| ----------------- | ------------------------------ |
|
|
84
|
+
| **Failing job** | Which job failed |
|
|
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]
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Phase 4: Identify Failure Pattern
|
|
103
|
+
|
|
104
|
+
Common CI failure patterns:
|
|
105
|
+
|
|
106
|
+
| Pattern | Symptoms | Typical Fix |
|
|
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 |
|
|
118
|
+
|
|
119
|
+
## Phase 5: Estimate Complexity
|
|
120
|
+
|
|
121
|
+
| Signals | Estimate | Approach |
|
|
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:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Run the same commands as CI
|
|
134
|
+
npm ci
|
|
135
|
+
npm run build
|
|
136
|
+
npm test
|
|
137
|
+
npm run lint
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
If it passes locally but fails in CI:
|
|
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:**
|
|
164
|
+
|
|
165
|
+
```bash
|
|
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
|
|
172
|
+
|
|
173
|
+
# Lint errors
|
|
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:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
npm run build
|
|
188
|
+
npm test
|
|
189
|
+
npm run lint
|
|
190
|
+
npm run type-check
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
All must pass locally.
|
|
194
|
+
|
|
195
|
+
## Phase 9: Push & Re-trigger CI
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
git add <files>
|
|
199
|
+
git commit -m "fix(ci): <description>
|
|
200
|
+
|
|
201
|
+
Root cause: [what was wrong]
|
|
202
|
+
<bead-id>"
|
|
203
|
+
|
|
204
|
+
git push
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Re-trigger CI:**
|
|
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
|
|
218
|
+
gh run watch
|
|
219
|
+
```
|
|
220
|
+
|
|
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>",
|
|
24
250
|
});
|
|
251
|
+
|
|
252
|
+
bd_done({ id: "<bead-id>", msg: "CI fixed: [summary]" });
|
|
25
253
|
```
|
|
26
254
|
|
|
27
|
-
|
|
255
|
+
**If CI still fails:**
|
|
28
256
|
|
|
29
|
-
|
|
257
|
+
Iterate:
|
|
30
258
|
|
|
31
|
-
1.
|
|
259
|
+
1. Fetch new logs
|
|
260
|
+
2. Identify new/remaining error
|
|
261
|
+
3. Fix and push again
|
|
262
|
+
4. Maximum 3 iterations before escalating
|
|
32
263
|
|
|
33
|
-
|
|
264
|
+
**If fix makes things worse:**
|
|
34
265
|
|
|
35
|
-
|
|
266
|
+
```bash
|
|
267
|
+
git revert HEAD
|
|
268
|
+
git push
|
|
269
|
+
```
|
|
36
270
|
|
|
37
|
-
|
|
271
|
+
Then reassess approach.
|
|
38
272
|
|
|
39
|
-
|
|
273
|
+
## Phase 11: Update Memory
|
|
40
274
|
|
|
41
|
-
|
|
275
|
+
If this was a recurring CI issue:
|
|
42
276
|
|
|
43
|
-
|
|
277
|
+
```typescript
|
|
278
|
+
memory -
|
|
279
|
+
update({
|
|
280
|
+
file: "project/gotchas",
|
|
281
|
+
content: `
|
|
282
|
+
## CI: [Issue Title]
|
|
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
|
+
});
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## Phase 12: Sync & Report
|
|
44
294
|
|
|
45
295
|
```typescript
|
|
46
|
-
|
|
296
|
+
bd_release({ _: true });
|
|
297
|
+
bd_sync({ reason: "Fixed CI: $ARGUMENTS" });
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
CI Fixed: $ARGUMENTS
|
|
302
|
+
━━━━━━━━━━━━━━━━━━━━
|
|
303
|
+
|
|
304
|
+
Estimate: [S/M/L]
|
|
305
|
+
Root cause: [brief description]
|
|
306
|
+
Pattern: [which common pattern]
|
|
307
|
+
|
|
308
|
+
Changes:
|
|
309
|
+
- [file] - [change]
|
|
310
|
+
|
|
311
|
+
CI Run: [new run URL]
|
|
312
|
+
Status: Passed ✓
|
|
313
|
+
|
|
314
|
+
Observation: Created ✓
|
|
315
|
+
Gotcha: [Added/Not needed]
|
|
316
|
+
|
|
317
|
+
Commit: [hash]
|
|
47
318
|
```
|
|
48
319
|
|
|
49
320
|
## Notes
|
|
50
321
|
|
|
51
|
-
- If `gh`
|
|
52
|
-
- If
|
|
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`
|