- Home
- Skills
- Code Quality & Review
- CodeGuardian: Anti Hallucination & Code Integrity Shield
Works with the AI tools you already use
CodeGuardian: Anti Hallucination & Code Integrity Shield
Prevents AI assistants from deleting code or truncating files by enforcing strict, line-by-line diff patches.
Free
CodeGuardian: Anti Hallucination & Code Integrity Shield
Example session with this skill installed
Add error handling to the fetch_user function in api_client.py without changing anything else.
- Read your context and instructions
- Compiled the codeguardian
🔍 CODE INTEGRITY VERIFIED. ENFORCING DIFF OUTPUT ONLY.
I have analyzed api_client.py. To prevent file truncation and protect your existing imports and helper functions, I am applying a precise diff patch to the fetch_user method.
Logic Integrity Patch
# [FILE]: api_client.py
# [SCOPE]: fetch_user method
# [STATUS]: Verified - No silent deletions detected.
# [REMOVE LINE]: response = requests.get(f"{self.base_url}/users/{user_id}")
# [REMOVE LINE]: return response.json()
# [ADD LINE]: try:
# [ADD LINE]: response = requests.get(f"{self.base_url}/users/{user_id}", timeout=10)
# [ADD LINE]: response.raise_for_status()
# [ADD LINE]: return response.json()
# [ADD LINE]: except requests.exceptions.RequestException as e:
# [ADD LINE]: logger.error(f"Failed to fetch user {user_id}: {e}")
# [ADD LINE]: return None
Next steps
- Run
pytest tests/test_api_client.pyto confirm the new exception handling works as expected. - Verify that the
loggerimport at the top of the file remains intact. - Check that the
timeoutvalue aligns with your internal SLA requirements.
Connects securely to your tools. The creator never sees your data.
About this skill
AI coding assistants often overwrite working code, introduce silent regressions, or provide lazy placeholders that break builds. This skill acts as a strict quality gate, forcing line-by-line diffs and protecting existing logic from accidental deletion.
What it does
- Diff enforcement isolates changes to specific lines to prevent full-file rewrites and potential corruption.
- Regression blocking programmatically checks that imports, helpers, and telemetry logs are not deleted during edits.
- Placeholder banning detects and stops the use of lazy comments like "rest of code remains the same" that truncate files.
- Integrity verification validates the logic profile before any file system write operation occurs.
How it works
- The skill intercepts the request to modify a file and scans the existing structure.
- It identifies the target lines for modification while locking the surrounding code.
- It generates a strict 4-block layout using
[REMOVE LINE]and[ADD LINE]markers. - It performs a final check to ensure no unauthorized deletions occurred before committing changes.
Frameworks & tools
This skill is designed for use with Claude Code, Cursor, and other AI IDEs. It operates at the filesystem level and is language-agnostic, supporting Python, JavaScript, Go, and enterprise-scale scripts.
Why this beats prompting it yourself
Generic prompts often fail when context windows get crowded, leading to truncated files. This skill provides a rigid execution policy that treats silent deletions as critical failures, ensuring production code remains intact during refactors.
Use cases
- Patching specific methods in 1000+ line legacy files without risk of truncation.
- Adding logging or telemetry to sensitive production scripts.
- Refactoring internal logic while preserving complex import blocks and comments.
Known limitations
Requires file system access to inspect line lengths. Works best on localized edits rather than total architectural migrations.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scanned
Verified clean today
- Free to download with an account