karpathy-guidelines
提供一组面向编码行为的轻量约束,帮助代理在动手前暴露假设、优先简单方案、保持改动外科化,并把任务改写成可验证目标。 当任务容易被误解、过度设计、顺手扩散改动,或需要先锁定成功标准时使用。
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-11
- Stars
- ★ 1.6k
- Forks
- 474
01 前言 Front Matter
- name
- karpathy-guidelines
- description
- 提供一组面向编码行为的轻量约束,帮助代理在动手前暴露假设、优先简单方案、保持改动外科化,并把任务改写成可验证目标。 当任务容易被误解、过度设计、顺手扩散改动,或需要先锁定成功标准时使用。
02 资源文件 1
- 参考文档agents/openai.yaml317 B
03 SKILL.md 正文
Karpathy Guidelines
基于 Colin4k1024/andrej-karpathy-skills 的方法论做本地化吸收,用来降低代理在真实代码库里常见的三类失误:替用户做错假设、把实现做重、顺手改到不该碰的地方。
这不是新的编码规范、TDD 或验收框架,而是一层更前置的行为护栏:
- 需要代码风格、命名、通用工程规范时,接 coding-standards
- 需要测试先行与 RED/GREEN/REFACTOR 时,接 tdd-workflow
- 需要在收尾前给出构建、测试、校验证据时,接 verification-loop
用途
- 把“先理解再动手”变成默认动作,而不是出错后的补救。
- 把“能跑就行”的实现收敛成最小可交付方案,减少过度抽象和未来感设计。
- 把改动边界钉住,避免为了解一个问题顺手重写一片上下文。
- 把含糊任务改写成可验证结果,方便后续接 TDD、验证循环和 handoff。
默认做法
- Think Before Coding:先写清当前理解、关键假设、歧义点和更简单备选,不在有歧义时静默选一种解释。
- Simplicity First:只做当前需求闭环所需的最小实现;不要为“以后可能用到”先铺抽象、配置层或扩展点。
- Surgical Changes:只改与当前请求直接相关的文件和代码;如果发现无关坏味道,只记录,不顺手清理。
- Goal-Driven Execution:把“做某件事”改写成“达到什么可验证结果”;优先使用测试、命令输出或明确检查项作为成功标准。
触发信号
- 用户目标清楚,但实现解释不止一种,容易靠猜测直接开写。
- 任务范围小,却很容易被做成一层新抽象、框架或配置系统。
- 仓库已有稳定模式,改动只应触及局部逻辑,不应连带整理周边代码。
- 需求里出现“修一下”“加一下”“支持一下”这类宽泛表述,需要先收敛成功条件。
- 开始编码前需要决定:先问清楚、先补测试、还是先做最小实现。
配套约束
- 这是一层前置行为约束,不替代具体实现 skill;进入编码后仍应接对应语言/框架 skill。
- 一旦决定实现新行为或修复缺陷,继续按 tdd-workflow 走测试先行。
- 完成实现后,仍需用 verification-loop 或等价命令给出 fresh evidence。
- 如果简单方案与用户指定路径冲突,要明确说出 tradeoff,而不是私自改方向。
- 看到 unrelated dead code、命名问题或旁路重构机会时,默认记录在 handoff / review,不在当前改动里顺手处理。
04 同仓库更多 Skills
migrate-to-e2e
Moves an existing Playwright, Cypress, Selenium, Appium, Detox, Maestro, or TesterArmy suite to e2e one slice at a time, with the old suite running beside the new one until each ported test is proven. Keeps a MIGRATION.md progress file so any later session resumes where the last stopped. Optionally plants a defect to show both suites catch it. Use for /migrate-to-e2e, "migrate our tests to e2e", "port these Maestro flows", "move our TesterArmy tests", or when a project has an e2e config and an older suite still running.
e2e
Writes, runs, and debugs end-to-end tests for web and mobile apps with e2e, the agentic test runner, which mixes agent.act goals with exact locator assertions on a Playwright browser or an iOS or Android device. Also drives a project's running app live over the e2e MCP server to look at a screen, check a UI change, take a screenshot or record a video, and try a locator; and runs bug bashes, parallel e2e explore runs with each bug proven by a repro test. Use when a project depends on e2e or has an e2e.config.ts, when asked for end-to-end, browser, mobile, or agentic UI tests, to check a change in the running app, to QA or bug bash an app or branch, or when an e2e run fails.
create-verification-skill
Generate a project-local verify-<app> skill on top of e2e, so any coding agent can launch the app, check it is worth driving, exercise a feature the way a user does, keep evidence, and bug bash it. Writes the skill, a feature map with one explore charter per feature, and proves it once. Use for /create-verification-skill, "make a verification skill for this repo", or when a project has no scripted way to prove UI behavior.
deja-search
deja-vu memory — search the user's past AI coding sessions with the deja CLI. Holds what they already settled and never wrote into the repo (naming rules, banned or already-tried tools, required checks before merge, preferred values, who owns what). Use before your first edit in a task, before you call a change done or ready to merge, before you recommend a tool, library, design or reviewer, before re-debugging an error that may already be solved, when they say 'didn't we fix this before', 'what did we decide about X' or 'I already have that', and before telling them something on this machine does not exist.
deja-reflect
End-of-session reflection and memory curation with deja-vu. Review what was decided, what commands broke and what repaired them, and record durable project rules or decisions with deja remember so the next session starts with them.
revid
Make, edit, export and post AI videos with Revid (revid.ai) through the Revid MCP server. Use whenever the user wants a short-form or long-form video made (from an idea, a script, a URL, an article, a PDF, a tweet, a product page, their own clips, or a song), wants to find what is going viral on TikTok, YouTube, Instagram or X before making something, wants to edit or re-export an existing Revid project, generate a standalone AI image or clip, make a series episode, or publish and schedule a finished video to connected social accounts. Covers setup (hosted MCP with OAuth, or an API key), the 36 tools, credits, polling and the rules for publishing. Routes to the more specific revid-* skills when one fits.