Loading...
Loading...
Creates GitHub pull requests with validation. Use when opening PRs or submitting code for review.
npx skill4agent add yonatangross/orchestkit create-pr/create-prAskUserQuestion(
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
}]
)# 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# 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: [...]}
Scope: ONLY read files directly relevant to the PR diff. Do NOT explore the entire codebase.
SUMMARY: End with: "RESULT: [PASS|WARN|BLOCK] - [N] issues: [brief list or 'clean']"
""",
run_in_background=True,
max_turns=25
)
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: [...]}
Scope: ONLY read files directly relevant to the PR diff. Do NOT explore the entire codebase.
SUMMARY: End with: "RESULT: [N]% coverage, [passed]/[total] tests - [status]"
""",
run_in_background=True,
max_turns=25
)
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: [...]}
Scope: ONLY read files directly relevant to the PR diff. Do NOT explore the entire codebase.
SUMMARY: End with: "RESULT: [PASS|WARN|FAIL] - [N] lint, [M] type errors"
""",
run_in_background=True,
max_turns=25
)# 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 typecheckBRANCH=$(git branch --show-current)
ISSUE=$(echo $BRANCH | grep -oE '[0-9]+' | head -1)
git log --oneline dev..HEAD
git diff dev...HEAD --statTYPE="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 --webgh pr create--from-pr <number|url>claude --from-pr 123 # Resume session linked to PR #123
claude --from-pr https://github.com/org/repo/pull/123token_counttool_usesduration_ms## Pre-PR Validation Metrics
| Agent | Tokens | Tools | Duration |
|-------|--------|-------|----------|
| security-auditor | 520 | 10 | 15s |
| test-generator | 380 | 6 | 12s |
| code-quality-reviewer | 450 | 8 | 10s |
**Total:** 1,350 tokens in 37s# Store PR context for future sessions
/ork:remember PR #123 created: [brief description], pending review from [team]gh pr create --body