Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Create Pr

ASecurity

Creates a well-structured pull request with product-focused summary, change highlights, and test steps. Auto-detects base branch, links Linear issues from branch name, and pushes if needed. Use when ready to open a PR or when asking to create a pull request.

4 stars
0 votes
0 copies
0 views
Added 9/19/2026
ai-agentsbashrefactoringgit

Works with

mcp

Security Analysis

A100/100

Scanned 9/19/2026

Install to Claude Code

$npx -y skills add mostafa-drz/claude-skills --skill create-pr --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Create Pr?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Create Pr
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mostafa-drz-create-pr/badge)](https://www.skillsdirectory.com/skills/mostafa-drz-create-pr)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: create-pr
description: >-
  Creates a well-structured pull request with product-focused summary, change highlights,
  and test steps. Auto-detects base branch, links Linear issues from branch name, and
  pushes if needed. Use when ready to open a PR or when asking to create a pull request.
argument-hint: "[issue-id] [--base branch] [--draft]"
disable-model-invocation: true
allowed-tools:
  - AskUserQuestion
  - Bash
  - Read
  - Glob
  - Grep
  - mcp__claude_ai_Linear__get_issue
  - mcp__claude_ai_Linear__update_issue
metadata:
  trigger: "Ready to open a PR or when asking to create a pull request."
  tags: "git, github, linear"
---

# Create PR

Create a well-structured, product-focused pull request.

## Preferences

_Read `~/.claude/skills/create-pr/preferences.md` using the Read tool. If not found, no preferences are set._

## Context

_On startup, use Bash to detect: current branch (`git branch --show-current`), upstream branch, commits ahead of upstream, and repo name (`gh repo view --json nameWithOwner -q .nameWithOwner`). Skip any that fail._

## Command routing

Check `$ARGUMENTS`:

- **`help`** → display help then stop
- **`config`** → interactive setup then stop
- **`reset`** → delete `~/.claude/skills/create-pr/preferences.md`, confirm, stop
- **anything else** (including empty) → create PR

### Flags

Parse from `$ARGUMENTS`:
- **`--base <branch>`** — override base branch
- **`--draft`** — create as draft PR
- **`--no-linear`** — skip Linear integration
- **Remaining text** — treated as Linear issue ID if it matches pattern (e.g., `AIS-810`)

### Help

```
PR — Create a well-structured pull request

Usage:
  /create-pr                         Create PR from current branch
  /create-pr <issue-id>              Create PR and link Linear issue
  /create-pr --base develop          Override base branch
  /create-pr --draft                 Create as draft
  /create-pr --no-linear             Skip Linear linking
  /create-pr config                  Set PR preferences
  /create-pr reset                   Clear preferences
  /create-pr help                    This help

Examples:
  /pr
  /create-pr AIS-810
  /create-pr --base develop --draft
  /create-pr AIS-810 --base main

What it does:
  1. Detects base branch (or uses preference/flag)
  2. Reads commits, diff, and Linear issue
  3. Builds product-focused PR description
  4. Pushes branch if needed
  5. Creates PR and links to Linear

Current preferences:
  (shown above under Preferences)
```

### Config

Use **`AskUserQuestion`**:

**Q1** — "Default base branch?" (auto-detect (default), main, develop, custom)
- Auto-detect: checks tracking branch, falls back to repo default branch

**Q2** — "Link Linear issues?" (Yes — from branch name (default), No)

**Q3** — "PR template?" (standard (default), minimal, detailed)

**Q4** — "Auto-push before creating?" (Yes (default), No — just create locally)

**Q5** — "Default PR type?" (Ready for review (default), Draft)

Save to `~/.claude/skills/create-pr/preferences.md`.

## First-time detection

If no preferences file exists, show:
"First time using /pr? Run `/create-prconfig` to set defaults (base branch, template, Linear linking), or continue — I'll auto-detect."

Then proceed.

## Steps

### 1. Gather context

**From git:**
- Current branch (pre-injected)
- Commits on this branch: `git log <base>..HEAD --oneline`
- Diff stat: `git diff <base>...HEAD --stat`
- Full diff summary: `git diff <base>...HEAD` (for understanding changes)

**Base branch detection** (in order):
1. `--base` flag if provided
2. Saved preference if set
3. Tracking branch upstream
4. Repo default branch: `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`

**Linear issue** (unless `--no-linear`):
- Extract issue ID from branch name (pattern: `user/ais-NNN-*` or `ais-NNN-*`)
- If found, fetch via `get_issue` for title, description, project

**Remote check:**
- Is branch pushed? If not, needs pushing.

### 2. Branch alignment

If a Linear issue was found, check if branch name matches `issue.gitBranchName`.
If mismatch, rename the branch to match (team convention):
```
git branch -m {old} {new}
git push origin --delete {old}  # if old was pushed
git push -u origin {new}
```

### 3. Push if needed

If branch isn't pushed (or was renamed):
```
git push -u origin {branch}
```

Skip if `--no-push` or preference says no.

### 4. Build PR content

**Title format:** Under 70 chars, conventional prefix.
- `feat: Description` for new features
- `fix: Description` for bug fixes
- `refactor: Description` for refactoring
- `chore: Description` for maintenance

**Body template (standard):**

```markdown
## Summary

{1-2 sentences: what this does and why. Product value first.}

**Linear:** [{issue-id}]({url}) (if available)

## What's New

- **{Feature/Change}** — {one sentence, user perspective}
- **{Feature/Change}** — {one sentence}

## How to Test

1. {Step}
2. {Step}
3. {Step}
```

**Body template (minimal):**

```markdown
{1-2 sentences: what and why}

Linear: [{issue-id}]({url})
```

**Body template (detailed):**

```markdown
## Summary

{1-2 sentences}

**Linear:** [{issue-id}]({url})

## What's New

- **{Feature}** — {description}

## Architecture

- {How it's structured}
- {What was reused}
- {Data flow}

## How to Test

1. {Step}
2. {Step}
```

### 5. Create the PR

```
gh pr create --base {base} --title "{title}" --body "$(cat <<'EOF'
{body}
EOF
)"
```

Add `--draft` if flag set or preference is draft.

### 6. Link to Linear

If Linear issue found, attach PR via `update_issue` with link:
```
url:   https://github.com/{org}/{repo}/pull/{number}
title: PR #{number} — {title}
```

### 7. Report

```
PR created: {url}

  Base:   {base}
  Head:   {branch}
  Title:  {title}
  Linear: {issue-id} (linked ✓) or "none"
  Type:   Ready / Draft

  Commits: {count}
  Files:   {count}
```

### 8. Learn

- If user changes base branch, save preference
- If user edits the generated title pattern, save style preference
- If user consistently uses draft, save as default

Attribution

mostafa-drzmostafa-drz
View sourceMore from mostafa-drz →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.

1023331 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

686011 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3331 votes

catchup

Recovers prior coding-agent session context by running `catchup <agent> --since-compact`, which extracts a clean summary of a previous Codex, Claude Code, Antigravity, OpenCode, or Pi Agent session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", or asks to recover/summarize a previous session before continuing. Do NOT use for the current conversation, git history, or any non-agent log.

611 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →