create-pr

A pull-request creation command that reads the current branch and linked GitHub Issue, checks the changes, and generates a pull request title and description. A pull request is a request to review and merge changes into a shared codebase.

In plain words
What is it for?
Use it to create a normal or draft pull request, automatically detect an issue from a feature or fix branch, and run linting, type checks, tests, and a build first.
Why use it?
It catches uncommitted changes or failed checks before opening the review request and reduces the need to write its summary manually.

Command for Claude Code

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 commands/kewton/commandmate/create-pr
Clone the repo
git clone --depth 1 https://github.com/Kewton/CommandMate

Made for: Claude Code.

Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,272 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00013 $0.02272
Opus 5 $0.00006 $0.01136
Sonnet 5 $0.00003 $0.00454
Haiku 4.5 $0.00001 $0.00227

Measured yesterday against content hash 1d7855ec68b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

create-pr scanned grade A with 1 finding 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sS "http://127.0.0.1:${CM_PORT:-3000}/api/worktrees/<worktree-id>/opencode/session" | jq -r '.instances[].sessionId'
.claude/commands/create-pr.md · 291 lines

How it starts

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

PR作成スキル

概要

Pull Request作成を自動実行するスキルです。Issue情報から自動でタイトル・説明を生成し、高品質なPRを作成します。

使用方法

  • /create-pr(Issue番号は自動検出)
  • /create-pr [Issue番号](明示的に指定)
  • /create-pr --draft(Draft PRとして作成)

実行内容

あなたはPR作成の専門家として、高品質なPull Requestを自動生成します。


実行フェーズ

Phase 1: ブランチとIssue情報の取得

1-1. 現在のブランチ確認
git branch --show-current

期待されるブランチ名: feature/{issue_number}-xxx または fix/{issue_number}-xxx

1-2. Issue番号の検出

パラメータでissue_numberが指定されていない場合、ブランチ名から抽出:

  • feature/145-add-dark-mode → Issue #145
  • fix/127-fix-login-error → Issue #127
1-3. Issue情報取得
gh issue view {issue_number} --json title,body,labels,assignees

Phase 2: PR作成前の最終チェック

2-1. 未コミットの変更確認
git status --porcelain

未コミットの変更がある場合はエラー。

2-2. 全チェック実行
npm run lint && npx tsc --noEmit && npm run test:unit && npm run build

重要: このチェックが失敗した場合はPR作成を中止。


Phase 3: PRタイトルの生成

3-1. ラベルからプレフィックス判定
Issue Label PR Prefix
feature feat
bug, bugfix fix
hotfix hotfix
refactor refactor
docs docs
test test
chore chore
3-2. タイトル生成

形式: [prefix]: [簡潔な説明]

:

  • feat: add dark mode toggle
  • fix: resolve login error on mobile

ルール:

  • 50文字以内
  • 命令形("Add" not "Added")

Phase 4: PR説明の生成

以下の構成でMarkdownを生成:

## Summary

[Issueの概要を1-2文で簡潔に記述]

Closes #{issue_number}

## Changes

### Added
- [追加した機能1]
- [追加した機能2]

### Changed
- [変更した既存機能1]

### Fixed (該当する場合)
- [修正したバグ1]

## Test Results

### Unit Tests

npm run test:unit Tests: X passed


### Lint & Type Check

- ESLint: 0 errors
- TypeScript: 0 errors

### Build

npm run build Build successful


## Checklist

- [x] Unit tests pass
- [x] Lint check passes
- [x] Type check passes
- [x] Build succeeds
- [x] No console.log in production code

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

Read the full file on GitHub · 291 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. yesterday First seen · 291 lines · 13 tokens per session scan A 1d7855ec68b3

Subscribe to this mod's changes

create-pr is a command published in the GitHub repository Kewton/CommandMate (39 stars, last pushed yesterday), licensed MIT. It adds 13 tokens to every session and 2,272 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.