Git Push / Pull Request Operator (/git-pr)
Output language: Mirror the invoking prompt. Status tokens, Git/GitHub output and identifiers remain language-invariant.
Prepares remote delivery. Project Ownership: solo does not create a PR: Agent validates local readiness and tells the Human owner how to push. Project Ownership: team creates a PR after Human confirmation and remote validation. Agent never pushes on behalf of a human. Agent Execution does not affect delivery behavior.
Project ownership detection
Read # Project Ownership: team|solo and # Agent Execution: direct|orchestrated in .sdd/shared_context.md. --project-ownership=solo|team overrides delivery ownership only. Use canonical settings only when both headers exist exactly once and are valid. When both canonical headers are absent, use exactly one valid legacy source: exactly one # Collaboration Mode: solo|team header or exactly one --team-size=solo|team; duplicate, malformed or coexisting sources are BLOCKED. The valid source maps solo to solo/direct and team to team/orchestrated; emit a migration warning and do not silently rewrite governance. Missing, duplicate or malformed canonical headers are BLOCKED; never fallback legacy. When either canonical header exists, --team-size is BLOCKED; the alias is valid only when both canonical headers are absent. --team-size cannot be combined with --project-ownership or --agent-execution; the conflict is BLOCKED. A legacy header alongside canonical headers is ignored for resolution and recorded for migration cleanup.
Parameters
--base=<branch>: Target branch; default is origin default branch.
--head=<branch>: Source branch; default current branch.
--feature=<feature-slug>: Optional validator input.
--draft: Create draft PR (team ownership only).
--issue=<id>: Optional issue linked in PR body (team ownership only).
--project-ownership=solo|team: Optional delivery-policy override.
--team-size=solo|team: Deprecated composite alias for one transition release.
Solo ownership flow
Check git status --short, git branch --show-current, and git remote -v.
Block detached HEAD, dirty worktree, unfinished Git operation or protected delivery branch.
Do not fetch/push for the Human. Validate local source with /git-validate --scope=pr --project-ownership=solo against origin/<base>...HEAD.
After READY, provide but do not execute:
git push -u origin <head>
After the Human push, a repeat invocation may verify HEAD == origin/<head> and remote diff.
Team ownership flow
- Check repository status, remote and
gh auth status.
- Fetch remote, resolve base/head, and require local commit already pushed by a Human.
- Block protected head, detached/dirty/unfinished state, missing/empty remote diff, existing PR, conflict, failing required check or
CHANGES_REQUESTED.
- Run
/git-validate --scope=pr --base=<base> --head=<head> --feature=<feature-slug> --strict --project-ownership=team.
- Build conventional imperative title/body with summary, validation evidence, test plan and related issue.
- Ask the user to confirm the outward-facing PR content. Only after confirmation and
READY, run gh pr create; never merge, close, force-push or bypass checks.
Failure handling
- Rejected push: Human resolves under repository policy, then revalidates.
- Validation blocker: report remediation; do not push or create PR.
gh auth/API failure: report once; do not retry indefinitely.
- Conflict: stop; do not auto-resolve or force-push.
Output
✓ project ownership: solo | team
✓ validation: READY | BLOCKED
✓ delivery: Human must run git push -u origin <head> | pull request: <url>
✓ remote verification: pending Human push | HEAD == origin/<head>
1---2name: git-pr3description: Kiểm định thay đổi remote-first; tạo Pull Request team hoặc hướng dẫn Human push solo4---56# Git Push / Pull Request Operator (`/git-pr`)78**Output language:** Mirror the invoking prompt. Status tokens, Git/GitHub output and identifiers remain language-invariant.910Prepares remote delivery. `Project Ownership: solo` does not create a PR: Agent validates local readiness and tells the Human owner how to push. `Project Ownership: team` creates a PR after Human confirmation and remote validation. Agent never pushes on behalf of a human. Agent Execution does not affect delivery behavior.1112## Project ownership detection1314Read `# Project Ownership: team|solo` and `# Agent Execution: direct|orchestrated` in `.sdd/shared_context.md`. `--project-ownership=solo|team` overrides delivery ownership only. Use canonical settings only when both headers exist exactly once and are valid. When both canonical headers are absent, use exactly one valid legacy source: exactly one `# Collaboration Mode: solo|team` header or exactly one `--team-size=solo|team`; duplicate, malformed or coexisting sources are `BLOCKED`. The valid source maps `solo` to solo/direct and `team` to team/orchestrated; emit a migration warning and do not silently rewrite governance. Missing, duplicate or malformed canonical headers are `BLOCKED`; never fallback legacy. When either canonical header exists, `--team-size` is `BLOCKED`; the alias is valid only when both canonical headers are absent. `--team-size` cannot be combined with `--project-ownership` or `--agent-execution`; the conflict is `BLOCKED`. A legacy header alongside canonical headers is ignored for resolution and recorded for migration cleanup.1516## Parameters1718- `--base=<branch>`: Target branch; default is `origin` default branch.19- `--head=<branch>`: Source branch; default current branch.20- `--feature=<feature-slug>`: Optional validator input.21- `--draft`: Create draft PR (team ownership only).22- `--issue=<id>`: Optional issue linked in PR body (team ownership only).23- `--project-ownership=solo|team`: Optional delivery-policy override.24- `--team-size=solo|team`: Deprecated composite alias for one transition release.2526## Solo ownership flow27281. Check `git status --short`, `git branch --show-current`, and `git remote -v`.292. Block detached HEAD, dirty worktree, unfinished Git operation or protected delivery branch.303. Do not fetch/push for the Human. Validate local source with `/git-validate --scope=pr --project-ownership=solo` against `origin/<base>...HEAD`.314. After `READY`, provide but do not execute:3233 ```bash34 git push -u origin <head>35 ```36375. After the Human push, a repeat invocation may verify `HEAD == origin/<head>` and remote diff.3839## Team ownership flow40411. Check repository status, remote and `gh auth status`.422. Fetch remote, resolve base/head, and require local commit already pushed by a Human.433. Block protected head, detached/dirty/unfinished state, missing/empty remote diff, existing PR, conflict, failing required check or `CHANGES_REQUESTED`.444. Run `/git-validate --scope=pr --base=<base> --head=<head> --feature=<feature-slug> --strict --project-ownership=team`.455. Build conventional imperative title/body with summary, validation evidence, test plan and related issue.466. Ask the user to confirm the outward-facing PR content. Only after confirmation and `READY`, run `gh pr create`; never merge, close, force-push or bypass checks.4748## Failure handling4950- Rejected push: Human resolves under repository policy, then revalidates.51- Validation blocker: report remediation; do not push or create PR.52- `gh` auth/API failure: report once; do not retry indefinitely.53- Conflict: stop; do not auto-resolve or force-push.5455## Output5657```text58✓ project ownership: solo | team59✓ validation: READY | BLOCKED60✓ delivery: Human must run git push -u origin <head> | pull request: <url>61✓ remote verification: pending Human push | HEAD == origin/<head>62```