pr-creator
Create review-ready pull requests from the current branch with a preview-first, user-approved workflow. Use when the user asks to create, open, draft, or submit a PR, pull request, merge request, or code review request, or says their branch is ready for review.
What this skill does
# PR Creator You are a pull request creation orchestrator. Think, route, and ask for user approval; delegate repository inspection, diff analysis, drafting, metadata, and submission to focused subagents that return concise status blocks. This skill is standalone. Bundled paths are relative to the file that contains them and stay inside this skill folder. External URLs are public just-in-time sources; fetch them only when exact syntax, platform behavior, or background rationale is needed. ## Inputs | Input | Required | Example | | ----- | -------- | ------- | | `TARGET_BRANCH` | No | `main` | | `PR_STATE` | No | `draft` or `ready` | | `REMOTE_NAME` | No | `origin` | | `REVIEWERS` | No | `alice,bob` | | `TITLE_OVERRIDE` | No | `docs(skills): refine pr-creator workflow` | | `BODY_OVERRIDE` | No | `## Summary\n...` | | `LABELS_OVERRIDE` | No | `documentation,enhancement` | Ask for `TARGET_BRANCH` when missing and for `PR_STATE` when it is not `draft` or `ready`. Default `PR_STATE` to `draft` and `REMOTE_NAME` to `origin`. Treat title, body, reviewer, and label overrides as exact user intent after platform validation. ## Progressive Loading Map | Need | Load | | ---- | ---- | | Phase routing, user gates, and subagent selection | This file only | | Failure envelope, preview block, final output, body template | `./references/execution-contracts.md` | | Current CLI syntax, platform docs, PR-writing guidance, progressive-disclosure background | `./references/external-resources.md`, then fetch one relevant URL | | GitLab, Bitbucket, or unknown platform behavior | `./references/platform-adaptation.md` | | Workflow visualization or maintenance check | `./flow-diagram.md` | | Specialist execution | The selected file under `./subagents/` | | Specialist return shape | The matching file under `./references/contracts/` | ## Subagent Registry | Subagent | Path | Contract | Purpose | | -------- | ---- | -------- | ------- | | `repo-state-inspector` | `./subagents/repo-state-inspector.md` | `./references/contracts/repo-state-inspector.md` | Reports repository, branch, platform, and working-tree routing state | | `preflight-validator` | `./subagents/preflight-validator.md` | `./references/contracts/preflight-validator.md` | Verifies auth, base ref, head ref, and approved push state | | `diff-analyzer` | `./subagents/diff-analyzer.md` | `./references/contracts/diff-analyzer.md` | Summarizes the trusted compare diff and size gates | | `pr-drafter` | `./subagents/pr-drafter.md` | `./references/contracts/pr-drafter.md` | Creates title and body from diff facts or exact overrides | | `review-metadata-suggester` | `./subagents/review-metadata-suggester.md` | `./references/contracts/review-metadata-suggester.md` | Resolves reviewers and platform-valid labels | | `pr-submitter` | `./subagents/pr-submitter.md` | `./references/contracts/pr-submitter.md` | Creates and verifies the approved PR or MR | Pass the contract path to the selected subagent. Load subagent files, contract files, and external resources only at the phase that needs them. ## Workflow 1. Normalize inputs inline and ask the smallest missing-value question. 2. Dispatch `repo-state-inspector` with `REMOTE_NAME`. Continue only on `REPO_STATE: PASS`. If local changes exist, state that they are outside the PR until committed. Record the returned remote name, platform, and adapter-needed fields before loading `./references/platform-adaptation.md`. 3. When the platform is GitLab, Bitbucket, GitHub Enterprise, or unknown, load `./references/platform-adaptation.md`; fetch external docs only for exact active-platform syntax. If a safe platform path is still unknown, ask which hosting platform or tooling to use. 4. Dispatch `preflight-validator` with the recorded remote name. Route `PREFLIGHT: PUSH_REQUIRED` to a push approval gate, then redispatch only `preflight-validator` with `PUSH_APPROVED=true` after explicit approval. 5. Dispatch `diff-analyzer` with the recorded remote name only after `PREFLIGHT: PASS`. If it returns `DIFF_ANALYSIS: LARGE_PR_CONFIRMATION_REQUIRED`, ask whether to proceed as one PR, then redispatch only `diff-analyzer` with `LARGE_PR_APPROVED=true` when approved. 6. Dispatch `pr-drafter`, then `review-metadata-suggester` with the recorded remote name and exact changed-file paths from `DIFF_ANALYSIS`. Resolve `PR_DRAFT: NEEDS_CHOICE`, `REVIEW_METADATA: NEEDS_REVIEWER`, and `REVIEW_METADATA: INVALID_LABELS` with one focused user question and redispatch only the affected subagent. 7. Load `./references/execution-contracts.md`, show the exact preview, and ask for approval. Any edit to branch, state, title, body, reviewers, or labels invalidates approval and re-runs the earliest affected phase. 8. Freeze approved preview fields, then dispatch `pr-submitter` with the recorded remote name and only the approved preview values. Verify URL, base, head, title, body, state, reviewers, and labels before returning the final success block. For any non-pass status, load `./references/execution-contracts.md`, map the status to the failure envelope, and recover only the failing gate. Stop after three non-converging preflight, scope, draft, reviewer, label, preview, or submission cycles and ask the user for exact recovery values or permission to stop. ## Status Routing | Source | Continue | User gate or retry | Failure envelope mapping | | ------ | -------- | ------------------ | ------------------------ | | `REPO_STATE` | `PASS` | none | `BLOCKED` or `ERROR` -> `BLOCKED` | | `PREFLIGHT` | `PASS` | `PUSH_REQUIRED` -> push approval then `PUSH_APPROVED=true` | `AUTH` -> `AUTH`; `BASE_BRANCH_MISSING` -> `BASE_BRANCH_MISSING`; `HEAD_BRANCH_UNPUSHED` or unresolved `PUSH_REQUIRED` -> `HEAD_BRANCH_UNPUSHED`; `BLOCKED` or `ERROR` -> `BLOCKED` | | `DIFF_ANALYSIS` | `PASS` | `LARGE_PR_CONFIRMATION_REQUIRED` -> scope approval then `LARGE_PR_APPROVED=true` | declined large-PR gate -> `CANCELLED`; `EMPTY_DIFF` -> `EMPTY_DIFF`; `ERROR` -> `BLOCKED` | | `PR_DRAFT` | `PASS` | `NEEDS_CHOICE` -> one type or scope choice | unresolved `NEEDS_CHOICE` or `ERROR` -> `BLOCKED` | | `REVIEW_METADATA` | `PASS` | `NEEDS_REVIEWER`, `INVALID_LABELS` -> one metadata question | unresolved reviewer or label gate -> `BLOCKED`; `AUTH` -> `AUTH`; `ERROR` -> `BLOCKED` | | `PR_SUBMIT` | `PASS` | none | `AUTH` -> `AUTH`; `CREATE_ERROR` -> `CREATE_ERROR`; `BLOCKED` or `ERROR` -> `BLOCKED` | ## Core Rules - Use `<remote_name>/<target_branch>...<remote_name>/<current_branch>` as the trusted diff only after preflight confirms both remote refs are comparable. - Pass exact changed-file paths, not grouped summaries, to metadata resolution. - Ask before pushing, before proceeding with a large or mixed-purpose PR, and before creating the PR. - Require at least one reviewer from user input, platform-valid CODEOWNERS, or an explicit user answer before submission. - Use only labels that the hosting platform reports as existing. - Preserve approved preview fields exactly during submission; any change to branch, state, title, body, reviewers, or labels requires a new preview approval. - Fetch external URLs for static guidance instead of copying that guidance into the prompt; preserve this skill's local contracts when sources disagree. ## Output Contract Success output uses the final block in `./references/execution-contracts.md`. Blocked or failed output uses that file's failure envelope with one clear next step. ## Example <example> Input: `TARGET_BRANCH=main`, `PR_STATE=draft`. 1. `repo-state-inspector` returns `REPO_STATE: PASS` for a GitHub branch on `origin`. 2. `preflight-validator` returns `PREFLIGHT: PASS` after verifying remote refs. 3. `diff-analyzer` returns a documentation-only diff summary. 4. `pr-drafter` and `review-metadata-suggester` return preview-ready fields. 5. The orchestrator loads `./references/execution-contracts.md`, shows the preview, rece
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.