Skip to content

Commit 9db8f39

Browse files
worktrunk-botclaude
andcommitted
fix(skill): add pre-commit and duplicate-PR checks to running-in-ci
The claude-mention bot created a duplicate PR (#1442) when #1416 already addressed the same issue, and shipped code without running cargo fmt — causing a CI failure and requiring a second commit. Both gaps exist because running-in-ci (loaded by all CI workflows) had no guidance on checking for existing PRs or formatting code before committing. The triage-issue skill had these checks but running-in-ci did not. Add two subsections under "PR Creation": - "Before creating a PR" — check open PRs and fix branches first - "Before committing code changes" — run cargo fmt at minimum Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 40810fe commit 9db8f39

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.claude/skills/running-in-ci/SKILL.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,35 @@ When the triggering comment asks for a PR (e.g., "make a new PR", "open a PR",
4040
"create a PR"), create it directly with `gh pr create`. The comment is the
4141
user's explicit request — don't downgrade it to a compare link.
4242

43+
### Before creating a PR
44+
45+
**Check for existing work.** Before creating a new branch or PR, check whether
46+
someone (including the bot) has already opened a PR for the same issue or topic:
47+
48+
```bash
49+
# Check open PRs — look for related titles and branches
50+
gh pr list --state open --json number,title,headRefName --jq '.[] | "#\(.number) [\(.headRefName)]: \(.title)"'
51+
52+
# Check for fix branches
53+
git branch -r --list 'origin/fix/*'
54+
```
55+
56+
If an existing PR addresses the same problem, work on that PR instead of
57+
creating a duplicate. Comment on the existing PR or the issue linking to it.
58+
59+
### Before committing code changes
60+
61+
Always run `cargo fmt` before committing Rust code changes. Ideally run the full
62+
lint and test suite:
63+
64+
```bash
65+
cargo fmt
66+
cargo run -- hook pre-merge --yes # full tests + lints
67+
```
68+
69+
At minimum, `cargo fmt` prevents formatting-only CI failures that waste a round
70+
trip (push, wait for CI, fix formatting, push again, wait again).
71+
4372
## Fork PRs
4473

4574
Before pushing commits to a PR branch, check whether it's a fork PR:

0 commit comments

Comments
 (0)