creating-prs
Creates pull requests with clear titles and well-structured descriptions — rebases onto the target branch, checks for PR templates and contributing guides, summarizes commits into a coherent narrative, and opens the PR via gh CLI. Use when opening a pull request or preparing a branch for review.
What this skill does
# Creating PRs Use this skill proactively when work on a feature branch is done and committed. A branch with commits that hasn't been turned into a PR is unfinished work. Always confirm with the user before actually creating the PR. ## Current context - Branch: !`git branch --show-current` - Remote: !`git remote get-url origin 2>/dev/null || echo "no remote"` ## Decision tree - What are you doing? - **Opening a PR for the current branch** -> follow the steps below - **On main/master** -> nothing to open a PR for, tell the user ## Step 1: Check if a PR already exists ```bash gh pr view --json number,title,url 2>/dev/null ``` If a PR already exists, tell the user and show the URL. Don't create a duplicate. ## Step 2: Rebase onto target branch Always rebase before opening a PR to keep history linear. Determine the target branch — usually `main`, fall back to `master`: ```bash git fetch origin ``` ```bash git rebase origin/main ``` If the rebase has conflicts: 1. Show the conflicting files 2. Attempt to resolve obvious conflicts (e.g., lockfile regeneration, import ordering) 3. For non-obvious conflicts, stop and ask the user — don't guess at conflict resolution ## Step 3: Check for project conventions Before writing the PR, look for guidance on how this project handles PRs: 1. `CONTRIBUTING.md` or `CONTRIBUTING` in the repo root 2. `.github/PULL_REQUEST_TEMPLATE.md` or `.github/pull_request_template.md` — if a template exists, fill it out instead of the default format 3. `CLAUDE.md` — check for PR conventions 4. `.github/CODEOWNERS` — note who will be auto-assigned Follow any conventions found. Project-specific rules override the defaults below. ## Step 4: Understand the changes ```bash git log --oneline main..HEAD ``` ```bash git diff main...HEAD --stat ``` Read the commit messages carefully — they contain the what and why. The PR description should synthesize these, not just list them. For larger branches, read key changed files to understand the full picture. ## Step 5: Determine the title style Check existing PR titles for the repo to match the convention: ```bash gh pr list --state merged --limit 10 --json title --jq '.[].title' ``` Match whatever style is used in the project: - If the repo uses conventional commit prefixes in PR titles (`feat:`, `fix:`), use them - If the repo uses plain descriptive titles, use those - If unclear, default to plain descriptive titles Keep titles under 70 characters. They should communicate the purpose of the whole branch. ## Step 6: Push the branch ```bash git push -u origin HEAD ``` If the push is rejected after a rebase, force push — this is expected after rebasing: ```bash git push --force-with-lease origin HEAD ``` ## Step 7: Decide draft vs. ready Open as a **draft** when: - Work is still in progress but you want early visibility or CI feedback - The branch is missing tests, docs, or final polish - The user says "WIP", "draft", or "not ready yet" Open as **ready for review** when the work is complete, tests pass, and there's nothing left to do. When in doubt, default to draft — it's easy to mark ready later. ## Step 8: Create the PR If a PR template exists, fill it out. Otherwise use this structure: Add `--draft` if opening as a draft (see step 7). ```bash gh pr create --title "the title" --body "$(cat <<'EOF' ## Summary Brief description of what this PR does and why. 2-3 sentences max, drawn from the commit bodies. A reviewer should understand the motivation without reading the code. - Key change 1 - Key change 2 - Key change 3 ## Test plan - [ ] How to verify this works - [ ] Edge cases to check ## Deploy notes Any migration steps, environment variable changes, feature flags, or sequencing considerations for shipping this. Omit this section if there's nothing special about deploying this change. EOF )" ``` Guidelines for the body: - **Summary** explains intent, not mechanics — the diff shows the mechanics - **Bullet points** for concrete changes — keep them scannable - **Test plan** with actionable steps, not "run the tests" - **Deploy notes** for anything a deployer needs to know — migrations, env vars, ordering. Skip the section entirely if it's a straightforward deploy. - **Link issues** when relevant: `Closes #123`, `Fixes #456` - Don't repeat the title in the body - Don't list every file changed — that's what the diff tab is for ## Step 9: Monitor CI After creating the PR, use the `monitoring-ci` skill to watch CI in the background. It will diagnose and fix any failures automatically, then re-watch until green. ### If gh is unavailable If `gh` is not installed or auth fails, print the branch name and remote URL so the user can create the PR manually.
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.