Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 1.31 KB

File metadata and controls

40 lines (29 loc) · 1.31 KB

CMT - Claude Code Instructions

Project Overview

cmt is a Rust CLI tool that generates git commit messages using LLMs (Claude, OpenAI, Gemini). It analyzes staged changes, builds rich context, and produces conventional commit messages via structured output.

Key Files

  • src/git.rs - Git diff extraction, filtering, and statistics
  • src/lib.rs - Main generation logic and post-processing
  • src/config/mod.rs - Resolved Config (defaults < global < project < CLI) passed through the pipeline
  • src/ai/mod.rs - LLM provider abstraction
  • src/prompts/ - System and user prompt templates
  • src/templates.rs - Handlebars template rendering
  • src/config/ - CLI args, config file loading, defaults
  • src/bin/main.rs - CLI entry point

Implementation Details

See METHODOLOGY.md for detailed documentation of:

  • How git diffs are assembled and filtered
  • Prompt construction and LLM communication
  • All default parameters and adaptive behavior

When modifying the diff-to-LLM pipeline, update METHODOLOGY.md to keep it accurate.

Build & Test

cargo build --release    # Build
cargo test               # Run tests
cargo clippy             # Lint

Dependencies

  • git2 - Git operations
  • rstructor - Structured LLM output
  • handlebars - Template rendering
  • tokio - Async runtime