From codagent
Orchestrates the post-implementation loop: push PR, wait for CI, fix failures, and repeat until CI passes or termination rules trigger a pause.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codagent:finalize-prThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Push the PR, wait for CI, fix any failures or review comments, and repeat until the PR is green — or pause when termination rules require human input.
Push the PR, wait for CI, fix any failures or review comments, and repeat until the PR is green — or pause when termination rules require human input.
Invoke codagent:push-pr to commit, push, and create or update the pull request.
If push-pr fails (e.g. no remote, auth error), report the error and stop.
Invoke codagent:wait-ci to poll CI status and gather review comments.
The wait-ci skill returns one of four statuses:
passed — CI green, no blocking reviews, no PR commentsfailed — CI failures or CHANGES_REQUESTED reviewscomments — CI green but PR comments need addressingpending — checks still running after timeoutOn passed: Workflow is complete. Report success with the PR URL. Stop.
On pending: Report which checks are still running. Use the appropriate tool for asking the user a question or requesting input to ask whether to wait longer or proceed.
On failed or comments: Record the failure signature (the set of failing CI check names, or comments-only if CI passed but comments exist), then proceed to Step 4.
Check termination rules before attempting a fix:
Max 3 fix cycles. If this would be the 4th fix attempt, pause immediately — show current CI status and use the appropriate tool for asking the user a question or requesting input to ask how to proceed. Do NOT attempt a 4th cycle.
Same failure persists after 2 fix attempts. If the failure signature from Step 3 matches the previous cycle's failure signature AND this is the 2nd consecutive attempt at the same failure, pause immediately — explain the persistent failure in detail and use the appropriate tool for asking the user a question or requesting input to ask for guidance. "Same failure" means the identical CI check name(s) appear as failing across two consecutive wait-ci results after fix attempts.
If neither termination rule applies:
codagent:fix-pr to address CI failures and/or review commentsMaintain a running count and history across cycles:
| Cycle | Failure signature | Action |
|---|---|---|
| 1 | ["lint", "test-unit"] | fix-pr → retry |
| 2 | ["test-unit"] | fix-pr → retry |
| 3 | ["test-unit"] | PAUSE (same failure persisted 2 attempts) |
Another example:
| Cycle | Failure signature | Action |
|---|---|---|
| 1 | ["lint"] | fix-pr → retry |
| 2 | ["test-e2e"] | fix-pr → retry |
| 3 | ["test-e2e"] | PAUSE (same failure persisted 2 attempts, AND max 3 cycles) |
push-pr, wait-ci, fix-pr) is independently invocable for ad-hoc usenpx claudepluginhub codagent-ai/agent-skills --plugin codagentIteratively commits fixes, pushes to GitHub PR, waits for CI completion, and resolves review comments until checks pass and no unresolved issues remain. Use to automate PRs to mergeable state.
Iterates on a PR until CI passes. Automatically fixes CI failures, addresses categorized review feedback, and pushes fixes until all checks are green.
Drives existing GitHub/GitLab PRs/MRs to merge: monitors CI/CD status, fixes issues in PR scope via sub-skills, handles multi-round code reviews, resolves comments until all requirements met.