ce:pr

ce:pr is a skill for Claude Code, Codex from Jerrylalala/compound-engineering. It costs 17 tokens per session (1,263 once invoked), scanned A, original, MIT.

A command that creates a GitHub Pull Request (PR), which asks to merge changes from one branch into another, and can optionally merge it into the main branch.

In plain words
What is it for?
Use it after completing or reviewing work to create a PR, optionally mark it as a draft, and choose whether to merge it.
Why use it?
It collects the branch and change information needed for a PR and checks common problems, such as being on the main branch or having uncommitted files.

Skill for Claude CodeCodex

Part of the compound-engineering plugin — 78 skills, 4 commands, 2 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jerrylalala/compound-engineering/ce-pr
Any agent
npx skills add Jerrylalala/compound-engineering --skill ce-pr
Clone the repo
git clone --depth 1 https://github.com/Jerrylalala/compound-engineering

Made for: Claude Code, Codex.

Or install compound-engineering, the plugin that ships this one along with the rest of its 78 skills, 4 commands, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ce:pr

README.md
[![agentmods](https://agentmods.dev/badge/skills/jerrylalala/compound-engineering/ce-pr.svg)](https://agentmods.dev/skills/jerrylalala/compound-engineering/ce-pr)
Your own site
<a href="https://agentmods.dev/skills/jerrylalala/compound-engineering/ce-pr"><img src="https://agentmods.dev/badge/skills/jerrylalala/compound-engineering/ce-pr.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,263 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00017 $0.01263
Opus 5 $0.00009 $0.00632
Sonnet 5 $0.00003 $0.00253
Haiku 4.5 $0.00002 $0.00126

Measured 5d ago against content hash b49a769b3c48, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ce:pr scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/compound-engineering/skills/ce-pr/SKILL.md · 164 lines

How it starts

The opening of the file, as written. The whole thing — 164 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PR Creation & Merge Command

创建 Pull Request 并可选合并到主分支。可在 /ce:work/ce:review 完成后自动触发,也可独立使用。

参数解析

开始时解析用户参数:

  • --draft:创建 draft PR
  • --no-merge:创建或定位 PR 后直接结束,不进入合并询问

移除已识别参数后,其余内容可作为 PR 标题/描述的额外上下文。

Phase 1: Pre-flight Checks

Step 1: 检测当前分支

current_branch=$(git branch --show-current)

如果 current_branch 为空(detached HEAD): → 提示用户:"当前处于 detached HEAD 状态,请先切换到功能分支。" → 终止流程

Step 2: 检测主分支

git symbolic-ref refs/remotes/origin/HEAD

如果输出形如 refs/remotes/origin/main,去掉 refs/remotes/origin/ 前缀作为 default_branch

如果命令失败或输出为空,执行:

git rev-parse --verify origin/main

如果命令成功,使用 main 作为 default_branch;如果失败,使用 master

Step 3: 分支安全检查

如果 current_branch == default_branch:
  → 提示:"当前在主分支 ($default_branch) 上,无法创建 PR。请先切换到功能分支。"
  → 终止流程

Step 4: 检查未提交的更改

git status --porcelain

如果有未提交的更改: → 使用 AskUserQuestion tool 询问:

Question: "检测到未提交的更改。如何处理?"

Options:

  1. 自动提交所有更改 - 使用自动生成的 commit message 提交
  2. 仅创建 PR(忽略未提交更改) - 只将已提交的内容纳入 PR
  3. 取消 - 先手动处理更改再创建 PR

Based on selection:

  • 自动提交 → 读取 git status --porcelain,按相关变更列出具体文件,使用 git add <file...> 暂存确认后的文件,再执行 git commit -m "feat: [auto-generated message]"
  • 忽略 → 继续流程
  • 取消 → 终止流程

Step 5: 检查是否已有 PR

existing_pr=$(gh pr list --head "$current_branch" --json number,url --jq '.[0]')

如果已有 PR: → 如果 --no-merge 参数存在,显示已有 PR URL 后结束流程。 → 否则使用 AskUserQuestion tool 询问:

Question: "当前分支已有 PR: $existing_pr_url。如何处理?"

Options:

  1. 查看已有 PR - 在浏览器中打开
  2. 跳到合并步骤 - 直接询问是否合并已有 PR
  3. 取消 - 终止流程

Based on selection:

  • 查看gh pr view --web
  • 合并 → 跳转到 Phase 3
  • 取消 → 终止流程

Phase 2: Create PR

Step 1: 检查远端分支

git ls-remote --exit-code origin "$current_branch"

如果命令失败,执行:

git push -u origin "$current_branch"

如果命令成功,执行:

git push

Step 2: 生成 PR 标题

pr_title=$(echo "$current_branch" | sed 's|/|: |; s|-| |g')
commit_title=$(git log "$default_branch".."$current_branch" --format="%s" --reverse | head -1)

Read the full file on GitHub · 164 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 164 lines · 17 tokens per session scan A b49a769b3c48

Subscribe to this mod's changes

ce:pr is a skill published in the GitHub repository Jerrylalala/compound-engineering (5 stars, last pushed 3mo ago), licensed MIT. It adds 17 tokens to every session and 1,263 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.