Skip to content
Development
Skill

/pr

Creates GitHub PR after pre-flight checks (lint/typecheck/tests), structured summary from commits. Triggers: pr, pull request, create PR, ready to merge.

From plugin
ai-toolkit
180117 skills44 agents

Claude Code

$ npx -y skills add softspark/ai-toolkit --skill pr --agent claude-code

SKILL.md

pr.SKILL.md
name: pr
description: "Creates GitHub PR after pre-flight checks (lint/typecheck/tests), structured summary from commits. Triggers: pr, pull request, create PR, ready to merge."
effort: medium
disable-model-invocation: true
argument-hint: "[title or branch]"
allowed-tools: Bash, Read, Grep

Pull Request

$ARGUMENTS

Create or update the task's GitHub pull request after project-specific checks. When called by `/autonomous-dev`, preserve its run ID, branch, PR identity, approval history and evidence. This skill publishes the PR; the calling process owns subsequent review, QA and required-CI completion.

Project context

  • Inspect the actual repository, branch and working tree. Resolve the base from

an existing PR first, then project configuration or the remote default branch. Do not assume a branch named `main` exists.

Usage

/pr [title]

Automated PR Summary Generation

Generate a structured PR summary from the commit history before writing the PR description:

python3 ${CLAUDE_SKILL_DIR}/scripts/pr-summary.py [base_branch]
# Pass the resolved PR base explicitly, for example develop.

The script outputs JSON with:

  • **base_sha**, **head_sha**: resolved commits used to summarize the changes
  • **title_suggestion**: auto-generated PR title from dominant commit type and scope
  • **commits[]**: each commit parsed into type, scope, description (conventional commits)
  • **groups**: commits grouped by type (Features, Bug Fixes, etc.)
  • **summary_bullets**: ready-to-use summary lines for the PR body
  • **has_breaking**: whether any BREAKING CHANGE markers were found
  • **breaking_changes[]**: list of breaking change descriptions
  • **files_changed**: total files in the diff
  • **test_files_changed**: count of test files modified
  • **has_tests**: whether the PR includes test changes

Use the output to populate the PR template fields below.

---

PR Creation Workflow

1. Pre-PR Checks

Read the project's instructions, CI configuration and package/Make scripts. For an autonomous run, use the commands frozen in its plan from `.ai-toolkit/autonomous.json`. Run the actual lint, typecheck, test and build commands applicable to that project; a Python command is not a universal gate. Inspect every result and preserve evidence of the tested commit. Missing runtime services or failed commands are blockers, never successful checks.

Verify that the authorized changes are committed, the intended base exists, and the diff contains only the task's work. Use the resolved base with a triple-dot diff for PR scope. Preserve unrelated dirty work and report it.

2. Create PR

Verify the repository and active account. Search for an existing PR from the exact head branch before creation, including after an interrupted publication. Update that PR when it represents this task. Never open a duplicate merely because a previous assistant message omitted its URL.

Use the repository's template and write the exact body with an editing tool to an absolute temporary file outside the checkout. Pass it through a structured connector argument or `gh --body-file`, preserving real newlines. For example, with actual repository/branch values and the prepared body file:

gh pr create --base develop --head feat/csv-export --title "feat: export filtered orders" --body-file /absolute/run/pr-body.md

For a behavior change, give the reviewer one comparison they can repeat. Name the fixture or action, what happened before, and what happened at the tested head. Use an observed result from a test, command or UI. Identify its revision when known. If the only baseline is the reporter's description, attribute it; if no baseline is available, say so. For a docs-only change, a checked link, rendered example or other relevant verification is enough. Redact private inputs.

Name the affected users, callers or stored state. Explain what reverting the commit would restore and which effects would require a separate recovery step. For example, reverting an installer can stop it overwriting settings on the next run; recovering a previously overwritten file needs a backup. Fit these details into the project's existing template when it has one.

Publishing must already be authorized by the task and allowed by the current host. A missing permission leaves a prepared, reviewable result and a concrete blocker. Creating a PR does not authorize merging it. Record the returned URL immediately in the autonomous run before continuing.

PR Template

## Summary
<1-3 bullet points describing changes>

## Behavior and evidence
<fixture or action, observed baseline and source, result on the tested revision>

## Impact and recovery
<affected callers or data, what a revert restores, any additional recovery>

## Test plan
- [ ] <specific check, tested commit and actual result; leave pending checks open>

## Screenshots
<if applicable>

PR Checklist

Before creating PR:

  • [ ] Project tests and required build pass for the current commit
  • [ ] Applicable linting and type checking pass
  • [ ] Actual base/head and repository are verified; an existing PR is reused
  • [ ] Documentation updated if needed
  • [ ] Commit messages follow conventional commits
  • [ ] Changes against the actual base are reviewed; merge conflicts are resolved
  • [ ] Evidence distinguishes observations from reports. The recovery note covers persistent effects.

Useful gh Commands

# View PR
gh pr view

# Check PR status
gh pr checks

# Inspect the current head and review state
gh pr view --json url,headRefOid,baseRefName,reviewDecision,mergeStateStatus

Rules

  • **MUST** run the project's applicable validation commands before opening the PR
  • **NEVER** force-push `main` or `master`
  • **NEVER** add AI co-authorship or generated-by signatures to commits or the PR body
  • **CRITICAL**: PR body must include a Test plan checklist — no exceptions
  • **MANDATORY**: commit messages follow conventional commits (`feat:`, `f
Read more
@softspark
Ships withai-toolkit

AI coding toolkit with machine-enforced safety, 116 skills, 44 agents, lifecycle hooks, persona presets, opt-in plugin packs, and benchmark tooling.

180117 skills44 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
180
Star history of softspark/ai-toolkit on GitHub, a chart by star-history.com

Other skills on ai-toolkit.

ai-toolkit-rules

ai-toolkit-rules

Mandatory engineering, security, testing, git, performance, quality, and response rules. Claude MUST load this skill for every…

mem-search

mem-search

Searches past coding sessions for observations, decisions, context. Triggers: mem-search, recall session, past work, prior…

a11y-validate

a11y-validate

Accessibility validator: WCAG 2.1 AA, EN 301 549, EAA. Triggers: a11y, accessibility, WCAG, EAA, ARIA, contrast, keyboard, screen…

agent-creator

agent-creator

Creates new specialized agents with frontmatter, tools, delegation. Triggers: new agent, create agent, agent scaffold,…

analyze

analyze

Analyzes code quality, complexity, patterns across codebase. Triggers: quality report, hotspot scan, code analysis, architecture…

api-patterns

api-patterns

API design: naming, versioning, pagination, idempotency, OpenAPI, error contracts and safe retries. Triggers: API design, REST,…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills3w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc4w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2w252k
@facebook@facebookInstall Skill

Questions about pr.

Which coding agents can use pr?
pr installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.