Agent skill
commit
Stage, commit, create PR, and merge to main. Use for the standard commit-PR-merge cycle.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/commit-andreamentasti-tweet-election
SKILL.md
Commit, PR, and Merge
Stage changes, commit with a descriptive message, create a PR, and merge to main.
Steps
- Check current state:
git status
git diff --stat
git log --oneline -5
- Create a branch from the current state:
git checkout -b <short-descriptive-branch-name>
- 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.
- 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
)"
- 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
)"
- Merge and clean up:
gh pr merge <pr-number> --merge --delete-branch
git checkout main
git pull
- Report the PR URL and what was merged.
Important
- Always create a NEW branch — never commit directly to main
- Exclude
settings.local.jsonand sensitive files from staging - Use
--merge(not--squashor--rebase) unless asked otherwise - If the commit message from
$ARGUMENTSis provided, use it exactly
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?