| name | prepare-pr |
| description | Thorough pre-merge audit — dependency graph, correctness, conventions, security, test coverage, and improvement suggestions |
| disable-model-invocation | true |
| argument-hint | |
Prepare PR
Perform a thorough pre-merge audit of the current changes. Start from the diff, then follow the dependency graph to understand how the changes fit into the broader system. Check correctness, security, MESA conventions, test coverage, and suggest improvements.
Scope: $ARGUMENTS
Step 1: Gather Changes
Get all changes on the branch compared to main:
- Run these commands in parallel:
git log main..HEAD --oneline — list commits on this branch
git diff main...HEAD --stat — file-level summary of changes
- Then run
git diff main...HEAD to get the full diff.
- If the diff output is too large to read at once, read it in chunks using offset/limit, or read each changed file individually instead.
- Run
git status to identify any uncommitted or untracked changes not yet in the diff.
Read the diff output AND the full content of every changed file.
Do NOT use gh CLI commands — it may not be installed. Use only git commands for gathering diffs and commit history.
Step 2: Follow the Dependency Graph
Starting from the changed files, trace connections to understand the full impact:
- Read related files within the same feature (State, Event, Screen, Store, UI, Factory, interactors)
- Read interfaces being implemented or extended
- Read consumers of changed APIs — if a public protocol, use case, or domain type was modified, find the files that depend on it and check they are compatible
- Read Factory files to verify dependency assembly is correct
The goal is to understand how the changes integrate with everything that touches them — not to review the entire codebase, but to verify nothing is broken or inconsistent at the boundaries.
Step 3: Correctness & Logic Review
Present findings with checkboxes as you go:
Logic & Correctness
Best Practices
Security
For a deeper security audit, run /security-check.
General Quality
Step 4: Convention Review
Present findings with checkboxes as you go:
MESA / Trapezio Conventions
Strata Conventions
Clean Architecture
License
Step 5: Test Coverage Analysis
Flag any gaps.
Step 6: Improvement Suggestions
Beyond issues, suggest improvements that are directly relevant to the changed code:
- Code simplification opportunities
- Better use of MESA/Strata patterns
- Performance considerations
- Accessibility (
accessibilityIdentifier on testable elements)
- Better error handling or user feedback
Step 7: Report
Present a structured report:
Summary
Brief overview of the changes and overall assessment (ready to merge, needs work, etc.).
Checklist Results
Show all completed checklists from Steps 3-5 with pass/fail/not-applicable indicators.
Blocking Issues
Must fix before merge. Include file path and line references.
Warnings
Should fix. Style issues, potential problems, missing patterns.
Missing Tests
For each file missing tests or test cases:
- File path
- What specific tests are needed
- Suggest running
/add-tests @<filepath> to generate them
Suggestions
Improvement opportunities. These are optional but recommended.