--pr: The PR number or URL (e.g., 123 or https://github.com/owner/repo/pull/123).
--test: The command to run tests (e.g., npm test, pytest).
--retries: (Optional) Number of times to attempt fixing the code if tests fail. Default: 3.
Requirements
gh CLI installed and authenticated.
Node.js environment.
Logic
Checks out the PR using gh pr checkout.
Runs the specified test command.
If tests fail:
Reads the output.
Attempts a fix (Currently a placeholder/mock fix logic).
Commits and pushes the fix.
Retries the test command.
If tests pass:
Merges the PR using gh pr merge --merge --auto.
1---2name: auto-pr-merger3description: Auto PR Merger Skill4---5# Auto PR Merger Skill67This skill automates the workflow of checking out a GitHub PR, running tests, attempting to fix failures, and merging if successful.89## Usage1011```bash12node skills/auto-pr-merger/index.js --pr <PR_NUMBER_OR_URL> --test "<TEST_COMMAND>" [--retries <NUMBER>]13```1415## Arguments1617- `--pr`: The PR number or URL (e.g., `123` or `https://github.com/owner/repo/pull/123`).18- `--test`: The command to run tests (e.g., `npm test`, `pytest`).19- `--retries`: (Optional) Number of times to attempt fixing the code if tests fail. Default: 3.2021## Requirements2223- `gh` CLI installed and authenticated.24- Node.js environment.2526## Logic27281. Checks out the PR using `gh pr checkout`.292. Runs the specified test command.303. If tests fail:31 * Reads the output.32 * Attempts a fix (Currently a placeholder/mock fix logic).33 * Commits and pushes the fix.34 * Retries the test command.354. If tests pass:36 * Merges the PR using `gh pr merge --merge --auto`.
Run npx skillmds@latest add demerzels-lab/auto-pr-merger in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Auto PR Merger Skill It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Demerzels-lab (@demerzels-lab) published this skill. Their other Agent Skills are listed on their SkillMD profile.