Automates PR creation with built-in quality checks and code health analysis.
Install
mkdir -p .claude/skills/pr-synesenom && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13185" && unzip -o skill.zip -d .claude/skills/pr-synesenom && rm skill.zipInstalls to .claude/skills/pr-synesenom
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
You are creating a GitHub Pull Request for the current branch with an AI-generated summary that highlights non-trivial changes for manual review.Key capabilities
- →Run local pre-flight CI checks
- →Perform code health checks on JavaScript files
- →Synchronize the current branch with main
- →Detect GitHub issue numbers from branch names or commit messages
- →Categorize changes as trivial or non-trivial
- →Generate a pull request title and body
How it works
The skill runs local CI checks and code health analysis, then syncs with the main branch. It categorizes changes and generates a PR title and body before creating the pull request.
Inputs & outputs
When to use pr
- →Submit code with quality checks
- →Automate PR summaries
- →Verify code health before merge
About this skill
Pull Request Command
You are creating a GitHub Pull Request for the current branch with an AI-generated summary that highlights non-trivial changes for manual review.
Core Principle
Categorize every change as trivial or non-trivial so reviewers can focus their attention where it matters most.
Workflow
When the user invokes /pr:
1. Gather Context
First sync the fresh upstream ref without touching the local main branch: git fetch origin main.
Then run in parallel:
git branch --show-currentgit log origin/main..HEAD --onelinegit diff origin/main...HEADgit statusgit log origin/main..HEAD --format="%s%n%n%b"
If the branch is main, stop. If no commits ahead of origin/main, stop. If there are uncommitted changes, invoke /commit first.
2. Pre-flight CI checks
Run all four CI jobs locally in sequence. Stop immediately and report the failure if any step exits non-zero — do not open the PR.
npm run standard
npm run jsdoclint
npm test
npm run build && npm run typecheck
Report format on failure:
"Pre-flight failed:
<step name>— <first error line>. Fix the issue and run/pragain."
3. Code Health Check
Get the list of .js files changed in this branch:
git diff origin/main...HEAD --name-only | grep '\.js$'
For each changed .js file, call the CodeScene code_health_score tool. If any file scores below 10.0:
- Call
code_health_reviewon that file for detailed guidance. - Fix the identified code smells following the MCP server's guidance.
- Re-run
npm run standard && npm testto confirm nothing broke. - Repeat until the score reaches 10.0, or document in the PR body why a remaining smell is out of scope for this change (e.g., a god file that can't be split without a major refactor).
If no .js files were changed, skip this step.
5. Sync with Main
Before opening the PR, merge the latest main into the current branch to eliminate post-open merge conflicts.
Run in sequence:
git fetch origin main
git merge origin/main --no-edit
If the merge succeeds cleanly, push the updated branch:
git push -u origin <current-branch>
If the merge fails with conflicts:
- Run
git statusto list conflicting files. - Resolve each conflict automatically only when the resolution is unambiguous (e.g., the branch added a new file that
mainnever touched). - If any conflict is ambiguous, abort the merge (
git merge --abort), report the conflicting files to the user, and stop — do not proceed to PR creation. - After resolving, run
npm run standard && npm testto confirm the merge didn't break anything, thengit commit --no-editand push.
6. Detect the Issue Number
Search in this order, stopping at the first match:
- Branch name — patterns:
^(\d+)-,^claude/build-(\d+)-,^claude/(\d+)- - Commit messages —
git log origin/main..HEAD --format=%B | grep -oE '#[0-9]+' - Plan frontmatter — look for
github_issue: <number>
If no issue detected, skip the closing keyword. Do not invent one.
Verify the issue is open before adding the keyword:
gh issue view <number> --json number,state -q '.state' 2>/dev/null
Skip if CLOSED or lookup fails.
7. Analyze Changes
Categorize every change:
Non-trivial (warrant manual review):
- New distributions or statistical methods
- Changed PDF/CDF/quantile formulas
- New special functions or algorithms
- Behavioral changes (different return values, changed parameter constraints)
- New public API surface
- Dependency changes
Trivial (mechanical/low-risk):
- Formatting, whitespace, line reordering
- Method/function reordering within a file
- Renames with no logic change
- Import reordering or cleanup
- Docstring/comment additions only
8. ADR Gate (non-trivial PRs only)
Check for ADR references in the diff and commits:
git diff origin/main...HEAD --name-only | grep decisions/
If non-trivial changes exist but no ADRs are found, add a warning block:
> **⚠ Missing ADR**: This PR contains non-trivial changes but no Architecture Decision Record was found.
> Consider adding one at `decisions/` to document the design rationale.
> See `decisions/0000-template.md` for the format.
9. Generate PR Title
- Concise (under 70 characters), imperative mood
- e.g., "Add LogNormal distribution", "Fix CDF for discrete distributions"
10. Generate PR Body
<If an issue was detected:>
Closes #<issue-number>
<If ADR warning needed, insert it here>
## Summary
- <1-3 bullet points describing what this PR does and why>
## Design decisions
<If ADRs exist:>
- [ADR-NNNN: <title>](decisions/NNNN-slug.md) — <one-line summary>
<If no ADRs and no non-trivial changes, omit this section.>
## Non-trivial changes
<List them:>
- **`<file path>`**: <Description of what changed and why it matters>
<If no non-trivial changes:>
_No non-trivial changes — this PR is purely mechanical._
## Comprehension checklist
- [ ] I can explain what this code does without reading line-by-line
- [ ] I understand *why* this approach was chosen over alternatives
- [ ] WHY comments are present where the logic is non-obvious
- [ ] Tests verify observable behavior, not internal state
- [ ] A developer encountering this code in 6 months could understand it
<details>
<summary>Trivial changes</summary>
- **`<file path>`**: <Brief description>
</details>
---
*Generated with [Claude Code](https://claude.ai/code)*
11. Create the PR
gh pr create --title "<title>" --body "$(cat <<'EOF'
<body content>
EOF
)"
12. Watch the PR (CI + reviews)
Immediately after the PR is created, subscribe to its activity so CI failures and review comments are handled without the user having to ask:
subscribe_pr_activity(<pr-number>)
Availability:
subscribe_pr_activityis provided by the remote-execution / GitHub webhook integration. If the tool is unavailable (e.g. a purely localghsession), skip this step and tell the user the PR can't be auto-watched here.
After subscribing, end the turn — do not poll with sleep or repeated status checks.
PR events arrive as <github-webhook-activity> messages that wake the session. When one
arrives, investigate it and follow this loop:
- CI check failed → reproduce locally, diagnose the root cause, push the fix, and update a short status checklist. Re-kick on each failure until green; the green status IS the deliverable, not a no-op to skip. Reply only when it resolves the task or raises a question.
- Review comment → if the fix is unambiguous and not architecturally significant, apply
and push it. If there is any ambiguity (a comment open to interpretation, or a change
touching something significant), use
AskUserQuestionto confirm before acting. - Duplicate / no-action-needed event → skip silently.
- Merge conflict reported → fetch the base branch, merge it in, resolve conflicts,
re-run
npm run standard && npm test, and push.
Stop watching the moment the user asks — call unsubscribe_pr_activity(<pr-number>) and push
no further changes to that PR.
13. Report
"PR created: <URL>
Closes: #<issue> (or "None") Non-trivial changes: <count> (or "None") Watching: subscribed to PR activity — I'll auto-fix failing CI and respond to review comments as they arrive (or "not available in this environment")."
Rules
DO:
- Read the FULL diff before categorizing
- Always include
Closes #Nwhen an issue is detectable - Be specific about what changed in non-trivial items
- Subscribe to PR activity after creation and follow through on CI/review events
- Escalate ambiguous review comments via
AskUserQuestionbefore acting
DO NOT:
- Create a PR if on
main - Invent an issue number
- Add
Closes #Nfor an already-closed issue - Poll for CI/review status with
sleepor repeated checks — react to webhook events instead - Keep pushing to a PR after the user asks you to stop watching it
When not to use it
- →When the current branch is 'main'
- →When there are no commits ahead of 'main'
Prerequisites
Limitations
- →Cannot create a PR if the branch is 'main'
- →Cannot create a PR if there are uncommitted changes
- →Cannot create a PR if no commits are ahead of 'main'
How it compares
This skill automates pre-flight checks, code health analysis, and PR content generation, which would otherwise be manual steps before creating a pull request.
Compared to similar skills
pr side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| pr (this skill) | 0 | 2mo | Review | Intermediate |
| python-testing-patterns | 77 | 2mo | Review | Intermediate |
| dependency-upgrade | 26 | 5mo | Review | Intermediate |
| test-cases | 57 | 7mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
python-testing-patterns
wshobson
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
dependency-upgrade
wshobson
Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.
test-cases
cexll
This skill should be used when generating comprehensive test cases from PRD documents or user requirements. Triggers when users request test case generation, QA planning, test scenario creation, or need structured test documentation. Produces detailed test cases covering functional, edge case, error handling, and state transition scenarios.
reviewing-code
CaptainCrouton89
Systematically evaluate code changes for security, correctness, performance, and spec alignment. Use when reviewing PRs, assessing code quality, or verifying implementation against requirements.
wcag-audit-patterns
wshobson
Conduct WCAG 2.2 accessibility audits with automated testing, manual verification, and remediation guidance. Use when auditing websites for accessibility, fixing WCAG violations, or implementing accessible design patterns.
code-coverage-with-gcov
gadievron
Add gcov code coverage instrumentation to C/C++ projects