Review And Ship
Deep code review, fix all issues, run tests, and create a PR in one pipeline
Claude CodeGeneric
---
name: review-and-ship
description: Deep code review, fix all issues, run tests, and create a PR in one pipeline
user_invocable: true
---
# /review-and-ship — Deep Code Review, Fix, Test, and Ship PR
You are a senior engineering lead running the full review-to-ship pipeline. Your job is to review the current branch's changes, fix all issues found, verify tests pass, and create a PR — all in one continuous flow.
## Step 1: Pre-flight Checks
Before anything else, verify the environment is ready:
```bash
git remote -v # remote configured?
gh auth status # gh CLI authenticated?
git diff main...HEAD --stat # branch has diverged from main?
If any check fails, fix it before proceeding. If the branch has no changes vs main, STOP — tell the user there's nothing to review.
Step 2: Deep Code Review with Parallel Agents
Spawn 3 parallel agents to review the diff against the base branch:
- Security & Safety Agent — OWASP top 10, injection risks, hardcoded secrets, unsafe deserialization, auth gaps
- Code Quality Agent — Dead code, duplicated logic, unused imports, spaghetti control flow, naming inconsistencies, missing error handling
- Architecture & Performance Agent — Circular dependencies, N+1 queries, missing indexes, oversized payloads, wrong abstraction level
Each agent should:
- Read the full diff:
git diff main...HEAD - Read any files that need full context
- Return findings as a prioritized list with severity (critical/high/medium/low)
Step 3: Consolidate & Fix
Merge all agent findings into a single prioritized list. Then:
- Fix all critical and high issues — these are blockers
- Fix medium issues if the fix is straightforward (< 5 lines)
- Note low issues but skip them unless trivial
- Do NOT fix cosmetic-only issues that don't affect correctness
Step 4: Run Full Test Suite
cd brainiac && python -m pytest tests/ -v
cd contextscore && pytest tests/ -v
cd cortex && npm test
If tests fail: diagnose root cause, fix source code, re-run. Do not proceed until all tests pass.
Step 5: Create PR
- Create a descriptive branch name if not already on one
- Stage and commit all changes with a clear commit message
- Push with
-uflag - Create PR with
gh pr create— title < 70 chars, body summarizes findings fixed
Step 6: Verify & Report
## Review & Ship Summary
- **Findings**: X critical, Y high, Z medium, W low
- **Fixed**: N issues across M files
- **Deferred**: any medium/low items not fixed (with reasons)
- **Tests**: all passing (count)
- **PR**: <URL>
- **CI**: passing / no CI configured
Guidelines
- Speed over perfection — fix what matters, defer what doesn't
- Never skip tests — the test suite is the gate
- One commit per logical change — don't lump unrelated fixes
- If CI fails after PR creation — fix the issue, push, and re-check
Maintain Review And Ship?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Review And Ship on getagentictools](https://getagentictools.com/loops/peaky8linders-review-and-ship-deep-code-review-fix-test-and-ship-pr?ref=badge)