agentleFS
GiggleLiuGiggleLiu/cryochamber/.claude/skills/fix-pr/SKILL.md

fix-pr

Skill34 starsChanged 7 months agoMITView on GitHub

Use when a PR has review comments to address, CI failures to fix, or codecov coverage gaps to resolve

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 9 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Clippy: Run make clippy locally, fix warnings

    line 71
  2. Very specific:

    Test: Run make test locally, fix failures

    line 72
  3. Very specific:

    Build: Run make build locally, fix errors

    line 73
  4. Distinctive:

    Read the comment and the code it references

    line 80
  5. Distinctive:

    If valid: make the fix, commit

    line 82
  6. Distinctive:

    If debatable: fix it anyway unless technically wrong

    line 83
  7. Distinctive:

    If wrong: prepare a response explaining why

    line 84
  8. Very specific:

    IMPORTANT: Do NOT run cargo-llvm-cov locally: Use the gh api to read the codecov report instead.

    line 97
  9. Distinctive:

    Read the uncovered file and identify the untested code paths

    line 119
  10. Distinctive:

    Write tests targeting those specific paths (error branches, edge cases, etc.)

    line 120
  11. Very specific:

    Run make test to verify tests pass

    line 121
  12. Distinctive:

    Commit the new tests

    line 122
  13. Distinctive:

    After pushing, CI will re-run coverage.

    line 126
  14. Distinctive:

    Commit with a descriptive message referencing the PR:

    line 137
  15. Very specific:

    Run /review-implementation first to catch issues before push.

    line 156
  16. Very specific:

    After creating a PR and running make copilot-review, use /fix-pr to address the resulting feedback.

    line 160

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Fix PR

Resolve PR review comments, fix CI failures, and address codecov coverage gaps for the current branch's PR.

Step 1: Gather PR State

IMPORTANT: Never use gh api --jq. It double-escapes through the shell and breaks in zsh (backslashes in \(...) and != get mangled). Always pipe to jq instead.

# Get PR number
PR=$(gh pr view --json number --jq .number)

# Get PR head SHA (on remote)
HEAD_SHA=$(gh api repos/{owner}/{repo}/pulls/$PR | jq -r '.head.sha')

1a. Fetch Review Comments

Three sources of feedback to check:

# Copilot and user inline review comments (on code lines)
gh api repos/{owner}/{repo}/pulls/$PR/comments \
  | jq -r '.[] | "[\(.user.login)] \(.path):\(.line // .original_line) — \(.body)"'

# Review-level comments (top-level review body)
gh api repos/{owner}/{repo}/pulls/$PR/reviews \
  | jq -r 'map(select(.body | length > 0)) | .[] | "[\(.user.login)] \(.state): \(.body)"'

# Issue-level comments (general discussion, exclude bots)
gh api repos/{owner}/{repo}/issues/$PR/comments \
  | jq -r 'map(select(.user.login | test("codecov|copilot") | not)) | .[] | "[\(.user.login)] \(.body)"'

1b. Check CI Status

# All check runs on the PR head
gh api repos/{owner}/{repo}/commits/$HEAD_SHA/check-runs \
  | jq -r '.check_runs[] | "\(.name): \(.conclusion // .status)"'

1c. Check Codecov Report

# Codecov bot comment with coverage diff
gh api repos/{owner}/{repo}/issues/$PR/comments \
  | jq -r '.[] | select(.user.login == "codecov[bot]") | .body'

Step 2: Triage and Prioritize

Categorize all findings:

PriorityTypeAction
1CI failures (test/clippy/build)Fix immediately -- blocks merge
2User review commentsAddress each one -- respond on PR
3Copilot review commentsEvaluate validity, fix if correct
4Codecov coverage gapsAdd tests for uncovered lines

Step 3: Fix CI Failures

For each failing check:

  1. Clippy: Run make clippy locally, fix warnings
  2. Test: Run make test locally, fix failures
  3. Build: Run make build locally, fix errors
  4. Coverage: See Step 5 (codecov-specific flow)

Step 4: Address Review Comments

For each review comment:

  1. Read the comment and the code it references
  2. Evaluate if the suggestion is correct
  3. If valid: make the fix, commit
  4. If debatable: fix it anyway unless technically wrong
  5. If wrong: prepare a response explaining why

Do NOT respond on the PR -- just fix and commit. The user will push and respond.

Handling Copilot Suggestions

Copilot suggestions with suggestion blocks contain exact code. Evaluate each:

  • Correct: Apply the suggestion
  • Partially correct: Apply the spirit, adjust details
  • Wrong: Skip, note why in commit message

Step 5: Fix Codecov Coverage Gaps

IMPORTANT: Do NOT run cargo-llvm-cov locally. Use the gh api to read the codecov report instead.

5a. Identify Uncovered Lines

From the codecov bot comment (fetched in Step 1c), extract:

  • Files with missing coverage
  • Patch coverage percentage
  • Specific uncovered lines (linked in the report)

For detailed line-by-line coverage, use the Codecov API:

# Get file-level coverage for the PR
gh api repos/{owner}/{repo}/issues/$PR/comments \
  | jq -r '.[] | select(.user.login == "codecov[bot]") | .body' \
  | grep -oP 'filepath=\K[^&]+'

Then read the source files and identify which new/changed lines lack test coverage.

5b. Add Tests for Uncovered Lines

  1. Read the uncovered file and identify the untested code paths
  2. Write tests targeting those specific paths (error branches, edge cases, etc.)
  3. Run make test to verify tests pass
  4. Commit the new tests

5c. Verify Coverage Improvement

After pushing, CI will re-run coverage. Check the updated codecov comment on the PR.

Step 6: Commit and Report

After all fixes:

# Verify everything passes locally
make check  # fmt + clippy + test

Commit with a descriptive message referencing the PR:

git commit -m "fix: address PR #$PR review comments

- [summary of fixes applied]
"

Report to user:

  • List of review comments addressed (with what was done)
  • CI fixes applied
  • Coverage gaps filled
  • Any comments left unresolved (with reasoning)

Integration

With review-implementation

Run /review-implementation first to catch issues before push. Then /fix-pr after push to address CI and reviewer feedback.

With executing-plans / finishing-a-development-branch

After creating a PR and running make copilot-review, use /fix-pr to address the resulting feedback.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.