GitHub starts a run from the events in this block.
2
Agent
GitHub Agentic Workflows (gh-aw), using the the engine in this block engine. You compile this file; gh-aw does not run the markdown as-is.
3
What it does
Comment /pr-fix on a pull request and the agent looks at the failing checks, finds the root cause, and pushes a fix to the PR branch.
4
What you get
This listing does not state a pull request or a comment. Read the prompt, and treat the result as not executed.
Setup
Where to paste this
Create .github/workflows/agentics-pr-fix.md (markdown, not a .yml file).
Paste the source below into that file, then run gh aw compile. Actions runs the compiled file at .github/workflows/agentics-pr-fix.lock.yml.
This file does not name a repository secret. If the engine needs a credential, the name is not written here. Check that engine’s docs before you add one.
Let your agent do it
Copy a prompt for Claude Code, Codex, or Cursor.
Paste it into your coding agent in this repo. It does the setup and asks before anything leaves your machine.
Runs the same job in your agent session, on the plan you are signed in with. No API key, no Action.
Do the job of the "PR Fix: /pr-fix command makes the agent fix a failing PR" workflow from AgentFlows (https://agentflows.sh/flows/agentics-pr-fix) right here, in this session, using the plan I'm signed in with. No API key and no GitHub Action.
Install these agent skills first. Download each SKILL.md from its source (respect its license) into .claude/skills/<name>/SKILL.md, or wherever this agent loads skills from:
- Debug: https://github.com/anthropics/knowledge-work-plugins/blob/main/engineering/skills/debug/SKILL.md (Apache-2.0), notes at https://agentflows.sh/skills/debug
- Iterate on a PR until CI passes and review feedback is addressed: https://github.com/getsentry/skills/tree/main/skills/iterate-pr (Apache-2.0), notes at https://agentflows.sh/skills/getsentry-iterate-pr
What it does: Comment /pr-fix on a pull request and the agent looks at the failing checks, finds the root cause, and pushes a fix to the PR branch.
The workflow normally runs on: slash_command: /pr-fix comment. Instead, ask me which pull request, issue, or branch to work on, then follow these instructions:
```text
# PR Fix
You are an AI assistant specialized in fixing pull requests with failing CI checks. Your job is to analyze the failure logs, identify the root cause of the failure, and push a fix to the pull request branch for pull request #${{ github.event.issue.number }} in the repository ${{ github.repository }}.
1. Read the pull request and the comments
2. Take heed of these instructions: "${{ steps.sanitized.outputs.text }}"
- (If there are no particular instructions there, your instructions are to fix the PR based on CI failures. You will need to analyze the failure logs from any failing workflow run associated with the pull request. Identify the specific error messages and any relevant context that can help diagnose the issue. Based on your analysis, determine the root cause of the failure. This may involve researching error messages, looking up documentation, or consulting online resources.)
3. Check out the branch for pull request #${{ github.event.issue.number }} and set up the development environment as needed.
4. Formulate a plan to follow the instructions. This may involve modifying code, updating dependencies, changing configuration files, or other actions.
5. Implement the changes needed to follow the instructions.
6. Run any necessary tests or checks to verify that your fix follows the instructions and does not introduce new problems.
7. Run any code formatters or linters used in the repo to ensure your changes adhere to the project's coding standards and fix any new issues they identify.
8. If you're confident you've made progress, push the changes to the pull request branch.
9. Add a comment to the pull request summarizing the changes you made and the reason for the fix.
```
Use the gh CLI for anything on GitHub, and show me what you plan to post or change before you do it.
The file
Workflow YAML
Copy the file as-is. The notes beside each block explain it.
.github/workflows/agentics-pr-fix.md
File
gh-aw source. Paste it as markdown, then compile. It is not a finished Actions YAML file.
1---2description:|3 This workflow makes fixes to pull requests on-demand by the '/pr-fix' command.4 Analyzes failing CI checks, identifies root causes from error logs, implements fixes,5 runs tests and formatters, and pushes corrections to the PR branch. Provides detailed6 comments explaining changes made. Helps rapidly resolve PR blockers and keep7 development flowing.8
Trigger
GitHub starts a run from the events in this block.
This token may network: defaults, tools: web-fetch:, and bash: true. Anything not listed is not granted.
15permissions:read-all1617network:defaults1819tools:20web-fetch:21bash:true22github:23min-integrity:none# This workflow is allowed to examine any PR because it's invoked by a repo maintainer24
What you get
What the agent is allowed to write back: push-to-pull-request-branch, create-issue, add-comment. gh-aw blocks other writes.
25safe-outputs:26push-to-pull-request-branch:27create-issue:28title-prefix:"[pr-fix] "29labels:[automation,pr-fix]30add-comment:3132timeout-minutes:203334---3536# PR Fix3738YouareanAIassistantspecializedinfixingpullrequestswithfailingCIchecks.Yourjobistoanalyzethefailurelogs,identifytherootcauseofthefailure,andpushafixtothepullrequestbranchforpullrequest#${{ github.event.issue.number }} in the repository ${{ github.repository }}.39401.Readthepullrequestandthecomments41422. Take heed of these instructions:"${{ steps.sanitized.outputs.text }}"4344- (Iftherearenoparticularinstructionsthere,yourinstructionsaretofixthePRbasedonCIfailures.Youwillneedtoanalyzethefailurelogsfromanyfailingworkflowrunassociatedwiththepullrequest.Identifythespecificerrormessagesandanyrelevantcontextthatcanhelpdiagnosetheissue.Basedonyouranalysis,determinetherootcauseofthefailure.Thismayinvolveresearchingerrormessages,lookingupdocumentation,orconsultingonlineresources.)45463.Checkoutthebranchforpullrequest#${{ github.event.issue.number }} and set up the development environment as needed.47484.Formulateaplantofollowtheinstructions.Thismayinvolvemodifyingcode,updatingdependencies,changingconfigurationfiles,orotheractions.49505.Implementthechangesneededtofollowtheinstructions.51526.Runanynecessarytestsorcheckstoverifythatyourfixfollowstheinstructionsanddoesnotintroducenewproblems.53547.Runanycodeformattersorlintersusedintherepotoensureyourchangesadheretotheproject's coding standards and fix any new issues they identify.55568.Ifyou're confident you'vemadeprogress,pushthechangestothepullrequestbranch.57589.Addacommenttothepullrequestsummarizingthechangesyoumadeandthereasonforthefix.