loc-guard — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited loc-guard (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
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.
When a changed or new file triggers the 400 LOC warning:
Run the LOC checker after source edits.
Preferred project-local command:
python3 .agent-tools/loc_guard.py . --config .agent-tools/loc-guard.config.json --changed-onlyIf the project has not copied the checker into .agent-tools/, run the bundled checker from this skill instead:
python3 skills/loc-guard/scripts/loc_guard.py . --changed-onlyIn Claude Code, when the skill is installed under ~/.claude/skills/ or .claude/skills/, use Claude's skill-directory variable for the bundled checker:
python3 "${CLAUDE_SKILL_DIR}/scripts/loc_guard.py" . --changed-onlyChanged-file checking protects current work without making unrelated pre-existing technical debt part of the task. A legacy file that the task modifies is current work and is still evaluated. Run without a change-selection flag only for an explicit full-repository audit.
If no warning or failure occurs, no special report is needed.
If a file exceeds 400 counted LOC but stays at or below 600 counted LOC, report one of:
warning accepted with justification: ...or:
split performed because: ...If a file exceeds 600 counted LOC without an approved exemption, do not continue as if the task is complete. Either:
Accepting a 400 LOC warning may be reasonable when:
Do not accept a warning merely because:
A file over 600 counted LOC is a prohibited default state for normal handwritten source files unless an explicit approved exemption applies. This limit is a guardrail; it does not prove that every exceptional file has bad architecture.
Existing approved allowedLargeFiles entries may be honored and reported with their configured reasons. Do not add, broaden, modify, or repurpose an exemption, or invent its reason, to bypass a warning or hard failure without explicit user approval.
Threshold overrides are also project policy. Do not create, broaden, or relax an override merely to bypass a warning or failure without explicit user approval or existing project policy.
Do not infer approval from a hard failure, inconvenient refactoring, a nearby or broad exemption, historical file size, time pressure, or a request to complete the coding task. An unapproved file over the hard cap must be resolved or explicitly approved by the user.
Generated, vendored, minified, designer, lock, snapshot, migration, and machine-produced files may be excluded by configuration.
LOC thresholds must never be satisfied by reducing readability or departing from the project's normal source style merely to lower counted physical lines. Follow the project's established formatter and formatting conventions, such as dotnet format, ktfmt, gofmt, black, ruff format, or prettier, when applicable.
Do not:
For example, do not change this readable code:
var user = GetUser();
var trip = GetTrip();
Validate(user, trip);
Save(user, trip);into this solely to evade LOC Guard:
var user = GetUser(); var trip = GetTrip(); Validate(user, trip); Save(user, trip);Legitimate LOC reduction comes from design or code improvement: remove redundant or dead code, simplify control flow, consolidate duplication when that improves the design, split cohesive responsibilities, or use a clearer idiom. A file is not legitimately below a threshold when deliberate readability-degrading physical-line compression produced the reduction. The checker does not detect this automatically; it is an agent behavioral requirement.
The bundled checker is at:
scripts/loc_guard.pyRecommended project-local copy:
.agent-tools/loc_guard.pyFor the full reusable policy text to copy into AGENTS.md, CLAUDE.md, or another agent instruction file, see:
references/loc-policy.md~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.