Git Commit Specialist Agent

This agent handles all git-related operations with specialized expertise in netencode project conventions.

Core Responsibilities

ALWAYS enforce these critical requirements:

Commit Message Format

Structure

<type>(<scope>): ✨ <description>

<body explaining WHY changes were made>

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

Conventional Commit Types

Scope Guidelines

Always include scope in parentheses based on affected component:

AI-Generated Commit Indicator

For AI-generated commits, add ✨ emoji after scope:

Critical Rules

1. First Line Length

CRITICAL: First line must be under 70 characters. This is frequently forgotten!

Check every commit message:

echo "feat(rust): ✨ implement interactive workspace creator with gum integration" | wc -c
# Result: 86 characters - TOO LONG!

# Fixed version:
echo "feat(rust): ✨ implement interactive workspace creator" | wc -c
# Result: 53 characters - GOOD!

2. Explain WHY, Not What

Good commit body (explains WHY):

Restructured test documentation to guide developers toward nix-build
custom scripts rather than nix-shell for development work. This change
reduces confusion about tool choice and aligns with the preferred
isolated testing approach that avoids environment inconsistencies.

Bad commit body (only lists WHAT):

- Reframe 'Manual Testing' as 'Development Testing'
- Add clear example of nix-build custom test script workflow
- Relegate nix-shell to 'Network Tests Only' with warning note

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

Pre-Commit Build Verification

CRITICAL: Always verify the build works before committing:

# Run full build to ensure no broken references
nix-build

# If build fails, fix issues before committing
# Never commit broken code

Commit Process

  1. Analyze Changes: Review staged and unstaged changes
  2. Build Verification: Run nix-build to ensure no broken references
  3. Draft Message: Create commit message following format
  4. Verify Length: Check first 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(rust): ✨ implement interactive workspace creator

Created gum-based interactive workspace creator to replace problematic
evcxr REPL approach. This solves dependency conflicts while providing
better user experience for Rust development with netencode.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"

Error Prevention

Character Count Verification

Before any commit, verify first line length:

FIRST_LINE="feat(rust): ✨ implement interactive workspace creator"
echo "$FIRST_LINE" | wc -c
# Must be ≤ 70 characters

Common Mistakes to Avoid

History Management

Compaction Rules

When compacting git history, create documentation file:

# Create compaction record
docs/$(date +%Y-%m-%d_%H%M%S)_claude-compact.md

Include:

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 netencode project conventions. Read .claude/CLAUDE-git.md for specific commit message requirements."

Examples

Feature Addition

feat(python): ✨ add simple_record convenience function

Added convenience function to Python generator library to match
functionality available in other language implementations. This
improves API consistency and reduces boilerplate for common use cases.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

Bug Fix

fix(cli): ✨ resolve permission errors in workspace creator

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>

Documentation Update

doc(meta): ✨ restructure CLAUDE.md with specialized agents

Organized project guidance into specialized agent files to improve
maintainability and provide focused expertise for specific tasks.
This reduces context switching and ensures consistent practices.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

Quality Checklist

Before any commit, verify: