Claude-project-skills-template pr-create

name: pr-create

install
source · Clone the upstream repo
git clone https://github.com/dohernandez/claude-project-skills-template
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/dohernandez/claude-project-skills-template "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/pr-create" ~/.claude/skills/dohernandez-claude-project-skills-template-pr-create && rm -rf "$T"
manifest: .claude/skills/pr-create/skill.yaml
source content

name: pr-create kind: workflow version: "1.0.0" description: "Creates GitHub pull requests with conventional commit-style titles following project conventions." severity: medium tags:

  • git
  • github
  • workflow
  • pr

purpose: | Creates GitHub pull requests using the

gh
CLI with properly formatted titles that follow conventional commits. Analyzes changes to determine appropriate type, scope, and summary.

owns:

  • "PR creation workflow"
  • "PR title formatting"
  • "PR body generation"

inputs_required:

  • id: committed_changes description: "Changes must be committed to a feature branch (not main)"
  • id: branch_pushed description: "Branch should be pushed or will be pushed during PR creation"

required_outputs:

  • "GitHub PR URL"

patterns:

  • id: conventional-commit-title description: | PR titles MUST follow conventional commit format: <type>(<scope>): <subject>

    • type: feat, fix, chore, docs, test, perf, ci
    • scope: workflows, scripts, ci, runner, config (optional)
    • subject: Capitalized, no period, max 50 chars total example: | feat(workflows): Add retry logic to E2E pipeline fix(scripts): Handle missing Docker Compose gracefully chore(runner): Add Go version check to provisioning ci(workflows): Add dispatch payload validation
  • id: analyze-before-title description: | Before creating PR title, analyze all commits on the branch:

    • git log origin/main..HEAD --oneline
    • git diff origin/main..HEAD --stat Determine the primary type and scope from the changes. commands:
    • "git log origin/main..HEAD --oneline"
    • "git diff origin/main..HEAD --stat"
  • id: specific-not-vague description: | Avoid vague words: "improve", "enhance", "update", "change" Use specific action verbs: "Add", "Fix", "Remove", "Refactor", "Handle" example: | Bad: chore(scripts): Update setup script Good: chore(scripts): Add Docker health check to provisioning

  • id: pr-body-structure description: | PR body MUST follow this format:

    • Summary: 2-3 sentences summarizing what changed and why
    • Changes: Bullet points of specific changes
    • Checklist: Mark [x] for items that apply example: |

    Summary

    Adds retry logic to the E2E test pipeline to handle transient network failures during consensus deployment.

    Changes

    • Add retry wrapper for task consensus:deploy
    • Configure max 3 retries with exponential backoff
    • Log retry attempts for debugging

    Checklist

    • Code follows project conventions
    • Documentation updated (if needed)
    • Changes tested locally (if applicable)
  • id: push-before-pr description: | Ensure branch is pushed before creating PR: git push -u origin HEAD commands:

    • "git push -u origin HEAD"

anti_patterns:

  • id: pr-from-main description: "Creating PR while on main branch" why_bad: "PRs should be from feature branches. Main is the target, not source."

  • id: vague-title description: "Using vague words like 'update', 'improve', 'enhance'" why_bad: "Doesn't communicate what actually changed. Be specific."

  • id: ai-attribution description: "Including ANY AI attribution in PR title, body, or commits" why_bad: | STRICTLY FORBIDDEN. This is a complete violation of project conventions. NEVER include:

    • Co-Authored-By: Claude, GPT, or any AI
    • AI-related emojis
    • "Generated by", "Created with", or similar phrases
    • Any reference to AI tools (Claude, ChatGPT, Copilot, etc.) PRs and commits must appear as human-authored work.
  • id: unpushed-pr description: "Attempting to create PR without pushing branch first" why_bad: "gh pr create requires the branch to exist on remote."

  • id: no-commit-analysis description: "Creating PR title without reviewing commits" why_bad: "Title should reflect all changes, not just the last commit."

procedure:

  • step: "Verify gh CLI prerequisites" detail: | Before anything else, verify GitHub CLI is available and authenticated:

    1. Check gh is installed: gh --version
    2. Check gh is authenticated: gh auth status If gh is not installed, tell user: "Install GitHub CLI: brew install gh" If gh is not authenticated, tell user: "Authenticate with: gh auth login" Do not proceed until both checks pass. commands:
    • "gh --version"
    • "gh auth status"
  • step: "Verify not on main" detail: | Check current branch is not main: git branch --show-current If on main, stop and inform user to create a feature branch. commands:

    • "git branch --show-current"
  • step: "Check repository state" detail: | Verify there are commits to PR and no uncommitted changes:

    • git status
    • git log origin/main..HEAD --oneline commands:
    • "git status"
    • "git log origin/main..HEAD --oneline"
  • step: "Analyze changes" detail: | Review all commits and changes to determine:

    • Primary type (feat, fix, chore, etc.)
    • Affected scope (workflows, scripts, ci, runner, config)
    • Summary of what the PR accomplishes commands:
    • "git log origin/main..HEAD --oneline"
    • "git diff origin/main..HEAD --stat"
  • step: "Push branch" detail: | Push branch to origin with upstream tracking: git push -u origin HEAD commands:

    • "git push -u origin HEAD"
  • step: "Present PR for user review" detail: | Before creating the PR, present the title and body to the user:

    PR Preview

    Title: <type>(<scope>): <subject>

    Body:

    Summary

    <summary>

    Changes

    • <changes>

    Checklist

    • Code follows project conventions
    • Documentation updated (if needed)
    • Changes tested locally (if applicable)

    Any changes I should make?

    Wait for user confirmation:

    • If user says "no" or confirms -> proceed to create PR
    • If user requests changes -> incorporate feedback and show again
  • step: "Create PR" detail: | After user confirms, use gh CLI to create the PR. Use HEREDOC for body to preserve formatting. commands:

    • | gh pr create --title "<type>(<scope>): <subject>" --body "$(cat <<'EOF'

      Summary

      <2-3 sentences summarizing what changed>

      Changes

      • <bullet points of changes>

      Checklist

      • Code follows project conventions
      • Documentation updated (if needed)
      • Changes tested locally (if applicable) EOF )"