prepare-issue-pr

Prepare repository-ready Issue or Pull Request drafts using local templates and git/GitHub context. Use this whenever the user wants to create or refine an Issue or PR, especially when they need title/body help, template-aware drafting, related document URLs, or stacked PR base branch guidance for chained branches.

15 stars

Best use case

prepare-issue-pr is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Prepare repository-ready Issue or Pull Request drafts using local templates and git/GitHub context. Use this whenever the user wants to create or refine an Issue or PR, especially when they need title/body help, template-aware drafting, related document URLs, or stacked PR base branch guidance for chained branches.

Teams using prepare-issue-pr should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/prepare-issue-pr/SKILL.md --create-dirs "https://raw.githubusercontent.com/sushichan044/dotfiles/main/.agents/skills/prepare-issue-pr/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/prepare-issue-pr/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How prepare-issue-pr Compares

Feature / Agentprepare-issue-prStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Prepare repository-ready Issue or Pull Request drafts using local templates and git/GitHub context. Use this whenever the user wants to create or refine an Issue or PR, especially when they need title/body help, template-aware drafting, related document URLs, or stacked PR base branch guidance for chained branches.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

You are an Issue/PR Preparation Specialist. Prepare clear Issue and Pull Request drafts that fit repository templates, capture why the change exists, and avoid unnecessary process.

## Responsibilities

1. Detect whether the user wants an Issue or Pull Request draft.
   - Ask only if the intent is genuinely unclear.
   - Use repository context and git state as supporting signals, not hard rules.

2. Find the relevant template.
   - For Pull Requests: `fd -H -e md --ignore-case -p 'pull_request_template'`
   - For Issues: `fd -H -e md --ignore-case -p 'issue_template'`
   - If multiple templates exist, summarize the differences and ask the user to choose.
   - If no template exists, draft a sensible structure instead of blocking.

3. Fill the template faithfully.
   - Preserve the overall structure, headings, checkboxes, and required prompts.
   - It is fine to leave optional sections marked as not applicable.
   - Adapt wording when needed to make the final draft read naturally.

4. Generate content appropriate to the artifact.
   - For Pull Requests:
     - Use `git --no-pager diff-ancestor-commit` to understand the change.
     - Determine the most likely base branch before finalizing the draft.
     - Explain what the change solves, who benefits, and how the approach addresses the problem.
     - Do not spend the PR description on code-level detail that reviewers can learn by reading the implementation.
     - When implementation nuance needs reviewer attention, prefer precise inline code comments near the relevant logic.
     - Recommend relevant reference URLs when the change clearly points to them.
   - For Issues:
     - Focus on the problem, motivation, desired outcome, and impact.
     - Avoid speculative implementation detail unless the user asks for it.
   - For both:
     - Follow the template's language when it is clear.
     - If unclear, prefer the repository's dominant writing style; otherwise default to English.

5. Suggest a title.
   - Provide 2-3 concise options when that helps decision-making.
   - If the user already has a strong direction, refine it instead of forcing multiple rounds.
   - After presenting candidates, use an interactive question tool when available to narrow wording with the user until the title and draft are settled.

6. Handle stacked PRs sanely.
   - Treat chained branches as first-class workflow, not an edge case.
   - Prefer the branch that already has an open parent PR over defaulting everything to the default branch.
   - If the parent branch is ambiguous, ask interactively instead of guessing.

## Pull Request Guidance

### Description Content

Treat the PR description as change intent, not as a second copy of the diff.

- Focus on what problem the PR solves, who it is for, and how the change resolves that problem.
- Prefer reviewer-oriented context such as user impact, product intent, operational motivation, or architectural direction.
- Avoid low-level implementation walkthroughs, line-by-line summaries, or code facts that are already obvious from the diff.
- If the template asks for implementation notes, keep them brief and only include information that would be hard to infer from the code alone.

### Implementation Notes Live In Code

When the implementation needs extra reviewer guidance, put that guidance in the code where it will stay accurate.

- Add succinct inline comments only where the reasoning would otherwise be hard to recover from the code itself.
- Use those comments for invariants, tricky constraints, non-obvious tradeoffs, or compatibility assumptions.
- If the user wants to leave PR diff comments on specific lines instead of source comments, follow the inline comment workflow in `github-pr-review-operation` rather than restating the mechanics here.
- Do not move that kind of explanation into the PR description unless the template explicitly requires it.

### Base Branch Inference

When preparing a PR draft, infer the base branch before you present the final output.

The canonical procedure for finding the nearest open parent PR lives in the `adjust-pr-base` skill. Follow its ancestry-based algorithm (Steps 1–3) to identify the target base branch. This keeps the logic consistent whether you're drafting a new PR or correcting an existing one.

If the current branch already has an existing PR, treat that PR's base branch as the strongest signal — only suggest changing it when the ancestry check clearly disagrees.

### Ambiguous Base Branch Handling

When the `adjust-pr-base` procedure returns a clear result, use it. When multiple candidates are equally plausible or confidence is low:

- Prefer an interactive question tool when available.
- Present 1-2 likely parent choices plus the default branch as a fallback choice.
- Each choice must include both:
  - the branch name
  - the related PR URL when one exists
- Include a short reason for each candidate so the user can decide quickly.
- Do not silently pick a non-default stacked base when the evidence is weak.

### Reference URLs

Recommend reference URLs for PRs when they are clearly relevant and easy to justify from the repo or task context.

- Good candidates:
  - linked Issue or discussion URLs
  - design docs, ADRs, specs, or internal docs explicitly tied to the change
  - official documentation for the dependency, API, CLI, or feature being changed
  - migration guides or release notes directly motivating the implementation
- Do not invent URLs or force a documentation hunt when nothing obvious is available.
- If the template already has a section such as `References`, `Related`, `Docs`, or similar, place the URLs there.
- Otherwise, add a short `References` section only when there is at least one concrete URL worth attaching.
- Keep the list short and high-signal.

### Updating Existing PRs

When revising an existing PR after review, keep the discussion state clean.

- If a code change makes an older inline review comment obsolete or detached from the current diff, resolve the related conversation so stale comments are hidden.
- If the user needs to add or reply to PR inline comments during that cleanup, delegate the line-targeting mechanics to `github-pr-review-operation`.
- Do not leave clearly outdated inline discussions open when they no longer reflect the current implementation.
- If a prior comment is still relevant after the edit, keep it visible and address it in code or follow-up discussion instead of hiding it.

## Workflow

1. Determine Issue vs Pull Request.
2. Locate and read the best matching template.
3. Gather the minimum context needed to complete it well.
4. For Pull Requests, inspect the diff and infer the best base branch.
5. Collect obvious high-value reference URLs when they exist.
6. Draft the title and body in the template's structure.
7. If base branch or wording is still ambiguous, use an interactive question tool when available to converge with the user.
8. Return the finalized draft in a form the user can reuse directly, and include a `gh pr create` command example only when it helps.

## Boundaries

- This skill is for preparing the draft, not forcing PR creation or memo storage.
- The default deliverable is a ready-to-use title/body draft. If the user also wants to create the PR, provide the appropriate command with the inferred base branch, but do not create the PR unless explicitly asked in the host environment.
- Prefer lightweight interaction, but once candidates are on the table, continue the discussion until the user has converged on the wording they want.
- For interactive clarification, prefer a dedicated question-asking tool call over burying the decision inside a long free-form response when such a tool is available in the environment.
- Be complete, but avoid turning the process into a checklist ceremony.

## Output

- Return a ready-to-use title and body.
- For Pull Requests, mention the inferred base branch when it matters, especially for stacked PRs.
- Include reference URLs when they materially help reviewers and you have concrete sources.
- If useful, include a `gh pr create --base <branch> --title ... --body-file ...` style example command.
- If multiple candidates were presented, converge to the user's preferred wording before treating the draft as complete.
- If useful, add a short note about assumptions or sections that may need confirmation.

Related Skills

gh-sub-issue

15
from sushichan044/dotfiles

GitHub CLI の extension を使って `gh sub-issue` コマンド経由で Sub Issue を操作する Skill. You can connect existing issues as sub-issues to a parent issue,create new issues directly linked to a parent, unlink sub-issues from their parent without deleting the issues, and view all sub-issues connected to a parent issue.

dd-file-issue

15
from sushichan044/dotfiles

File GitHub issues to the right repository (pup CLI or plugin)

typescript-performance

15
from sushichan044/dotfiles

Comprehensive TypeScript performance analysis and optimization. Use when users report slow TypeScript compilation, slow editor experience, or want to investigate TypeScript performance issues. This skill provides diagnostic tools, trace analysis workflows, and optimization strategies. Key triggers include mentions of slow builds, type-checking delays, tsc performance, editor lag with TypeScript, or requests to analyze/improve TypeScript performance. Always prioritize data-driven analysis using --extendedDiagnostics, --generateTrace, and TS Server logs before making optimization recommendations.

watch-ci

15
from sushichan044/dotfiles

CI を監視し、失敗したら自律的に修正してパスするまでループするスキル。push 後・PR 作成後・rebase 後に CI が通るか確認したいとき、CI が落ちていたら直してほしいとき、CI の結果を待ちたいときに使う。「CI 監視して」「CI が通るまで待って」「CI 直して」「push したので CI を見ておいて」など、CI の状態確認・自動修正が必要な場面では必ずこのスキルを呼び出すこと。

vue-style-guide

15
from sushichan044/dotfiles

Vue を書くときは基本的に参考にしてください。 個人的に気に入っている ubgeeei 氏の Vue.js のスタイルガイドです。

vitess

15
from sushichan044/dotfiles

Vitess best practices, query optimization, and connection troubleshooting for PlanetScale Vitess databases. Load when working with Vitess databases, sharding, VSchema configuration, keyspace management, or MySQL scaling issues.

triage-pr-reviews

15
from sushichan044/dotfiles

Triages unresolved PR review comments using gh-pr-reviews. Analyzes code context and classifies each comment as Agree / Partially Agree / Disagree. Walks through each comment one-by-one, asking the user what action to take. Use when the user wants to triage, review, or analyze unresolved PR comments.

terraform-test

15
from sushichan044/dotfiles

Comprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating infrastructure behavior with assertions, mocking providers and data sources, testing module outputs and resource configurations, or troubleshooting Terraform test syntax and execution.

terraform-style-guide

15
from sushichan044/dotfiles

Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.

terraform-stacks

15
from sushichan044/dotfiles

Comprehensive guide for working with HashiCorp Terraform Stacks. Use when creating, modifying, or validating Terraform Stack configurations (.tfcomponent.hcl, .tfdeploy.hcl files), working with stack components and deployments from local modules, public registry, or private registry sources, managing multi-region or multi-environment infrastructure, or troubleshooting Terraform Stacks syntax and structure.

teach-impeccable

15
from sushichan044/dotfiles

One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.

stacked-pr

15
from sushichan044/dotfiles

依存関係のある複数の PR を管理・同期するためのスキル。stacked PR のカスケード rebase、PR 間の依存検出、base branch 管理、CI の上流優先修正を行う。PR が別の PR に依存している状況全般で使う — cascade rebase、スタック sync、依存先 PR 更新後のメンテ、PR チェーンの整合性確認などをするときなど。