关于 karpathy-vibe-to-agentic
karpathy-vibe-to-agentic 是一项技能,帮助通过 Agent 辅助的渐进式工作,将快速构建的原型转为更可靠、易维护的软件。流程包括审查假设和故障模式、制定可测试的成功标准,并保留人工审核。
主要功能
- 01原型审查提示词
- 02可测试的成功标准
- 03渐进式清理循环
- 04Vibe 编码反模式检查
- 05人工审核的 Agent 工作流
适用场景
- 01在生产化开发前评估原型
- 02将隐含目标改为可测试标准
- 03每次经审核后逐步改进脚本
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ learnprompt/ andrej-karpathy-skills --skill karpathy-vibe-to-agentic安装后在 Claude Code 中输入/karpathy-vibe-to-agentic确认已加载。
详细介绍
技能 5:Vibe 编码 → Agentic 跃迁
来源:https://x.com/karpathy/status/2004607146781278521 | https://x.com/karpathy/status/2026731645169185220 “作为程序员,我从未觉得自己落后这么多”——5.6 万个赞
核心原则
Vibe 编码拉高下限。Agentic 工程拉高上限。
两者并不相同,而且你都需要:
| Vibe 编码 | Agentic 工程 | |
|---|---|---|
| 目标 | 快速原型,探索想法 | 可靠、可维护、可验证 |
| 方式 | 自然语言 → 运行代码 | 任务规范 + 成功标准 + 循环 |
| 适用阶段 | 前 20%(探索) | 后 80%(执行) |
| 风险 | 你不了解自己构建的东西 | Agent 不理解你的需求 |
| Karpathy 的说法 | “拉高下限” | “拉高上限” |
过渡流程
当你有了 Vibe 编码的原型,并需要进一步完善时:
第 1 步:审查你构建的内容
I vibe-coded this [project/script/app]. I need to understand what I actually have before leveling it up.
[PASTE CODE OR DESCRIBE IT]
Please:
1. Describe exactly what this does in plain English (3-5 sentences)
2. List every assumption baked in (hardcoded values, expected input format, etc.)
3. Identify the 3 most likely failure modes
4. List what's missing for this to be production-ready
5. What would break if I ran this on a different machine / with different data?
Be blunt. I'm about to invest more time in this and need to know if it's worth it.
第 2 步:定义成功标准
Based on this audit of my prototype:
[AUDIT OUTPUT FROM STEP 1]
Help me define clear, verifiable success criteria for the "production-ready" version.
Format each criterion as a testable assertion:
- GIVEN [input/condition]
- WHEN [action]
- THEN [expected output/behavior]
List 5-7 criteria. Start with the most important.
第 3 步:Agentic 清理循环
You are a senior engineer reviewing this prototype. Your job is to systematically improve it.
Prototype: [CODE]
Success criteria: [FROM STEP 2]
Work incrementally:
1. First fix: address the most critical issue only (one diff)
2. After I approve each fix, suggest the next
3. Never refactor unrelated code
4. For each fix, explain: WHAT changed, WHY this matters, RISK of this change
Start with fix #1.
需要清理的常见 Vibe 编码问题
Review this vibe-coded project for these specific anti-patterns:
[PASTE CODE]
Check for:
1. Hardcoded credentials, paths, or magic numbers → suggest config/env vars
2. No error handling on file I/O or network calls → add try/except with clear messages
3. print() debugging left in → identify and offer to remove
4. Functions doing 3+ things → suggest split points
5. No way to run without human supervision → suggest automation hooks
6. Dependencies that aren't in requirements.txt / package.json
For each issue found: show the exact line and suggest the minimal fix.
双轨系统
Karpathy 并行运行以下两条轨道:
TRACK A (IDE / Human) TRACK B (Agent)
───────────────────── ───────────────
- Review diffs - Implement incrementally
- Apply taste/judgment - Run tests automatically
- Verify understanding - Suggest next steps
- Commit good work - Generate options
- Ask "is this right?" - Never commit autonomously
始终让人类参与品味判断。Agent 负责执行,不负责判断哪些东西值得构建。
快速升级提示词
快速一次性升级简单的 Vibe 脚本:
Upgrade this vibe-coded script to production quality.
[PASTE SCRIPT]
Requirements:
1. Add proper error handling (no unhandled exceptions)
2. Make all hardcoded values configurable via CLI args or env vars
3. Add a --dry-run flag that shows what would happen without doing it
4. Add basic logging (not print) with timestamps
5. Keep the core logic identical — only add robustness
6. Maximum 20% increase in line count
Output the complete upgraded script.
工作流
所属工作流:从想法到上线(开发者)
| 位置 | 上游 | 下游 |
|---|---|---|
| 第 5 步(收尾) | karpathy-supply-chain-hygiene(安全审查后) | 部署/交付 |
完整链路:idea-files → agentic-engineering → minimalism → supply-chain-hygiene → vibe-to-agentic
提示词约定
I have a vibe-coded prototype: <PASTE_CODE_OR_DESCRIBE>. Step 1: Audit — describe what it does, list hidden assumptions, identify failure modes, list what's missing for production. Step 2: Define 5-7 verifiable success criteria in GIVEN/WHEN/THEN format. Step 3: Start the agentic cleanup loop — one incremental fix at a time, explain WHAT/WHY/RISK for each.
验证清单
- 已列出原型的所有隐含假设
- 已将成功标准定义为可测试的 GIVEN/WHEN/THEN 格式
- 每轮修复只改一个问题
- 核心逻辑未遭破坏(功能不变)
- 已添加错误处理和日志
- 硬编码值已替换为配置项
评论
支持 Markdown