How this skill is triggered — by the user, by Claude, or both
Slash command
/axis-human-ai-toolbox:create-prThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Role:** Senior engineer opening a pull request.
Role: Senior engineer opening a pull request.
Goal: Auto-generate a complete, reviewer-ready PR from git context alone. Every section is derived from the diff, commits, branch name, and project files — no manual writing required. When --auto is passed (or when called by another skill/agent), skip all confirmation steps and create the PR immediately.
Parse $ARGUMENTS for:
--base <branch> — target branch for the PR (skip inference if provided)--ticket-id <id> — ClickUp or issue ID to reference (optional)--auto — skip all confirmation steps and create the PR without askingCapture any provided values. Set AUTO_MODE = true if --auto is present.
Run all commands via Bash. Capture every output — it feeds every section of the template.
# Current branch
git branch --show-current
# Remote URL (to extract OWNER and REPO)
git remote get-url origin
# Current git user email (to exclude from FYI tagging)
git config user.email
# All remote branches (for base branch inference)
git branch -r --format='%(refname:short)' | sed 's/origin\///'
# Last 20 commits on this branch (used for description and module inference)
git log HEAD --oneline -20
# All changed files vs each candidate base branch (resolved once base is confirmed)
# Run after base is resolved:
git diff <BASE_BRANCH>...HEAD --name-only
git diff <BASE_BRANCH>...HEAD --stat
git diff <BASE_BRANCH>...HEAD
Extract OWNER and REPO from the remote URL:
[email protected]:owner/repo.githttps://github.com/owner/repo.gitIf the working tree has uncommitted changes, warn:
"Uncommitted changes detected. These will not be included in the PR. Commit them first or proceed anyway." In
AUTO_MODE, proceed without asking.
If --base was provided, use it as BASE_BRANCH without any confirmation or inference and skip to Step 4. This is always correct when called by implement-task — do not second-guess it.
Otherwise, infer from the remote branches list using this priority order:
mainmasterdevelopstagingrelease/* branch foundIf AUTO_MODE is false and the inferred branch is not main or master, confirm with the user:
"Inferred base branch:
<branch>. Is this correct?" InAUTO_MODE, proceed with the inferred branch silently.
If the current branch equals BASE_BRANCH, stop:
"The current branch is the same as the base branch. Switch to a feature branch first."
Derive the PR title from the branch name:
feat/, fix/, chore/, refactor/, docs/, hotfix/CU-abc123-, M3-S12-)[Feature], [Fix], [Refactor], [Docs], [Chore], [Hotfix]--ticket-id or extracted from the branch name), append it: (CU-abc123)Example: feat/CU-abc123-user-auth-flow → [Feature] User auth flow (CU-abc123)
The canonical PR body structure is defined in templates/pull_request_template.md at the project root of the ai-toolbox repo (the repo where this skill lives). Read that file and use it as the exact skeleton — do not invent or remove sections. Populate every placeholder by analyzing the git context from Step 2. Instructions inside each section below describe how to derive the content — follow them precisely. The rendered output must not contain the instruction text or placeholder markers.
Using the commit messages and git diff output:
add, update, fix, refactor, deleteFrom the PR title type label (inferred in Step 4) or the branch prefix, tick exactly one checkbox:
| Branch prefix / label | Checkbox to tick |
|---|---|
feat/ / [Feature] | - [x] Feature |
fix/ / [Fix] | - [x] Bug Fix |
refactor/ / [Refactor] | - [x] Refactor |
docs/ / [Docs] | - [x] Docs |
chore/ / [Chore] | - [x] Chore |
hotfix/ / [Hotfix] | - [x] Hotfix |
Leave all others unchecked.
--ticket-id was provided, format it as a ClickUp URL: https://app.clickup.com/t/<id>CU-abc123), use the same formatN/AParse the branch name and the last 20 commit messages for:
M1, M2, M3, migration-1, section-2 in the branch name or commits. Extract as M{N}. If not found, write <!-- TBD -->.S12, sprint-12, sprint/12 in the branch name or commits. Extract as S{N}. If not found, write <!-- TBD -->.Never invent values. Placeholders are correct when data is absent.
Inspect the list of changed files (git diff --name-only) for any files inside directories that suggest shared or cross-cutting code:
shared/, core/, common/, lib/, utils/, helpers/, hooks/, composables/, services/, types/, constants/If any matches are found:
Team notified: No (the author must verify before merge)If no matches: Do not include the ### Shared Code Impact section in the rendered PR body.
Analyze the git diff and commit messages for indications of breaking changes, such as:
BREAKING CHANGE: or ! in the type prefix (e.g. feat!:)If breaking changes are detected:
If no breaking changes: Do not include the ### Breaking Changes section in the rendered PR body.
Check if a CODEOWNERS file exists at the project root or .github/CODEOWNERS.
If it exists, read it and extract GitHub handles (@username) mapped to the changed files.
Also run:
git log <BASE_BRANCH>...HEAD --invert-grep -E --format="%ae" -- <changed files> | sort | uniq
Map contributor emails to GitHub handles where possible (use the handle from CODEOWNERS if the same person appears there).
Combine both sources into a de-duplicated list of @handles.
Mandatory: remove the current PR author's handle from the list (identified by git config user.email from Step 2).
If the list is empty after deduplication, write: No additional stakeholders identified.
Inspect the changed file paths for UI indicators:
pages/, views/, routes/, screens/, app/, src/app/.vue, .svelte, Page., View., Screen., Layout.If UI changes are detected:
https://github.com/<OWNER>/<REPO>/blob/<CURRENT_BRANCH>/.github/evidence/<filename>.png?raw=true
If no UI changes: write: No UI changes in this PR.
Derive a concrete, ordered checkbox list a reviewer can follow to verify the changes end-to-end.
Rules:
npm test -- --testPathPattern=<file>)Format:
- [ ] <imperative step>
- [ ] <imperative step>
Ready for release: Yes — if all test plan steps are expected to pass based on the implementationNeeds additional work: No — unless there are known gaps, open questions, or incomplete items identified during implementationAssemble the full PR body using this exact structure:
## Description 📝
<populated description bullets>
### Type of Change
<checkbox list with exactly one item checked based on branch type>
### Related Ticket
<ticket URL or "N/A">
### Module
- Migration: <M{N} or TBD>
- Sprint: <S{N} or TBD>
### Shared Code Impact
<Include only if Yes: file list and Team notified>
### Breaking Changes
<Include only if Yes: describe what breaks and the migration path>
### FYI 🙋
<@handles or "No additional stakeholders identified.">
### Screenshots 📸
<screenshot entries or "No UI changes in this PR.">
### Test Plan 🧪
<checkbox list>
### Release Readiness
- Ready for release: <Yes/No>
- Needs additional work: <Yes/No>
If AUTO_MODE is false, present the rendered body and the inferred title to the user and ask:
"Does this PR look correct? Reply Yes to create it, or paste corrections." Apply any corrections before proceeding.
If AUTO_MODE is true, skip confirmation and proceed immediately.
All PRs must be created as Draft. This is non-negotiable — never omit --draft.
gh pr create \
--title "<PR title>" \
--body "<rendered PR body>" \
--base "<BASE_BRANCH>" \
--head "<current branch>" \
--draft
If the command exits with a non-zero status, capture the error and proceed to the fallback below.
If gh pr create failed, create the PR using the MCP tool:
mcp__github__create_pull_request {
owner: "<OWNER>",
repo: "<REPO>",
title: "<PR title>",
body: "<rendered PR body>",
head: "<current branch>",
base: "<BASE_BRANCH>",
draft: true
}
If both methods fail, report the errors from both attempts and stop.
## Pull Request Created (Draft)
Title: <title>
URL: <pr_url>
Base: <BASE_BRANCH> <- <current branch>
Files: <count> changed
Method: <gh CLI | GitHub MCP (fallback)>
Store PR_URL and PR_NUMBER in context — downstream skills or agents may need them.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub axis-human/dev-workflow-plugin --plugin axis-human-ai-toolbox