From agentops
Prepares PR commits and bodies by analyzing repository conventions, git history, test coverage, and generating structured PR descriptions. Triggers on 'pr-prep' or 'pr prep'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agentops:pr-prepThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Systematic PR preparation that validates tests and generates high-quality PR bodies.
Systematic PR preparation that validates tests and generates high-quality PR bodies.
Prepares contributions by analyzing the target repo's conventions, git history, test coverage, and generating properly-formatted PR bodies.
When to Use:
When NOT to Use:
pr-research routes herepr-research → upstream research mode. Use when you need to Research an upstream repo
before contributing — systematic exploration of an external codebase as the FIRST step before
planning or implementing an open source contribution: prior-work check (existing issues/PRs),
mandatory CONTRIBUTING.md discovery, guidelines/templates analysis, PR archaeology on merged
PRs and commit patterns, maintainer response-pattern research, and issue discovery for
contribution opportunities. That research lane now lives at the front of this skill's
workflow — Phase -1 (Prior Work Check) and Phase 1 (Context Discovery) absorb it; write the
findings to .agents/research/YYYY-MM-DD-upstream-*.md before moving to commit/body 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
4.5 Commit Split Advisor -> Suggest logical commit groups (manual)
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
CRITICAL: Run this FIRST. Do not proceed if PR mixes unrelated changes.
# Extract commit type prefixes from branch
git log --oneline main..HEAD | sed 's/^[^ ]* //' | grep -oE '^[a-z]+(\([^)]+\))?:' | sort -u
Rule: If more than one commit type prefix exists, the PR is mixing concerns.
# 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 |
DO NOT PROCEED IF ISOLATION CHECK FAILS.
NEVER submit a PR without explicit user approval.
After generating the PR body (Phase 5), ALWAYS:
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
Analyze the branch diff and suggest logical commit groupings.
# Review the scope of changes
git diff --stat main..HEAD
Output a numbered list of suggested commits with file groups:
Commit 1: [description] -- files: path/a.go, path/a_test.go
Commit 2: [description] -- files: path/b.go, path/c.go
Ordering: Infrastructure/migrations > Models/services > Controllers/views > Tests > VERSION/CHANGELOG. Each commit must be independently valid (no broken imports). If diff is < 50 lines across < 4 files, recommend a single commit.
See references/commit-split-advisor.md for full rules.
These are suggestions only. User reads and implements manually.
## 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
Key conventions:
[x] (you ran them before PR)Fixes #NNN goes at the end# Create PR with reviewed body
gh pr create --title "type(scope): brief description" \
--body "$(cat /tmp/pr-body.md)" \
--base main
Remember: This command should ONLY run after user explicitly approves.
| 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 |
User says: "Prepare this branch for PR submission."
What happens:
User says: "Generate a high-quality PR description with clear verification steps."
What happens:
| 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 gh pr create |
| 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 |
references/pr-prep.feature — Executable spec: analyze repo conventions/history, validate tests first, generate PR body + branch (soc-qk4b)
npx claudepluginhub boshu2/agentops --plugin agentopsCreates structured pull requests with Sentry's engineering practices. Analyzes committed branch diffs and generates descriptions covering what changed, why, and reviewer context.
Analyzes git diffs and commit history to fill PR templates and create pull requests via gh CLI. Useful for automating PR creation and descriptions.
Creates GitHub Pull Requests using GitHub CLI: detects existing PRs for branches, pushes changes, generates titles/bodies from commits. Handles monorepos/submodules. Use for /create-pr or PR/review requests.