← LeaderboardThe Skill Leaderboard

commit

Stage, commit, create PR, and merge to main. Use for the standard commit-PR-merge cycle.

Published by brycewang-stanford ↗brycewang-stanford/Auto-Empirical-Research-Skills

Try your first task

commit

Start a fresh conversation. Replace the highlighted placeholders.

Use commit to Stage [files to stage], commit them with [commit message], create a PR, and merge to main; stop after the PR is created to wait for my integration choice before merging and deleting the branch.

Required inputs

  • [files to stage]
  • [commit message]

User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗

SKILL.md

name: commitdescription: Stage, commit, create PR, and merge to main. Use for the standard commit-PR-merge cycle.argument-hint: "[optional: commit message]"allowed-tools: ["Bash", "Read", "Glob"]

Commit, PR, and Merge

Stage changes, commit with a descriptive message, create a PR, and merge to main.

Steps

  1. Check current state:
git status
git diff --stat
git log --oneline -5
  1. Create a branch from the current state:
git checkout -b <short-descriptive-branch-name>
  1. Stage files — add specific files (never use git add -A):
git add <file1> <file2> ...

Do NOT stage .claude/settings.local.json or any files containing secrets.

  1. Commit with a descriptive message:

If $ARGUMENTS is provided, use it as the commit message. Otherwise, analyze the staged changes and write a message that explains why, not just what.

git commit -m "$(cat <<'EOF'
<commit message here>
EOF
)"
  1. Push and create PR:
git push -u origin <branch-name>
gh pr create --title "<short title>" --body "$(cat <<'EOF'
## Summary
<1-3 bullet points>

## Test plan
<checklist>

🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
  1. Merge and clean up:
gh pr merge <pr-number> --merge --delete-branch
git checkout main
git pull
  1. Report the PR URL and what was merged.

Important

  • Always create a NEW branch — never commit directly to main
  • Exclude settings.local.json and sensitive files from staging
  • Use --merge (not --squash or --rebase) unless asked otherwise
  • If the commit message from $ARGUMENTS is provided, use it exactly