---
name: agent-diff-ship-check
description: >
  Pre-merge ship check for AI/agent-generated diffs. Use on uncommitted changes or PRs
  written mostly by agents, or Chinese "Agent 改动能不能合", "AI PR 检查", "上线前检查".
  Focus on ship risk, not style nits.
---

# Agent Diff Ship Check

## Overview

AI diffs fail differently: missing tests, silent behavior change, secrets, incomplete migrations, debug leftovers. Produce a **go / no-go** with blockers.

## Checklist axes

1. **Intent** — what was supposed to change vs what did  
2. **Correctness risk** — edge cases, nulls, authz  
3. **Tests** — added/updated? gaps?  
4. **Migrations / flags** — safe rollout?  
5. **Secrets & debug** — keys, `console.log`, TODOs that ship  
6. **Scope creep** — unrelated files  
7. **Rollback** — can we revert cleanly?  

## Steps

1. Collect diff (`git status` / `git diff` / PR).  
2. Summarize intent in one sentence (ask user if unclear).  
3. Walk checklist; record blockers vs warnings.  
4. Required commands to run before merge (test, lint, migrate dry-run).  
5. Verdict: **ship** | **ship-with-followups** | **block**.  

## Exit criteria

- [ ] Diff scope summarized  
- [ ] Checklist completed  
- [ ] Blockers explicit  
- [ ] Verdict stated  

## Anti-patterns

- Style-only review  
- “LGTM” without tests when behavior changed  

## Output template

```markdown
## Agent diff ship-check
### Intent
...
### Findings
| severity | item | why |
|----------|------|-----|
### Commands before merge
- [ ] ...
### Verdict
- **block** | **ship-with-followups** | **ship**
```
