code-guard
Skill1 starsChanged 19 days agoMITView on GitHub
Full-lifecycle codebase and commit integrity auditor. Operates in two modes: inspect-commit (fast delta pre-commit/PR audit for dead code, secrets, regressions, layer leaks) and inspect-codebase (deep whole-codebase architectural sweep for pure core vs imperative shell, layer DAG enforcement, module depth, seam encapsulation, schema migrations, and churn hotspots). Backward compatible with commit-guard. Use when user asks to review changes, pre-commit audit, audit codebase, inspect architecture, check git diff, find dead code, or run /code-guard or /commit-guard.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- veschin/skilliosistheir own version, first seen Nov 29, 2026
- iskendernarynbaev-lab/claude-skilltheir own version, first seen Jul 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- veschin/skilliosis★ 6same name
- iskendernarynbaev-lab/claude-skill★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
Run the bundled deterministic extraction script from the repository root:
- Very specific: line 78
Use Format 1 for inspect-commit audits.
- Distinctive: line 81
Always issue an unambiguous verdict:
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Guard
code-guard is an uncompromising full-lifecycle codebase and commit integrity auditor. It prevents software entropy by operating across two complementary scopes:
inspect-commit(Delta Mode): Lightning-fast (<1.5s) pre-commit and PR gate that inspects modified lines for dead/debug code, exposed secrets, broken crypto, layer inversions, and regression risks.inspect-codebase(Holistic Mode): Deep repository-wide audit that enforces architectural layering, module depth, logic purity (pure core vs. imperative shell), seam encapsulation, forward-only migrations, and churn hotspot risk.
Operating Modes & Scopes
| Mode | Command / User Triggers | Inspection Target | Execution Target |
inspect-commit (Default) | "review my changes", "audit diff", "pre-commit check", "audit PR" | Staged or unstaged working tree delta, feature branch against main, or specific commit | Fast delta scan on changed lines + untracked files |
inspect-codebase | "audit codebase", "inspect architecture", "codebase hygiene scan", "find deepening opportunities" | Full repository tree, subsystem path, or high-churn Git hotspots | Whole AST parse, layer DAG verification, purity audit, churn risk |
The 3-Phase Review Workflow
[ Phase 1: Scan & Metrics ] ───► [ Phase 2: Multi-Pillar Audit ] ───► [ Phase 3: Structured Report ]
scripts/code_guard.py Checklist, DAG & Principles Delta or Architecture ReportPhase 1: Deterministic Heuristic Extraction
Run the bundled deterministic extraction script from the repository root:
For Delta Commits (inspect-commit):
python3 /path/to/code-guard/scripts/code_guard.py --mode commit --scope uncommitted --jsonOr for branch / PR review:
python3 /path/to/code-guard/scripts/code_guard.py --mode commit --scope branch --base main --jsonFor Whole-Codebase Architecture (inspect-codebase):
python3 /path/to/code-guard/scripts/code_guard.py --mode codebase --path . --hotspots --jsonFor legacy codebases adopting Code Guard: Use --generate-baseline .codeguard-baseline.json to capture existing debt, and --baseline .codeguard-baseline.json on subsequent runs to ratchet only newly introduced violations.
Phase 2: Multi-Pillar Deep Inspection
Examine the code against the standards defined in:
- CHECKLIST.md:
- Pillar 1: Dead, Bloat & Shallow Modules (Top Priority) — leftover debuggers, unused imports, orphaned helpers, shallow wrappers, the Deletion Test, the Two-Adapter Rule, and the Indirection Tax.
- Pillar 2: Security, Cryptography & Trust Boundaries — hardcoded secrets, injection flaws, auth/BOLA bypasses, NIST SP 800-175B crypto primitives, and defensive plugin sandboxing.
- Pillar 3: Architectural Integrity & System Seams — Downwards-Only Layer Hierarchy (strict DAG), Pure Core, Imperative Shell (zero I/O in rules/parsers), Clean Seams (zero external calls to
obj._private), and Forward-Only Database Migrations. - Pillar 4: Efficiency, Concurrency & Performance — $O(N^2)$ loops, N+1 queries, unclosed resources, sync calls in async loops, TOCTOU, and race conditions.
- Pillar 5: Code Robustness & Error Discipline — swallowed exceptions, fragile typing, and fail-fast validation.
- Pillar 6: Test Suite Discipline & Speed Budgets — Tier 1 Pure Unit Suite ($<2$s in-memory), Tier 2 Integration Suite ($<60$s), and zero flaky sleeps (
time.sleepbanned). - Pillar 7: Documentation & Contract Completeness — in-code docstrings, OpenAPI/schema synchronization, ADRs, README config updates.
- DOMAINS.md:
- Domain 6: Enterprise Architecture & Scaling — Layer DAG contracts, schema drift prevention, churn $\times$ complexity hotspot prioritization, and plugin blast radius isolation.
- Domain 1–5: AI/LLM agent safety, container/CI security, API idempotency & SSRF, concurrency TOCTOU, WCAG AA accessibility.
- COMPLIANCE.md:
- Semantic Versioning 2.0.0, Conventional Commits 1.0.0, Keep a Changelog.
- OWASP Top 10, NIST SP 800-175B, CWE Top 25, GDPR/CCPA Zero PII in logs, SLSA v1.0, SPDX licensing.
Phase 3: Verdict & Structured Report
Generate a clear, actionable review using the templates in REPORT-FORMAT.md:
- Use Format 1 for
inspect-commitaudits. - Use Format 2 for
inspect-codebaseaudits.
Always issue an unambiguous verdict:
- 🛑 BLOCK / FAIL: Critical security vulnerability, hardcoded secret, architectural layer inversion, broken migration, leaked private state, or leftover debug/test bypass code. Do not commit / merge.
- ⚠️ WARN: Suboptimal performance, single-implementation speculative ABC, impure domain rule, missing test coverage, or test sleep. Fix before merge.
- ✅ PASS: Code is lean, secure, performant, architecturally sound, and compliant.
For every finding, provide:
- Exact file path and line number with clickable markdown link.
- Severity and violated pillar/compliance standard.
- Concrete before/after diff showing the recommended fix.
Automated Git Hook Integration
Developers can enforce Code Guard locally on every commit by running:
python3 /path/to/code-guard/scripts/install_hook.pyThis installs .git/hooks/pre-commit, running code_guard.py --mode commit --scope staged before every commit.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

