mcpbeat Sign in

Draft Pr Agent Skill

Creates a pull request for the current branch, generating a clear title and a description that summarizes the changes and includes instructions on how to test them. Use when asked to open, draft, or create a PR.

991 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
1310
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/microsoft/roosterjs --skill draft-pr

The instruction itself

11 sections, as written by the author

Draft PR Skill

This skill creates a pull request for the current branch. It inspects the diff against master, generates a concise imperative title and a structured description (summary + how-to-test), and opens the PR with the gh CLI.

Steps

Step 1: Determine the current branch

git branch --show-current

If the current branch is master (or release), stop and tell the user to switch to a feature branch first — PRs should not be opened from master.

Step 2: Inspect the changes

Gather the commits and the diff that this branch adds on top of master:

git log master..HEAD --oneline
git diff master...HEAD --stat
git diff master...HEAD

If there are no commits/diff versus master, stop and tell the user there is nothing to open a PR for.

Read the diff carefully so the title and description reflect what actually changed — not just the commit messages.

Step 3: Make sure the branch is pushed

Check the upstream state:

git status -sb

If the branch has no upstream or has unpushed commits, push it:

git push -u origin <branch_name>

If there are uncommitted changes, stop and ask the user whether to commit them first — do not commit on their behalf without confirmation.

Step 4: Check for an existing PR

gh pr list --head <branch_name> --json number,title,url

If a PR already exists, show its URL and ask the user whether to update it instead of creating a new one. Do not create a duplicate.

Step 5: Write the title

Follow the repo's commit/PR conventions (see AGENTS.md):

  • Concise, imperative mood ("Add", "Fix", "Remove", "Update").
  • Mention the surface area / feature when helpful (e.g. [Table Improvements] ...).
  • Reference a GitHub issue/PR number when relevant.

Step 6: Write the description

Write the body to a temp file (avoids shell-escaping issues) using this template:

## Summary

<1-3 sentence explanation of WHAT changed and WHY. Reference the specific
file(s)/function(s) and the behavior before vs. after when it clarifies intent.>

## How to test

1. <Exact command(s) to run the relevant tests, e.g.
   `yarn test:fast --testPathPattern=<regex>`>
2. <Manual / integration steps when applicable: setup, action to trigger, and
   the expected result. Call out before-this-fix vs. after-this-fix behavior
   when it makes verification clearer.>

Guidance for the How to test section:

  • Always include the project test command: yarn test:fast (optionally scoped with --testPathPattern=<regex> or --testNamePattern=<regex>). Never suggest yarn test or karma start.
  • Prefer concrete, copy-pasteable steps over vague descriptions.
  • When the change is behavioral, describe how to observe the difference (e.g. "Before this fix: X. After this fix: Y.").

Step 7: Create the PR

Use a heredoc to build the body file, then create the PR against master:

cat > /tmp/draft_pr_body.md << 'EOF'
<description from Step 6>
EOF
gh pr create --base master --head <branch_name> --title "<title>" --body-file /tmp/draft_pr_body.md

If the user asked for a draft PR, add the --draft flag.

Display the resulting PR URL to the user and a one-line recap of the title and how-to-test summary.

Notes

  • PRs target the master branch by default (per AGENTS.md). Only target another base if the user explicitly asks.
  • Keep the title and description grounded in the actual diff — do not invent changes or test steps that the code does not support.
  • If anything is ambiguous (e.g. which issue to reference, draft vs. ready), ask the user rather than guessing.

Other skills for the same job

different authors, same section of the catalogue
Karpathy Guidelines
by hyyhf
×3

Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.

629 tokens
Plan Writing
by ComeOnOliver
×2

Structured task planning with clear breakdowns, dependencies, and verification criteria. Use when implementing features, refactoring, or any multi-step work.

4k tokens
Modern Javascript Patterns
by ComeOnOliver
×2

Master ES6+ features including async/await, destructuring, spread operators, arrow functions, promises, modules, iterators, generators, and functional programming patterns for writing clean, efficient JavaScript code. Use when refactoring legacy code, implementing modern patterns, or optimizing JavaScript applications.

9k tokens
Modern Javascript Patterns
by ComeOnOliver
×2

Master ES6+ features including async/await, destructuring, spread operators, arrow functions, promises, modules, iterators, generators, and functional programming patterns for writing clean, efficient JavaScript code. Use when refactoring legacy code, implementing modern patterns, or optimizing JavaScript applications.

8k tokens
Contributor Pr Description
by flutter
vendor ×1

Guidelines and format for writing pull request descriptions in this repository. Use this skill whenever the user asks you to draft a pull request description, submit a PR, or update a PR description.

697 tokens
Angular Best Practices
by lingxling
×1

Angular performance optimization and best practices guide. Use when writing, reviewing, or refactoring Angular code for optimal performance, bundle size, and rendering efficiency.

4k tokens
Gh Fix CI
by christophacham
×1

Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions. Uses `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treats external providers (for example Buildkite) as out of scope and reports only the details URL. Do NOT use for addressing PR review comments (use gh-address-comments) or general CI outside GitHub Actions.

7k tokens scripts
Angular Best Practices
by ComeOnOliver
×1

Angular performance optimization and best practices guide. Use when writing, reviewing, or refactoring Angular code for optimal performance, bundle size, and rendering efficiency.

6k tokens

How to use it

Copy the folder

Take microsoft/draft-pr from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.