Agent skill

Codex Merge PR

by tbhb in tbhb/vale-ai-tells

Squash merge a pull request. An agent skill from tbhb/vale-ai-tells.

MITAuto-check passedDevelopment

Install Codex Merge PR

skills CLI
$ npx skills add tbhb/vale-ai-tells --skill codex-merge-pr -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tbhb/vale-ai-tells codex-merge-pr --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tbhb/vale-ai-tells.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/codex-merge-pr .claude/skills/codex-merge-pr && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codex-merge-pr
GitHub stars
116
Token cost
~3k tokens
SKILL.md length
1,699 words
Files
7 (incl. scripts)
Skills in repo
27
Repo updated
First seen
Licence
MIT

At a glance

Squash merge a pull request. An agent skill from tbhb/vale-ai-tells.

  • Works in 8 steps: open the task list → confirm the pull request is mergeable → settle the description first → …
  • Land a pull request
  • SKILL.md covers Preflight, Step 0: open the task list, Step 1: confirm the pull… and Step 2: settle the description…, plus 6 more sections
  • Runs Shell scripts from its folder; calls bash, mise and gh

What it does

Codex Merge PR is an agent skill from tbhb/vale-ai-tells. Squash merge a pull request. The commit message comes from this workflow rather than from GitHub, whose own version concatenates every commit on the branch into text no linter ever reads. A briefing script prints the published description, every commit the squash collapses, and the diffstat, then leaves a SQUASHAGENTMSG skeleton whose body the caller writes. Review, the commit-msg gates, and an operator confirmation all run before the merge. Use this whenever the user asks to merge or land a pull request…

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts (for example `scripts/populate-description.sh`, `scripts/preflight.sh` and `scripts/squash-merge.sh`).

It sits in Development, covering Pull requests, Linting and formatting and Commit messages. It works with GitHub. The repository describes itself as: In today's rapidly evolving landscape, vale-ai-tells is a comprehensive, cutting-edge Vale style package that empowers writers to seamlessly delve into the rich tapestry of AI…. The licence is MIT.

When your agent uses it

  • Land a pull request
  • Including one nobody here authored such as a dependency bump

Example prompts

  • “/codex-merge-pr”

Requirements

  • A Bash shell

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. open the task list
  2. confirm the pull request is mergeable
  3. settle the description first
  4. write the squash message
  5. review the message
  6. run the commit-msg gates
  7. confirm with the operator
  8. merge and clean up

What it can do on your machine

Read from SKILL.md and the folder at commit 4c7abc9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 5 files in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • bash
    • mise
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codex Merge PR loads about 3k tokens when it runs. Until then it costs about 147 tokens; SKILL.md has 1,699 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~147
When it runs · the whole SKILL.md, loaded when a task matches
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from tbhb/vale-ai-tells at commit 4c7abc9, republished under its MIT licence (© tbhb). 1,699 words, ~2,974 tokens.

Download SKILL.mdSave it as .claude/skills/codex-merge-pr/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
codex-merge-pr
description
Squash merge a pull request. The commit message comes from this workflow rather than from GitHub, whose own version concatenates every commit on the branch into text no linter ever reads. A briefing script prints the published description, every commit the squash collapses, and the diffstat, then leaves a SQUASH_AGENTMSG skeleton whose body the caller writes. Review, the commit-msg gates, and an operator confirmation all run before the merge. Use this whenever the user asks to merge or land a pull request, including one nobody here authored such as a dependency bump.

Merge a pull request

Work the steps in order. Codex doesn't provide skill-scoped command hooks, so the scripts enforce the terminal invariants while these instructions keep every mutating command on the sanctioned path. Never run gh pr merge directly.

Left alone, GitHub writes the squash message by concatenating every commit on the branch. That text has never passed a commit-msg hook, and it arrives on the default branch where the rest of the toolchain assumes those hooks ran. Nothing lints it afterwards. This workflow writes the message itself and puts it through what a commit answers to.

Preflight

Run bash .agents/skills/codex-merge-pr/scripts/preflight.sh [number], passing the pull request number when the request names one.

Step 0: open the task list

Create these with update_plan, keeping exactly one item in_progress at a time.

  1. Confirm the pull request is mergeable
  2. Settle the published description
  3. Write the squash message in SQUASH_AGENTMSG
  4. Review the message with codex-review-squash-message
  5. Run the commit-msg gates
  6. Confirm the message with the operator
  7. Merge and clean up

Stop before any of it where preflight reports a missing precondition, a draft pull request, or a failing check. Say what's wrong and hand back.

Step 1: confirm the pull request is mergeable

Preflight printed the state, the check rollup, and the review decision. Merging needs an open pull request that nobody marked as a draft, with every check green.

A failing check goes to codex-fix-pr, and a running one goes to codex-watch-pr. Neither belongs here, and the merge script refuses both anyway.

A mergeStateStatus of BEHIND or DIRTY is the third case. The branch needs the base underneath it before anything merges, so run the codex-rebase skill and push the result. Don't reach for GitHub's own update button: it merges the base into the branch, which leaves a merge commit this workflow never wrote a message for.

Where the repository requires a review decision, respect it. CHANGES_REQUESTED means the merge waits, whatever the checks say.

Step 2: settle the description first

The description is on GitHub at this point, and often nothing sits on disk. Fetch it back before revising it:

text
bash .agents/skills/codex-merge-pr/scripts/populate-description.sh <number>

That rebuilds PR_AGENTDESC.md from what the pull request currently says, reassembling the frontmatter from the properties set on the pull request. It refuses to overwrite an existing draft without --force, because a pr workflow further up the stack may have one in flight.

Merging is the last moment the description can change, and the squash message gets written from it, so a wrong description propagates that error into history.

Read what preflight printed under == description as published == against the commits it collapses. Where it no longer describes the branch, delegate codex-write-pr-description and then codex-review-pr-description in fresh agents, following the codex-pr review loop, then republish with bash .agents/skills/codex-pr/scripts/create-pr.sh.

Most merges skip this. A description that still fits doesn't need a pass, and a pull request nobody here authored has none of this machinery behind it, so take its description as it stands.

Step 3: write the squash message

text
bash .agents/skills/codex-merge-pr/scripts/squash-message.sh <number>

That prints a briefing and writes a skeleton. Nothing in it converts the description into a message, because no rewriting rule produces one. The commit that merges here is the one a whole branch leaves behind, so writing it means reading everything that landed and deciding what a reader years from now still needs.

Your briefing carries the description as published, every commit message the squash collapses in full, the diffstat, and the trailers those commits carry. Read it before writing a word. Commit bodies matter most. Each one already argued for itself once, and this is the last place that argument survives. Run the command on its own and read the whole thing. Piping it through head or tail keeps the trailing skeleton and drops those bodies, which nothing else in this workflow prints, and the script caps nothing on purpose, so a cap you add is one nobody downstream can see you added.

SQUASH_AGENTMSG at the repository root holds the skeleton, which a gitignore entry keeps out of history. Subject and footer come filled in. The body stays empty until you write it.

Subject

The script sets <pull request title> (#<number>). Keep the reference, because squash-merge.sh reads it back to confirm the draft belongs to this pull request. Fix the rest where the title described one commit rather than the branch. A squash leaves one commit behind, so the subject names what the whole stack did.

Body

The description was Markdown, written for a reviewer with the diff open beside it. This is plain text, and whoever reads it three years from now has neither.

Take from the description:

  • Summary and Why, which carry the reason the branch exists
  • Risk, but only where it names a rollback the reader wouldn't guess

Leave behind:

  • Verification, entirely. It reported what a reviewer needed at the time, and the moment the suite changes it describes a run nobody can repeat.
  • Risk that only says the change could be wrong.

Then read the result back against the commits. The commits outrank it. Descriptions get published early while branches keep growing, so the commits record what landed rather than what someone expected to land. Where a commit body gives a reason the description never stated, that reason belongs in the message. Otherwise it goes at the merge, with the commit that held it.

Avoid:

  • Restating the diff. A reader who wants the what reads the diff.
  • Walking the stack. A branch of eight commits becomes one account rather than eight paragraphs.
  • Counting. No file, line, test, or commit counts.
  • Provenance filler. Nothing about requests, review rounds, sessions, prompts, models, or tools.
  • Markdown. No fenced blocks, headings, emphasis, links, or tables. Backticks around a literal identifier are fine.

Hard wrap the body at 72 characters and the trailers at 100.

The script fills this in. Closes lines come from the description's Related section, and the trailers come from the commits themselves, ordered with attribution first and sign-off last.

Check the closing references before going on. Related lists whatever the author put there, so a number that names a pull request or a document rather than an issue this branch closes comes out of the footer.

Show full SKILL.md (666 more words)Show less

Step 4: review the message

Spawn a delegated agent with fork_turns: "none". Tell it to use codex-review-squash-message, pass the absolute repository root, forbid edits, and require its exact verdict block as the final response. Wait for it to finish. This fresh thread hasn't watched you work and reads the message against every commit the squash collapses.

This step is mandatory, and the merge script enforces it. Save the delegated agent's exact final response in a temporary file, then run bash .agents/skills/codex-merge-pr/scripts/stamp-review.sh <absolute-repository-root> <verdict-file>. The script accepts only a clean verdict that names the exact PR head the reviewer read. It confirms that head is still current before signing it together with the exact draft bytes. A finding erases any earlier signature. Editing the draft or pushing another commit afterward voids it.

Fix everything it returns. Push back only where it's demonstrably wrong about the commits, and say why.

A finding names one instance rather than the fault itself. Fix the instance, then read the rest of the message for the same fault, because a reviewer that found one instance finds the next one on the next round.

Step 5: run the commit-msg gates

text
mise run lint-squash-msg

The same four hooks a commit answers to:

  • vale under the commit scope, which catches AI tells through ai-tells-commits
  • cspell with the commit dictionary
  • commitlint for the Conventional Commits shape
  • commit-trailers for trailer order

Resolve every finding. Edited the draft to clear them? Then step 4 runs again, because the gate compares bytes rather than intentions.

Step 6: confirm with the operator

Print this first, verbatim:

text
Merging: #<number> <title>
Into:    <base branch>
Commits: <count> collapsing into one

<the entire SQUASH_AGENTMSG contents, verbatim>

Preflight answered this under == pre-approval ==. Where it reported merge: GRANTED, the operator answered this question for this Codex thread in advance, through mise run preapprove merge. Print the preceding block so the message still reaches them, name the grant this merge goes under, and move to step 7.

The grant answers one question, merge under this message. Ask anyway where any of these holds:

  • the review returned a finding nobody acted on
  • the checks aren't green
  • this pull request isn't the one the session set out to merge, which covers a dependency bump nobody here authored unless the operator named it

Where preflight reported merge: not granted, Default mode has no structured question tool. End the turn after the preceding block and ask Squash merge with this message?, presenting these four options in order:

LabelDescription
Merge itThe subject line, verbatim
Revise the messageRedraft the message, review it again, and come back.
Wait on the checksHand this to watch-pr first, and merge once it reports green.
Stop hereLeave the pull request, the draft, and the branch untouched.

Don't merge in the same turn that asks. Resume only after an explicit answer. Follow it exactly. Revising sends you back through the delegated review because the gate compares bytes.

Step 7: merge and clean up

text
bash .agents/skills/codex-merge-pr/scripts/squash-merge.sh <number>

That script re-runs every gate before it touches anything. It checks that the message names this pull request, that the signature matches the bytes on disk and the current PR head, that the linters pass, and that the pull request is open, approved where required, mergeable, ready, and green. The merge itself names the reviewed head, so a commit pushed while the final checks run isn't part of the squash. Then it removes SQUASH_AGENTMSG and PR_AGENTDESC.md along with their signatures and deletes a merged branch only when it belongs to this repository. A fork branch remains untouched.

No post-merge hook exists to hang that cleanup on, so the script that watched the merge succeed does it.

Report the merged commit. Where this worktree stands on the branch that merged, the script says so rather than deleting the branch out from under the session. The operator decides whether to switch or drop the worktree.

Preconditions

  • gh installed and authenticated
  • a mise run lint-squash-msg task
  • a gitignore entry for SQUASH_AGENTMSG
  • the codex-review-squash-message skill deployed alongside this one

Preflight checks each. Where one is missing, tell the operator rather than improvising a substitute.

© tbhb, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts) in .claude/skills/codex-merge-pr of tbhb/vale-ai-tells.

  • SKILL.md
  • scripts/populate-description.sh
  • scripts/preflight.sh
  • scripts/squash-merge.sh
  • scripts/squash-message.sh
  • scripts/stamp-review.sh
  • tokens.json

Open the folder on GitHubat commit 4c7abc9

Compare with similar skills

Codex Merge PR next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codex Merge PR compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codex Merge PR this skilltbhb/vale-ai-tells116—~3kAutomated safety check: PassMIT
Create PRRLinf/RLinf5.5k—~2.2kAutomated safety check: PassApache-2.0
Development Workflowkid-sid/claude-spellbook190—~3.2kAutomated safety check: PassMIT
PR Finalize Reviewmicrosoft/garnet12k—~3.1kAutomated safety check: PassMIT
React Router Pull Request Creatorremix-run/react-router57k—~2.5kAutomated safety check: PassMIT
Verdaccio Pull Request Workflowverdaccio/verdaccio18k—~1.9kAutomated safety check: PassMIT

Similar skills

  • Create PR

    RLinf/RLinf

    Open a GitHub pull request for RLinf, or fix an existing one — checks the PR title against Conventional Commits, writes a precise description that follows .github/PULLREQUESTTEMPLATE.md, and lints…

    5.5k GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Development Workflow

    kid-sid/claude-spellbook

    A skill your agent uses when choosing a branching strategy, writing a commit message, opening or reviewing a pull request, setting up commit linting, or tagging a versioned release.

    190 GitHub stars~3.2k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • PR Finalize Review

    microsoft/garnet

    Official

    Checks that a pull request's title and description match its implementation and reviews the code for Garnet best practices, reporting findings without posting them.

    12k GitHub stars~3.1k tokensUpdated today
    DevelopmentAuto-check passed
  • React Router Pull Request Creator

    remix-run/react-router

    Packages finished React Router work into a draft pull request: branch, commit, push, a written PR body and the right GitHub labels.

    57k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Takes a change through a verdaccio pull request: branch, local checks, changeset, title and body, labels, CI and review rounds, and ports to other release lines.

    18k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Gh PR Metadata

    module-federation/core

    Update the current GitHub PR title and body for this repository so they match the repo's pull request template and conventional-commit title style.

    2.7k GitHub stars~1k tokensUpdated today
    DevelopmentAuto-check passed

More from tbhb/vale-ai-tells

All 27 skills in this repo
  • Analyze Session

    tbhb/vale-ai-tells

    Query a Claude Code transcript without reading it into context, then write the retrospective to disk so it remains available after the session ends.

    116 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Codex Analyze Session

    tbhb/vale-ai-tells

    Query a Codex transcript without reading it into context, then write the retrospective to disk so it remains available after the session ends.

    116 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Codex Fix PR

    tbhb/vale-ai-tells

    Diagnose failing pull request checks, reproduce them locally, make focused fixes, commit them through codex-commit, and refresh the published description when needed.

    116 GitHub stars~575 tokensUpdated today
    Auto-check passed
  • Codex PR

    tbhb/vale-ai-tells

    Open or update a pull request for the current branch with an independently drafted and reviewed PRAGENTDESC.md.

    116 GitHub stars~846 tokensUpdated today
    Auto-check passed
  • Codex Rebase

    tbhb/vale-ai-tells

    Replay the current branch onto its base and establish that the result is sound.

    116 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Settle the conflicts a merge-backend rebase left behind. An agent skill from tbhb/vale-ai-tells.

    116 GitHub stars~2.1k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Codex Merge PR

What does Codex Merge PR do?

Squash merge a pull request. An agent skill from tbhb/vale-ai-tells. Codex Merge PR is an agent skill from tbhb/vale-ai-tells. Squash merge a pull request.

When should I use Codex Merge PR?

Codex Merge PR fits situations like: land a pull request; including one nobody here authored such as a dependency bump.

How do I install Codex Merge PR in Claude Code?

Run `npx skills add tbhb/vale-ai-tells --skill codex-merge-pr -a claude-code`. Or copy the skill folder (.claude/skills/codex-merge-pr in tbhb/vale-ai-tells) into .claude/skills/codex-merge-pr in your project. Claude Code loads it when a task matches its description.

How do I install Codex Merge PR in Codex?

Run `npx skills add tbhb/vale-ai-tells --skill codex-merge-pr -a codex`. Or copy the skill folder (.claude/skills/codex-merge-pr in tbhb/vale-ai-tells) into .agents/skills/codex-merge-pr in your project. Codex loads it when a task matches its description.

Can I use Codex Merge PR in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tbhb/vale-ai-tells --skill codex-merge-pr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codex-merge-pr, .gemini/skills/codex-merge-pr, .github/skills/codex-merge-pr and .opencode/skills/codex-merge-pr in your project.

What does Codex Merge PR need to run?

Going by SKILL.md and its folder, Codex Merge PR needs a shell for the scripts in its folder and the command-line tools its instructions call (bash, mise and gh). Our summary lists: A Bash shell.

Does Codex Merge PR access the network?

SKILL.md contains no URLs. Its commands use gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Codex Merge PR safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Codex Merge PR use?

Codex Merge PR is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codex Merge PR use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codex Merge PR?

Skills that share tags, products or a category with Codex Merge PR: Create PR (RLinf/RLinf, 5.5k stars), Development Workflow (kid-sid/claude-spellbook, 190 stars), PR Finalize Review (microsoft/garnet, 12k stars) and React Router Pull Request Creator (remix-run/react-router, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codex Merge PR?

tbhb (a GitHub user) maintains it in tbhb/vale-ai-tells, which has 116 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on October 9, 2026.

Source: tbhb/vale-ai-tells on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.