@ravilabs/draft-pr
v0.1.6
Published
Installs the draft-pr Claude Code skill into your project
Maintainers
Readme
@ravilabs/draft-pr
A zero-dependency NPM package that installs the draft-pr Claude Code skill into your project. Run npx @ravilabs/draft-pr once to set it up, then tell Claude Code "draft pr" — it analyzes your git diff and creates a fully populated GitHub Pull Request in seconds.
What it does
The package installs a skill file that Claude Code reads. When triggered, Claude will:
- Read your saved config (base branch, PR template path)
- Run preflight checks — git repo,
ghCLI auth, branch state - Detect whether a PR already exists and skip if nothing changed
- Read your PR template (existing or default)
- Analyze the full
git diffto determine change type, title, description, and checklist items - Ask you three quick questions in chat: ticket ID, how it was tested, and show a preview for approval
- Resolve labels — create any missing ones in the repo with sensible default colors
- Run
gh pr create --draft(orgh pr editfor updates) and print the PR URL
No AI logic lives in this package — it is purely a skill file distributor. All intelligence runs inside Claude Code at execution time.
Prerequisites
- Claude Code
- gh CLI — installed and authenticated (
gh auth login) - Node.js ≥ 18
Setup
Run once from your project root:
npx @ravilabs/draft-prThe installer asks two questions:
| Question | Details |
|----------|---------|
| Do you have an existing PR template? | Auto-detects .github/pull_request_template.md — installs default if not found |
| Default base branch | Required — e.g. main, master, develop |
It then writes .claude/skills/draft-pr/config.json and drops the skill files into .claude/skills/draft-pr/.
Usage
After installation, restart Claude Code to register the skill. Then trigger it in two ways:
Slash command (recommended):
/draft-pr → creates PR against your configured default branch
/draft-pr main → creates PR against main (one-time override)
/draft-pr staging → creates PR against staging (one-time override)Natural language:
draft pr
draft pr main
draft pr staging
create pr
open pull request
raise a PR
submit PR
update my PR
fix my PR descriptionFiles installed into your project
.claude/
└── skills/
└── draft-pr/
├── SKILL.md ← skill definition Claude Code reads
├── config.json ← your base branch + template config
├── scripts/
│ └── preflight.sh ← git/gh checks run before each PR
└── templates/
└── pr_template.md ← default PR template (if you didn't have one)
.github/
└── pull_request_template.md ← installed if you didn't already have oneUpdating
To get the latest skill files when a new version is published:
npx @ravilabs/draft-pr@latestRun this from your project root. The installer will detect the existing installation and ask whether to overwrite. Your config.json is always preserved — only SKILL.md, scripts/, and templates/ are updated. Restart Claude Code after updating.
Reconfigure
To change your base branch or template settings:
npx @ravilabs/draft-pr@latestSame command — re-running the installer lets you update config and skill files in one step.
Default PR template
If you don't have an existing PR template, the installer copies this one:
## Description
## Fixes / Changes
## Type of Change
## Jira / Linear Ticket
## How Have You Tested?
## Checklist
## Additional NotesYou can edit .github/pull_request_template.md freely — the skill reads whatever is there at runtime.
Package contents
draft-pr/
├── bin/
│ └── install.js ← npx entrypoint (pure Node built-ins, zero deps)
├── skills/
│ └── draft-pr/
│ ├── SKILL.md
│ ├── templates/
│ │ └── pr_template.md
│ └── scripts/
│ └── preflight.sh
├── package.json
└── README.mdLicense
MIT
