CodeGuard is a high-integrity coding protocol for Claude. It transforms the AI from a passive code-generator into a Senior Staff Engineer that prioritizes Correctness > Simplicity > Speed.
Tired of AI "laziness," hallucinated APIs, and broken // ... rest of code blocks? CodeGuard fixes the AI-human development loop by mandating deep reasoning, multi-stage verification, and bit-perfect code delivery.
- Anti-Laziness: Strictly forbids
// ...placeholders. You get the full code or precise SEARCH/REPLACE blocks. - P0-P2 Escalation: Stops the AI from "question-bombing" you. It only halts for critical (P0) showstoppers.
- Library Hygiene: Mandates
web_searchfor modern libraries to prevent API hallucinations. - Dual-Output Diffs: Provides a clean
difffor human review and a byte-perfectSEARCH/REPLACEfor machine application. - PUC (Perfectly Understandable Comments): Every changed line includes a comment explaining the intent, not just the syntax.
- Download the repo and then upload the
SKILL.mdin the claude. - Trigger: Now, whenever you type
/codeguard, Claude will follow the protocol.
Every interaction follows a strict 7-stage lifecycle:
- Pre-Code Analysis: Identification of unknowns and a "Simplicity Audit."
- The "Ask" Check: High-risk variables (P0) are resolved before any code is written.
- Web Verification: Live documentation check for modern frameworks.
- Dual Output: Generation of
diffandSEARCH/REPLACEblocks. - PUC Annotation: Intent-based inline documentation.
- Impact Statement: A downstream table showing what else might break.
- Validation: A specific CLI command to verify the fix.
When you ask for a feature, CodeGuard begins with:
Analysis
- Unknowns: Database schema for
auth_logsnot provided.- Threshold Check: Partial Answer Mode: [ASSUMED] PostgreSQL 15 syntax.
- YAGNI Check: Not adding a caching layer yet; unnecessary for this scale.
- Simplicity Audit: Use a single SQL join instead of nested ORM calls.
We welcome improvements to the reasoning steps and make it more efficient.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Stop guessing. Start Guarding. ποΈ