@@ -10,7 +10,10 @@ cclint validates YAML frontmatter, checks structural patterns, and suggests impr
1010- ** YAML frontmatter parsing** : Validates required fields and data types
1111- ** CUE schema validation** : Embedded schemas for type-safe validation
1212- ** Quality scoring** : 0-100 scores with tier grading (A-F)
13- - ** Cross-file validation** : Detects missing skill references
13+ - ** Cross-file validation** : Detects missing skill references and circular dependencies
14+ - ** Diff-aware linting** : Lint only staged/changed files for fast pre-commit hooks
15+ - ** Baseline support** : Gradual adoption for legacy projects with existing issues
16+ - ** Canonical formatting** : ` cclint fmt ` for consistent component style
1417- ** Multiple output formats** : Console, JSON, Markdown
1518- ** CI/CD ready** : Exit codes and JSON output for automation
1619
@@ -89,6 +92,66 @@ cclint --format json --output report.json
8992cclint --format markdown --output report.md
9093```
9194
95+ ### Git Integration (Diff-aware Linting)
96+
97+ Lint only changed files for fast pre-commit hooks:
98+
99+ ``` bash
100+ # Lint only staged files (perfect for pre-commit)
101+ cclint --staged
102+
103+ # Lint all uncommitted changes (staged + unstaged)
104+ cclint --diff
105+ ```
106+
107+ If not in a git repository, falls back to full lint with a warning.
108+
109+ ### Baseline Support (Gradual Adoption)
110+
111+ For legacy projects with existing issues, use baseline mode to adopt cclint incrementally:
112+
113+ ``` bash
114+ # Create baseline from current issues (accepts current state)
115+ cclint --baseline-create
116+
117+ # Lint with baseline - only NEW issues fail the build
118+ cclint --baseline
119+
120+ # Use custom baseline file
121+ cclint --baseline --baseline-path .baseline-legacy.json
122+ ```
123+
124+ ** Workflow:**
125+ 1 . Run ` cclint --baseline-create ` to snapshot current issues into ` .cclintbaseline.json `
126+ 2 . Commit the baseline file to version control
127+ 3 . Run ` cclint --baseline ` in CI/CD — only new issues fail
128+ 4 . Fix issues incrementally, update baseline as needed
129+
130+ ### Canonical Formatting
131+
132+ Format components with consistent style using ` cclint fmt ` :
133+
134+ ``` bash
135+ # Preview formatting (stdout)
136+ cclint fmt agents/my-agent.md
137+
138+ # Format in place
139+ cclint fmt --write agents/my-agent.md
140+ cclint fmt -w agents/
141+
142+ # Show diff of changes
143+ cclint fmt --diff agents/
144+
145+ # CI mode: exit 1 if formatting needed
146+ cclint fmt --check
147+ ```
148+
149+ ** Formatting rules:**
150+ - Frontmatter field order: ` name ` , ` description ` , ` model ` , ` tools ` /` allowed-tools ` , then alphabetically
151+ - Exactly one blank line after frontmatter
152+ - Trailing whitespace removed
153+ - File ends with single newline
154+
92155### Exit Codes
93156
94157| Code | Meaning |
@@ -105,9 +168,12 @@ cclint validates references between components:
105168| Check | Description |
106169| -------| -------------|
107170| ** Skill existence** | Agents referencing non-existent skills produce errors |
171+ | ** Circular dependencies** | Detects cycles in agent → skill → agent delegation chains |
108172| ** Orphan detection** | Skills not referenced by any agent/command show as suggestions |
109173| ** Tool permissions** | Commands using undeclared tools produce warnings |
110174
175+ To disable circular dependency detection: ` cclint --no-cycle-check `
176+
111177Skill references are detected in multiple formats:
112178- ` Skill: name ` - Plain format (including inside code blocks)
113179- ` **Skill**: name ` - Bold format
@@ -311,13 +377,16 @@ jobs:
311377 steps :
312378 - uses : actions/checkout@v4
313379
380+ - name : Set up Go
381+ uses : actions/setup-go@v5
382+ with :
383+ go-version : ' 1.23'
384+
314385 - name : Install cclint
315- run : |
316- go install github.com/dotcommander/cclint@latest
386+ run : go install github.com/dotcommander/cclint@latest
317387
318388 - name : Run cclint
319- run : |
320- cclint --format json --output cclint-report.json
389+ run : cclint --format json --output cclint-report.json
321390
322391 - name : Upload results
323392 if : always()
@@ -327,6 +396,13 @@ jobs:
327396 path : cclint-report.json
328397` ` `
329398
399+ **With baseline support (gradual adoption):**
400+
401+ ` ` ` yaml
402+ - name : Run cclint with baseline
403+ run : cclint --baseline --format json --output cclint-report.json
404+ ` ` `
405+
330406### GitLab CI
331407
332408` ` ` yaml
@@ -349,17 +425,19 @@ Create `.git/hooks/pre-commit`:
349425
350426` ` ` bash
351427#!/bin/bash
352- # Run cclint on commit
353- cclint || exit 1
428+ # Run cclint on staged files only (fast!)
429+ cclint --staged || exit 1
354430` ` `
355431
356432Or with [husky](https://github.com/typicode/husky) :
357433
358434` ` ` bash
359435npm install --save-dev husky
360- npx husky set .husky/pre-commit "cclint"
436+ npx husky set .husky/pre-commit "cclint --staged "
361437` ` `
362438
439+ Using `--staged` makes pre-commit hooks fast by only linting changed files.
440+
363441# # File Discovery
364442
365443cclint searches the following locations :
0 commit comments