loc-guardlisted
Install: claude install-skill stef-k/agent-loc-guard
# LOC Guard
Use this skill whenever source files are created, edited, reviewed, or refactored.
The purpose of this skill is not to force tiny files. The purpose is to prevent oversized, hard-to-review, multi-responsibility files.
## Thresholds
- 400 counted LOC is a review trigger, not an automatic refactor command.
- More than 600 counted LOC is a prohibited default state for normal handwritten source unless an explicit approved exemption applies.
## Interpretation
When a changed or new file triggers the 400 LOC warning:
1. Inspect whether the file is still cohesive.
2. Check whether it has a clear single responsibility.
3. Decide whether the extra size is justified by necessary orchestration or simple linear structure.
4. Check whether the file is mixing separable responsibilities.
5. Consider likely near-term growth from upcoming slices before accepting the warning.
6. Split only when the split improves responsibility boundaries or reduces meaningful complexity.
7. Do not split purely to satisfy the number if the split adds indirection without design benefit.
## Required behavior after editing
Run the LOC checker after source edits.
Preferred project-local command:
```bash
python3 .agent-tools/loc_guard.py . --config .agent-tools/loc-guard.config.json --changed-only
```
If the project has not copied the checker into `.agent-tools/`, run the bundled checker from this skill instead:
```bash
python3 skills/loc-guard/scripts/loc_guard.py . --changed-only
```
In C