Skip to content

Commit 51dc97e

Browse files
committed
docs: improve CLAUDE.md conciseness and add pipeline overview
1 parent 40183cc commit 51dc97e

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

CLAUDE.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ cargo build --release
1717

1818
## Architecture
1919

20+
**Pipeline:** git diff → tree-sitter parse → symbol extraction → context building (budget, evidence, connections) → LLM prompt → sanitize → validate+retry → commit
21+
2022
- **Hybrid Git**: gix for repo discovery, git CLI for diffs (documented choice)
2123
- **Tree-sitter**: Full file parsing with hunk mapping (not just +/- lines)
2224
- **Parallelism**: rayon for CPU-bound tree-sitter parsing, tokio JoinSet for concurrent git content fetching
@@ -28,9 +30,9 @@ cargo build --release
2830
1. **Full file parsing** - Parse staged/HEAD blobs, map diff hunks to symbol spans
2931
2. **Token budget** - 24K char limit (~6K tokens), prioritizes diff over symbols
3032
3. **TTY detection** - Safe for git hooks (graceful non-interactive fallback)
31-
4. **Commit sanitizer** - Validates LLM output, supports JSON + plain text; emits `BREAKING CHANGE:` footer and `!` suffix for breaking changes (footer emitted regardless of `include_body` — it is machine-readable metadata)
33+
4. **Commit sanitizer** - Validates LLM output (JSON + plain text), emits `BREAKING CHANGE:` footer regardless of `include_body`
3234
5. **Structured JSON output** - Prompt requests JSON for reliable parsing; schema includes `breaking_change: Option<String>` field
33-
6. **System prompt** - Single `pub(crate) const SYSTEM_PROMPT` in `llm/mod.rs`, shared by all providers; includes commit type list (synced with `CommitType::ALL`), project-agnostic breaking change threshold (only when existing users or dependents must change their code/config/scripts to stay compatible — not for new features, bug fixes, or internal refactors), and 72-char subject limit
35+
6. **System prompt** - Single `SYSTEM_PROMPT` in `llm/mod.rs`, shared by all providers. Type list synced with `CommitType::ALL`, 72-char subject limit.
3436
7. **Simplified user prompt** - Concise format optimized for <4B parameter models
3537
8. **Commit splitting** - Detects multi-concern changes, suggests splitting into separate commits
3638
9. **Body line wrapping** - Sanitizer wraps body text at 72 characters
@@ -117,6 +119,7 @@ src/
117119
├── cli.rs # CLI arguments (clap)
118120
├── config.rs # Configuration (figment layered)
119121
├── error.rs # Error types (thiserror + miette)
122+
├── queries/ # Tree-sitter .scm patterns (10 languages)
120123
├── domain/
121124
│ ├── mod.rs
122125
│ ├── change.rs # FileChange, StagedChanges, ChangeStatus
@@ -189,7 +192,7 @@ src/
189192
### Running Tests
190193

191194
```bash
192-
cargo test # All tests (334 tests)
195+
cargo test # All tests (339 tests)
193196
cargo test --test sanitizer # CommitSanitizer tests
194197
cargo test --test safety # Safety module tests
195198
cargo test --test context # ContextBuilder tests
@@ -330,4 +333,4 @@ A tracked list of review findings, design decisions, and improvement ideas that
330333

331334
### Documentation Sync
332335

333-
Keep README.md test count in sync (currently 339).
336+
Keep test counts in sync across README.md, DOCS.md, PRD.md, CLAUDE.md (currently 339).

0 commit comments

Comments
 (0)