pr
Open a Pull Request with an interview process. Use when the user wants to create a PR, open a pull request, or ship changes to a branch.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- pr
- description
- Open a Pull Request with an interview process. Use when the user wants to create a PR, open a pull request, or ship changes to a branch.
03 SKILL.md 正文
Rule: Opening a Pull Request with Interview
Arguments
base(optional): Target branch for the PR. Defaults to the repository's default branch (viagh repo view --json defaultBranchRef --jq .defaultBranchRef.name).
Goal
Create a draft pull request with an interview process that captures both the assistant's analysis and the user's own thinking. This ensures the user understands and has reflected on the changes before they go up for review.
Hard Rules
- You MUST follow every step in the Process section below, in order. Do not skip, compress, or combine steps.
- The interview is mandatory. Ask each section's question one at a time, wait for the user's response, then move to the next section. Never batch questions or pre-fill the user's answers. The user may choose to skip sections or end the interview early ("ship it", "looks good") — but that's their call, not yours.
- Use the correct PR structure. The description MUST use the section format (Background, Approach, Reviewer notes, Testing plan — or the repo's PR template). Never output a flat, unstructured description.
- Use the dual-perspective format for any section where the user contributed. The
<username> says/<assistant> saysformat is not optional. - The only exception is step 4's trivial-PR shortcut, and even then you must propose it and get explicit confirmation before skipping.
Process
-
Resolve identities and base branch. Before anything else, determine:
- The user's GitHub username: run
gh api user --jq .login(fall back togit config user.nameifghis unavailable). - The assistant's name: use whatever name you identify as (e.g., "Claude"). If unknown, use "Agent".
- The base branch: use the
baseargument if provided, otherwise detect viagh repo view --json defaultBranchRef --jq .defaultBranchRef.name.
Use these throughout the process.
- The user's GitHub username: run
-
Detect PR template. Check for a repository PR template in these locations (in order):
.github/PULL_REQUEST_TEMPLATE.md.github/pull_request_template.mddocs/pull_request_template.mdPULL_REQUEST_TEMPLATE.md
If a template exists, use its sections as the structure for both drafting and the interview. Map each template section to the closest interview question (see defaults below) and interview on those sections instead. If no template is found, fall back to the default sections: Background, Approach, Reviewer notes, Testing plan.
-
Research the changes. Look at the full commit history on the current branch vs the base branch (
git log,git diff). Also search git history and related PRs to build context. For bug fixes, dig into the root cause: usegit log -S,git blame, and PR archaeology to trace how the bug was introduced and why the code ended up this way. The background for a bug fix should tell the story of how we got here, not just describe the symptom. -
Gauge the scope. Look at what changed. If the PR is trivial (typo fix, version bump, single-line config change, etc.), propose skipping the interview: "This looks straightforward — here's what I'd put up. Want to go through the full interview, or is this good to go?" Let the user decide. For anything non-trivial, proceed with the interview.
-
Draft a PR title and all sections. The title should be short (under 72 chars), imperative mood, and scoped to what changed (e.g., "Fix race condition in worker pool shutdown", "Add duti for default editor file associations"). Prepare drafts for each section from the template (or the defaults). Follow the prose rules from
style-guide.mdandtropes.md— write in the user's voice, be direct and specific, avoid AI writing patterns. -
Interview section by section. For each section, present your draft and then ask the user for their take. Go through them one at a time. Default interview prompts (adapt to match template section names):
- Background / Context / Description: "Here's my read on the background. What's your take? What motivated this, and what context am I missing?"
- Approach / Changes: "Here's how I'd describe the approach. Anything you'd add or frame differently?"
- Reviewer notes: "Here's what I think is worth calling out for reviewers. Anything you want to highlight or get specific feedback on?"
- Testing plan / How to test: "Here's what I have for testing. How did you test it, or how should a reviewer?"
For template sections that don't map to a default prompt, ask an open-ended question: "Here's what I have for [section]. What would you add or change?"
The user can skip any section ("skip", "looks good", empty response) or skip the rest of the interview entirely ("ship it", "looks good, let's go"). If skipped, use your draft as-is without the split format.
-
Assemble the PR description. Use the template structure if one was found. For sections where the user contributed, use the dual-perspective format:
## [Section Name]
### <github_username> says
[The user's words, lightly cleaned up but preserving their voice]
### <assistant_name> says
[Your analysis]
For sections where the user skipped, use the normal format:
## [Section Name]
[Your draft, no sub-headings needed]
-
Review together. Show the user the full assembled PR title and description before creating it. Make adjustments based on their feedback.
-
Create the draft PR. Open as a draft. Use
gh pr create --draft --base <base_branch>.
Notes
- PRs should be small and focused on a single concern. Avoid bundling unrelated changes. If you notice the code needs refactoring (code smells, emerging duplication), flag it and ask the user rather than folding it into the current PR.
- The user's words should be kept in their voice. Don't rewrite them into formal prose. Light cleanup (typos, formatting) is fine.
- If the user's take and your take overlap significantly, that's fine — it shows alignment. Don't try to artificially differentiate them.
- The interview step is the important part. Don't skip it or pre-fill the user's sections. But respect the user's time — if they want to skip sections or the whole interview, let them.
- Keep the interview conversational. Ask follow-up questions if something is unclear or you think there's more to draw out. This is a dialogue, not a form.
- Don't ask all sections at once. Go one at a time so the conversation stays focused.
04 同仓库更多 Skills
skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
writing-shape
Writing, exploit: shape raw material into an article, paragraph by paragraph.
webapp-testing
Test local web applications using Playwright. Use when verifying frontend functionality, debugging UI behavior, capturing browser screenshots, or viewing browser logs.
wait-what
Stop. That last message did not land: re-pitch it.
prototype
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
improve-codebase-architecture
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.