pr-fixer
Skill131 starsChanged 6 months agoMITView on GitHub
Trigger the Amber Handler to automatically fix a pull request (rebase, address review comments, run lints/tests, push fixes). Posts @ambient-code on the PR to trigger the fix prompt. Use when user types /pr-fixer <number>, says "fix PR", "run pr-fixer", "address PR comments", or "auto-fix pull request".
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- alignSkill
- amber-reviewSkill
- workflowSkill
- ambient-pr-testSkill
- ambientSkill
- dev-clusterSkill
- deploySkill
- devflowSkill
- discoverSkill
- cypress-demoSkill
- frontend-developmentSkill
- grpc-devSkill
- unleash-flagSkill
- memorySkill
- scaffoldSkill
- ambient-api-serverSkill
- specSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Check the PR exists and its state:
- Distinctive: line 32
If the exit code is non-zero: abort with "PR #N not found in <owner/repo>."
- Very specific: line 33
If state is CLOSED or MERGED: abort with "PR #N is already <state>.
- Very specific: line 34
Only proceed if state is exactly OPEN.
- Very specific: line 35
If PR is from a fork (isCrossRepository: true), warn: "PR #N is from a fork.
- Distinctive: line 43
Wait a few seconds for the run to register
- Distinctive: line 61
If 30 minutes elapse without completion, notify: "PR Fixer timed out after 30 minutes.
- Distinctive: line 62
When the run reaches a terminal state, notify with:
- Very specific: line 63
Run conclusion (success/failure/cancelled)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR Fixer Skill
Triggers the Amber Handler (amber-issue-handler.yml) to automatically fix a pull request. Posting @ambient-code on a PR triggers the fix prompt, which creates an ACP session that rebases the PR, evaluates reviewer comments (fixes valid issues, responds to invalid ones), runs lints and tests, and pushes the fixes.
Usage
/pr-fixer <pr-number>
The PR number is required. Example: /pr-fixer 1234
What It Does
- Validate prerequisites
- Confirm
ghCLI is authenticated (gh auth status) - Detect the repo from the local git remote (
gh repo view --json nameWithOwner --jq .nameWithOwner)
- Confirm
- Pre-flight PR check
- Check the PR exists and its state:
gh pr view <N> --repo <owner/repo> --json state,isCrossRepository --jq '{state, isCrossRepository}' gh pr viewreturns state in uppercase:OPEN,CLOSED, orMERGED. A non-zero exit code (with stderr error) means the PR does not exist.- If the exit code is non-zero: abort with "PR #N not found in <owner/repo>."
- If state is
CLOSEDorMERGED: abort with "PR #N is already<state>. Nothing to fix." (use the actual uppercase value returned) - Only proceed if state is exactly
OPEN. - If PR is from a fork (
isCrossRepository: true), warn: "PR #N is from a fork. The Amber Handler skips fork PRs. Push the branch to the org repo and re-open the PR, or fix locally."
- Check the PR exists and its state:
- Trigger the fix
gh pr comment <N> --repo <owner/repo> --body "@ambient-code" - Locate the triggered run
- Wait a few seconds for the run to register
- Find it via:
gh run list --workflow=amber-issue-handler.yml --repo <owner/repo> --limit 5 --json databaseId,status,createdAt,event - Match the most recent
issue_comment-triggered run created after the comment
- Print the run URL immediately so the user has it:
PR Fixer dispatched for PR #<N> Run: https://github.com/<owner/repo>/actions/runs/<run-id> PR: https://github.com/<owner/repo>/pull/<N> Monitoring in background — you'll be notified when it completes. - Spawn a background agent to monitor the run (30-minute timeout):
- Poll
gh run view <run-id> --repo <owner/repo> --json status,conclusionevery 30 seconds - If 30 minutes elapse without completion, notify: "PR Fixer timed out after 30 minutes. Check the run manually."
- When the run reaches a terminal state, notify with:
- Run conclusion (success/failure/cancelled)
- Session name and phase (parse from
gh run view <run-id> --repo <owner/repo> --json jobs— look for the "Session summary" step output) - Whether commits were pushed (check
gh pr view <N> --repo <owner/repo> --json commitscount before and after) - Links to the GHA run and the PR
- Poll
Error Handling
- No PR number provided: Print usage:
/pr-fixer <pr-number> ghnot authenticated: "Error: GitHub CLI is not authenticated. Rungh auth loginfirst."- Fork PR detected: "Warning: PR #N is from a fork. The Amber Handler skips fork PRs. Push the branch to the org repo and re-open the PR, or fix locally."
- Run not found after dispatch: "Warning: Could not locate the triggered run. Check manually: https://github.com/<owner/repo>/actions/workflows/amber-issue-handler.yml"
- All session steps skipped: The Amber Handler's fix steps have conditions (non-fork, correct prompt type). If steps are skipped, check the run logs for why.
When to Invoke This Skill
Invoke when users say things like:
- "/pr-fixer 1234"
- "Fix PR 1234"
- "Run the PR fixer on 1234"
- "Trigger pr-fixer for PR #1234"
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
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.

