From loc-guardian
Use when counting lines of code, computing LOC metrics, or formatting LOC reports with tokei.
How this skill is triggered — by the user, by Claude, or both
Slash command
/loc-guardian:locThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- Tool: `tokei` (install via `brew install tokei`)
tokei (install via brew install tokei).venv, __pycache__, node_modules, .git, dist, build, *.lock, *-lock.yaml, *-lock.jsontests, test, spec, __tests__, __test__, e2e, integration-tests, test-utils, fixtures, mocks*_test.*, *.test.*, *_spec.*, *.spec.*, test_*.*js/javascript → JavaScript, ts/typescript → TypeScript, cpp/c++ → C++, py/python → Python, rb/ruby → Ruby, sh/bash/shell → Shell, rs/rust → Rust, kt/kotlin → Kotlin| Metric | Definition |
|---|---|
| Pure LOC | Code lines from production files only (no tests, no blanks, no comments) |
| Raw LOC | Total lines (code + comments + blanks) across all files |
| Test LOC | (All-files code lines) minus (production-only code lines) |
| Test:Prod ratio | Test LOC / Pure LOC, formatted as N.NN:1 |
| Comment density | comments / (code + comments) * 100, from all files |
| Blank line % | blanks / total * 100, from all files |
.claude/loc-guardian.local.md YAML frontmatter field max_pure_loc| Language | Files | Code | Comments | Blanks | Total |
|----------|------:|-----:|---------:|-------:|------:|
With a bold Total row at the bottom.
| Metric | Value |
|-------------------------------|--------|
| **Pure LOC** (prod code only) | N |
| **Raw LOC** (all files) | N |
| **Test LOC** | N |
| **Test:Prod ratio** | N.NN:1 |
| **Comment density** | N.N% |
| **Blank line %** | N.N% |
| # | File | Code |
|---|------|-----:|
Top 10 largest production files by code lines. Paths relative to project root.
| # | File | Pure LOC | Limit | Over By |
|---|------|--------:|------:|--------:|
| # | File | Pure LOC | Limit | Usage |
|---|------|--------:|------:|------:|
Always end the report with exactly this format:
**VERDICT: N over limit, M warnings | limit: L**
Where N = number of over-limit files, M = number of warning-zone files, L = configured limit. Example: **VERDICT: 3 over limit, 5 warnings | limit: 350** or **VERDICT: 0 over limit, 0 warnings | limit: 350**.
After the verdict, if no config file exists, add: *Run /loc-guardian:init to configure.*
Always append a fenced data block after the verdict for downstream consumption (even if empty):
```loc-data
OVER path/to/file.ts 482
OVER path/to/other.py 378
WARN path/to/growing.ts 310
```
One file per line: OVER|WARN <path> <pure_loc>. This block is machine-readable and used by the optimizer agent.
Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub xiaolai/claude-plugin-marketplace --plugin loc-guardian