What This Document Covers:
- Mandatory
/commitcommand usage via commit-manager agent - Prohibited git operations (direct git commit via Bash/Task tools)
- Conventional commit format with logical grouping
- Three commit modes: session changes, all pending, scoped commits
- Branch strategy and collaboration workflow
- Common git operations and troubleshooting
Sections in This Document:
- Critical Requirements
- Commit Manager Agent
- Commit Modes
- Conventional Commit Format
- Branch Strategy
- Common Operations
- Troubleshooting
- Examples
Related Documentation:
- → ../../README.md - Project overview
- → ./.claude/CLAUDE.md - Development guidelines
- → ./CODE_STYLE.md - Code formatting before commits
Context Tags: #git #workflow #commits #version-control #commit-manager
ALL git commits in this project MUST use the /commit command (commit-manager agent).
Zero exceptions. Zero tolerance. No excuses.
The following operations are ABSOLUTELY PROHIBITED:
Forbidden: All direct git commit commands (including -m, --amend, -a, etc.), Task tool with generic agent for git operations, manual git add + git commit workflows.
| Command | Use Case |
|---|---|
/commit |
Session changes (default) |
/commit --all |
All pending changes |
/commit <scope> |
Scoped commits (e.g., web ui, database, documentation) |
The commit-manager is a specialized agent that:
- Analyzes git status to understand changes
- Groups related changes into logical commits
- Follows conventional commit standards
- Filters scopes intelligently
- Provides session-aware commit creation
- Uses ZERO Opus tokens (100% token savings)
Benefits:
- Logical Grouping - Related changes automatically grouped
- Conventional Format - Consistent commit message style
- Token Efficiency - No Opus tokens consumed
- Quality Control - Validates changes before committing
- Session Awareness - Tracks what changed in current session
Use Case: Commit changes made in current session
# Commit all changes from current working session
/commitWhat It Does:
- Analyzes changes made during current session
- Groups related changes logically
- Creates one or more commits based on logical boundaries
- Recommended for most use cases
Use Case: Commit all pending changes, including untracked files
# Commit everything that's modified or new
/commit --allWhat It Does:
- Includes all modified files
- Includes all untracked files
- Groups into logical commits
- Use sparingly (prefer session-based commits)
When to Use:
- After major refactoring across multiple components
- When catching up after extended offline work
- When multiple unrelated changes accumulated
Use Case: Commit only changes related to specific scope
# Commit only web UI changes
/commit web ui
# Commit only database changes
/commit database
# Commit only documentation changes
/commit documentation
# Commit only workflow changes
/commit workflowsWhat It Does:
- Filters files by scope keyword
- Commits only matching files
- Useful for focused, incremental commits
Common Scopes:
web ui- Web UI and API changesdatabase- Vector DB, Firebase changesworkflows- Workflow documentation/implementationdocumentation- Docs-only changestests- Test files onlyorchestrators- Orchestrator changes
The commit-manager agent automatically formats commits using the Conventional Commits standard:
<type>(<scope>): <description>
[optional body]
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
| Type | Use Case | Example |
|---|---|---|
feat |
New feature | feat(web-ui): add memecoin edit proposal endpoint |
fix |
Bug fix | fix(firebase): resolve wallet status update race condition |
docs |
Documentation only | docs(workflows): add Document Summary to 8 READMEs |
refactor |
Code refactoring | refactor(processor): simplify stage execution logic |
test |
Adding/updating tests | test(firebase): add integration tests for trend storage |
chore |
Maintenance tasks | chore(deps): update pydantic to v2.5 |
perf |
Performance improvement | perf(rag): optimize vector search query |
style |
Code style changes | style(all): run PyCharm reformat on codebase |
| Scope | Files Affected |
|---|---|
web-ui |
src/web_ui/**/* |
workflows |
src/workflows/**/* |
database |
src/services/*firebase*, src/ai_generation/rag_memecoin/vector_store.py |
orchestrators |
src/orchestrators/**/* |
domain |
src/domain/**/* |
tests |
tests/**/* |
docs |
docs/**/*, *.md |
- Branch:
main - Protection: Direct commits allowed (small team)
- Quality: All commits must pass pre-commit hooks
Feature branches: For larger features, create with git checkout -b feature/<name>, commit with /commit, then merge with git merge feature/<name>.
Hotfix branches: For urgent fixes, create with git checkout -b hotfix/<name>, commit with /commit, then merge to main.
ALWAYS run PyCharm formatting before committing:
1. Code → Reformat Code (Ctrl+Alt+L / Cmd+Option+L)
2. Code → Optimize Imports (Ctrl+Alt+O / Cmd+Option+O)
Undo Changes: Use git reset --soft HEAD~1 to undo your last commit while keeping changes (then use /commit again). Use git reset --hard HEAD only if you need to discard all local changes.
Push: After committing with /commit, push with git push origin main. Avoid git push --force unless absolutely necessary.
Solution:
# Undo the commit (keep changes)
git reset --soft HEAD~1
# Now use /commit instead
/commitCommon Causes:
- Formatting issues - Run PyCharm "Reformat Code"
- Import issues - Run PyCharm "Optimize Imports"
- Linting errors - Fix errors shown in hook output
Solution:
# Fix the issues
# Re-run /commit (commit-manager will amend if safe)
/commitSolution:
# 1. Pull latest changes
git pull origin main
# 2. Resolve conflicts in files
# (Edit files, remove conflict markers)
# 3. Stage resolved files
git add <resolved-files>
# 4. Complete merge
git commit # Auto-generated merge commit message
# 5. Push
git push origin main# Make additional changes
# ... edit files ...
# Stage changes
git add <files>
# Amend last commit
git commit --amend --no-edit
# Or update commit message
git commit --amendNOTE: The commit-manager agent handles amendments automatically when pre-commit hooks modify files.
# 1. Make changes to web UI
# ... edit src/web_ui/api/memecoin_routes.py ...
# 2. Format code
# Code → Reformat Code
# Code → Optimize Imports
# 3. Check status
git status
# Modified: src/web_ui/api/memecoin_routes.py
# 4. Commit using commit-manager
/commit
# Output:
# ✓ Created commit: feat(web-ui): add batch approve endpoint for memecoins
# 🤖 Generated with Claude Code
# Co-Authored-By: Claude <noreply@anthropic.com>
# 5. Push
git push origin main# 1. Update multiple README files
# ... edit docs/workflows/*.md ...
# 2. Commit documentation changes
/commit documentation
# Output:
# ✓ Created commit: docs(workflows): add Document Summary sections to 8 workflow READMEs
# Updated:
# - src/workflows/WORKFLOWS.md
# - src/workflows/live_launch_detection_workflow/README.md
# - src/workflows/csv_launch_detection_workflow/README.md
# ... (5 more files)
# 3. Push
git push origin main# 1. Make changes across multiple components
# ... edit src/workflows/trend_detection_workflow.py ...
# ... edit src/domain/processor/stages/trend_classification_stage.py ...
# ... edit tests/unit/domain/processor/stages/test_trend_classification_stage.py ...
# 2. Format all changed files
# Code → Reformat Code (select all)
# 3. Commit all session changes
/commit
# Output:
# ✓ Created 3 commits:
# 1. feat(workflows): enhance trend classification with multimodal analysis
# 2. feat(domain): add entity-to-image mapping in trend classification stage
# 3. test(domain): add tests for multimodal trend classification
# 4. Push
git push origin main# 1. Add tests for new feature
# ... create tests/unit/services/test_wallet_validation.py ...
# 2. Commit only test files
/commit tests
# Output:
# ✓ Created commit: test(services): add comprehensive wallet validation tests
# Added: tests/unit/services/test_wallet_validation.py
# 3. Push
git push origin main- Use
/commitfor all commits - No exceptions - Format code before committing - PyCharm "Reformat Code"
- Commit frequently - Small, logical commits
- Write descriptive commit messages - Let commit-manager handle it
- Review git status before committing - Know what you're committing
- Pull before push - Stay in sync with remote
- Don't use
git commitdirectly - Use/commitinstead - Don't commit without formatting - Always format first
- Don't commit commented-out code - Delete it
- Don't commit secrets - Use
.envfiles - Don't force push to main - Unless absolutely necessary
- Don't commit large binary files - Use Git LFS if needed
When using /commit, the commit-manager agent:
- Checks authorship - Ensures you own the commit
- Validates not pushed - Prevents amending pushed commits
- Runs pre-commit hooks - Formatting, linting, tests
- Handles hook changes - Amends if hooks modify files
- Creates commits - With conventional format
If pre-commit hooks modify files (e.g., formatting), the commit-manager automatically amends. If hooks fail with errors, fix them and re-run /commit.
Last Updated: January 2025 - LaunchAgencyBot v2.0