opencodekit 0.21.10 → 0.22.0
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 +116 -487
- package/dist/template/.opencode/README.md +1 -1
- package/dist/template/.opencode/agent/build.md +56 -396
- package/dist/template/.opencode/agent/explore.md +0 -1
- package/dist/template/.opencode/agent/review.md +0 -1
- package/dist/template/.opencode/agent/scout.md +0 -1
- package/dist/template/.opencode/agent/vision.md +0 -1
- package/dist/template/.opencode/command/clarify.md +48 -0
- package/dist/template/.opencode/command/commit.md +53 -0
- package/dist/template/.opencode/command/fix.md +56 -0
- package/dist/template/.opencode/command/improve-architecture.md +55 -0
- package/dist/template/.opencode/command/init.md +88 -68
- package/dist/template/.opencode/command/refactor.md +66 -0
- package/dist/template/.opencode/command/test.md +66 -0
- package/dist/template/.opencode/dcp.jsonc +13 -2
- package/dist/template/.opencode/memory/README.md +3 -5
- package/dist/template/.opencode/memory/_templates/adr.md +45 -0
- package/dist/template/.opencode/memory/project/gotchas.md +1 -1
- package/dist/template/.opencode/memory/session-context.md +1 -1
- package/dist/template/.opencode/plugin/README.md +1 -1
- package/dist/template/.opencode/plugin/guard.ts +62 -0
- package/dist/template/.opencode/plugin/{lib/memory-admin-tools.ts → memory/admin.ts} +4 -4
- package/dist/template/.opencode/plugin/{lib → memory}/capture.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/compile.ts +2 -2
- package/dist/template/.opencode/plugin/{lib → memory}/context.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/curator.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/db/observations.ts +102 -3
- package/dist/template/.opencode/plugin/{lib → memory}/db/schema.ts +43 -1
- package/dist/template/.opencode/plugin/{lib → memory}/db/types.ts +22 -0
- package/dist/template/.opencode/plugin/{lib/memory-db.ts → memory/db.ts} +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/distill.ts +1 -1
- package/dist/template/.opencode/plugin/{lib/memory-helpers.ts → memory/helpers.ts} +5 -1
- package/dist/template/.opencode/plugin/{lib/memory-hooks.ts → memory/hooks.ts} +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/index-generator.ts +2 -2
- package/dist/template/.opencode/plugin/{lib → memory}/inject.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/lint.ts +2 -2
- package/dist/template/.opencode/plugin/memory/tools.ts +322 -0
- package/dist/template/.opencode/plugin/{lib → memory}/validate.ts +2 -2
- package/dist/template/.opencode/plugin/memory.ts +7 -17
- package/dist/template/.opencode/plugin/srcwalk.ts +721 -0
- package/dist/template/.opencode/skill/agent-code-quality-gate/SKILL.md +98 -0
- package/dist/template/.opencode/skill/behavioral-kernel/SKILL.md +52 -0
- package/dist/template/.opencode/skill/browser-testing-with-devtools/SKILL.md +85 -0
- package/dist/template/.opencode/skill/code-cleanup/SKILL.md +114 -0
- package/dist/template/.opencode/skill/code-navigation/SKILL.md +142 -0
- package/dist/template/.opencode/skill/code-review-and-quality/SKILL.md +131 -0
- package/dist/template/.opencode/skill/debugging-and-error-recovery/SKILL.md +109 -0
- package/dist/template/.opencode/skill/deep-module-design/SKILL.md +207 -0
- package/dist/template/.opencode/skill/git-workflow-and-versioning/SKILL.md +77 -0
- package/dist/template/.opencode/skill/grill-me/SKILL.md +140 -0
- package/dist/template/.opencode/skill/memory-system/SKILL.md +9 -10
- package/dist/template/.opencode/skill/planning-and-task-breakdown/SKILL.md +116 -0
- package/dist/template/.opencode/skill/shipping-and-launch/SKILL.md +95 -0
- package/dist/template/.opencode/skill/source-driven-development/SKILL.md +103 -0
- package/dist/template/.opencode/skill/spec-driven-development/SKILL.md +121 -0
- package/dist/template/.opencode/skill/srcwalk/SKILL.md +161 -0
- package/dist/template/.opencode/skill/ubiquitous-language/SKILL.md +184 -0
- package/package.json +1 -1
- package/dist/template/.opencode/AGENT_ALIGNMENT.md +0 -564
- package/dist/template/.opencode/agent/painter.md +0 -83
- package/dist/template/.opencode/command/compound.md +0 -240
- package/dist/template/.opencode/command/curate.md +0 -299
- package/dist/template/.opencode/command/handoff.md +0 -149
- package/dist/template/.opencode/command/health.md +0 -356
- package/dist/template/.opencode/command/init-context.md +0 -297
- package/dist/template/.opencode/command/init-user.md +0 -125
- package/dist/template/.opencode/command/iterate.md +0 -200
- package/dist/template/.opencode/command/lfg.md +0 -173
- package/dist/template/.opencode/command/resume.md +0 -78
- package/dist/template/.opencode/command/status.md +0 -126
- package/dist/template/.opencode/command/ui-slop-check.md +0 -169
- package/dist/template/.opencode/plugin/lib/memory-tools.ts +0 -535
- package/dist/template/.opencode/skill/agent-evals/SKILL.md +0 -208
- package/dist/template/.opencode/skill/anti-ai-slop/SKILL.md +0 -76
- package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +0 -122
- package/dist/template/.opencode/skill/augment-context-engine/mcp.json +0 -6
- package/dist/template/.opencode/skill/brand-asset-protocol/SKILL.md +0 -222
- package/dist/template/.opencode/skill/code-search-patterns/SKILL.md +0 -224
- package/dist/template/.opencode/skill/code-simplification/SKILL.md +0 -211
- package/dist/template/.opencode/skill/context-condensation/SKILL.md +0 -149
- package/dist/template/.opencode/skill/context-initialization/SKILL.md +0 -69
- package/dist/template/.opencode/skill/context-management/SKILL.md +0 -390
- package/dist/template/.opencode/skill/deep-research/SKILL.md +0 -384
- package/dist/template/.opencode/skill/design-direction-advisor/SKILL.md +0 -139
- package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +0 -191
- package/dist/template/.opencode/skill/executing-plans/SKILL.md +0 -247
- package/dist/template/.opencode/skill/figma-go/SKILL.md +0 -65
- package/dist/template/.opencode/skill/finishing-a-development-branch/SKILL.md +0 -357
- package/dist/template/.opencode/skill/full-output-enforcement/SKILL.md +0 -62
- package/dist/template/.opencode/skill/gh-address-comments/SKILL.md +0 -29
- package/dist/template/.opencode/skill/gh-address-comments/scripts/fetch_comments.py +0 -237
- package/dist/template/.opencode/skill/gh-fix-ci/SKILL.md +0 -38
- package/dist/template/.opencode/skill/gh-fix-ci/scripts/inspect_pr_checks.py +0 -509
- package/dist/template/.opencode/skill/hi-fi-prototype-html/SKILL.md +0 -253
- package/dist/template/.opencode/skill/html-deck-export/SKILL.md +0 -189
- package/dist/template/.opencode/skill/index-knowledge/SKILL.md +0 -413
- package/dist/template/.opencode/skill/memory-grounding/SKILL.md +0 -68
- package/dist/template/.opencode/skill/playwriter/SKILL.md +0 -158
- package/dist/template/.opencode/skill/portless/SKILL.md +0 -109
- package/dist/template/.opencode/skill/prd/SKILL.md +0 -146
- package/dist/template/.opencode/skill/prd-task/SKILL.md +0 -182
- package/dist/template/.opencode/skill/prd-task/references/prd-schema.json +0 -124
- package/dist/template/.opencode/skill/prompt-leverage/SKILL.md +0 -90
- package/dist/template/.opencode/skill/prompt-leverage/references/framework.md +0 -91
- package/dist/template/.opencode/skill/prompt-leverage/scripts/augment_prompt.py +0 -157
- package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +0 -263
- package/dist/template/.opencode/skill/reconcile/SKILL.md +0 -183
- package/dist/template/.opencode/skill/reflection-checkpoints/SKILL.md +0 -183
- package/dist/template/.opencode/skill/requesting-code-review/SKILL.md +0 -443
- package/dist/template/.opencode/skill/requesting-code-review/references/specialist-profiles.md +0 -108
- package/dist/template/.opencode/skill/requesting-code-review/review.md +0 -160
- package/dist/template/.opencode/skill/rtk-command-compression/SKILL.md +0 -134
- package/dist/template/.opencode/skill/screenshot/SKILL.md +0 -48
- package/dist/template/.opencode/skill/screenshot/scripts/ensure_macos_permissions.sh +0 -54
- package/dist/template/.opencode/skill/screenshot/scripts/macos_display_info.swift +0 -22
- package/dist/template/.opencode/skill/screenshot/scripts/macos_permissions.swift +0 -40
- package/dist/template/.opencode/skill/screenshot/scripts/macos_window_info.swift +0 -126
- package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.ps1 +0 -163
- package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.py +0 -585
- package/dist/template/.opencode/skill/security-threat-model/SKILL.md +0 -36
- package/dist/template/.opencode/skill/security-threat-model/references/prompt-template.md +0 -255
- package/dist/template/.opencode/skill/security-threat-model/references/security-controls-and-assets.md +0 -32
- package/dist/template/.opencode/skill/sharing-skills/SKILL.md +0 -214
- package/dist/template/.opencode/skill/skill-creator/SKILL.md +0 -181
- package/dist/template/.opencode/skill/skill-installer/SKILL.md +0 -58
- package/dist/template/.opencode/skill/skill-installer/scripts/github_utils.py +0 -21
- package/dist/template/.opencode/skill/skill-installer/scripts/install-skill-from-github.py +0 -313
- package/dist/template/.opencode/skill/skill-installer/scripts/list-skills.py +0 -106
- package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +0 -244
- package/dist/template/.opencode/skill/swarm-coordination/references/architecture.md +0 -39
- package/dist/template/.opencode/skill/swarm-coordination/references/delegation-worker-protocol.md +0 -145
- package/dist/template/.opencode/skill/swarm-coordination/references/dependency-graph.md +0 -50
- package/dist/template/.opencode/skill/swarm-coordination/references/drift-check.md +0 -90
- package/dist/template/.opencode/skill/swarm-coordination/references/integration-beads.md +0 -20
- package/dist/template/.opencode/skill/swarm-coordination/references/launch-flow.md +0 -186
- package/dist/template/.opencode/skill/swarm-coordination/references/reconciler.md +0 -172
- package/dist/template/.opencode/skill/swarm-coordination/references/tier-enforcement.md +0 -78
- package/dist/template/.opencode/skill/swarm-coordination/references/tmux-integration.md +0 -134
- package/dist/template/.opencode/skill/systematic-debugging/SKILL.md +0 -402
- package/dist/template/.opencode/skill/terse-output-mode/SKILL.md +0 -95
- package/dist/template/.opencode/skill/think-in-code/SKILL.md +0 -136
- package/dist/template/.opencode/skill/ux-quality-gates/SKILL.md +0 -137
- package/dist/template/.opencode/skill/v1-run/SKILL.md +0 -175
- package/dist/template/.opencode/skill/v1-run/mcp.json +0 -6
- package/dist/template/.opencode/skill/verification-gates/SKILL.md +0 -63
- package/dist/template/.opencode/skill/visual-analysis/SKILL.md +0 -154
- package/dist/template/.opencode/skill/web-design-guidelines/SKILL.md +0 -46
- package/dist/template/.opencode/skill/workspace-setup/SKILL.md +0 -76
- package/dist/template/.opencode/skill/writing-plans/SKILL.md +0 -320
- /package/dist/template/.opencode/plugin/{lib → memory}/compact.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/graph.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/maintenance.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/pipeline.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/notify.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/operation-log.ts +0 -0
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: finishing-a-development-branch
|
|
3
|
-
description: Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
|
|
4
|
-
version: 1.0.0
|
|
5
|
-
tags: [workflow, git]
|
|
6
|
-
dependencies: []
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Finishing a Development Branch
|
|
10
|
-
|
|
11
|
-
## When to Use
|
|
12
|
-
|
|
13
|
-
- Implementation is complete and tests pass, and you need to merge/PR/cleanup
|
|
14
|
-
- You must present structured end-of-work options and execute the chosen path
|
|
15
|
-
|
|
16
|
-
## When NOT to Use
|
|
17
|
-
|
|
18
|
-
- Tests or mandatory gates are failing
|
|
19
|
-
- Work is still in progress and not ready for integration
|
|
20
|
-
|
|
21
|
-
## Overview
|
|
22
|
-
|
|
23
|
-
Guide completion of development work by presenting clear options and handling chosen workflow.
|
|
24
|
-
|
|
25
|
-
**Core principle:** Verify tests → Present options → Execute choice → Clean up.
|
|
26
|
-
|
|
27
|
-
**Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
|
|
28
|
-
|
|
29
|
-
## The Process
|
|
30
|
-
|
|
31
|
-
### Step 1: Verify Tests
|
|
32
|
-
|
|
33
|
-
#### Completion Prep Checklist
|
|
34
|
-
|
|
35
|
-
- [ ] Run the project's test suite
|
|
36
|
-
- [ ] Stop if any tests fail and report failures
|
|
37
|
-
|
|
38
|
-
**Before presenting options, verify tests pass:**
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# Run project's test suite
|
|
42
|
-
npm test / cargo test / pytest / go test ./...
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**If tests fail:**
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
Tests failing (<N> failures). Must fix before completing:
|
|
49
|
-
|
|
50
|
-
[Show failures]
|
|
51
|
-
|
|
52
|
-
Cannot proceed with merge/PR until tests pass.
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Stop. Don't proceed to Step 2.
|
|
56
|
-
|
|
57
|
-
**If tests pass:** Continue to Step 2.
|
|
58
|
-
|
|
59
|
-
### Step 2: Determine Base Branch
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
# Try common base branches
|
|
63
|
-
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Or ask: "This branch split from main - is that correct?"
|
|
67
|
-
|
|
68
|
-
### Step 3: Present Options
|
|
69
|
-
|
|
70
|
-
Use question tool to present completion options:
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
question({
|
|
74
|
-
questions: [
|
|
75
|
-
{
|
|
76
|
-
header: "Complete",
|
|
77
|
-
question: "Implementation complete. What would you like to do?",
|
|
78
|
-
options: [
|
|
79
|
-
{
|
|
80
|
-
label: "Merge locally (Recommended)",
|
|
81
|
-
description: "Merge to base branch",
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
label: "Push & create PR",
|
|
85
|
-
description: "Create pull request for review",
|
|
86
|
-
},
|
|
87
|
-
{ label: "Keep branch", description: "I'll handle it later" },
|
|
88
|
-
{ label: "Discard work", description: "Delete this branch" },
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
});
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
**Don't add explanation** - keep options concise.
|
|
96
|
-
|
|
97
|
-
### Step 4: Execute Choice
|
|
98
|
-
|
|
99
|
-
#### Execute Choice Checklist
|
|
100
|
-
|
|
101
|
-
- [ ] Follow the selected option's steps exactly
|
|
102
|
-
- [ ] Re-run tests on merged result when applicable
|
|
103
|
-
- [ ] Only cleanup worktree for Options 1, 2, or 4
|
|
104
|
-
|
|
105
|
-
#### Option 1: Merge Locally
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
# Switch to base branch
|
|
109
|
-
git checkout <base-branch>
|
|
110
|
-
|
|
111
|
-
# Pull latest
|
|
112
|
-
git pull
|
|
113
|
-
|
|
114
|
-
# Merge feature branch
|
|
115
|
-
git merge <feature-branch>
|
|
116
|
-
|
|
117
|
-
# Verify tests on merged result
|
|
118
|
-
<test command>
|
|
119
|
-
|
|
120
|
-
# If tests pass
|
|
121
|
-
git branch -d <feature-branch>
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
Then: Cleanup worktree (Step 5)
|
|
125
|
-
|
|
126
|
-
#### Option 2: Push and Create PR
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
# Push branch
|
|
130
|
-
git push -u origin <feature-branch>
|
|
131
|
-
|
|
132
|
-
# Create PR
|
|
133
|
-
gh pr create --title "<title>" --body "$(cat <<'EOF'
|
|
134
|
-
## Summary
|
|
135
|
-
<2-3 bullets of what changed>
|
|
136
|
-
|
|
137
|
-
## Test Plan
|
|
138
|
-
- [ ] <verification steps>
|
|
139
|
-
EOF
|
|
140
|
-
)"
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Then: Cleanup worktree (Step 5)
|
|
144
|
-
|
|
145
|
-
#### Option 3: Keep As-Is
|
|
146
|
-
|
|
147
|
-
Report: "Keeping branch <name>. Worktree preserved at <path>."
|
|
148
|
-
|
|
149
|
-
**Don't cleanup worktree.**
|
|
150
|
-
|
|
151
|
-
#### Option 4: Discard
|
|
152
|
-
|
|
153
|
-
**Confirm first:**
|
|
154
|
-
|
|
155
|
-
```
|
|
156
|
-
This will permanently delete:
|
|
157
|
-
- Branch <name>
|
|
158
|
-
- All commits: <commit-list>
|
|
159
|
-
- Worktree at <path>
|
|
160
|
-
|
|
161
|
-
Type 'discard' to confirm.
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
Wait for exact confirmation.
|
|
165
|
-
|
|
166
|
-
If confirmed:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
git checkout <base-branch>
|
|
170
|
-
git branch -D <feature-branch>
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
Then: Cleanup worktree (Step 5)
|
|
174
|
-
|
|
175
|
-
### Step 5: Cleanup Worktree
|
|
176
|
-
|
|
177
|
-
**For Options 1, 2, 4:**
|
|
178
|
-
|
|
179
|
-
Check if in worktree:
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
git worktree list | grep $(git branch --show-current)
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
If yes:
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
git worktree remove <worktree-path>
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
**For Option 3:** Keep worktree.
|
|
192
|
-
|
|
193
|
-
## Quick Reference
|
|
194
|
-
|
|
195
|
-
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
|
|
196
|
-
| ---------------- | ----- | ---- | ------------- | -------------- |
|
|
197
|
-
| 1. Merge locally | ✓ | - | - | ✓ |
|
|
198
|
-
| 2. Create PR | - | ✓ | ✓ | - |
|
|
199
|
-
| 3. Keep as-is | - | - | ✓ | - |
|
|
200
|
-
| 4. Discard | - | - | - | ✓ (force) |
|
|
201
|
-
|
|
202
|
-
## Mandatory Build Gates (Longshot Pattern)
|
|
203
|
-
|
|
204
|
-
**Build gates are non-optional before any merge/PR/close.** Advisory verification has failed at scale — gates must be enforced as hard blockers.
|
|
205
|
-
|
|
206
|
-
### Gate Sequence
|
|
207
|
-
|
|
208
|
-
#### Gate Checklist
|
|
209
|
-
|
|
210
|
-
- [ ] Gate 1: `npm run typecheck`
|
|
211
|
-
- [ ] Gate 2: `npm run lint` (run `npm run lint:fix` if needed)
|
|
212
|
-
- [ ] Gate 3: `vitest`
|
|
213
|
-
- [ ] Stop and fix if any gate fails
|
|
214
|
-
|
|
215
|
-
Every bead MUST pass all three gates in order. No exceptions.
|
|
216
|
-
|
|
217
|
-
```bash
|
|
218
|
-
# Gate 1: Typecheck
|
|
219
|
-
npm run typecheck
|
|
220
|
-
# Must exit 0. If fails → STOP. Fix types first.
|
|
221
|
-
|
|
222
|
-
# Gate 2: Lint
|
|
223
|
-
npm run lint
|
|
224
|
-
# Must exit 0. If fails → STOP. Run npm run lint:fix, then fix remaining.
|
|
225
|
-
|
|
226
|
-
# Gate 3: Tests
|
|
227
|
-
vitest
|
|
228
|
-
# Must exit 0. If fails → STOP. Fix failing tests first.
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### Gate Enforcement Script
|
|
232
|
-
|
|
233
|
-
Run before every merge, PR creation, or bead close:
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
#!/bin/bash
|
|
237
|
-
# Run mandatory gates — all must pass
|
|
238
|
-
|
|
239
|
-
echo "Gate 1/3: Typecheck..."
|
|
240
|
-
npm run typecheck || { echo "FAILED: Fix type errors before proceeding."; exit 1; }
|
|
241
|
-
|
|
242
|
-
echo "Gate 2/3: Lint..."
|
|
243
|
-
npm run lint || {
|
|
244
|
-
echo "Attempting auto-fix..."
|
|
245
|
-
npm run lint:fix
|
|
246
|
-
npm run lint || { echo "FAILED: Fix lint errors before proceeding."; exit 1; }
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
echo "Gate 3/3: Tests..."
|
|
250
|
-
vitest || { echo "FAILED: Fix failing tests before proceeding."; exit 1; }
|
|
251
|
-
|
|
252
|
-
echo "All gates passed. Safe to merge/PR/close."
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
### Gate Failure Response
|
|
256
|
-
|
|
257
|
-
| Gate Failure | First Action | If Still Failing |
|
|
258
|
-
| ------------ | -------------------------------- | --------------------------- |
|
|
259
|
-
| Typecheck | Fix type errors at reported line | Use LSP hover for type info |
|
|
260
|
-
| Lint | Run `npm run lint:fix` | Fix remaining manually |
|
|
261
|
-
| Tests | Read failing test output | Fix implementation or test |
|
|
262
|
-
|
|
263
|
-
### Hard Rules
|
|
264
|
-
|
|
265
|
-
**NEVER:**
|
|
266
|
-
|
|
267
|
-
- Close a bead without passing all 3 gates
|
|
268
|
-
- Create a PR without passing all 3 gates
|
|
269
|
-
- Merge locally without passing all 3 gates on merged result
|
|
270
|
-
- Skip gates "because the change is small"
|
|
271
|
-
|
|
272
|
-
**ALWAYS:**
|
|
273
|
-
|
|
274
|
-
- Run gates after EVERY non-trivial file change
|
|
275
|
-
- Re-run gates after fixing gate failures (to catch regressions)
|
|
276
|
-
- Run gates on the merged result, not just the branch
|
|
277
|
-
|
|
278
|
-
### Integration with Bead Workflow
|
|
279
|
-
|
|
280
|
-
```bash
|
|
281
|
-
# Before closing any bead:
|
|
282
|
-
npm run typecheck && npm run lint && vitest
|
|
283
|
-
|
|
284
|
-
# If all pass:
|
|
285
|
-
br close <id> --reason "Implementation complete. All gates passed."
|
|
286
|
-
br sync --flush-only
|
|
287
|
-
|
|
288
|
-
# If any fail:
|
|
289
|
-
# STOP. Fix. Re-run gates. Then close.
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
### Gate State in Delegation Packets
|
|
293
|
-
|
|
294
|
-
Workers must include gate results in their completion report:
|
|
295
|
-
|
|
296
|
-
```markdown
|
|
297
|
-
## Completion Report
|
|
298
|
-
|
|
299
|
-
### Gate Results
|
|
300
|
-
|
|
301
|
-
- [ ] typecheck: PASS / FAIL (error: ...)
|
|
302
|
-
- [ ] lint: PASS / FAIL (error: ...)
|
|
303
|
-
- [ ] tests: PASS / FAIL (N failed, N passed)
|
|
304
|
-
|
|
305
|
-
### Gate Command Used
|
|
306
|
-
|
|
307
|
-
`npm run typecheck && npm run lint && vitest`
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
## Common Mistakes
|
|
311
|
-
|
|
312
|
-
**Skipping test verification**
|
|
313
|
-
|
|
314
|
-
- **Problem:** Merge broken code, create failing PR
|
|
315
|
-
- **Fix:** Always verify tests before offering options
|
|
316
|
-
|
|
317
|
-
**Open-ended questions**
|
|
318
|
-
|
|
319
|
-
- **Problem:** "What should I do next?" → ambiguous
|
|
320
|
-
- **Fix:** Present exactly 4 structured options
|
|
321
|
-
|
|
322
|
-
**Automatic worktree cleanup**
|
|
323
|
-
|
|
324
|
-
- **Problem:** Remove worktree when might need it (Option 2, 3)
|
|
325
|
-
- **Fix:** Only cleanup for Options 1 and 4
|
|
326
|
-
|
|
327
|
-
**No confirmation for discard**
|
|
328
|
-
|
|
329
|
-
- **Problem:** Accidentally delete work
|
|
330
|
-
- **Fix:** Require typed "discard" confirmation
|
|
331
|
-
|
|
332
|
-
## Red Flags
|
|
333
|
-
|
|
334
|
-
**Never:**
|
|
335
|
-
|
|
336
|
-
- Proceed with failing tests
|
|
337
|
-
- Merge without verifying tests on result
|
|
338
|
-
- Delete work without confirmation
|
|
339
|
-
- Force-push without explicit request
|
|
340
|
-
|
|
341
|
-
**Always:**
|
|
342
|
-
|
|
343
|
-
- Verify tests before offering options
|
|
344
|
-
- Present exactly 4 options
|
|
345
|
-
- Get typed confirmation for Option 4
|
|
346
|
-
- Clean up worktree for Options 1 & 4 only
|
|
347
|
-
|
|
348
|
-
## Integration
|
|
349
|
-
|
|
350
|
-
**Called by:**
|
|
351
|
-
|
|
352
|
-
- **subagent-driven-development** (Step 7) - After all tasks complete
|
|
353
|
-
- **executing-plans** (Step 5) - After all batches complete
|
|
354
|
-
|
|
355
|
-
**Pairs with:**
|
|
356
|
-
|
|
357
|
-
- **using-git-worktrees** - Cleans up worktree created by that skill
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: full-output-enforcement
|
|
3
|
-
description: MUST load when generating complete files, long code blocks, or any output where truncation or placeholder comments like '// ... rest of code' would be harmful. Bans all placeholder patterns and enforces exhaustive, unabridged output.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## When to Use
|
|
7
|
-
|
|
8
|
-
- When generating complete files, long code blocks, or full configuration outputs
|
|
9
|
-
- When truncation or placeholder comments like `// ... rest of code` would be harmful
|
|
10
|
-
- When the user needs exhaustive, unabridged output
|
|
11
|
-
|
|
12
|
-
## When NOT to Use
|
|
13
|
-
|
|
14
|
-
- For short code snippets or single-function responses
|
|
15
|
-
- When summarization is explicitly requested
|
|
16
|
-
- For conversational responses that don't involve code generation
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# Full-Output Enforcement
|
|
20
|
-
|
|
21
|
-
## Baseline
|
|
22
|
-
|
|
23
|
-
Treat every task as production-critical. A partial output is a broken output. Do not optimize for brevity — optimize for completeness. If the user asks for a full file, deliver the full file. If the user asks for 5 components, deliver 5 components. No exceptions.
|
|
24
|
-
|
|
25
|
-
## Banned Output Patterns
|
|
26
|
-
|
|
27
|
-
The following patterns are hard failures. Never produce them:
|
|
28
|
-
|
|
29
|
-
**In code blocks:** `// ...`, `// rest of code`, `// implement here`, `// TODO`, `/* ... */`, `// similar to above`, `// continue pattern`, `// add more as needed`, bare `...` standing in for omitted code
|
|
30
|
-
|
|
31
|
-
**In prose:** "Let me know if you want me to continue", "I can provide more details if needed", "for brevity", "the rest follows the same pattern", "similarly for the remaining", "and so on" (when replacing actual content), "I'll leave that as an exercise"
|
|
32
|
-
|
|
33
|
-
**Structural shortcuts:** Outputting a skeleton when the request was for a full implementation. Showing the first and last section while skipping the middle. Replacing repeated logic with one example and a description. Describing what code should do instead of writing it.
|
|
34
|
-
|
|
35
|
-
## Execution Process
|
|
36
|
-
|
|
37
|
-
1. **Scope** — Read the full request. Count how many distinct deliverables are expected (files, functions, sections, answers). Lock that number.
|
|
38
|
-
2. **Build** — Generate every deliverable completely. No partial drafts, no "you can extend this later."
|
|
39
|
-
3. **Cross-check** — Before output, re-read the original request. Compare your deliverable count against the scope count. If anything is missing, add it before responding.
|
|
40
|
-
|
|
41
|
-
## Handling Long Outputs
|
|
42
|
-
|
|
43
|
-
When a response approaches the token limit:
|
|
44
|
-
|
|
45
|
-
- Do not compress remaining sections to squeeze them in.
|
|
46
|
-
- Do not skip ahead to a conclusion.
|
|
47
|
-
- Write at full quality up to a clean breakpoint (end of a function, end of a file, end of a section).
|
|
48
|
-
- End with:
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
[PAUSED — X of Y complete. Send "continue" to resume from: next section name]
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
On "continue", pick up exactly where you stopped. No recap, no repetition.
|
|
55
|
-
|
|
56
|
-
## Quick Check
|
|
57
|
-
|
|
58
|
-
Before finalizing any response, verify:
|
|
59
|
-
- No banned patterns from the list above appear anywhere in the output
|
|
60
|
-
- Every item the user requested is present and finished
|
|
61
|
-
- Code blocks contain actual runnable code, not descriptions of what code would do
|
|
62
|
-
- Nothing was shortened to save space
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: gh-address-comments
|
|
3
|
-
description: Use when the user asks to review and address GitHub PR comments/threads for the current branch using gh CLI.
|
|
4
|
-
version: 1.0.0
|
|
5
|
-
tags: [workflow, git, agent-coordination]
|
|
6
|
-
dependencies: []
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# gh-address-comments
|
|
10
|
-
|
|
11
|
-
Fetch PR comments and review threads, then apply selected fixes.
|
|
12
|
-
|
|
13
|
-
## When to Use
|
|
14
|
-
|
|
15
|
-
- User asks to resolve PR review comments
|
|
16
|
-
- User wants a numbered list of comment threads to triage
|
|
17
|
-
|
|
18
|
-
## When NOT to Use
|
|
19
|
-
|
|
20
|
-
- No open PR associated with current branch
|
|
21
|
-
- `gh` is unavailable/auth is missing and user declines auth
|
|
22
|
-
|
|
23
|
-
## Workflow
|
|
24
|
-
|
|
25
|
-
1. Check auth: `gh auth status`
|
|
26
|
-
2. Fetch comments: `python3 .opencode/skill/gh-address-comments/scripts/fetch_comments.py`
|
|
27
|
-
3. Present numbered comment threads with short fix summaries
|
|
28
|
-
4. Ask which comments to address
|
|
29
|
-
5. Implement only selected fixes and report results
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Fetch all PR conversation comments + reviews + review threads (inline threads)
|
|
4
|
-
for the PR associated with the current git branch, by shelling out to:
|
|
5
|
-
|
|
6
|
-
gh api graphql
|
|
7
|
-
|
|
8
|
-
Requires:
|
|
9
|
-
- `gh auth login` already set up
|
|
10
|
-
- current branch has an associated (open) PR
|
|
11
|
-
|
|
12
|
-
Usage:
|
|
13
|
-
python fetch_comments.py > pr_comments.json
|
|
14
|
-
"""
|
|
15
|
-
|
|
16
|
-
from __future__ import annotations
|
|
17
|
-
|
|
18
|
-
import json
|
|
19
|
-
import subprocess
|
|
20
|
-
import sys
|
|
21
|
-
from typing import Any
|
|
22
|
-
|
|
23
|
-
QUERY = """\
|
|
24
|
-
query(
|
|
25
|
-
$owner: String!,
|
|
26
|
-
$repo: String!,
|
|
27
|
-
$number: Int!,
|
|
28
|
-
$commentsCursor: String,
|
|
29
|
-
$reviewsCursor: String,
|
|
30
|
-
$threadsCursor: String
|
|
31
|
-
) {
|
|
32
|
-
repository(owner: $owner, name: $repo) {
|
|
33
|
-
pullRequest(number: $number) {
|
|
34
|
-
number
|
|
35
|
-
url
|
|
36
|
-
title
|
|
37
|
-
state
|
|
38
|
-
|
|
39
|
-
# Top-level "Conversation" comments (issue comments on the PR)
|
|
40
|
-
comments(first: 100, after: $commentsCursor) {
|
|
41
|
-
pageInfo { hasNextPage endCursor }
|
|
42
|
-
nodes {
|
|
43
|
-
id
|
|
44
|
-
body
|
|
45
|
-
createdAt
|
|
46
|
-
updatedAt
|
|
47
|
-
author { login }
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
# Review submissions (Approve / Request changes / Comment), with body if present
|
|
52
|
-
reviews(first: 100, after: $reviewsCursor) {
|
|
53
|
-
pageInfo { hasNextPage endCursor }
|
|
54
|
-
nodes {
|
|
55
|
-
id
|
|
56
|
-
state
|
|
57
|
-
body
|
|
58
|
-
submittedAt
|
|
59
|
-
author { login }
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
# Inline review threads (grouped), includes resolved state
|
|
64
|
-
reviewThreads(first: 100, after: $threadsCursor) {
|
|
65
|
-
pageInfo { hasNextPage endCursor }
|
|
66
|
-
nodes {
|
|
67
|
-
id
|
|
68
|
-
isResolved
|
|
69
|
-
isOutdated
|
|
70
|
-
path
|
|
71
|
-
line
|
|
72
|
-
diffSide
|
|
73
|
-
startLine
|
|
74
|
-
startDiffSide
|
|
75
|
-
originalLine
|
|
76
|
-
originalStartLine
|
|
77
|
-
resolvedBy { login }
|
|
78
|
-
comments(first: 100) {
|
|
79
|
-
nodes {
|
|
80
|
-
id
|
|
81
|
-
body
|
|
82
|
-
createdAt
|
|
83
|
-
updatedAt
|
|
84
|
-
author { login }
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
"""
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
def _run(cmd: list[str], stdin: str | None = None) -> str:
|
|
96
|
-
p = subprocess.run(cmd, input=stdin, capture_output=True, text=True)
|
|
97
|
-
if p.returncode != 0:
|
|
98
|
-
raise RuntimeError(f"Command failed: {' '.join(cmd)}\n{p.stderr}")
|
|
99
|
-
return p.stdout
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
def _run_json(cmd: list[str], stdin: str | None = None) -> dict[str, Any]:
|
|
103
|
-
out = _run(cmd, stdin=stdin)
|
|
104
|
-
try:
|
|
105
|
-
return json.loads(out)
|
|
106
|
-
except json.JSONDecodeError as e:
|
|
107
|
-
raise RuntimeError(f"Failed to parse JSON from command output: {e}\nRaw:\n{out}") from e
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
def _ensure_gh_authenticated() -> None:
|
|
111
|
-
try:
|
|
112
|
-
_run(["gh", "auth", "status"])
|
|
113
|
-
except RuntimeError:
|
|
114
|
-
print("run `gh auth login` to authenticate the GitHub CLI", file=sys.stderr)
|
|
115
|
-
raise RuntimeError("gh auth status failed; run `gh auth login` to authenticate the GitHub CLI") from None
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
def gh_pr_view_json(fields: str) -> dict[str, Any]:
|
|
119
|
-
# fields is a comma-separated list like: "number,headRepositoryOwner,headRepository"
|
|
120
|
-
return _run_json(["gh", "pr", "view", "--json", fields])
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
def get_current_pr_ref() -> tuple[str, str, int]:
|
|
124
|
-
"""
|
|
125
|
-
Resolve the PR for the current branch (whatever gh considers associated).
|
|
126
|
-
Works for cross-repo PRs too, by reading head repository owner/name.
|
|
127
|
-
"""
|
|
128
|
-
pr = gh_pr_view_json("number,headRepositoryOwner,headRepository")
|
|
129
|
-
owner = pr["headRepositoryOwner"]["login"]
|
|
130
|
-
repo = pr["headRepository"]["name"]
|
|
131
|
-
number = int(pr["number"])
|
|
132
|
-
return owner, repo, number
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
def gh_api_graphql(
|
|
136
|
-
owner: str,
|
|
137
|
-
repo: str,
|
|
138
|
-
number: int,
|
|
139
|
-
comments_cursor: str | None = None,
|
|
140
|
-
reviews_cursor: str | None = None,
|
|
141
|
-
threads_cursor: str | None = None,
|
|
142
|
-
) -> dict[str, Any]:
|
|
143
|
-
"""
|
|
144
|
-
Call `gh api graphql` using -F variables, avoiding JSON blobs with nulls.
|
|
145
|
-
Query is passed via stdin using query=@- to avoid shell newline/quoting issues.
|
|
146
|
-
"""
|
|
147
|
-
cmd = [
|
|
148
|
-
"gh",
|
|
149
|
-
"api",
|
|
150
|
-
"graphql",
|
|
151
|
-
"-F",
|
|
152
|
-
"query=@-",
|
|
153
|
-
"-F",
|
|
154
|
-
f"owner={owner}",
|
|
155
|
-
"-F",
|
|
156
|
-
f"repo={repo}",
|
|
157
|
-
"-F",
|
|
158
|
-
f"number={number}",
|
|
159
|
-
]
|
|
160
|
-
if comments_cursor:
|
|
161
|
-
cmd += ["-F", f"commentsCursor={comments_cursor}"]
|
|
162
|
-
if reviews_cursor:
|
|
163
|
-
cmd += ["-F", f"reviewsCursor={reviews_cursor}"]
|
|
164
|
-
if threads_cursor:
|
|
165
|
-
cmd += ["-F", f"threadsCursor={threads_cursor}"]
|
|
166
|
-
|
|
167
|
-
return _run_json(cmd, stdin=QUERY)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
def fetch_all(owner: str, repo: str, number: int) -> dict[str, Any]:
|
|
171
|
-
conversation_comments: list[dict[str, Any]] = []
|
|
172
|
-
reviews: list[dict[str, Any]] = []
|
|
173
|
-
review_threads: list[dict[str, Any]] = []
|
|
174
|
-
|
|
175
|
-
comments_cursor: str | None = None
|
|
176
|
-
reviews_cursor: str | None = None
|
|
177
|
-
threads_cursor: str | None = None
|
|
178
|
-
|
|
179
|
-
pr_meta: dict[str, Any] | None = None
|
|
180
|
-
|
|
181
|
-
while True:
|
|
182
|
-
payload = gh_api_graphql(
|
|
183
|
-
owner=owner,
|
|
184
|
-
repo=repo,
|
|
185
|
-
number=number,
|
|
186
|
-
comments_cursor=comments_cursor,
|
|
187
|
-
reviews_cursor=reviews_cursor,
|
|
188
|
-
threads_cursor=threads_cursor,
|
|
189
|
-
)
|
|
190
|
-
|
|
191
|
-
if "errors" in payload and payload["errors"]:
|
|
192
|
-
raise RuntimeError(f"GitHub GraphQL errors:\n{json.dumps(payload['errors'], indent=2)}")
|
|
193
|
-
|
|
194
|
-
pr = payload["data"]["repository"]["pullRequest"]
|
|
195
|
-
if pr_meta is None:
|
|
196
|
-
pr_meta = {
|
|
197
|
-
"number": pr["number"],
|
|
198
|
-
"url": pr["url"],
|
|
199
|
-
"title": pr["title"],
|
|
200
|
-
"state": pr["state"],
|
|
201
|
-
"owner": owner,
|
|
202
|
-
"repo": repo,
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
c = pr["comments"]
|
|
206
|
-
r = pr["reviews"]
|
|
207
|
-
t = pr["reviewThreads"]
|
|
208
|
-
|
|
209
|
-
conversation_comments.extend(c.get("nodes") or [])
|
|
210
|
-
reviews.extend(r.get("nodes") or [])
|
|
211
|
-
review_threads.extend(t.get("nodes") or [])
|
|
212
|
-
|
|
213
|
-
comments_cursor = c["pageInfo"]["endCursor"] if c["pageInfo"]["hasNextPage"] else None
|
|
214
|
-
reviews_cursor = r["pageInfo"]["endCursor"] if r["pageInfo"]["hasNextPage"] else None
|
|
215
|
-
threads_cursor = t["pageInfo"]["endCursor"] if t["pageInfo"]["hasNextPage"] else None
|
|
216
|
-
|
|
217
|
-
if not (comments_cursor or reviews_cursor or threads_cursor):
|
|
218
|
-
break
|
|
219
|
-
|
|
220
|
-
assert pr_meta is not None
|
|
221
|
-
return {
|
|
222
|
-
"pull_request": pr_meta,
|
|
223
|
-
"conversation_comments": conversation_comments,
|
|
224
|
-
"reviews": reviews,
|
|
225
|
-
"review_threads": review_threads,
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
def main() -> None:
|
|
230
|
-
_ensure_gh_authenticated()
|
|
231
|
-
owner, repo, number = get_current_pr_ref()
|
|
232
|
-
result = fetch_all(owner, repo, number)
|
|
233
|
-
print(json.dumps(result, indent=2))
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
if __name__ == "__main__":
|
|
237
|
-
main()
|