Profpatsch/.claude/CLAUDE-git.md

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:

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)

Scope Guidelines for Profpatsch User Projects

Always use the format users/Profpatsch/<project> for scope:

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

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

  1. Analyze Changes: Review staged and unstaged changes
  2. Determine Scope: Identify which Profpatsch project is affected
  3. Draft Message: Create commit message following depot format
  4. Verify Length: Check subject line character count
  5. Commit: Use heredoc format for proper multi-line messages
  6. 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:

Multi-Project Changes

For changes affecting multiple projects, use the broadest applicable scope:

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

Integration with Main Claude

When to Delegate to Git Agent

Main Claude should ALWAYS delegate to git agent for:

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: