sourcery-pr-cycle
Skill2 starsChanged 4 months agoMITView on GitHub
Runs the PR creation and Sourcery AI review loop until merge-ready: open PR with gh, poll checks and comments, fix blocking issues, push, re-request review, repeat. Use when the user asks to create a PR, run the Sourcery cycle, address Sourcery review comments, or get a branch merge-ready after review.
- Reads credentials
- Commits and pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- leshchenko1979/fast-mcp-telegramword for word, first seen Jul 28, 2026
Other versions1 project uses a version of this.
Word for word · 1
- leshchenko1979/fast-mcp-telegram★ 50100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/code-optimization.mdcCursor rule
- .cursor/rules/docs-plain-language.mdcCursor rule
- .cursor/rules/general.mdcCursor rule
- .cursor/rules/implementation-workflow.mdcCursor rule
- .cursor/rules/memory-bank.mdcCursor rule
- Clean Up Docs PushSkill
- feature-developmentSkill
- Release Notes GenerationSkill
- Remove Old LogsSkill
- telegram-patternsSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 9 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 44
Run exit tests/commands from the approved plan before every commit and push.
- Distinctive: line 46
If fixes changed behavior, re-run exits after fixes and before commit.
- Very specific: line 52
Use gh for all GitHub operations.
- Distinctive: line 61
Check whether the branch tracks remote and is up to date.
- Very specific: line 81
Commit rules: Only commit when the user asks.
- Distinctive: line 107
Wait several minutes after triggering before expecting new results.
- Distinctive: line 121
Version bumps: If Sourcery flags a version bump, ask the user before changing version files.
- Distinctive: line 123
Use sourcery-pr-review-analysis to build a status table (Fixed / Not done / Skipped) before implementing.
- Distinctive: line 125
After fixes, run code-reviewer (readonly) when the diff is non-trivial — aligns with implementation-workflow step 5 closeout.
- Distinctive: line 131
Only when the user asked to commit:
- Distinctive: line 152
After pushing fixes, trigger a fresh review:
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sourcery PR Cycle
End-to-end loop: open PR → Sourcery review → fix → push → re-review → repeat → merge.
For triage and status tables on individual comments, read sourcery-pr-review-analysis. This skill is the workflow loop only.
When to use
- User asks to create a PR or run the Sourcery review cycle
- Post-implementation work is done and the branch needs merge readiness
- Sourcery left comments and the user wants fixes + another review pass
Cycle checklist
Copy and track progress:
PR + Sourcery cycle:
- [ ] 1. Pre-push: exit tests green
- [ ] 2. Create PR (gh push + gh pr create)
- [ ] 3. Wait / poll Sourcery (checks + comments)
- [ ] 4. Triage comments; fix blocking issues
- [ ] 5. Pre-push: exit tests green again
- [ ] 6. Commit + push fixes
- [ ] 7. Request new Sourcery review
- [ ] 8. Repeat 3–7 until clean
- [ ] 9. Closeout + merge when ready1. Pre-push gate (every push)
Run exit tests/commands from the approved plan before every commit and push. Do not push with failing exits.
If fixes changed behavior, re-run exits after fixes and before commit.
2. Create the PR
Use gh for all GitHub operations. Before creating the PR, gather branch state in parallel:
git status
git diff
git log --oneline -10
git diff main...HEAD # or master — use repo default baseCheck whether the branch tracks remote and is up to date.
Push and create (sequential):
git push -u origin HEAD
gh pr create --title "the pr title" --body "$(cat <<'EOF'
## Summary
- ...
## Test plan
- [ ] ...
EOF
)"Return the PR URL to the user.
Commit rules: Only commit when the user asks. Never commit secrets (.env, tokens, acl.dev.yaml with real bearers).
3. Wait for / check Sourcery
Sourcery runs after the PR exists. Poll until the review finishes or stale.
CI / check status:
gh pr checks <N>Review comments (issue-level, from sourcery-ai[bot]):
gh api repos/{owner}/{repo}/pulls/<N>/comments --jq '.[] | select(.user.login=="sourcery-ai[bot]") | .body'Grouped review body (top-level suggestions):
gh api repos/{owner}/{repo}/pulls/<N>/reviews --jq '.[] | select(.user.login=="sourcery-ai[bot]") | .body'Wait several minutes after triggering before expecting new results. Full fetch/triage commands: reference.md.
4. Triage and fix
Default: always fix post-review blocking issues unless the user explicitly narrows scope.
| Priority | Types | Action |
| 1 — Blocking | bug_risk, security, correctness | Always fix |
| 2 — Quality | testing on changed code | Fix when straightforward |
| 3 — Optional | complexity, suggestion, style | Fix only if user said "do all"; otherwise ask or skip with brief reason |
Version bumps: If Sourcery flags a version bump, ask the user before changing version files. Do not bump silently.
Use sourcery-pr-review-analysis to build a status table (Fixed / Not done / Skipped) before implementing.
After fixes, run code-reviewer (readonly) when the diff is non-trivial — aligns with implementation-workflow step 5 closeout.
5. Commit and push fixes
Only when the user asked to commit:
git status
git diff
git log --oneline -5
git add <relevant files>
git commit -m "$(cat <<'EOF'
fix: address Sourcery review on <topic>
EOF
)"
git pushRe-run exit tests before push (step 1).
6. Request another Sourcery review
After pushing fixes, trigger a fresh review:
gh pr comment <N> --body "@sourcery-ai review"Then return to step 3 (poll checks and comments).
7. Repeat until merge-ready
Loop 3 → 4 → 5 → 6 until:
gh pr checksare green (or only known/flaky exceptions the user accepts)- All blocking Sourcery items are fixed or explicitly deferred by the user
- Exit tests pass on the final branch state
Optional refactors left open: document in PR comment or triage table with reason.
8. Phase close — merge
Merge when checks are green and blocking review items are resolved.
Closeout (matches implementation-workflow step 5):
| # | Check |
| 1 | Diff matches approved plan; no unapproved scope |
| 2 | Re-run exit commands on final state |
| 3 | Fix blocking findings only; no scope creep |
| 4 | Update docs / memory bank if the plan required it |
Merge via user-preferred method (gh pr merge, squash, etc.) when the user asks.
Related skills
| Skill | Role |
| sourcery-pr-review-analysis | Triage tables, fetch patterns, categorization |
| release-notes | Version bump + release after merge (not part of this loop); before Telegram posts, see release-notes CI gate |
| implementation-workflow | Plan approval, exit tests, step 5 closeout |
Additional resources
- reference.md — gh command snippets and poll helpers
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

