/building:draft-prfrom building
Create a draft pull request with a standardized body (a blank Intent for the author, then What/Why/How) and conventional-commit title, or hand the user the exact `gh pr create --draft` command to run. Follow this skill whenever opening a pull request, or when the user asks for the command to open one — the draft PR is the human review checkpoint, so the body format is fixed, the title is conventional-commit, and the PR is always marked draft. Main agents only; sub-agents return their work to the main agent to PR.
Ships in building. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
git branch --show-currentgit status --shortgh repo view --json defaultBranchRef -q .defaultBranchRef.name 2>/dev/null || echo maingit log --oneline origin/HEAD..HEAD 2>/dev/null || echo "(cannot compute — origin/HEAD unset)"gh pr view --json number,url,isDraft,state 2>/dev/null || echo "(no PR for this branch)"gh auth status 2>&1 | head -1Every PR this skill creates is --draft. Never omit the flag, never mark a PR ready for review. The draft state is the human checkpoint — the user transitions the PR to ready-for-review themselves.
No --force, no --force-with-lease, no --no-verify. If a push is rejected or a hook fails, surface the error and stop.
If an open PR already exists for the current branch, surface its URL and stop. Do not create a duplicate. Updating an existing PR is out of scope for this skill.
Sub-agents do not create PRs. PR creation IS the human review checkpoint — if a sub-agent is creating a PR, the checkpoint is being skipped. Sub-agents return their work to the calling agent, which creates the PR.
Conventional Commits v1.0.0, same rules as the commit skill:
<type>[optional scope][optional !]: <description>
Types: feat, fix, refactor, chore, docs, style, test, build, ci, perf
Scope: Single atomic identifier — never comma-separated.
Subject: Imperative mood, under 72 characters, captures the why.
Derivation priority:
type(scope): subject line that summarizes the branch, drawing on the commit subjects and the branch name.Exactly four sections, in this order, with these headings:
## Intent
> [!IMPORTANT]
> Author: replace this block with the mission these changes drive towards, in your own words. An agent never writes this section.
## What
<bulleted summary of the changes — derived from the commits on this branch>
## Why
<motivation — the problem this is solving, drawn from conversation context>
## How
<approach — key design decisions or tradeoffs worth surfacing to the reviewer>
git log <base>..HEAD alone. No conversation required.Stop and report if any check fails:
git rev-parse --git-dir).gh repo view --json defaultBranchRef -q .defaultBranchRef.name, fall back to main.git status --porcelain empty). If dirty, point the user to the commit skill.origin/<default> when that ref exists, otherwise local <default>. Check with git rev-list --count <base>..HEAD.## Intent: the placeholder, verbatim.## What from git log <base>..HEAD --format='%s%n%b' — bullet the distinct changes.## Why from conversation context.## How from conversation context.If Why or How cannot be derived from conversation, ask the user. Do not fabricate.
State, without waiting: the title, the base branch, draft status, and whether the push creates or updates the remote branch. Then proceed.
With the PR URL, tell the user to replace the Intent block before marking the PR ready.
The draft state is the review gate — the user reviews the PR itself, not a preview of it. Asking twice is what this skill is removing.
In order:
git push -u origin HEAD — pushes the current branch and sets upstream if unset, no force. HEAD avoids naming the branch, which would need command substitution.gh pr create --draft --base <default-branch> --title <title> --body <body>.ci-watch skill against the new PR,
so failing checks are repaired without another prompt. The agent runs
detached; do not wait for it. Report the PR URL immediately and note that
the watcher is running.If step 1 fails, stop — do not attempt step 2.
Hand-back mode. Use it when gh auth status fails, or when the user asks for the
command instead of the PR. Run step 1 as above. Then, instead of steps 2–4, give the user
the exact gh pr create --draft --base <default-branch> --title <title> --body <body>
command, with the title and body from step 2 filled in, ready to paste. There is no PR yet,
so do not start the watcher.
## Intent
> [!IMPORTANT]
> Author: replace this block with the mission these changes drive towards, in your own words. An agent never writes this section.
## What
- <change 1 — from commit subjects>
- <change 2>
## Why
<motivation from conversation context>
## How
<approach / key decisions from conversation context>
| Condition | Behavior |
|---|---|
| On the default branch | Refuse. Ask user to create a feature branch. |
| Dirty working tree | Refuse. Point to the commit skill. |
| No commits ahead of base | Refuse. Nothing to PR. |
| Open PR already exists for branch | Refuse. Surface the existing PR URL. |
gh not authenticated | Use hand-back mode. Push, then give the exact gh pr create --draft command. |
| Missing Why/How context | Ask the user. Do not fabricate. |
| User asks the agent to fill in the Intent | Leave the placeholder. Say the Intent is theirs to write, on the PR. |
git push fails | Surface the error. Do not attempt gh pr create. |
| CI still red after the watcher's three rounds | Surface the watcher's report. Do not retry. |
gh pr create without --draft.--no-verify.All of these mean: stop, surface the issue to the user, and wait.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub joelstoddard/guardrails --plugin building10 skills in this plugin
/biasesCounter reasoning biases when investigating, debugging, or searching a codebase or history. Follow this skill when looking for every instance of a pattern, diagnosing an incident, judging a past decision, or answering "has this happened before" — anywhere a partial sample could pass for the whole population./ci-watchWatch a pull request's CI checks and repair failures until they pass. Follow this skill after opening a PR, or when asked to watch, babysit, or fix CI on a PR. Bounded at three fix rounds; never weakens a test to reach green./commitCreate atomic conventional commits. Follow this skill whenever committing code — commit without asking, never push, and sub-agents commit as they go and surface a summary in their return value./concise-commentsUse when writing or editing comments in source code, when a comment is running past two sentences, when explaining non-obvious design context, tradeoffs, constraints or workarounds in code, or when reviewing code that carries long explanatory comment blocks or changelog-style notes. Trigger on 'document this decision', 'explain why this is here', 'make sure the next person understands', 'comment this properly'./learning-styleSet how Claude presents information to you, and takes it in from you, for this session. Styles are reading, seeing (or visual), doing and listening; give one or more./pre-pr-checkRun the repo's documented lint and tests, sweep the diff for secrets, over-long comments and code it could do without, grade this change against the compliance checklist, and weigh its impact and risk. Follow this skill before pushing anything to a shared remote or opening a pull request, and whenever the user asks to review changes or for a pre-push review. Pass --full to add the project-level categories that are near-static between PRs.