hallucination-guard

Verify existence and signatures of libraries and methods before generating code.

Updated Feb 12, 2026
One-click install
npx skills add https://github.com/hadimiftahulf/antigravity-skills --skill hallucination-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hallucination-guard
Source: https://github.com/hadimiftahulf/antigravity-skills/tree/main/hallucination-guard
Command: npx skills add https://github.com/hadimiftahulf/antigravity-skills --skill hallucination-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents the AI from fabricating non-existent APIs, libraries, or methods, ensuring that generated code is based on verifiable components.

Core Features & Use Cases

  • Verification: Ensures that any code it generates or uses relies on actual, existing libraries, functions, or classes.
  • Correction: Automatically corrects or flags instances where it might be tempted to invent functionality.
  • Use Case: When asked to implement a feature using a specific library, the AI will first verify the library's existence and the method's signature before proceeding, preventing runtime errors and improving code quality.

Quick Start

Verify that the 'requests' library and its 'get' method exist before using them in the code.

Frequently Asked Questions about hallucination-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent AI code generation from hallucinating non-existent APIs?

To prevent AI code generation from hallucinating non-existent APIs, you need a verification mechanism that enforces strict checking of library existence and method signatures before any code is generated. This ensures all invoked components actually exist.

Why does AI fabricate libraries and methods during code generation?

AI fabricates libraries and methods because it lacks inherent verification against actual documentation. Applying a strict verification process before code generation corrects this by forcing the model to check the existence and signature of all invoked components.

Can I verify external dependencies before generating code automatically?

Yes, you can automatically verify external dependencies before generating code. By enforcing a strict checking process for the existence and signature of all referenced libraries and methods, the AI is prevented from inventing functionality.

What is the best way to ensure generated code uses valid library signatures?

The best way to ensure generated code uses valid library signatures is to apply a verification rule that checks the existence and exact signature of all invoked components before the code generation process begins, preventing runtime errors.

Does this verification approach work for all code generation tasks?

Yes, this verification approach applies to all code generation tasks where external dependencies or internal methods are referenced. It requires strict adherence to checking for the existence and signature of all invoked components to prevent fabrication.