Loading...
Loading...
PR preparation: git archaeology, test validation, structured PR body generation. Mandatory user review gate before submission. Triggers: "prepare PR", "PR prep", "submit PR", "create PR body", "write PR description".
npx skill4agent add boshu2/agentops pr-prep-1. Prior Work Check -> BLOCKING: Final check for competing PRs
0. Isolation Check -> BLOCK if PR mixes unrelated changes
1. Context Discovery -> Understand target repo conventions
2. Git Archaeology -> Analyze commit patterns, PR history
3. Pre-Flight Checks -> Run tests, linting, build
4. Change Analysis -> Summarize what changed and why
5. PR Body Generation -> Create structured PR description
6. USER REVIEW GATE -> STOP. User must approve before submission.
7. Submission -> Only after explicit user approval# Extract commit type prefixes from branch
git log --oneline main..HEAD | sed 's/^[^ ]* //' | grep -oE '^[a-z]+(\([^)]+\))?:' | sort -u# List all files changed vs main
git diff --name-only main..HEAD
# Group by directory
git diff --name-only main..HEAD | cut -d'/' -f1-2 | sort -u| Check | Pass Criteria |
|---|---|
| Single commit type | All commits share same prefix |
| Thematic files | All changed files relate to PR scope |
| No main overlap | Changes not already merged |
| Atomic scope | Can explain in one sentence |
gh pr create# Write PR body to file
cat > /tmp/pr-body.md << 'EOF'
<generated PR body>
EOF
# Show user
cat /tmp/pr-body.md
# ASK - do not proceed without answer
echo "Review complete. Submit this PR? [y/N]"# Go projects
go build ./...
go vet ./...
go test ./... -v -count=1
# Node projects
npm run build
npm test
# Python projects
pytest -v## Summary
Brief description of WHAT changed and WHY. 1-3 sentences.
Start with action verb (Add, Fix, Update, Refactor).
## Changes
Technical details of what was modified.
## Test plan
- [x] `go build ./...` passes
- [x] `go test ./...` passes
- [x] Manual: <specific scenario tested>
Fixes #NNN[x]Fixes #NNN# Create PR with reviewed body
gh pr create --title "type(scope): brief description" \
--body "$(cat /tmp/pr-body.md)" \
--base main| DON'T | DO INSTEAD |
|---|---|
| Submit without approval | ALWAYS stop for user review |
| Skip isolation check | Run Phase 0 FIRST |
| Bundle lint fixes into feature PRs | Lint fixes get their own PR |
| Giant PRs | Split into logical chunks |
| Vague PR body | Detailed summary with context |
| Skip pre-flight | Always run tests locally |
| Problem | Cause | Solution |
|---|---|---|
| PR body is weak | Missing context from commits/tests | Re-run evidence collection and expand summary |
| Submission blocked | Mandatory review gate not passed | Get explicit user approval before |
| Test plan incomplete | Commands/results not captured | Add executed checks and outcomes explicitly |
| Title/body mismatch | Scope drift during edits | Regenerate from latest branch diff and constraints |