[GIT] Create GitHub pull requests with validation. Use when opening PRs or submitting code for review.
Creates GitHub pull requests with automated validation and parallel security, testing, and code quality checks.
/plugin marketplace add yonatangross/orchestkit/plugin install ork@orchestkitComprehensive PR creation with validation. All output goes directly to GitHub PR.
/create-pr
BEFORE creating tasks, clarify PR type:
AskUserQuestion(
questions=[{
"question": "What type of PR is this?",
"header": "Type",
"options": [
{"label": "Feature (Recommended)", "description": "New functionality with full validation"},
{"label": "Bug fix", "description": "Fix for existing issue"},
{"label": "Refactor", "description": "Code improvement, no behavior change"},
{"label": "Quick", "description": "Skip validation, just create PR"}
],
"multiSelect": false
}]
)
Based on answer, adjust workflow:
BEFORE doing ANYTHING else, create tasks to show progress:
# 1. Create main PR task IMMEDIATELY
TaskCreate(
subject="Create PR for {branch}",
description="PR creation with parallel validation agents",
activeForm="Creating pull request"
)
# 2. Create subtasks for phases
TaskCreate(subject="Pre-flight checks", activeForm="Running pre-flight checks")
TaskCreate(subject="Run parallel validation agents", activeForm="Validating with agents")
TaskCreate(subject="Run local tests", activeForm="Running local tests")
TaskCreate(subject="Create PR on GitHub", activeForm="Creating GitHub PR")
# 3. Update status as you progress
TaskUpdate(taskId="2", status="in_progress") # When starting phase
TaskUpdate(taskId="2", status="completed") # When phase done
# Verify branch
BRANCH=$(git branch --show-current)
if [[ "$BRANCH" == "dev" || "$BRANCH" == "main" ]]; then
echo "Cannot create PR from dev/main. Create a feature branch first."
exit 1
fi
# Check for uncommitted changes
if [[ -n $(git status --porcelain) ]]; then
echo "Uncommitted changes detected. Commit or stash first."
exit 1
fi
# Push branch if needed
git fetch origin
if ! git rev-parse --verify origin/$BRANCH &>/dev/null; then
git push -u origin $BRANCH
fi
Launch validation agents in ONE message BEFORE creating PR:
# PARALLEL - All 3 in ONE message
Task(
subagent_type="security-auditor",
prompt="""Security audit for PR changes:
1. Check for secrets/credentials in diff
2. Dependency vulnerabilities (npm audit/pip-audit)
3. OWASP Top 10 quick scan
Return: {status: PASS/BLOCK, issues: [...]}
SUMMARY: End with: "RESULT: [PASS|WARN|BLOCK] - [N] issues: [brief list or 'clean']"
""",
run_in_background=True
)
Task(
subagent_type="test-generator",
prompt="""Test coverage verification:
1. Run test suite with coverage
2. Identify untested code in changed files
Return: {coverage: N%, passed: N/N, gaps: [...]}
SUMMARY: End with: "RESULT: [N]% coverage, [passed]/[total] tests - [status]"
""",
run_in_background=True
)
Task(
subagent_type="code-quality-reviewer",
prompt="""Code quality check:
1. Run linting (ruff/eslint)
2. Type checking (mypy/tsc)
3. Check for anti-patterns
Return: {lint_errors: N, type_errors: N, issues: [...]}
SUMMARY: End with: "RESULT: [PASS|WARN|FAIL] - [N] lint, [M] type errors"
""",
run_in_background=True
)
Wait for agents, then run local validation:
# Backend
cd backend
poetry run ruff format --check app/
poetry run ruff check app/
poetry run pytest tests/unit/ -v --tb=short -x
# Frontend
cd ../frontend
npm run lint && npm run typecheck
BRANCH=$(git branch --show-current)
ISSUE=$(echo $BRANCH | grep -oE '[0-9]+' | head -1)
git log --oneline dev..HEAD
git diff dev...HEAD --stat
TYPE="feat" # Determine: feat/fix/refactor/docs/test/chore
gh pr create --base dev \
--title "$TYPE(#$ISSUE): Brief description" \
--body "## Summary
[1-2 sentence description]
## Changes
- [Change 1]
- [Change 2]
## Test Plan
- [x] Unit tests pass
- [x] Lint/type checks pass
Closes #$ISSUE
Generated with [Claude Code](https://claude.com/claude-code)"
PR_URL=$(gh pr view --json url -q .url)
echo "PR created: $PR_URL"
gh pr view --web
After creating a PR, optionally notify the team:
mcp__slack__post_message({
channel: "#dev-prs",
text: "New PR: #{number} - {title} | {files} files, +{additions}/-{deletions}"
})
CC 2.1.20's /commit-push-pr flow can be extended with Slack auto-posting. See slack-integration skill for setup.
Sessions created via gh pr create are now automatically linked to the PR. Use --from-pr <number|url> to resume sessions linked to a specific PR:
claude --from-pr 123 # Resume session linked to PR #123
claude --from-pr https://github.com/org/repo/pull/123
This means PR context (diff, comments, review status) is available when resuming.
gh pr create --bodyOnly use Task agents for:
/create-prCreate a new branch, commit changes, and submit a pull request with automatic commit splitting
/create-prStreamlines pull request creation by handling the entire workflow: creating a new branch, committing changes, formatting modified files with Biome, and submitting the PR.