Show HN:Sphinx — 一个在发布前考你对 AI 代码理解的钩子
Show HN: Sphinx – A hook that quizzes you on your AI's code before shipping

原始链接: https://sphinx-six-theta.vercel.app/

Sphinx 是一个用于代理辅助开发的 Git 钩子,它会暂停推送到受保护分支,并询问开发者变更代码在故障场景下会做什么。它使用审查模型根据 diff 生成问题,独立于编码代理。开发者回答;答对允许推送,答错则揭示问题并提供另一场景。它支持 Codex、Claude Code、Cursor、OpenCode、Pi 或普通 Git,并可使用 OpenRouter 或兼容 OpenAI 的端点,token 用量极少。它从不向代理暴露 .env 文件或密钥,跳过操作通过 `sphinx yolo` 记录。安装:`npm install -g sphinx-understand`,运行 `sphinx install`,然后正常推送。需要 macOS、Linux 或 WSL 上的 Node 22.19+。

Sphinx 是一个 Show HN 工具,在 AI 生成的代码发布前测验开发者,旨在在加速编码的同时保留理解。评论者对其价值存在争议:一些人说它可能减少粗心的“vibe coding”并发现盲点;其他人则认为它增加摩擦,可能通过把问题粘贴给 AI 来作弊,或者只能检查理解而不能捕捉 diff 级别的 bug。许多人反思更广泛的速度与理解之间的紧张关系:AI 能加速工作,但可能削弱学习,尤其是对经验不足的开发者;仔细审查、清晰的 PR 描述、架构纪律和可选使用,可能比强制测验更重要。有人建议在 PR 前应用检查,或用于开源/企业防作弊;怀疑者则说有动力的开发者已经理解自己的代码,没动力的不会在乎。总体而言,该讨论将 Sphinx 视为不断变化的工作流中一个不完美的防护栏,人类判断仍然不可或缺。
相关文章

原文

“Outsource your thinking,
not your understanding.”

— Sun Tzu

Sphinx is a Git hook for agent-assisted development. Before your agent’s code ships, it asks you a question about what that code actually does.

npm install -g sphinx-understand

Built to run on minimal tokens, from your existing coding agent, OpenRouter, or any OpenAI-compatible endpoint.

$ git push origin main

sphinx · understanding check for main

11 files changed · +5,012 −3,147

Sphinx

Your webhook handler now saves the event ID before calling charge(). Stripe times out and sends the same event again. What happens on the retry?

You

It runs twice, so the customer is charged twice.

Sphinx

You

It skips the charge, so the customer is never billed.

✓ Understood. Pushing to origin/main.

An illustrative exchange. Real questions come from your diff.

  1. 01

    You push.

    Or your agent does. Git pauses on the branches you protect.

  2. 02

    Sphinx asks.

    A reviewer that never saw your chat reads the diff and asks what the change does when things go wrong.

  3. 03

    You answer.

    Get it wrong and you learn why, then try a new scenario. Get it right and the push continues.

Works with Codex, Claude Code, Cursor, OpenCode, and Pi, or plain Git. Your answers never reach the coding agent, and .env files and keys are never opened. In a hurry? sphinx yolo lets pushes through, and every skip is logged.

# Node 22.19+ · macOS, Linux, or WSL
npm install -g sphinx-understand
sphinx install

# then push as usual
git push

sphinx install connects Git and your coding agents and asks which model should review. Read the docs for everything else.

联系我们 contact @ memedata.com