agentleFS
sneg55sneg55/agent-starter/skills/commit-push-pr/SKILL.md

commit-push-pr

Skill76 starsChanged 6 months agoMITView on GitHub

Full git workflow - creates branch, commits, pushes, and creates or updates a PR with summary and test plan.

  • Reads credentials
  • Commits and pushes

12 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use systematic-debugging, tdd and 1 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.
  • OpenAISkill

    systematic-debugging

    Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

    Also in 3 projects that use this

  • AWSSkill

    tdd

    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

  • MicrosoftSkill

    handoff

    Compact the current conversation into a handoff document for another agent to pick up.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 11 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 5

    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
  1. Distinctive:

    NEVER update the git config

    line 31
  2. Very specific:

    NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them

    line 32
  3. Very specific:

    NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it

    line 33
  4. Distinctive:

    NEVER run force push to main/master, warn the user if they request it

    line 34
  5. Very specific:

    Do not commit files that likely contain secrets (.env, credentials.json, etc)

    line 35
  6. Distinctive:

    Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported

    line 36
  7. Very specific:

    Use the format username/feature-name:

    line 45
  8. Distinctive:

    Use heredoc syntax for the message:

    line 51
  9. Distinctive:

    Follow the repo's commit message style (check git log --oneline -10)

    line 58
  10. Distinctive:

    Keep it concise (1-2 sentences)

    line 60
  11. Very specific:

    Check if a PR already exists (from the gh pr view output above).

    line 68
  12. Distinctive:

    If PR exists: - update it:

    line 70
  13. Distinctive:

    If no PR: - create one:

    line 83
  14. Distinctive:

    Keep PR titles under 70 characters.

    line 97
  15. Distinctive:

    Test plan should be a checklist of verification steps

    line 99
  16. Distinctive:

    Do all of the above in a single message using multiple tool calls.

    line 103

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Commit, Push, and Open PR

Context

Gather this context first:

  • git status
  • git diff HEAD
  • git branch --show-current
  • git diff main...HEAD (or default branch)
  • gh pr view --json number 2>/dev/null || true

Git Safety Protocol

  • NEVER update the git config
  • NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them
  • NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it
  • NEVER run force push to main/master, warn the user if they request it
  • Do not commit files that likely contain secrets (.env, credentials.json, etc)
  • Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported

Task

Analyze ALL changes that will be included in the pull request - look at ALL commits from git diff main...HEAD, not just the latest commit.

Based on the changes:

1. Create branch (if on main/master)

Use the format username/feature-name:

git checkout -b username/descriptive-feature-name

2. Create a single commit

Use heredoc syntax for the message:

git commit -m "$(cat <<'EOF'
Commit message here.
EOF
)"
  • Follow the repo's commit message style (check git log --oneline -10)
  • Focus on "why" not "what"
  • Keep it concise (1-2 sentences)

3. Push the branch

git push -u origin HEAD

4. Create or update PR

Check if a PR already exists (from the gh pr view output above).

If PR exists - update it:

gh pr edit --title "Short title" --body "$(cat <<'EOF'
## Summary
<1-3 bullet points>

## Test plan
- [ ] Test item 1
- [ ] Test item 2
EOF
)"

If no PR - create one:

gh pr create --title "Short, descriptive title" --body "$(cat <<'EOF'
## Summary
<1-3 bullet points>

## Test plan
- [ ] Test item 1
- [ ] Test item 2
EOF
)"

Rules:

  • Keep PR titles under 70 characters. Use the body for details.
  • Summary should be 1-3 bullet points covering WHAT changed and WHY
  • Test plan should be a checklist of verification steps

5. Return the PR URL

Do all of the above in a single message using multiple tool calls. Return the PR URL when done.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.