跳到正文
Skillpedia
通用编程29k · #9616

zero-hallucination-coder

它能做什么

这项技能引导 AI 完成高风险编程工作的谨慎流程,例如修改登录、数据库或迁移。适合希望减少虚构函数和跳过步骤的开发者。

适用场景

  • ✓当编程任务风险很高或难以撤销时,例如数据库迁移或身份验证变更。
  • ✓当一项变更涉及多个现有文件并接触外部 API 时。
  • ✓当你要求 AI 谨慎规划、避免编造代码的时候。

技能链接

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

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/alirezarezvani/claude-skills/blob/main/engineering/zero-hallucination-coder/skills/zero-hallucination-coder/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请谨慎规划这次数据库迁移,并确保你使用的每个函数在我们的库版本中真实存在。”

每周 5 个新技能,1 分钟读完。

工作原理

它会依次完成几个阶段:讨论目标、梳理现有代码、把工作拆分为步骤、进行修改,并在继续之前验证每个导入和 API。

技术内容(原始 SKILL.md)

作者在 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

常见问题

小的编辑也要用它吗?

不需要。该技能说明,修正错别字或小的格式调整不需要完整流程,因为那会增加额外步骤。

它检查什么?

在认为变更完成之前,它会检查代码中使用的每个导入和 API 是否存在。

它会让 AI 变慢吗?

会。它增加了规划和检查步骤,因此只适用于高风险的工作。

详情

作者的原始描述

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

热度

GitHub 星标
29k
排名
#9616
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能