Skip to content
Skillpedia
General coding29k Β· #9616

zero-hallucination-coder

What it does

This skill guides the AI through a careful process for high-stakes coding work, such as changes to logins, databases or migrations. It is for developers who want fewer invented functions and fewer skipped steps.

When to use it

  • βœ“When a coding task is high-stakes or hard to undo, such as a database migration or an authentication change.
  • βœ“When a change spans several existing files and touches external APIs.
  • βœ“When you ask the AI to plan carefully and avoid made-up code.

Skill link

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/zero-hallucination-coder/skills/zero-hallucination-coder/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/zero-hallucination-coder/skills/zero-hallucination-coder/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œPlan this database migration carefully and make sure every function you use actually exists in our library version.”

5 new skills a week. 1 minute to read.

How it works

It works through a set of phases: discuss the goal, map the existing code, break the work into steps, make the changes and verify each import and API before moving on.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Zero-Hallucination Coder

A disciplined, senior engineering partner. The goal is code that is correct, grounded, and complete β€” with zero invented APIs, zero skipped steps, and zero hallucinated behavior.

When to invoke (opt-in discipline)

This is a deliberate, opt-in pipeline, not the default for every edit. Reach for it when:

  • The task is high-stakes or hard to undo (migrations, schema/auth changes, deployments).
  • It spans existing code across multiple files, or touches external APIs, auth, databases, or state.
  • The user explicitly asks to "plan carefully," "avoid hallucinated code," or "do this rigorously."

For a typo, a reformat, a docstring, or a throwaway script, skip the loop β€” the ceremony costs more than it saves. Anti-hallucination Rules 1-7 (below) still apply everywhere, but the five-phase loop is reserved for work that earns it.

Credits & Inspiration

This skill is a synthesis of four open-source projects. Their ideas power every phase of the loop below.

Project Author What It Contributes
Ralph @snarktank PRD-driven atomic coding loop β€” implement one story at a time in fresh context, commit only when quality checks pass
GSD Core @open-gsd Context-engineering discipline β€” Discuss β†’ Plan β†’ Execute β†’ Verify β†’ Ship phase loop, structured memory files, preventing context rot
Graphify @safishamsi Knowledge-graph codebase reasoning β€” explicit KNOWN/INFERRED/UNKNOWN relationship tagging, grounded in real structure not guesses
Ponytail @DietrichGebert Lazy senior dev hierarchy β€” before writing any code, check if it needs to exist at all, producing 80–94% less code

Each project also ships its own native tooling (autonomous runners, AST graph builders, lifecycle hooks). This skill bakes their discipline into one loop; install the originals separately only if you want their standalone tooling.


Before Starting

Check for context first: If project-context.md exists in the workspace, read it before asking questions. Use that context and only ask for gaps.

Modes

  • Build from scratch β€” no existing codebase. Run all five phases.
  • Extend existing code β€” the relevant files must be shared before Phase 2 (Map) can run. Request only the files that matter, not the whole repo.
  • Debug or refactor β€” abbreviated loop: Discuss β†’ Map (read broken code) β†’ Execute (targeted fix) β†’ Verify.

The Five-Phase Loop

Every session under this skill runs all five phases in order. Skipping phases is the primary cause of hallucinated, broken, or incomplete code.

Phase 1: DISCUSS

Goal: Capture what is actually being built before any planning happens.

Ask and fully resolve:

  1. What is the end state? Describe the working thing, not the steps to get there.
  2. What tech stack, language, and major libraries are in use? (Do NOT assume.)
  3. Does existing code exist that this touches? If yes, share it.
  4. What are the hard constraints? (Must run on X, must use Y, must not break Z.)
  5. What does "done" look like β€” how will we know this works?

Rules:

  • Ask all five questions in a single message and wait for answers.
  • Do not start planning until questions 1, 2, and 5 are answered.
  • If the user says "just write the code", explain briefly why skipping Discuss produces broken output and ask once more. If they insist, proceed with explicit UNKNOWN tags everywhere.

Output: A one-paragraph Situation Summary the user confirms before moving forward.

Phase 2: MAP

Goal: Build a codebase map before writing a single line of code. (Graphify principle)

For existing code:

CODEBASE MAP
============
[KNOWN]    UserService.ts β†’ calls β†’ AuthService.authenticate()
[KNOWN]    AuthService.ts β†’ imports β†’ jwt library (v9.x, user confirmed)
[INFERRED] UserController.ts β†’ probably calls β†’ UserService (assumed from naming)
[UNKNOWN]  Database connection layer β†’ HOW auth tokens are stored β†’ NOT VERIFIED

UNKNOWN FLAGS β€” must resolve before coding:
- Token storage mechanism: ask user or request db/config file

For greenfield projects: sketch the proposed architecture as a dependency map with the same t

FAQ

Should I use it for small edits?

No, the skill says a typo fix or small reformat does not need the full process, since it adds extra steps.

What does it check?

It checks that every import and API used in the code exists before the change is considered done.

Does it make the AI slower?

Yes, it adds planning and checking steps, which is why it is meant for risky work only.

Details

Original description by the author

Use before high-stakes or multi-file coding (auth, databases, migrations), or when asked to plan carefully and avoid invented APIs. Runs discuss, map, decompose, execute and verify, checking every import and API exists. Not for trivial edits.

repo: alirezarezvani/claude-skills

Popularity

GitHub stars
29k
Ranking position
#9616
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills