create-pull-request

A command workflow for preparing the current code changes and opening a GitHub pull request, a request for others to review and merge a branch. It includes Nx version plans, checks, a commit, and a push to the remote repository.

In plain words
What is it for?
Use it to format, type-check, lint, create version-plan files, commit changes, push a branch, and create a pull request.
Why use it?
It gathers changes from both commits and the working folder, runs the required checks, and handles the repeated steps needed to send the work for review. It also creates a feature branch when starting from main.

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/phuctm97/modelfetch/create-pull-request
Clone the repo
git clone --depth 1 https://github.com/phuctm97/modelfetch

Made for: Claude Code.

Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,091 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.00024 $0.01091
Opus 5 $0.00012 $0.00545
Sonnet 5 $0.00005 $0.00218
Haiku 4.5 $0.00002 $0.00109

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

Security

Grade A, and why

create-pull-request 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 2d 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.

.claude/commands/create-pull-request.md · 73 lines

How it starts

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

Generate Nx version plans, run the pre-commit workflow, create a git commit with all changes, push to the remote repository, and create a pull request.

Execute the following steps in order:

  1. Check current branch: Run git branch --show-current to check the current branch

    • If on main branch, create a new feature branch:
      • Generate a branch name based on the changes (e.g., update-documentation, fix-type-errors, add-new-feature)
      • Create and switch to the new branch with git checkout -b <branch-name>
    • If on a feature branch, continue to the next step
  2. Generate version plans: Analyze all changes in the current branch (including committed, uncommitted, staged, and unstaged changes) compared to origin/main and generate one or more Nx version plan files as needed

    • Find the merge base: git merge-base HEAD origin/main
    • Get all commits in the branch: git log --oneline <merge-base>..HEAD
    • Get the full diff of all changes: git diff <merge-base>..HEAD
    • Also check for any uncommitted changes: git status and git diff
    • If there are no changes at all (neither in commits nor uncommitted), skip version plan generation
    • Check existing version plans in .nx/version-plans/ to ensure you're not creating duplicate or similar plans
    • Analyze the changes to determine if they should be grouped into one or multiple version plans:
      • Group related changes together (e.g., all changes for a single feature)
      • Create separate plans for unrelated changes (e.g., a bug fix and a new feature)
      • Consider the scope and impact of changes when deciding how to group them
    • For each version plan needed:
      • Determine the appropriate semantic version bump:
        • patch: Bug fixes, typo corrections, documentation changes, internal refactors that don't affect functionality
        • minor: New features, enhancements, non-breaking improvements
        • major: Breaking changes, API modifications, removal of features
      • Create a concise, single-line changelog entry
      • Generate a descriptive filename (using kebab-case)
    • Create the version plan file(s) in .nx/version-plans/ with format:
      ---
      __default__: version-type
      ---
      
      Single line changelog entry describing the changes
      
    • Important considerations:
      • Always use __default__ since this repository releases the same version for all projects
      • The changelog entry must be a single line without bullet points or multiple paragraphs
      • Create separate version plans for unrelated changes (don't combine a bug fix with a new feature)
      • Each filename should be descriptive, unique, and clearly indicate what changed
      • Avoid creating plans for changes that already have similar plans in the directory
  3. Format code: Run pnpm -w format to format all files

  4. Type check: Run pnpm exec nx run-many -t typecheck to check TypeScript types

  5. Lint and auto-fix issues: Run pnpm exec nx run-many -t lint --args=--fix to lint and auto-fix issues

  6. Stage all changes: Run git add -A to stage all changes (including any fixes from the above steps)

  7. Review changes: Run git status and git diff to review what will be committed

  8. Create commit: Generate an appropriate commit message based on the changes and create the commit

  9. Push to remote: Push the current branch to the remote repository with git push

  10. Create pull request: Create a GitHub pull request with gh pr create

For the commit message:

  • Keep it concise and descriptive
  • Focus on the "why" rather than the "what"
  • DO NOT use conventional commit prefixes (no "fix:", "feat:", "chore:", etc.)

If any of the formatting, type checking, or linting steps fail, attempt to fix the issues. After fixing the issues or making any changes manually, repeat the entire process from step 3 to ensure everything is in order before committing.

If the push fails (e.g., due to remote changes), report the errors to the user for resolution.

Read the full file on GitHub · 73 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. 2d ago First seen · 73 lines · 24 tokens per session scan A 7824031b34cd

Subscribe to this mod's changes

create-pull-request is a command published in the GitHub repository phuctm97/modelfetch (145 stars, last pushed 8mo ago), licensed MIT. It adds 24 tokens to every session and 1,091 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-30.