Agent Skills: prepare-issue-pr

Prepare comprehensive Issue or Pull Request descriptions using repository templates. Automatically detects type, finds appropriate templates, and guides users through filling them out completely. Use when users want to create Issues or PRs.

UncategorizedID: sushichan044/dotfiles/prepare-issue-pr

Install this agent skill to your local

pnpm dlx add-skill https://github.com/sushichan044/dotfiles/tree/HEAD/.agents/skills/prepare-issue-pr

Skill Files

Browse the full folder contents for prepare-issue-pr.

Download Skill

Loading file tree…

.agents/skills/prepare-issue-pr/SKILL.md

Skill Metadata

Name
prepare-issue-pr
Description
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.

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 both the purpose of the change and the implementation shape.
      • 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

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.

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.