arthai-marketplace

/pr

Run QA, create a GitHub PR, and manage post-merge workflow. Never push directly to main.

Synopsis

/pr [--skip-qa]

When to use it

Prerequisites: an authenticated platform CLI. GitHub CLI (gh, run gh auth login if needed), GitLab CLI (glab), Azure CLI (az), or Bitbucket API credentials, matching your git remote origin. /pr auto-detects the platform from .git/config.

Quickstart

/pr

What you’ll see: a mode line, a revert-safety check, /qa in commit mode, a commit, a tracking issue found or created, your branch rebased on the default branch and pushed, and a PR URL with Summary / QA Results / Test plan sections. For large PRs (>500 changed lines or >15 files), a one-line tech-debt suggestion is appended. If compliance extensions are enabled, a compliance matrix is added too. If arth-memory is configured and healthy, a non-blocking “Constraint Advisories” section may be added when the changed files match known org constraints.

Supports GitHub, GitLab, Bitbucket, and Azure DevOps, platform is auto-detected from .git/config. Examples below show GitHub (gh) commands; GitLab uses glab mr create, Bitbucket uses its REST API, Azure DevOps uses az repos pr create.

Examples

/pr             # full workflow — QA + commit + push + PR
/pr --skip-qa   # QA already ran upstream (/fix, /implement) — quick lint + type sanity check only

Arguments & flags

Flag Values Default What it does
--skip-qa : off Skips the full QA gate (used when /fix or /implement already ran QA); runs only a quick lint + type-check sanity pass

What it does

  1. Convention discovery, reads CLAUDE.md, the project profile, and git history to match your team’s commit style, PR template, and branch protection rules; also detects the source-control platform (GitHub/GitLab/Bitbucket/Azure DevOps) from .git/config.
  2. Tech-debt nudge, for large diffs (>500 changed lines or >15 files), flags that a /tech-debt pass is worth running after merge. Skipped silently otherwise, or if disabled in .claude/tech-debt-config.json.
  3. Revert check, runs /revert-check in advisory mode. If it suspects your working tree accidentally undoes recently-merged PRs, it surfaces the warning and asks whether to proceed (user-confirmation checkpoint).
  4. Precheck (toolkit projects only), if this is the claude-agents toolkit itself (detected via tests/run.sh), runs /precheck first and stops on failure. Skipped for non-toolkit projects.
  5. QA gate, runs /qa in commit mode (or just the quick sanity check with --skip-qa). Failures stop the workflow, no PR is created on a failing QA run.
  6. Stage and commit, stages relevant files (never .env, credentials, or large binaries) and commits in the project’s detected style. Verifies the branch is complete (type check / lint) before pushing.
  7. Issue linkage, finds an existing tracking issue for the branch or creates one, so the PR auto-closes it on merge via Closes #N.
  8. Compliance evidence (if extensions enabled), when .claude/extensions/.enabled.json lists enabled packs, generates a per-pack evidence report and adds a compliance matrix to the PR body. Skipped entirely (zero overhead) if no extensions are enabled.
  9. Constraint advisories (if arth-memory configured), when arth-memory is configured and healthy, calls constraint_check against the changed files and PR summary; any matches render as a non-blocking ## ⚠ Constraint Advisories section in the PR body. Skipped silently (zero overhead) if memory isn’t configured, unhealthy, or returns no matches, this step never fails PR creation.
  10. Push and create the PR, rebases on the latest default branch (fails loudly on conflicts, never auto-resolves), pushes, and opens the PR with Summary, QA Results, and Test plan sections. Refuses to run on main, branch first.
  11. Completion verification, a completion-verifier agent confirms the PR matches the plan/spec (skipped with --skip-qa, since that flag signals QA already ran upstream via /fix or /implement, if you pass it standalone with no prior QA, the verifier is still skipped).
  12. Post-merge workflow, when the merge is detected (a Monitor watcher fires automatically if configured, otherwise tell it “merged”): verifies the issue closed, deletes remote and local branches, checks out main, pulls, and runs /onboard for what’s next.

Agents spawned

Agent Model tier Role
completion-verifier sonnet PR-vs-plan check (skipped with --skip-qa)

(The QA gate itself runs via the /qa skill, which spawns its own checkers.)

Output & artifacts

Troubleshooting

Problem Fix
Refuses to run on main Create a feature branch first: /pr never pushes to main
✗ Rebase conflicts against origin/main /pr stops rather than auto-resolving. Open the conflicting files, fix the markers, git add them, then git rebase --continue and re-run /pr: or bail out entirely with git rebase --abort
QA gate fails and PR is not created Fix the reported failures (route to /fix if needed) and re-run: /pr won’t ship failing code
Revert check flags files you changed on purpose Confirm at the prompt that the changes are intentional and the workflow continues
Post-merge cleanup didn’t run No merge webhook configured: just say “merged” and the post-merge steps run manually
Unexpected ## Compliance section in the PR body Your project has compliance extensions enabled (.claude/extensions/.enabled.json): see /extensions status for what’s tracked and why
Unexpected ## ⚠ Constraint Advisories section in the PR body arth-memory is configured (/memory-setup) and constraint_check flagged advisory-only matches for your changed files: review them; this section never blocks the PR
/precheck ran when I didn’t ask for it Expected on the claude-agents toolkit repo itself: /pr runs it automatically before QA to catch failures locally in ~30s