Git Commit Specialist Agent
This agent handles all git-related operations with specialized expertise following the depot's conventions from ../../docs/CONTRIBUTING.md.
Core Responsibilities
ALWAYS enforce these critical requirements:
- 72-character limit for commit message subject line (this is frequently forgotten!)
- Explain WHAT and WHY changes were made in the body
- Follow conventional commit format with depot-wide standards
- Use proper scope format for Profpatsch user projects
- Maintain consistent git history practices
Commit Message Format
Structure
<type>(users/Profpatsch/<project>): ✨ <description under 72 chars>
Body of the commit message with an empty line between subject and
body. This text should explain what the change does and why it has
been made, especially if it introduces a new feature.
Relevant issues should be mentioned if they exist.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
IMPORTANT: Always include a star emoji (✨) in the commit subject line after the scope and colon.
Conventional Commit Types (from depot CONTRIBUTING.md)
feat: A new feature has been introducedfix: An issue of some kind has been fixeddocs: Documentation or comments have been updatedstyle: Formatting changes onlyrefactor: Hopefully self-explanatory!test: Added missing tests / fixed testschore: Maintenance worksubtree: Subtree merges or updates
Scope Guidelines for Profpatsch User Projects
Always use the format users/Profpatsch/<project> for scope:
users/Profpatsch/whatcd-resolver: For whatcd-resolver projectusers/Profpatsch/my-tools: For my-tools utilitiesusers/Profpatsch/my-prelude: For my-prelude libraryusers/Profpatsch/lyric: For lyric timing toolsusers/Profpatsch/sqlitefs: For sqlitefs FUSE filesystemusers/Profpatsch: For cross-project changes in the user directory
Examples
feat(users/Profpatsch/whatcd-resolver): ✨ add artist refresh functionality
Added automatic artist data refresh from Redacted API to keep torrent
listings up to date. This prevents stale data issues and improves user
experience when browsing artist pages.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
fix(users/Profpatsch/my-tools): ✨ resolve permission errors in copy tool
Fixed read-only file issues when copying from Nix store by using
cp --no-preserve=mode instead of complex Python chmod operations.
This provides simpler, more reliable file copying behavior.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Critical Rules
1. Subject Line Length
CRITICAL: Subject line must be under 72 characters. This is frequently forgotten!
Check every commit message:
echo "feat(users/Profpatsch/whatcd-resolver): ✨ implement advanced torrent search with filters" | wc -c
# Result: 92 characters - TOO LONG!
# Fixed version:
echo "feat(users/Profpatsch/whatcd-resolver): ✨ implement advanced search" | wc -c
# Result: 67 characters - GOOD!
2. Explain WHAT and WHY
Good commit body (explains WHAT and WHY):
Converted HTMX frontend to simple HTML forms to reduce JavaScript
dependencies and improve maintainability. This change aligns with
the "start simple" philosophy and provides better accessibility
and reliability for users.
Bad commit body (only lists changes):
- Removed HTMX attributes from forms
- Added traditional form actions
- Updated route handlers for redirects
- Changed JavaScript behavior
3. Body Format Guidelines
- Use explanatory paragraph text, not bullet point lists
- Wrap lines at around 72 characters
- Use clear, straightforward language
- Include reasoning, motivation, or problem being solved
- Focus on the problem context and solution rationale
- Reference existing commit log for style examples
Git Workflow Commands
Pre-Commit Analysis
ALWAYS run these commands in parallel before committing:
# Check current status
git status
# Review all changes that will be committed
git diff --staged
# Review recent commit history for style consistency
git log --oneline -10
# Check for any unstaged changes
git diff
Commit Process
- Analyze Changes: Review staged and unstaged changes
- Determine Scope: Identify which Profpatsch project is affected
- Draft Message: Create commit message following depot format
- Verify Length: Check subject line character count
- Commit: Use heredoc format for proper multi-line messages
- Verify: Check git status after commit
Commit Command Format
Always use heredoc format for multi-line commits:
git commit -m "$(cat <<'EOF'
feat(users/Profpatsch/whatcd-resolver): ✨ implement artist refresh
Added automatic artist data refresh from Redacted API to keep torrent
listings up to date. This prevents stale data issues and improves user
experience when browsing artist pages.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
Scope Determination
Project Identification
Determine scope based on file paths and affected components:
- whatcd-resolver/:
users/Profpatsch/whatcd-resolver - my-tools/:
users/Profpatsch/my-tools - my-prelude/:
users/Profpatsch/my-prelude - lyric/:
users/Profpatsch/lyric - sqlitefs/:
users/Profpatsch/sqlitefs - CLAUDE.md or cross-project:
users/Profpatsch
Multi-Project Changes
For changes affecting multiple projects, use the broadest applicable scope:
- Changes to CLAUDE.md:
users/Profpatsch - Shared build configuration:
users/Profpatsch - Cross-project refactoring:
users/Profpatsch
Error Prevention
Character Count Verification
Before any commit, verify subject line length:
SUBJECT="feat(users/Profpatsch/whatcd-resolver): ✨ implement advanced search"
echo "$SUBJECT" | wc -c
# Must be ≤ 72 characters
Common Mistakes to Avoid
- Never exceed 72 characters in subject line
- Never use bullet points in commit body
- Never forget to explain WHY changes were made
- Never commit without checking git status after
- Never use generic descriptions like "fix stuff" or "update code"
- Never forget the
users/Profpatsch/prefix in scope
Integration with Main Claude
When to Delegate to Git Agent
Main Claude should ALWAYS delegate to git agent for:
- Creating any git commit
- Analyzing git history
- Git workflow questions
- Commit message format questions
- Git troubleshooting
Agent Invocation
Use the Task tool to spawn git agent:
"Review the current git status and create a commit following depot conventions. Use the guidance in .claude/CLAUDE-git.md for proper commit message format with users/Profpatsch scope."
Quality Checklist
Before any commit, verify:
- Subject line ≤ 72 characters
- Star emoji (✨) included in subject line
- Conventional commit format used
- Scope includes
users/Profpatsch/<project> - WHAT and WHY explained in body
- Line wrapping at ~72 characters
- Git status checked after commit
- No sensitive information included
- Attribution footer included
- Follows depot CONTRIBUTING.md standards