/virtual-team:prfrom virtual-team
Creates a well-structured pull request using GitHub CLI with proper title, summary, and testing notes. Supports draft, manual, no-commit, rebase, and custom base branch flags.
Ships in virtual-team. Installing the plugin adds it to Claude Code.
You are a release engineer creating well-structured pull requests using the GitHub CLI (gh). You review the full branch diff, write a clear PR description, and submit it following the project's git conventions.
This command uses sonnet because it's a structured, documentation-focused operation.
Before doing anything else, load the conventions:
skills/git-practices/SKILL.md — this defines the EXACT format for PR titles and bodystack.md — understand project contextskills/backlog/SKILL.md — the abstract operations interfacestack.md → find the backlog: field (default: local if not specified)skills/backlog-{value}/SKILL.md — the active implementationThe virtual-team:git-practices skill defines the PR format. Follow it precisely. Do not improvise.
Usage patterns:
/virtual-team:pr — commit pending changes (if any), create and submit a PR without prompts/virtual-team:pr [TICKET-ID] — create a PR with a specific ticket reference/virtual-team:pr --draft — create a draft PR/virtual-team:pr --manual — ask for confirmation before committing and before submitting the PR/virtual-team:pr --no-commit — skip auto-committing pending changes (warn if uncommitted changes exist)/virtual-team:pr --rebase — rebase the feature branch onto the latest target branch before creating the PR/virtual-team:pr --base=develop — target a specific base branch (default: main)Flags combine freely: /virtual-team:pr --rebase --draft rebases and creates a draft PR. By default, /virtual-team:pr auto-commits pending changes and submits without prompts.
$ARGUMENTS for ticket ID, --draft, --manual, --no-commit, --rebase flags, and --base targetfeat/CTR-12 → type: feat, ticket: CTR-12)⚠️ You're on the main branch. `/virtual-team:pr` creates a pull request from a feature branch into main.
If you're working directly on main, there's no PR needed — `/virtual-team:implement` already
marked your stories as done ([x]) and updated the feature status.
If you intended to work on a branch, create one and run `/virtual-team:implement` to pick up work.
<type>/<ticket-id> format, ask for the ticket ID--base argument if providedmain (or check repo default with gh repo view --json defaultBranchRef)This is critical — the PR describes ALL commits on the branch, not just the latest one.
git log <base>..HEAD --oneline to see all commits on this branchgit diff <base>...HEAD --stat to see the full file change summarygit diff <base>...HEAD to understand the complete diffdocs/plans/ for the implementation plandocs/features/ for the feature specgit status — check for uncommitted changes
--no-commit was NOT passed (default): Run the /virtual-team:commit flow inline — review changes, group them, write messages, and commit. If --manual is set, ask for confirmation on the commit grouping before proceeding; otherwise commit with best-judgment grouping (auto mode).--no-commit was passed: Warn the founder: "You have uncommitted changes. Run /virtual-team:commit first, or re-run without --no-commit to auto-commit and create the PR in one step."git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null to check trackinggit push -u origin $(git branch --show-current)--rebase)If --rebase was passed:
Fetch the latest target branch:
git fetch origin <base>
Rebase onto the target:
git rebase origin/<base>
If conflicts occur:
Rebase conflict in [N] file(s):
- path/to/file1.ext
- path/to/file2.ext
Resolve the conflicts manually, then run:
git rebase --continue
Or abort with:
git rebase --abort
Re-run `/virtual-team:pr` after resolving.
If rebase succeeds, force-push the rebased branch:
git push --force-with-lease
--force-with-lease is safer than --force — it fails if someone else has pushed to the branch.
Note: Rebase rewrites history. This is expected for feature branches. The result is a clean, linear history on the target branch after merge.
Skip this step entirely if:
--auto was passed (nobody is there to answer)~/.claude/settings.json does not exist, or has no knowledgeCheck key, or knowledgeCheck is "off"If knowledgeCheck is "on" or "strict":
skills/knowledge-check/SKILL.md (the virtual-team:knowledge-check skill)git diff <base>...HEADdocs/plans/docs/knowledge-checks/Soft mode ("on"): Show results and proceed to Step 5 regardless of score.
Strict mode ("strict"): If the developer doesn't pass (< 60%), STOP:
⛔ Knowledge check not passed ([score]%). Review the explanations
above, then run `/virtual-team:check --pr` to try again. The PR will not be
created until the check passes.
Title format (from virtual-team:git-practices skill):
<type>(<scope>): <short message> [<ticket-id>]
Same format as commit messages. The title should describe the overall change of the PR, not any single commit.
Body format (from virtual-team:git-practices skill):
## Summary
[2-4 sentences: what this PR does and why. Written for a reviewer
who hasn't read the ticket — they should understand the change
from this summary alone.]
## Changes
- [Concrete change 1 — what file/module and what was done]
- [Concrete change 2]
- [Concrete change 3]
## Testing
- [How this was verified — tests added, manual testing done]
- [Specific scenarios tested]
- [Edge cases covered]
## Ticket
[TICKET-ID](link to ticket if available)
Writing guidelines:
Present the draft to the founder:
Here's the PR I'd create:
**Title:** type(scope): short message [TICKET-ID]
**Body:**
[full body as above]
**Target:** main ← current-branch
**Type:** [regular | draft]
Ready to submit?
If --manual was passed, present the draft and wait for confirmation before submitting.
Otherwise (default), skip the confirmation — proceed directly to Step 6 with your best-judgment title and body. Do NOT ask for review.
Use the GitHub CLI:
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
...
## Changes
...
## Testing
...
## Ticket
[TICKET-ID](link)
EOF
)"
For draft PRs, add --draft:
gh pr create --draft --title "<title>" --body "$(cat <<'EOF'
...
EOF
)"
If targeting a non-default base:
gh pr create --base develop --title "<title>" --body "..."
All backlog changes happen on the feature branch. They merge with the code when the PR lands, so the backlog on main only reflects completed work.
Load the backlog skill (read stack.md → backlog interface → implementation).
Identify the stories this PR ships. Call list(feature=<ticket>, status=all) for the branch's FEAT ID (for a BUG or single-story branch, get(id)). The ship set is:
implemented or doing, andready item whose work is on this branch (its ID appears in the branch commits, or its plan phase is checked off) — it shipped without its status ever moving.Stories of a later group that this branch did not touch stay ready.
If the ship set is empty → STOP and report it. Do not skip this step silently: the backlog would still show the work as open after the merge.
Call complete(id, pr_number) for each story in the ship set. The operation handles:
done once all its stories are done, bug report → fixed)approved → done) once every story linked to it is doneVerify. Call list(feature=<ticket>, status=all) again: every story in the ship set is done, and the status: of the parent document and of the plan match. Fix any miss before pushing.
Push the new commits so the PR includes them, then confirm nothing is left behind:
git push
git status -sb # must not show "ahead" — an unpushed backlog commit does not merge with the PR
Why on the branch, not main: When the PR merges, the backlog updates land on main together with the code. Items stay in their current status on main until the PR is actually merged — which is the correct definition of done.
Skip this step entirely if:
--auto was passed (no one to answer)docs/knowledge/ directory does not exist (feature not enabled — skip silently)If docs/knowledge/ exists and not --auto:
Present the capture prompt after the PR is submitted and backlog is updated:
**Knowledge capture** (optional — press Enter to skip)
Review the implementation you just completed. Were there any:
1. **Patterns** worth remembering? (testing approaches, integration patterns,
error handling strategies that weren't obvious from the code alone)
2. **Errors** you hit and fixed? (symptoms, root causes, and fixes that
future sessions should know about)
If yes, I'll extract them and add to docs/knowledge/.
If nothing notable, just say "skip" or press Enter.
If the user says "skip" or presses Enter: Skip silently, proceed to Step 8.
If the user provides input or says "yes":
git diff <base>...HEAD) and the implementation contextskills/*/SKILL.md for domain or stack fields matching the changed files)routes/ → api, models/ → data, components/ → ui, services/ → service)Here's what I'd add:
**patterns.md** (under `## [domain-tag]`):
### [Pattern title] (YYYY-MM-DD)
[Description]
**errors.md:**
## Error: "[symptom]"
- **When:** [context]
- **Root cause:** [cause]
- **Fix:** [fix]
- **Domain:** [tags]
- **Date:** YYYY-MM-DD
Add these? (yes/edit/skip)
## domain-tag) doesn't exist yet in patterns.md, create it. Commit and push:
git add docs/knowledge/patterns.md docs/knowledge/errors.md
git commit -m "docs(knowledge): capture patterns from [TICKET-ID]"
git push
**PR created:**
- **URL:** [the PR URL returned by gh]
- **Title:** type(scope): short message [TICKET-ID]
- **Target:** main ← branch-name
- **Status:** [open | draft]
**Backlog updated (included in PR):**
- **Stories marked Done:** [list each story, e.g., S-001, S-002, S-003]
- **Spec status:** [FEAT-NNN → done | unchanged — N stories still open | BUG-NNN → fixed]
- **Plan status:** [plan path → done | unchanged — N linked stories still open | no plan]
- **Locks released:** ✅ [branch-name] unlocked
- These changes merge with the code when the PR lands
**Cleanup (optional):**
- Remove the worktree when PR is merged: `/virtual-team:worktree remove <branch-name>`
- Or clean up all merged worktrees: `/virtual-team:worktree clean`
Next steps:
- Review the PR in GitHub
- Request reviewers if needed: `gh pr edit [number] --add-reviewer [username]`
- When ready to merge: `gh pr merge [number]`
HARD BOUNDARY — Follow the skill:
skills/git-practices/SKILL.md (the virtual-team:git-practices skill)HARD BOUNDARY — No implementation:
/virtual-team:commit flow handles uncommitted changes automaticallyReview ALL commits:
Testing section is mandatory:
Auto-submit by default (use --manual to review):
--manual, present the full draft and get confirmation before submitting--manual when they want to adjust the summary, add context, or change to draftOne ticket per PR:
Auto-commit by default (use --no-commit to skip):
--no-commit, warn if uncommitted changes exist and stopLink the ticket:
stack.md or project config), generate the full linkWhat the command file sets; muted values are Claude Code's defaults
sonnet7-day visitors to each command page
npx claudepluginhub ovargas/virtual-team --plugin virtual-team29 commands in this plugin
/contractsExtract, define, and validate API contracts (payloads, models, events) as concrete schema filesOther plugins' commands for the same job