Skip to content

Commit 28a8a61

Browse files
committed
chore: add skill to fix github issues
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1 parent 453f796 commit 28a8a61

File tree

1 file changed

+143
-0
lines changed

1 file changed

+143
-0
lines changed

.claude/skills/fix-issues/SKILL.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
---
2+
name: fix-issues
3+
description: >
4+
Fix one or more GitHub issues by creating branches, writing fixes, and opening PRs.
5+
Use this skill whenever the user provides GitHub issue numbers and wants them fixed,
6+
or says things like "fix issue 1234", "address these issues", "create PRs for issues
7+
1234 and 5678". Triggers on any request involving GitHub issue numbers paired with
8+
fixing, addressing, resolving, or creating PRs. Also triggers for "fix #1234" shorthand.
9+
---
10+
11+
# Fix Issues
12+
13+
Given one or more GitHub issue numbers from the docker/docs repository, fix each
14+
issue end-to-end: analyze, branch, fix, commit, push, and open a PR.
15+
16+
## Workflow
17+
18+
### 1. Fetch all issues in parallel
19+
20+
Use `gh issue view <number> --repo docker/docs --json title,body,labels` for each
21+
issue number. Launch all fetches in parallel since they're independent.
22+
23+
### 2. Fix each issue sequentially
24+
25+
Process each issue one at a time in the main context. Do NOT use background
26+
subagents for this — they can't get interactive Bash permission approval, which
27+
blocks all git operations. Sequential processing in the main context is faster
28+
than agents that stall on permissions.
29+
30+
For each issue:
31+
32+
#### a. Analyze
33+
34+
Read the issue body to understand:
35+
- Which file(s) need changes
36+
- What the problem is
37+
- What the fix should be
38+
39+
#### b. Create a branch
40+
41+
```bash
42+
git checkout -b fix/issue-<number>-<short-description> main
43+
```
44+
45+
Use a short kebab-case description derived from the issue title (3-5 words max).
46+
47+
#### c. Read and fix
48+
49+
- Read each affected file before editing
50+
- Make the minimal change that addresses the issue
51+
- Don't over-engineer or add unrequested improvements
52+
- Follow the repository's STYLE.md and COMPONENTS.md guidelines
53+
54+
#### d. Format
55+
56+
Run prettier on every changed file:
57+
58+
```bash
59+
npx prettier --write <file>
60+
```
61+
62+
#### e. Self-review
63+
64+
Re-read the changed file to verify:
65+
- The fix addresses the issue correctly
66+
- No unintended changes were introduced
67+
- Formatting looks correct
68+
69+
#### f. Commit
70+
71+
Stage only the changed files (not `git add -A`), then commit:
72+
73+
```bash
74+
git add <specific-files>
75+
git commit -m "$(cat <<'EOF'
76+
<Short summary of fix>
77+
78+
<Brief explanation of why>
79+
80+
Closes #<issue-number>
81+
82+
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
83+
EOF
84+
)"
85+
```
86+
87+
#### g. Push and create PR
88+
89+
```bash
90+
git push -u origin fix/issue-<number>-<short-description>
91+
```
92+
93+
Then create the PR:
94+
95+
```bash
96+
gh pr create --repo docker/docs \
97+
--title "<Short summary matching commit>" \
98+
--body "$(cat <<'EOF'
99+
## Summary
100+
101+
- <1-3 bullet points describing what changed and why>
102+
103+
Closes #<issue-number>
104+
105+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
106+
EOF
107+
)"
108+
```
109+
110+
#### h. Label and assign reviewers
111+
112+
```bash
113+
gh pr edit <pr-number> --repo docker/docs \
114+
--add-label "status/review" \
115+
--add-reviewer docker/docs-team
116+
```
117+
118+
### 3. Switch back to main
119+
120+
After all issues are processed:
121+
122+
```bash
123+
git checkout main
124+
```
125+
126+
### 4. Report results
127+
128+
Present a summary table:
129+
130+
| Issue | PR | Change |
131+
|-------|-----|--------|
132+
| #N | #M | Brief description |
133+
134+
## Important notes
135+
136+
- Always work from `main` as the base for each branch
137+
- Each issue gets its own branch and PR — don't combine issues
138+
- If an issue references a file that doesn't exist, check for renames or
139+
reorganization before giving up (files move around in this repo)
140+
- Validation commands (`docker buildx bake lint vale`) are available but slow;
141+
only run them if the user asks or the changes are complex enough to warrant it
142+
- The `/manuals` prefix is removed from URLs in the live site — keep this in
143+
mind when verifying link paths

0 commit comments

Comments
 (0)