rune-hallucination-guard

Verifies AI-generated imports, packages, and API calls against manifests and registries.

1|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/dangvu008/VietTruyen --skill rune-hallucination-guard-dangvu008
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rune-hallucination-guard
Source: https://github.com/dangvu008/VietTruyen/tree/main/.agents/skills/rune-hallucination-guard
Command: npx skills add https://github.com/dangvu008/VietTruyen --skill rune-hallucination-guard-dangvu008

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI-generated code frequently contains hallucinated imports, non-existent packages, phantom functions, and incorrect API signatures, and attackers exploit this via slopsquatting — registering package names that AI commonly invents. This Skill validates every reference in generated code before it is committed. ## Core Features & Use Cases - Import Verification: Extracts all import/require/use statements from changed files, confirms internal files exist, and checks that specific exported symbols are actually defined. - Dependency & Registry Checks: Validates external packages against package.json, requirements.txt, pyproject.toml, or Cargo.toml, and verifies new packages exist on npm, PyPI, or crates.io. - Slopsquatting Defense: Flags package names with edit distance ≤ 2 from popular packages (e.g., axois vs axios) and checks popularity signals for suspicious newly registered packages. - Use Case: After an AI coding session adds import axios from 'axois', the guard blocks the commit, reports the package does not exist on npm, and suggests the correct package name. ## Quick Start Verify all imports and API calls in the files just changed and report any hallucinated packages or phantom functions.

Frequently Asked Questions about rune-hallucination-guard

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

FAQPage Schema
How do I detect hallucinated packages in AI-generated code?

Extract every import statement from changed files, then verify external packages against the project manifest and the actual registry using npm view, pip index versions, or cargo search. Packages absent from the registry are blocked as likely hallucinations.

What is slopsquatting and how do I prevent it?

Slopsquatting is when attackers register package names that AI models commonly hallucinate. Prevent it by checking registry existence for new packages and flagging names with edit distance of 2 or less from popular packages like axios or lodash.

How to verify an imported function actually exists in a package?

Resolve the import path, then grep the resolved file for the specific exported symbol such as export function or export const. Checking only that the file exists misses phantom functions, so symbol-level verification is required.

Does this check work for Python and Rust dependencies?

Yes, it supports Python via requirements.txt or pyproject.toml and pip index versions, and Rust via Cargo.toml and cargo search. JavaScript and TypeScript use package.json and npm view for the same verification flow.

Why does a package in package.json still fail verification?

A package listed in the manifest but missing from the lockfile is not yet installed and is marked as a warning. A package used in code but absent from the manifest entirely is blocked as a phantom dependency.