create-pr
Create GitHub pull requests for TriStar features. Runs pre-flight checks, security scan, generates PR description from SDLC artifacts, and manages PR lifecycle.
SKILL.md.claude/skills/create-pr/SKILL.md
GitHubCreate PR Skill
Prime Directive
"Every PR tells a story. Make it complete."
Create well-documented pull requests with security scans, artifact references, and clear descriptions. Manage the full PR lifecycle from creation through merge.
Arguments
- Default: create a new PR for the current branch
--status: check existing PR status--reviewers=<list>: assign reviewers--merge: merge the PR (after checks pass)
Pre-Flight Checks
Before creating a PR, verify:
- GitHub CLI authenticated:
gh auth status - Not on main/master branch: refuse to create PR from protected branches
- No uncommitted changes:
git statusshows clean working tree - Branch has commits ahead of base:
git log main..HEADshows commits - Remote branch exists or push first: ensure branch is pushed with
-uflag
Process
Step 1: Pre-Flight
Run all pre-flight checks. If any fail, report the failure and stop.
Step 2: Security Scan
Run bash scripts/security-scan.sh if the script exists. If it fails, warn the user but do not block (they may choose to proceed).
Step 3: Gather Context
- Read
git log main..HEAD --onelinefor commit history - Read
git diff main...HEAD --statfor changed files summary - Check for SDLC artifacts in
docs/artifacts/relevant to this branch - Read any available artifacts (problem_spec.md, design_spec.md, verification_report.md, risk_assessment.md)
Step 4: Generate PR Title
Use conventional commit format: <type>: <description>
Types:
feat: New featurefix: Bug fixdocs: Documentation onlyrefactor: Code restructuretest: Add/update testschore: Tooling, dependencies
Determine type from commit messages and changed files. Keep title under 70 characters.
Step 5: Generate PR Description
Use the template from templates/pr-description.md. Fill in:
- Summary from commit messages and changed files
- Layers affected (from artifact or file analysis)
- Type of change
- Test plan
- Security status
- SDLC artifact references (if available)
Step 6: Create PR
Use gh pr create with the generated title and body.
gh pr create --title "<title>" --body "<body>"
Step 7: Report
Output the PR URL and a summary of what was created.
Branch Naming Convention
feature/<description>- New feature developmentbugfix/<description>- Bug fixdocs/<description>- Documentation changesrefactor/<description>- Code restructuringtest/<description>- Test additions
PR Lifecycle Operations
Status Check
gh pr status
gh pr checks
Assign Reviewers
gh pr edit --add-reviewer <username>
Merge (after approval)
gh pr merge --squash --delete-branch
Important Rules
- Do NOT add Co-Authored-By lines to PR descriptions
- Do NOT push to main/master directly
- Do NOT create PRs from main/master branch
- Always run security scan before creating PR
- Always include SDLC artifact references when available
- Use conventional commit format for PR titles
Templates
templates/pr-description.md- PR body template