| name | create-pr |
| description | Create a pull request. Always use this skill when the user requests creating a PR. Route through this skill instead of using gh commands directly. |
| allowed-tools | Bash, Read, Grep, Write |
Create Pull Request Skill
This skill creates pull requests with a standardized format after running CI-equivalent checks.
Pre-PR Workflow
Before creating a PR, you MUST complete the following steps in order:
Step 1: Run CI-equivalent tests locally
Run these commands in sequence. If any fail, handle as described:
pnpm build
pnpm lint
pnpm format:check
pnpm typecheck
pnpm knip
pnpm test
Failure handling:
- If
build fails: Report the error and STOP. Do not create PR.
- If
lint or format:check fails: Try auto-fix with pnpm exec oxlint --fix . && pnpm format. If still failing, report the error and STOP.
- If
typecheck or knip fails: Report the error and STOP. Do not create PR.
- If
test fails: Report the error and STOP. Do not create PR.
Step 2: Check and create changeset if needed
Check if a changeset file exists in the PR diff:
git diff main...HEAD --name-only | grep -E '^\.changeset/.*\.md$' | grep -v README.md
If NO changeset exists, create one:
-
Analyze ALL changes from main branch (not just the latest commit):
git diff main...HEAD
git log main..HEAD --oneline
-
Determine version type automatically (pre-1.0 policy):
minor: Breaking changes only
patch: Bug fixes, new features, refactoring, docs
major: Not used until 1.0 release
-
Create changeset file in .changeset/ with a random name (e.g., cool-dogs-fly.md):
---
"zinfer": patch
---
Description of ALL PR changes in English
-
Commit the changeset:
git add .changeset/*.md
git commit -m "chore: add changeset"
Step 3: Create PR
After all checks pass and changeset exists, create the PR.
PR Format Rules
When creating a pull request, follow these rules:
- Language: Write all PR content (title, body) in English
- No Test Plan: Do NOT include a "Test plan" section
- No Claude Footer: Do NOT include "🤖 Generated with Claude Code" or similar footer
- Concise Summary: Focus on what changed and why
PR Body Structure
## Summary
- Brief description of changes (bullet points)
- Focus on what and why, not how
## Additional sections (optional)
Add relevant sections based on the changes:
- Breaking Changes
- Migration Guide
- Notes
Commands
Check current state
git status
git diff main...HEAD
git log main..HEAD --oneline
Create PR
gh pr create --draft --title "type: description" --body "$(cat <<'EOF'
## Summary
- Change 1
- Change 2
EOF
)"
Update existing PR
gh pr edit <number> --title "new title" --body "new body"
Commit Message Convention
Use conventional commits format:
feat: - New feature
fix: - Bug fix
chore: - Maintenance
refactor: - Code refactoring
docs: - Documentation
Complete Workflow Summary
- Run
pnpm build → If fails, STOP and report
- Run
pnpm lint → If fails, try pnpm exec oxlint --fix . → If still fails, STOP and report
- Run
pnpm format:check → If fails, try pnpm format → If still fails, STOP and report
- Run
pnpm typecheck → If fails, STOP and report
- Run
pnpm knip → If fails, STOP and report
- Run
pnpm test → If fails, STOP and report
- Check if changeset exists in diff → If missing, analyze ALL PR changes and create one
- Create PR with
gh pr create --draft
Example
When user says: "create a PR"
- Run CI checks (build, lint, format:check, typecheck, knip, test)
- If lint/format fails, run auto-fix and retry
- Check for changeset, create if missing based on ALL changes from main
- Create PR with English content:
gh pr create --draft --title "feat: add type extraction for nested schemas" --body "$(cat <<'EOF'
## Summary
- Add support for extracting types from nested Zod schemas
- Handle recursive schema references in type generation
EOF
)"