commit-push-pr
Skill837 starsChanged 15 months agoApache-2.0View on GitHub
Commit changes, push to GitHub, and open a PR. Includes quality checks (security, patterns, simplification). Use --quick to skip checks.
- Commits and pushes
12 other projects use a version of this.
Adopted by
Most recently taken up by
- converge-ai-labs/agent-foundationtheir own version, first seen Sep 30, 2026
- ZunoSmartLabs/zsl-superpowerstheir own version, first seen Sep 21, 2026
- congmnguyen/claude-code-wsl2-setuptheir own version, first seen Sep 8, 2026
- dceoy/ai-coding-agent-skillstheir own version, first seen Sep 6, 2026
- cmacnichol/skillstheir own version, first seen Jul 31, 2026
- jh941213/my-cc-harnesstheir own version, first seen Jul 27, 2026
Used with
Projects with it also use simplify, commit and 3 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.
Hugging FaceSkillsimplify
Refactor code after tests pass. The "Refactor" phase of Red-Green-Refactor.
Also in 3 projects that use this
SentrySkillcommit
Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.
Also in 4 projects that use this
OpenAISkillsystematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Also in 3 projects that use this
AWSSkilltdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Also in 3 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 3 projects that use this
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- converge-ai-labs/agent-foundation★ 143same name
- jh941213/my-cc-harness★ 126same name
- sneg55/agent-starter★ 76same name
- congmnguyen/claude-code-wsl2-setup★ 50same name
- dceoy/ai-coding-agent-skills★ 4same name
- wangyiyang/dev-agent-skills★ 4same name
- ZunoSmartLabs/zsl-superpowers★ 2same name
- arkan/skills★ 1same name
- enderyildirim/claude-skills★ 1same name
- renatorozas/claude-code-config★ 1same name
2 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 repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cli-skillsSkill
- code-reviewSkill
- common-skillsSkill
- config-skillsSkill
- designer-skillsSkill
- electron-skillsSkill
- fix-ciSkill
- generate-subsystem-skillsSkill
- go-skillsSkill
- python-skillsSkill
- rag-skillsSkill
- react-skillsSkill
- reflectSkill
- runtime-skillsSkill
- server-skillsSkill
- temp-filesSkill
- typescript-skillsSkill
- wtSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
27 rules. 0 are common, 21 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
21
Distinctive
This author's own choices. Worth a look.
6
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 13
Before executing, internalize the git workflow standards: @.claude/rules/git_workflow.md
- Very specific: line 17
Use Conventional Commits format: type(scope): description
- Distinctive: line 27
Run these commands to understand the current state:
- Distinctive: line 70
Check if PR already exists:
- Distinctive: line 101
Create and checkout the new branch:
- Distinctive: line 108
Check if PR exists for context
- Distinctive: line 144
Run quality checks on staged changes before committing.
- Distinctive: line 148
Search for and remove debug statements:
- Very specific: line 156
Remove console.log(...), console.debug(...), console.info(...) statements
- Very specific: line 158
Remove print(...) statements (Python)
- Distinctive: line 178
If BLOCK issues found:
- Very specific: line 187
Ask: "Apply this fix? (y/n/all/skip)"
- Distinctive: line 188
If approved: apply edit, re-stage
- Distinctive: line 189
If skipped: continue without fix
- Distinctive: line 201
Create the commit with the approved message:
- Distinctive: line 213
Use HEREDOC for multi-line messages
- Distinctive: line 214
Never add co-author or Claude attribution
- Very specific: line 220
Do NOT retry with --no-verify
- Distinctive: line 221
Ask user how to proceed (fix issues or abort)
- Distinctive: line 225
Check if branch has upstream:
- Very specific: line 230
If no upstream, push with -u:
- Distinctive: line 235
If has upstream, regular push:
- Distinctive: line 243
Do NOT force push
- Distinctive: line 295
Remove the colon after type/scope
- Distinctive: line 331
Never mention Claude: - No co-author lines, no "generated by Claude" in PR descriptions
- Distinctive: line 334
Handle errors gracefully: - Don't leave the repo in a broken state
- Distinctive: line 335
Ask when uncertain: - If the commit message isn't clear, ask the user
“Common” is measured: kept by at least 6 in 10 of the 11 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 Skill
Automates the git workflow of committing changes, pushing to GitHub, and opening a PR with intelligent handling of edge cases.
Required Reading
Before executing, internalize the git workflow standards: @.claude/rules/git_workflow.md
Key rules:
- Use Conventional Commits format:
type(scope): description - NEVER attribute Claude in commits or PRs (no co-author, no mentions)
- NEVER skip pre-commit hooks (no
--no-verify)
Execution Workflow
Step 1: Assess Git State
Run these commands to understand the current state:
# Detect the default branch (main, master, etc.)
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
# Fallback if symbolic-ref fails (e.g., shallow clone or missing HEAD)
if [ -z "$DEFAULT_BRANCH" ]; then
DEFAULT_BRANCH=$(git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}')
fi
# Final fallback to 'main' if detection fails
DEFAULT_BRANCH=${DEFAULT_BRANCH:-main}
# Get current branch
BRANCH=$(git branch --show-current)
# Check for uncommitted changes
git status --porcelain
# Check for unpushed commits (if branch has upstream)
git log origin/$DEFAULT_BRANCH..HEAD --oneline 2>/dev/null || echo "No upstream or no commits ahead"
# Check if branch has upstream tracking
git rev-parse --abbrev-ref @{upstream} 2>/dev/null || echo "No upstream"Determine the state:
HAS_CHANGES: Are there uncommitted changes (staged, unstaged, or untracked)?HAS_UNPUSHED: Are there commits ahead of origin/$DEFAULT_BRANCH?ON_DEFAULT_BRANCH: Is current branch the default branch ($DEFAULT_BRANCH)?HAS_UPSTREAM: Does the branch track a remote?
Step 2: Handle "Nothing to Do" Case
If !HAS_CHANGES && !HAS_UNPUSHED:
Inform user: "No changes to commit and no unpushed commits. Nothing to do."
Exit gracefully.Step 3: Handle "No Changes But Unpushed Commits" Case
If !HAS_CHANGES && HAS_UNPUSHED:
- Check if PR already exists:
gh pr list --head "$(git branch --show-current)" --json number,url,title- If PR exists:
- Offer to push updates to the existing PR
- Report the PR URL
- If no PR:
- Offer to push and create a new PR
- Proceed to Step 7
Step 4: Branch Management (if HAS_CHANGES)
If on default branch ($DEFAULT_BRANCH):
- Inform user that changes need to go on a feature branch
- Stage changes first to analyze them:
git add -A
git diff --staged --stat- Generate a conventional commit message based on the changes (see Step 5)
- Derive branch name from commit message:
feat(cli): add project list→feat-cli-add-project-listfix: resolve memory leak→fix-resolve-memory-leak- Rules: lowercase, replace spaces/special chars with hyphens, max 50 chars
- Create and checkout the new branch:
git checkout -b <branch-name>If already on feature branch:
- Continue with the existing branch
- Check if PR exists for context
Step 5: Stage Changes and Generate Commit Message
- Stage all changes:
git add -A- Analyze the staged changes:
git diff --staged --stat
git diff --staged- Generate a conventional commit message based on:
- Files changed (infer scope from directory)
- Nature of changes (feat/fix/refactor/docs/test/chore)
- Summarize the "why" not just the "what"
- Present the commit message to the user. Example format:
Proposed commit message:
feat(cli): add project listing command
Adds a new 'lf project list' command that displays all projects
in the current workspace with their status.
Do you want to use this message, modify it, or provide your own?Step 5.5: Quality Check
Skip if: --quick flag was passed.
Run quality checks on staged changes before committing.
1. Auto-fix trivial issues (no prompt needed)
Search for and remove debug statements:
# Find files with debug statements
git diff --staged --name-only | xargs grep -l -E "(console\.(log|debug|info)|debugger|print\()" 2>/dev/nullFor each file found:
- Remove
console.log(...),console.debug(...),console.info(...)statements - Remove
debugger;statements - Remove
print(...)statements (Python) - Re-stage the file after fixes
Report: "Auto-fixed: Removed N debug statements from M files"
2. Check for issues requiring attention
Scan staged diff for:
| Issue | Severity | Action |
| Hardcoded secrets (API keys, passwords) | BLOCK | Cannot auto-fix - user must remove |
Command injection (shell=True, os.system) | BLOCK | Cannot auto-fix - user must refactor |
| Empty catch/except blocks | PROPOSE | Suggest adding error logging |
| Duplicate code patterns | PROPOSE | Suggest extraction |
| Unused imports | PROPOSE | Suggest removal |
| TODO/FIXME comments | WARN | Note but allow proceed |
3. Handle blocking issues
If BLOCK issues found:
- List each issue with file:line reference
- Stop the workflow
- User must fix manually and re-run
4. Handle proposable fixes
For each PROPOSE issue:
- Show: file, line, problem, suggested fix
- Ask: "Apply this fix? (y/n/all/skip)"
- If approved: apply edit, re-stage
- If skipped: continue without fix
5. Handle warnings
For WARN issues:
- Display summary
- Continue without blocking
Step 6: Create the Commit
Create the commit with the approved message:
git commit -m "$(cat <<'EOF'
type(scope): short description
Optional longer description explaining the change.
EOF
)"Important:
- Use HEREDOC for multi-line messages
- Never add co-author or Claude attribution
- Let pre-commit hooks run (never use
--no-verify)
If commit fails due to pre-commit hook:
- Report the failure to the user
- Show the hook output
- Do NOT retry with
--no-verify - Ask user how to proceed (fix issues or abort)
Step 7: Push to Remote
- Check if branch has upstream:
git rev-parse --abbrev-ref @{upstream} 2>/dev/null- If no upstream, push with
-u:
git push -u origin $(git branch --show-current)- If has upstream, regular push:
git pushIf push fails due to conflicts:
- Inform user about the conflict
- Suggest:
git pull --rebase origin $DEFAULT_BRANCHorgit merge origin/$DEFAULT_BRANCH - Do NOT force push
Step 8: Create or Report PR
- Check if PR already exists:
gh pr list --head "$(git branch --show-current)" --json number,url,title- If PR exists:
- Report: "Changes pushed to existing PR:
<URL>" - Show PR title and number
- Report: "Changes pushed to existing PR:
- If no PR exists:
- Generate PR title from commit message (first line)
- Generate PR body with summary of changes
- Create PR:
gh pr create --title "type(scope): description" --body "$(cat <<'EOF'
## Summary
- Brief description of changes
## Changes
- List of key changes made
## Test Plan
- How to verify these changes work
EOF
)"- Report the new PR URL to the user
Branch Name Generation
Convert commit message to valid branch name:
| Input | Output |
feat(cli): add project list command | feat-cli-add-project-list-command |
fix: resolve memory leak in cache | fix-resolve-memory-leak-in-cache |
refactor(server): simplify auth flow | refactor-server-simplify-auth-flow |
Algorithm:
- Take the commit message (first line only)
- Lowercase everything
- Remove the colon after type/scope
- Replace
(and)with- - Replace spaces and special characters with
- - Collapse multiple hyphens to single hyphen
- Trim to max 50 characters at word boundary
- Remove trailing hyphens
Error Handling
| Error | Action |
| Pre-commit hook fails | Show output, ask user to fix, do NOT bypass |
| Push rejected (conflicts) | Suggest rebase/merge, do NOT force push |
| PR creation fails | Show error, suggest manual creation |
| Not a git repo | Inform user, exit |
| gh CLI not installed | Inform user how to install |
| Not authenticated to GitHub | Suggest gh auth login |
Output Format
On success, report:
Committed: feat(cli): add project list command
Branch: feat-cli-add-project-list-command
Pushed to: origin/feat-cli-add-project-list-command
PR: https://github.com/owner/repo/pull/123Notes for the Agent
- Never mention Claude - No co-author lines, no "generated by Claude" in PR descriptions
- Respect hooks - Pre-commit hooks exist for a reason, never skip them
- Be informative - Tell the user what's happening at each step
- Handle errors gracefully - Don't leave the repo in a broken state
- Ask when uncertain - If the commit message isn't clear, ask the user
- Keep it simple - One commit per invocation, clear linear workflow
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.

