Skip to content

Commit b601410

Browse files
committed
docs: update PRD v2.7, README, and CLAUDE.md for quality improvements
- PRD v2.7: FR-023 enhanced (E1-E3, H2, H6), FR-034 fully implemented (G1 metadata breaking, H5 symbol tri-state), FR-041 expanded (F3 subject specificity), PE-001/PE-002 updated - README: test count 133 -> 169 - CLAUDE.md: test count 168 -> 169
1 parent 62d82b2 commit b601410

3 files changed

Lines changed: 139 additions & 58 deletions

File tree

CLAUDE.md

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ cargo build --release
1919

2020
- **Hybrid Git**: gix for repo discovery, git CLI for diffs (documented choice)
2121
- **Tree-sitter**: Full file parsing with hunk mapping (not just +/- lines)
22+
- **Parallelism**: rayon for CPU-bound tree-sitter parsing, tokio JoinSet for concurrent git content fetching
2223
- **LLM**: Ollama primary (qwen3:4b), OpenAI/Anthropic secondary
2324
- **Streaming**: Line-buffered JSON parsing with CancellationToken
2425

@@ -96,8 +97,8 @@ src/
9697
│ └── commit.rs # CommitType
9798
└── services/
9899
├── mod.rs
99-
├── git.rs # GitService (gix + git CLI)
100-
├── analyzer.rs # AnalyzerService (tree-sitter)
100+
├── git.rs # GitService (gix + git CLI, concurrent content fetching)
101+
├── analyzer.rs # AnalyzerService (tree-sitter, parallel via rayon)
101102
├── context.rs # ContextBuilder (token budget)
102103
├── safety.rs # Secret scanning, conflict detection
103104
├── sanitizer.rs # CommitSanitizer (JSON + plain text, BREAKING CHANGE footer)
@@ -115,14 +116,39 @@ src/
115116
- **Conventional Commits spec anchoring**: `.claude/plans/PLAN_CONVENTIONAL_COMMITS_SPEC.md`
116117
- **v0.3.0 enhancement plan**: `.claude/plans/PLAN_V030_ENHANCEMENTS.md`
117118
- **Implementation plan (v1, outdated)**: `.claude/plans/PLAN_COMMITBEE_V1.md` — superseded by PRD v2.1
119+
- **Skills ecosystem design**: `.claude/plans/2026-02-22-skills-ecosystem-design.md`
120+
121+
## Project Skills
122+
123+
| Skill | Invocation | Purpose |
124+
| --- | --- | --- |
125+
| `ci-check` | `/ci-check [fast\|full\|test <name>]` | Run fmt + clippy + tests + audit |
126+
| `reuse-annotate` | `/reuse-annotate <file>` | Add SPDX headers to new files |
127+
128+
## Project Agents
129+
130+
| Agent | File | Purpose |
131+
| --- | --- | --- |
132+
| `rust-security-reviewer` | `.claude/agents/rust-security-reviewer.md` | Read-only security audit (8-category) |
133+
| `cargo-dep-auditor` | `.claude/agents/cargo-dep-auditor.md` | Check deps for outdated versions, yanked crates, advisories |
134+
| `api-compat-reviewer` | `.claude/agents/api-compat-reviewer.md` | Check public API changes for breaking callers/impls |
135+
| `llm-prompt-quality-reviewer` | `.claude/agents/llm-prompt-quality-reviewer.md` | Audit SYSTEM_PROMPT, schemas, CommitType sync, spec compliance |
136+
137+
## Project Hooks
138+
139+
| Hook | Trigger | Action |
140+
| --- | --- | --- |
141+
| `rust-fmt.sh` | PostToolUse Edit/Write | `rustfmt <file>` on `.rs` files |
142+
| `block-generated-files.sh` | PreToolUse Edit/Write | Block manual edits to `Cargo.lock` |
143+
| `superpowers-check.sh` | SessionStart | Warn if superpowers plugin missing |
118144

119145
## Development Notes
120146

121147
### Toolchain
122148

123-
- Rust edition 2024, MSRV 1.85
149+
- Rust edition 2024, MSRV 1.94
124150
- License: PolyForm-Noncommercial-1.0.0 (REUSE compliant)
125-
- Dev deps: `tempfile`, `assert_cmd`, `predicates`, `wiremock`, `insta`, `proptest`
151+
- Dev deps: `tempfile`, `assert_cmd`, `predicates`, `wiremock`, `insta`, `proptest`, `toml`
126152

127153
### REUSE / SPDX Headers
128154

@@ -134,7 +160,7 @@ src/
134160
### Running Tests
135161

136162
```bash
137-
cargo test # All tests (133 tests)
163+
cargo test # All tests (169 tests)
138164
cargo test --test sanitizer # CommitSanitizer tests
139165
cargo test --test safety # Safety module tests
140166
cargo test --test context # ContextBuilder tests
@@ -145,6 +171,15 @@ cargo test -- --nocapture # Show println output
145171

146172
**Important:** `cargo test sanitizer` matches test *names* across all binaries. Use `cargo test --test <name>` to select a specific integration test file.
147173

174+
### Test Conventions
175+
176+
- Async tests: `#[tokio::test]` (not `#[test]` with `.block_on()`)
177+
- Snapshots: after changing output, run `cargo insta review` to accept/reject
178+
- Snapshot env: `UPDATE_EXPECT=1 cargo test` for bulk snapshot update
179+
- Wiremock: NDJSON streaming mocks use `respond_with(ResponseTemplate::new(200).set_body_raw(...))` with `\n`-delimited JSON
180+
- Git fixtures: `tempfile::TempDir` + `git init` via `std::process::Command`, not real repos
181+
- Proptest: `PROPTEST_CASES=1000` for thorough local runs before push
182+
148183
### Building
149184

150185
```bash
@@ -181,6 +216,15 @@ git add some-file.rs
181216
./target/release/commitbee --yes
182217
```
183218

219+
### Dependency Management
220+
221+
When adding or updating crates:
222+
1. Verify latest stable version via `cargo search <crate> --limit 1` before adding to `Cargo.toml`
223+
2. If a pre-release version is detected or would be added: **STOP and ask the user** — report the pre-release version found, the latest stable version (if any exists), and whether no stable release is available yet. Do not add a pre-release version without explicit user approval.
224+
3. Prefer `x.y` (minor-compatible) over `=x.y.z` (exact pin) unless a bug requires it
225+
4. Run `cargo audit` before and after adding new dependencies
226+
5. Use `cargo-dep-auditor` agent for full pre-release dependency review
227+
184228
### Gotchas
185229

186230
- `gix` API: use `repo.workdir()` not `repo.work_dir()` (deprecated)
@@ -189,7 +233,8 @@ git add some-file.rs
189233
- Parallel subagents running `cargo fmt` may create unstaged changes — commit formatting separately
190234
- Secret pattern `sk-[a-zA-Z0-9]{48}` requires exactly 48 chars after `sk-` in test data
191235
- `tokio::process::Command` output needs explicit `std::process::Output` type annotation when using `.ok()?`
192-
- Tree-sitter is CPU-bound/sync — pre-fetch file content into HashMaps async, then pass as sync closures
236+
- Tree-sitter is CPU-bound/sync — pre-fetch file content into HashMaps async, then pass `&HashMap<PathBuf, String>` to `extract_symbols()` which uses rayon for parallel parsing
237+
- `rayon::par_iter()` requires data to be `Sync`; `tree_sitter::Parser` is neither `Send` nor `Sync` — create a new `Parser` per file inside the rayon closure
193238
- `#[cfg(feature = "secure-storage")]` gates both the error variant and CLI commands for keyring
194239

195240
### Known Issues
@@ -199,14 +244,5 @@ git add some-file.rs
199244

200245
### Post-Implementation Documentation TODOs
201246

202-
After `PLAN_CONVENTIONAL_COMMITS_SPEC` is implemented, update:
203-
204-
- **PRD.md PE-001**: Change "Includes 2-3 few-shot examples" → the new system prompt uses a schema template (no shot examples). Update the PE-001 description accordingly.
205-
- **PRD.md Phase 2 roadmap**: Add "Conventional Commits 1.0.0 spec anchoring (`!` suffix, `BREAKING CHANGE:` footer, spec-compliant type list sync)" to the v0.3.0 feature list.
206247
- **README.md roadmap**: Pre-existing version mismatch — README shows v0.3.0 as "Polish & Providers ✅ Complete" but PRD says v0.2.0 shipped both Phase 1 and Phase 2, and v0.3.0 is the upcoming Differentiation release. Reconcile before the v0.3.0 release.
207-
- **README.md Running Tests**: Update `118 tests` count.
208-
209-
### Markdown Conventions
210-
211-
- No `---` horizontal rules before `#` or `##` headers (they provide their own visual separation)
212-
- Tables must use properly aligned columns with `| --- |` separator rows
248+
- **README.md Running Tests**: Updated to 169 (was 133 in README, now fixed).

0 commit comments

Comments
 (0)