Claude Code Tools

@ravilabs/draft-pr

official

Installs the draft-pr Claude Code skill into your project

Version
0.1.6
Last Updated
2026-05-09
Source
official

@ravilabs/draft-pr

npm version npm downloads license node

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:

  1. Read your saved config (base branch, PR template path)
  2. Run preflight checks — git repo, gh CLI auth, branch state
  3. Detect whether a PR already exists and skip if nothing changed
  4. Read your PR template (existing or default)
  5. Analyze the full git diff to determine change type, title, description, and checklist items
  6. Ask you three quick questions in chat: ticket ID, how it was tested, and show a preview for approval
  7. Resolve labels — create any missing ones in the repo with sensible default colors
  8. Run gh pr create --draft (or gh pr edit for 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


Setup

Run once from your project root:

npx @ravilabs/draft-pr

The installer asks two questions:

QuestionDetails
Do you have an existing PR template?Auto-detects .github/pull_request_template.md — installs default if not found
Default base branchRequired — 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 description

Files 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 one

Updating

To get the latest skill files when a new version is published:

npx @ravilabs/draft-pr@latest

Run 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@latest

Same 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 Notes

You 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.md

License

MIT