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.
npx skills add https://github.com/microsoft/roosterjs --skill draft-pr
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.
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.
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.
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.
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.
Follow the repo's commit/PR conventions (see AGENTS.md):
[Table Improvements] ...).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:
yarn test:fast (optionally scoped with --testPathPattern=<regex> or --testNamePattern=<regex>). Never suggest yarn test or karma start.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.
master branch by default (per AGENTS.md). Only target another base if the user explicitly asks.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.
Structured task planning with clear breakdowns, dependencies, and verification criteria. Use when implementing features, refactoring, or any multi-step work.
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.
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.
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.
Angular performance optimization and best practices guide. Use when writing, reviewing, or refactoring Angular code for optimal performance, bundle size, and rendering efficiency.
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.
Angular performance optimization and best practices guide. Use when writing, reviewing, or refactoring Angular code for optimal performance, bundle size, and rendering efficiency.
Take microsoft/draft-pr from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
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.