Agent skill
commit
Quick commit with build verification
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/commit-pjpj42-gridracer
SKILL.md
Quick Commit
Stage and commit changes with build verification.
Usage
/commit "Add velocity display to HUD"
Steps
0. Validate changes (NEW)
Run /validate-changes to ensure build and tests pass.
If validation fails:
- Report errors clearly
- Abort commit
- Suggest: Fix errors and try again
If validation passes, continue to next step.
1. Review changes
git status
git diff --stat
2. Check for Issue Reference
COMMIT_MSG="$ARGUMENTS"
# Check if commit message contains issue reference
if [[ "$COMMIT_MSG" =~ \#[0-9]+ ]]; then
echo "✓ References issue(s) in commit message"
else
# No issue reference found
echo ""
echo "💡 Consider referencing an issue with #NUMBER"
echo ""
echo "Recent open issues:"
gh issue list --limit 5 2>/dev/null || echo " (gh CLI not available)"
echo ""
echo "Commit message patterns:"
echo " - 'Fixes #N' to auto-close issue"
echo " - 'Refs #N' to link without closing"
echo ""
fi
# Check if on issue branch
BRANCH=$(git branch --show-current)
if [[ "$BRANCH" =~ issue-([0-9]+) ]]; then
ISSUE_NUM=${BASH_REMATCH[1]}
echo "🔨 Currently on issue branch: issue-$ISSUE_NUM"
if [[ ! "$COMMIT_MSG" =~ \#$ISSUE_NUM ]]; then
echo "💡 Suggested: Add 'Refs #$ISSUE_NUM' or 'Fixes #$ISSUE_NUM' to message"
fi
fi
3. Stage and commit
# Build commit message with issue reference reminder
COMMIT_MESSAGE="$ARGUMENTS"
# Add issue reference reminder if not present
if [[ ! "$COMMIT_MESSAGE" =~ \#[0-9]+ ]]; then
# Check if on issue branch and suggest
BRANCH=$(git branch --show-current)
if [[ "$BRANCH" =~ issue-([0-9]+) ]]; then
ISSUE_NUM=${BASH_REMATCH[1]}
echo "Add issue reference to commit? (Fixes #$ISSUE_NUM / Refs #$ISSUE_NUM / Skip)"
# If user adds reference, append to COMMIT_MESSAGE
fi
fi
# Stage changes (review first with git status above)
git add -A
git commit -m "$(cat <<EOF
$COMMIT_MESSAGE
Co-Authored-By: Claude Opus 4.5 <[email protected]>
EOF
)"
Commit Message Guidelines
- Start with verb: Add, Fix, Update, Refactor, Remove
- Be specific
- Keep first line under 72 characters
- Reference issues when applicable:
Fixes #N- Auto-closes issue on mergeRefs #N- Links without closing- Include in body or first line
Examples
Fix racer respawn velocity (Fixes #47)
Add lap counter to HUD (Refs #42)
Refactor collision detection
- Consolidate Bresenham logic
- Add path caching
Refs #35
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?