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.mdCopy 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
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
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:
- What is the end state? Describe the working thing, not the steps to get there.
- What tech stack, language, and major libraries are in use? (Do NOT assume.)
- Does existing code exist that this touches? If yes, share it.
- What are the hard constraints? (Must run on X, must use Y, must not break Z.)
- 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.
Popularity
- GitHub stars
- 29k
- Ranking position
- #9616
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
agent-launcher-orchestrator
29kHelps your agent plan, build, test and schedule a Claude managed agent in your own account, step by step, starting from one clear goal.
grade-iterate
29kLets your agent grade a managed AI agent's work against a rubric and improve it in a fixed number of rounds, so it never loops forever.
interview
29kLets your agent interview you about an AI agent idea and turn your answers into a simple build plan before anything is launched.
run-without-you
29kHelps your agent set up a managed AI agent to run on a schedule or when an event happens, with the cron timing checked before launch.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.