commit-push-pr
Skill2 starsChanged 6 months agoMITView on GitHub
Reviews uncommitted git changes, runs available project validation (tests, lint, typecheck), flags hazards, drafts a Conventional Commit message AND a PR package (title, summary, validation notes, risk notes), then waits for explicit approval before staging, committing, pushing, or opening a pull request. Uses a two-stage approval gate: approve commit first, then approve push + PR. Refuses force-push and requires explicit confirmation before pushing to main or master. Use this skill whenever the user says "commit-push-pr", "commit and push", "ship this", "open a PR for this", "prepare a PR", "draft a PR", "wrap this up and push it", "I'm ready to push", or describes finished work and wants it landed. Always use this skill before running git push or opening a PR — even if the changes look simple. Pairs with commit-safe (which stops at the commit; this skill extends to push + PR).
- Reads credentials
- Deletes or force-pushes
- Commits and pushes
24 other projects use a version of this.
Adopted by
Most recently taken up by
- converge-ai-labs/agent-foundationtheir own version, first seen Nov 28, 2026
- dceoy/ai-coding-agent-skillstheir own version, first seen Nov 22, 2026
- kbourzayq/arch-guardtheir own version, first seen Nov 8, 2026
- jh941213/my-cc-harnesstheir own version, first seen Nov 1, 2026
- jh941213/ADLC-harnesstheir own version, first seen Nov 1, 2026
- tardigrde/agent-skill-evaltheir own version, first seen Oct 20, 2026
Used with
Projects with it also use docs-ci, docs-interfaces and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
jh941213Skilldocs-ci
문서 CI(링크·OpenAPI lint·breaking 게이트·mermaid 검증)나 문서 드리프트 감지(docs.yaml 신선도 검사)를 설치하거나 돌릴 때 사용. 문서 내용 작성은 docs-architecture·docs-interfaces·docs-manuals.
Also in 3 projects that use this
jh941213Skilldocs-interfaces
API·이벤트 인터페이스 문서(OpenAPI·swagger·AsyncAPI 명세, 엔드포인트 레퍼런스, API 구성도·시퀀스, API CHANGELOG)를 만들거나 코드와 맞출 때 사용. 시스템 구성도는 docs-architecture, API 설계 원칙은 api-design-principles.
Also in 3 projects that use this
RachaelQuiselSkillclient-docs
Client documentation. Use when a build needs documentation updates or missing project documents need to be identified.
Also in 3 projects that use this
planailabsSkilldocs-architecture
Layout, build pipeline, and structural gotchas for this dual-Astro repo. Read before changing structure, routing, or adding content. Operational/dev-server questions → dev-build skill.
Also in 3 projects that use this
dbankscardSkilltechdebt
Find and report technical debt, duplicated code, and cleanup opportunities. Run at end of sessions.
Also in 5 projects that use this
diego-tobalinaSkillbuild-fix
Fix build and compilation errors systematically. Run when build fails.
Also in 3 projects that use this
- +4 more from jh941213
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- converge-ai-labs/agent-foundation★ 1.8ksame name
- llama-farm/llamafarm★ 837same name
- galacean/effects-runtime★ 758same name
- shenjingnan/xiaozhi-client★ 341same name
- RedWoodOG/Hermes-Desktop★ 177same name
- jh941213/ADLC-harness★ 125same name
- jh941213/my-cc-harness★ 125same name
- jh941213/my-claude-code-asset★ 125same name
- sneg55/agent-starter★ 76same name
- jackson-video-resources/skills★ 17same name
14 more not listed
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 repository3 other files it gives its agents.
- commit-safeSkill
- gmail-daily-briefingSkill
- weekly-tune-upSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
36 rules. 0 are common, 28 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
28
Distinctive
This author's own choices. Worth a look.
8
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
- Very specific: line 17
Never force-push: Not with --force, not with --force-with-lease, not ever.
- Very specific: line 19
Never invent validation commands: Only run commands the project defines (in package.json scripts, pyproject.toml, Makefile, etc.).
- Distinctive: line 26
Run these commands in order using bash.
- Distinctive: line 47
If git status --short returns nothing AND the upstream check shows no new commits AND it's not a new branch, stop.
- Distinctive: line 53
Check for these files to figure out what validation to run:
- Distinctive: line 66
If nothing is defined, write "No project validation commands found" in the Validation section.
- Distinctive: line 74
Look at the diff and decide:
- Distinctive: line 101
If nothing suspicious: write "No obvious hazards found."
- Distinctive: line 135
Prefer 50 characters or fewer when practical
- Distinctive: line 136
Do not end the subject with a period
- Distinctive: line 137
Use the body to explain why, not what
- Distinctive: line 142
Use the component, module, or package name as the scope.
- Distinctive: line 147
If the scope isn't obvious from the diff, ask before guessing.
- Very specific: line 151
If the change involves any of: breaking changes, multi-scope commits, footer conventions (Refs:, Closes:, BREAKING CHANGE:), or anything …
- Distinctive: line 154
If the fetched spec conflicts with this file, follow the spec.
- Distinctive: line 179
Keep bullets concise — one line each when possible.
- Distinctive: line 225
Wait for the user to respond:
- Distinctive: line 237
After the commit is made, show:
- Distinctive: line 246
Wait for the user:
- Distinctive: line 254
Check whether the branch has upstream tracking set:
- Distinctive: line 260
If a tracking branch is returned → run git push (no force, no force-with-lease).
- Very specific: line 261
If the command fails (no upstream) → run git push -u origin <branch-name> to set tracking and push.
- Very specific: line 263
If push fails with "non-fast-forward" or "rejected", do NOT retry with force flags.
- Distinctive: line 265
If push fails for any other reason, stop and report the error.
- Very specific: line 269
Check if gh CLI is available AND authenticated:
- Very specific: line 275
If both succeed: run gh pr create --title "..." --body "..." with the approved title and body.
- Very specific: line 276
If either fails: print the PR title and body in a copyable block, plus the GitHub URL for the branch …
- Distinctive: line 289
If the user asks for any of these, explain that this skill doesn't do force-push or unconfirmed main-push, and suggest they run the command …
- Distinctive: line 295
Don't run git add . — always stage specific files
- Distinctive: line 296
Don't auto-amend a previous commit
- Distinctive: line 297
Don't force-push, ever
- Distinctive: line 298
Don't combine Gate 1 and Gate 2 approvals into a single ask
- Distinctive: line 299
Don't invent validation commands the project hasn't defined
- Distinctive: line 300
Don't bury hazards (failed tests, .env files, main-branch push) in the recommendation section — surface them in Safety check
- Distinctive: line 301
Don't draft the commit or PR before running inspection and validation
- Distinctive: line 302
Don't open a PR if the push failed — stop and report
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
commit-push-pr
Extends commit-safe with validation, push, and PR drafting. Two approval gates: one before commit, one before push + PR. Never force-pushes. Refuses to push to main/master without explicit confirmation.
Hard rules (read first)
- Never run
git add,git commit,git push, or open a PR without explicit approval from the user in chat. "Go ahead", "yes", "commit it", "push it", or "approved" counts. Silence does not. - Two approval gates, not one. Gate 1: approve the commit message + staged files → run
git add+git commit. Gate 2: approve the PR package + push target → rungit push+ open PR. Don't combine them. - Never force-push. Not with
--force, not with--force-with-lease, not ever. If the user asks, refuse and explain that this skill doesn't do force-push. - Pushing to
mainormasterrequires explicit confirmation. Surface the branch name in the Branch section. If it's main/master, ask: "This will push directly to main. Confirm?" - Never invent validation commands. Only run commands the project defines (in
package.jsonscripts,pyproject.toml,Makefile, etc.). If none exist, say so — don't guess. - One logical change per commit. Mixed diffs get a split recommendation, not a merged message.
Step 1: Inspect the repo
Run these commands in order using bash. Inject their output into context before drafting anything.
git status --short
git branch --show-current
git diff --stat
git diff
git diff --stagedThen check upstream status — this handles new branches, missing upstream, and commits-ahead:
BRANCH=$(git branch --show-current)
if git rev-parse --verify "origin/$BRANCH" >/dev/null 2>&1; then
git log "origin/$BRANCH..HEAD" --oneline
else
echo "NEW_BRANCH: no upstream yet — first push will use 'git push -u origin $BRANCH'"
fiIf git status --short returns nothing AND the upstream check shows no new commits AND it's not a new branch, stop. Tell the user there's nothing to commit or push.
Step 2: Detect project type and run validation
Check for these files to figure out what validation to run:
| File found | Try these commands (only if defined) |
package.json | npm test, npm run lint, npm run typecheck, npm run build |
pyproject.toml or setup.py | pytest, ruff check, mypy (only if configured) |
Makefile | make test, make lint (only if targets exist) |
Cargo.toml | cargo test, cargo clippy |
Rules:
- For npm scripts: check
package.jsonscriptsblock first. Don't run what isn't defined. - For Python: only run tools if config exists (
pyproject.tomlmentions them, or config files like.ruff.tomlare present). - For Make: check
make -n <target>doesn't error before running. - If nothing is defined, write "No project validation commands found" in the Validation section. Don't apologize for it.
Capture pass/fail for each command. If something fails, surface it in the Safety check — don't bury it.
Step 3: Identify the change
Look at the diff and decide:
- One clean logical change → proceed to draft a single commit + PR
- Multiple unrelated changes → recommend a split before drafting anything else. Stop and ask the user how to proceed.
- Accidental / generated / debug / secret files in the diff → flag immediately, recommend removing before proceeding
Step 4: Hazard check
Scan the diff for any of these. List them in the Safety check section.
| Hazard | What to look for |
| Secrets | API keys, tokens, passwords, private keys, OAuth client secrets |
.env files | Any .env, .env.local, .env.production, etc. |
| Local config | config.local.*, IDE settings (.vscode/, .idea/), OS files (.DS_Store, Thumbs.db) |
| Generated artifacts | dist/, build/, node_modules/, __pycache__/, .next/, compiled binaries |
| Debug code | console.log, print() for debugging, commented-out code blocks |
| Unrelated churn | Whitespace-only changes in files unrelated to the main work |
| Large files | Anything over ~1 MB that isn't obviously intentional |
| Local data | Exported CSVs, cached API responses, database dumps, fixture data not meant for the repo |
| Personal tool config | Editor/notebook/vault config folders that shouldn't be shared (e.g., .obsidian/, .jupyter/) |
| Push target | Pushing to main or master — flag for explicit confirmation |
| Force-push request | Refuse outright |
| Failed validation | Tests or lint failed in Step 2 |
If nothing suspicious: write "No obvious hazards found."
Step 5: Draft the Conventional Commit message
Format:
type(scope): imperative summary
Optional body explaining why the change was made, tradeoffs,
or anything important for future maintainers.Allowed types
| Type | Use for |
feat | New user-facing functionality |
fix | Bug fix |
docs | Documentation-only change |
refactor | Code restructuring without behavior change |
test | Test additions or corrections |
chore | Maintenance work (dependency bumps, tooling) |
style | Formatting-only changes |
perf | Performance improvement |
build | Build system or dependency changes |
ci | CI/CD changes |
Rules
- Imperative mood: "add", "fix", "update", "remove" — not "added", "fixes", "updating"
- Subject specific and outcome-focused
- Prefer 50 characters or fewer when practical
- Do not end the subject with a period
- Use the body to explain why, not what
- Mention breaking changes clearly with
BREAKING CHANGE:in the footer
Scope conventions
Use the component, module, or package name as the scope. Examples:
feat(auth): add OAuth token refreshfix(api): correct timezone offset in schedulingchore(deps): bump SDK to latest
If the scope isn't obvious from the diff, ask before guessing.
Edge cases — fetch the spec
If the change involves any of: breaking changes, multi-scope commits, footer conventions (Refs:, Closes:, BREAKING CHANGE:), or anything unusual — fetch the current spec before drafting:
- Fetch
https://www.conventionalcommits.org/en/v1.0.0/ - If the fetched spec conflicts with this file, follow the spec.
Step 6: Draft the PR package
PR title: Same as the commit subject (type(scope): summary). If multiple commits, use a higher-level summary.
PR body template:
## Summary
- [Bullet: what this PR does and why]
- [Bullet: any context a reviewer needs]
## Validation
- [What was run, what passed/failed]
- [Manual verification steps, if any]
## Risk / Notes
- [What could break]
- [What to watch for after merge]
- [Migration notes, if any]Keep bullets concise — one line each when possible. The diff shows the what; the PR explains the why and the risk.
Step 7: Output (before any git action)
Return exactly these seven sections, in this order, with these headers.
Branch
Current branch name. If it's main or master, add a warning line: "⚠️ This will push directly to main. Confirm in your approval."
Change summary
One paragraph. What changed and why, based on the diff.
Validation
What was run, what passed, what failed. Or "No project validation commands found."
Safety check
List every hazard found, or "No obvious hazards found."
Proposed commit
type(scope): imperative summary
Optional body.Proposed PR
## Summary
-
## Validation
-
## Risk / Notes
- Next step
Explicit ask: "Approve the commit message + staged files? Once committed, I'll show the push + PR plan for a second approval."
Step 8: Gate 1 — Commit approval
Wait for the user to respond:
- "Approved" / "go ahead" / "commit it" / "yes" → run
git add <specific files>andgit commit -m "..."with the approved message. Then proceed to Step 9. - "Change the commit message to..." → redraft, show again, wait for approval.
- "Split it" → stop here. Recommend the split groups. Don't commit anything until the user restarts with a single clean change.
- "Commit only, don't push yet" → run the commit, then stop. Skip Step 9. Tell the user to run the skill again when ready to push.
- Ambiguous ("looks good", "ok") → ask: "Commit and proceed to push approval, or commit only?"
Step 9: Gate 2 — Push + PR approval
After the commit is made, show:
Commit made: <hash> <subject>
Ready to push to <remote>/<branch> and open a PR with the title and body shown above.
Approve?Wait for the user:
- "Approved" / "push it" / "yes" → push using the logic below. Then open the PR.
- "Don't push yet" → stop. Commit stays local. Tell the user how to push manually when ready.
- "Change the PR body to..." → redraft, show again, wait.
Pushing
Check whether the branch has upstream tracking set:
git rev-parse --abbrev-ref --symbolic-full-name @{upstream} 2>/dev/null- If a tracking branch is returned → run
git push(no force, no force-with-lease). - If the command fails (no upstream) → run
git push -u origin <branch-name>to set tracking and push.
If push fails with "non-fast-forward" or "rejected", do NOT retry with force flags. Tell the user the remote has diverged and recommend they pull and rebase manually before re-running this skill: git pull --rebase origin <branch>. Then stop.
If push fails for any other reason, stop and report the error. Do not retry with force flags.
Opening the PR
Check if gh CLI is available AND authenticated:
which gh && gh auth status >/dev/null 2>&1- If both succeed: run
gh pr create --title "..." --body "..."with the approved title and body. - If either fails: print the PR title and body in a copyable block, plus the GitHub URL for the branch (
https://github.com/<owner>/<repo>/compare/<branch>?expand=1). Tell the user to paste and create manually.
Push safety
Refuse all of these — no exceptions:
git push --forceorgit push -fgit push --force-with-lease- Pushing without explicit approval
- Pushing to main/master without the explicit branch-name confirmation in approval
If the user asks for any of these, explain that this skill doesn't do force-push or unconfirmed main-push, and suggest they run the command manually if they're sure.
Anti-patterns (do not do)
- Don't run
git add .— always stage specific files - Don't auto-amend a previous commit
- Don't force-push, ever
- Don't combine Gate 1 and Gate 2 approvals into a single ask
- Don't invent validation commands the project hasn't defined
- Don't bury hazards (failed tests, .env files, main-branch push) in the recommendation section — surface them in Safety check
- Don't draft the commit or PR before running inspection and validation
- Don't open a PR if the push failed — stop and report
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.

