zero-hallucination-coder

Implements code through a five-phase Discuss-Map-Decompose-Execute-Verify loop that prevents invented APIs and placeholder code.

25.3k|3.6k|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/alirezarezvani/claude-skills --skill zero-hallucination-coder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: zero-hallucination-coder
Source: https://github.com/alirezarezvani/claude-skills/tree/main/engineering/zero-hallucination-coder/skills/zero-hallucination-coder
Command: npx skills add https://github.com/alirezarezvani/claude-skills --skill zero-hallucination-coder

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

AI coding agents often invent APIs, assume imports, skip planning, and emit placeholder code, producing broken output on high-stakes or multi-file tasks. This Skill enforces a disciplined engineering loop that grounds every line of code in verified structure before anything is written.

Core Features & Use Cases

  • Five-Phase Loop: Runs Discuss, Map, Decompose, Execute, and Verify phases in order, with a codebase map tagging every dependency as KNOWN, INFERRED, or UNKNOWN before coding begins.
  • Ponytail YAGNI Check: A six-rung ladder runs before every story to delete unnecessary code, preferring stdlib, platform features, or already-installed dependencies over new implementations.
  • Atomic Story Execution: Tasks are decomposed into single-response stories with acceptance criteria, self-review checklists, and handoff notes, one story per turn.
  • Use Case: When adding an authentication feature across multiple existing files, the Skill first maps the real code structure, resolves all unknowns, splits the work into verifiable stories, and verifies the result against the original goal.

Quick Start

Ask the agent to plan carefully and implement this feature using the zero-hallucination loop, starting with the Discuss phase questions.

Frequently Asked Questions about zero-hallucination-coder

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

FAQPage Schema
How do I stop AI coding agents from hallucinating APIs and imports?

Use a structured loop that maps the codebase first and tags every dependency as KNOWN, INFERRED, or UNKNOWN before writing code. This Skill refuses to write code depending on unresolved UNKNOWNs and marks uncertain methods with explicit ASSUMED comments.

How to plan a complex multi-file feature before writing code?

Run the Discuss phase to capture the end state and constraints, then Map the existing code, then Decompose the work into atomic stories with acceptance criteria. Each story must fit in one response and is verified before the next begins.

When should I use the full five-phase coding loop?

Use the full loop for high-stakes work touching existing code across multiple files, external APIs, auth, databases, or migrations. For typo fixes, reformatting, or throwaway scripts, skip the loop since the ceremony costs more than it saves.

What is the Ponytail check in AI-assisted coding?

The Ponytail check is a six-rung YAGNI ladder run before each story: it asks whether the code needs to exist, whether the stdlib, platform, or installed dependencies already solve it, and only writes the minimum implementation as a last resort.

Can this skill be used for debugging instead of new features?

Yes, debugging uses an abbreviated loop: Discuss the issue, Map the broken code, Execute a targeted minimal-diff fix, and Verify the result. The anti-hallucination rules still apply even in the shortened workflow.