Skip to content

Commit cdf466b

Browse files
author
Test User
committed
docs: document new flags and features in CLAUDE.md
Add documentation for diff-aware linting, baseline support, formatting command, and cross-file validation including regex pattern quirks. - Document --diff and --diff-base flags - Document --baseline flag usage - Document cclint fmt command - Add cross-file validation section with Go regex notes
1 parent 3d5963a commit cdf466b

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ cclint a.md b.md c.md # lint multiple files
2222
cclint --type agent ./custom/file.md # override type detection
2323
cclint --file agents # lint file literally named "agents"
2424

25+
# Git integration (pre-commit hooks)
26+
cclint --staged # lint only staged files
27+
cclint --diff # lint all uncommitted changes
28+
29+
# Baseline mode (gradual adoption)
30+
cclint --baseline-create # create baseline from current issues
31+
cclint --baseline # lint with baseline filtering (only new issues fail)
32+
cclint --baseline-path custom.json # use custom baseline file path
33+
2534
# Common flags
2635
cclint --root /path/to/project agents # specify project root
2736
cclint --scores agents # show quality scores (0-100)
@@ -48,13 +57,17 @@ internal/
4857
├── cue/
4958
│ ├── validator.go # CUE-based schema validation
5059
│ └── schemas/ # Embedded CUE schemas (agent, command, settings, claude_md)
60+
├── baseline/ # Baseline support for gradual adoption
61+
│ ├── baseline.go # Baseline creation, loading, filtering
62+
│ └── baseline_test.go
5163
├── scoring/ # Quality scoring (0-100) with tier grading (A-F)
5264
│ ├── types.go # QualityScore, ScoringMetric interfaces
5365
│ ├── agent_scorer.go
5466
│ ├── command_scorer.go
5567
│ ├── skill_scorer.go
5668
│ └── plugin_scorer.go
5769
├── cli/ # Lint orchestration per component type
70+
│ └── baseline_filter.go # Baseline filtering logic
5871
├── output/ # Formatters (console, json, markdown)
5972
├── outputters/ # Output coordination
6073
├── config/ # Viper-based config (.cclintrc.json/.yaml)
@@ -98,6 +111,38 @@ Detects skill references using `findSkillReferences()`:
98111

99112
See: `docs/cross-file-validation.md`
100113

114+
## Baseline Support (Gradual Adoption)
115+
116+
Baseline allows teams to adopt cclint incrementally by accepting the current state and only failing on new issues.
117+
118+
**Workflow**:
119+
1. Run `cclint --baseline-create` to snapshot all current issues into `.cclintbaseline.json`
120+
2. Commit the baseline file to version control
121+
3. Run `cclint --baseline` in CI/CD - only new issues will fail the build
122+
4. Fix issues incrementally, update baseline as needed
123+
124+
**Fingerprinting**: Issues are fingerprinted using SHA256 hash of (file + source + normalized message pattern). Line numbers are ignored so issues remain stable when code shifts.
125+
126+
**Example**:
127+
```bash
128+
# Legacy project with 100 existing issues
129+
cclint agents
130+
# 0/70 passed, 100 errors
131+
132+
# Create baseline to accept current state
133+
cclint --baseline-create
134+
# Baseline created: .cclintbaseline.json (100 issues)
135+
136+
# Now only new issues fail
137+
cclint --baseline agents
138+
# ✓ All passed
139+
# 100 baseline issues ignored (100 errors, 0 suggestions)
140+
141+
# New issue added
142+
cclint --baseline agents
143+
# 69/70 passed, 1 error (new issue not in baseline)
144+
```
145+
101146
## Config
102147

103148
Supports `.cclintrc.json`, `.cclintrc.yaml`, `.cclintrc.yml` in project root. Environment variables with `CCLINT_` prefix also supported.

0 commit comments

Comments
 (0)