Karpathy编程四大原则
AI编程四大原则 - 源自Karpathy法则 (forrestchang/andrej-karpathy-skills 94.2k⭐)。用于在AI编程时强制执行先思考、保持简单、精准修改、目标驱动四大原则。适用于AI代码审查、代码生成、修复bug等场景。 Skill: Karpathy编程四大原则 Owner: 534422530 Summary: AI编程四大原则 - 源自Karpathy法则 (forrestchang/andrej-karpathy-skills 94.2k⭐)。用于在AI编程时强制执行先思考、保持简单、精准修改、目标驱动四大原则。适用于AI代码审查、代码生成、修复bug等场景。 Tags: ai-coding:1.0.0, karpthy:1.0.0, latest:1.0.0, programming-principles:1.0.0 Version history: v1.0.0 | 2026-04-28T03:23:16.935Z | user 初始版本 Archive index: Archive v1.0.0: 3 files, 3359 bytes Files: skill-card.md (1876b), SKILL.md (3220b),
Rank
62
Safety
84
Downloads
1.5k
Updated
Oct 10, 2026
Version
1.0.0
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.5K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 10, 2026
- Adoption signal
- 1.5K downloadsadoption · observed Oct 10, 2026
- Latest release
- 1.0.0release · observed Apr 28, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s170k9770tgh0506hw0dwtb6pd83kwyq:karpathy-principles- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-534422530-karpathy-principles/snapshot"
Documentation
CLAWHUB
4,278 characters of source documentation, loaded on request.
Extracted files
3 files captured from the source.
SKILL.md
---
name: karpathy-principles
description: AI编程四大原则 - 源自Karpathy法则 (forrestchang/andrej-karpathy-skills 94.2k⭐)。用于在AI编程时强制执行先思考、保持简单、精准修改、目标驱动四大原则。适用于AI代码审查、代码生成、修复bug等场景。
metadata: {"openclaw": {"requires": {}, "install": []}}
tags: [ai-coding, karpathy, programming-principles, code-quality, tdd]
version: 1.0.0
author: laosi
source: local
---
# ⚠️ 发布规则
**所有发布到ClawHub的技能必须严格测试,确定没有问题再发布**
---
## 技能测试验证清单
发布前必须验证:
- [ ] 功能完整性:所有描述的功能都能正常工作
- [ ] 语法正确性:Markdown格式正确,无错误
- [ ] 激活词有效性:激活词能正确触发
- [ ] 场景覆盖:主要使用场景已测试
- [ ] 无副作用:不会破坏已有功能
---
# Karpathy Principles - AI编程四大原则
> 基于 Andrej Karpathy 的 AI 编程观察,使用 forrestchang/andrej-karpathy-skills (94.2k⭐)
> 激活词: 克拉aude法则 / 编程法则
## 原则概述
| 原则 | 核心 | 执行 |
|------|------|------|
| 1. 先思考 | 不假设,不隐藏困惑 | 不确定就问,多种解释列出 |
| 2. 保持简单 | 最小代码解决问题 | 无多余抽象 |
| 3. 精准修改 | 只改必须改的 | 不"顺便"改进邻接代码 |
| 4. 目标驱动 | 测试先行,验证闭环 | "修bug"→"写测试复现→让测试通过" |
## 触发条件
当AI出现以下情况时,必须应用此原则:
- 代码过于复杂 (>200行可解决写1000行)
- 改动范围失控 (修改了不相关的代码)
- 未经确认就实现 (不询问就开干)
- 缺少验证 (没有测试或检查点)
## 工作流程
### 1. 代码审查
```
CLAUDE.md → 检查错误假设 → 检查过度复杂 → 检查连带修改 → 报告问题
```
### 2. 代码生成
```
需求 → 列出多种解释 → 选择最简方案 → 写测试 → 实现
```
### 3. Bug修复
```
报告bug → 写测试复现bug → 让测试通过 → 验证修复
```
## 示例
### 错误示范 ❌
用户: "添加用户验证"
AI: 直接写了一个完整的UserService类,包含角色权限、密码加密、会话管理...
(过度复杂,假设了不需要的功能)
### 正确示范 ✅
用户: "添加用户验证"
AI:
1. 你需要哪种验证? (邮件+密码? 手机号? OAuth?)
2. 需要验证哪些字段?
3. 数据规模多大?
4. 有现有用户表结构吗?
(先思考,不假设)
### Bug修复
用户: "修复登录bug"
AI:
1. 写测试复现bug → 让测试失败
2. 定位问题 → 修复
3. 让测试通过
4. 验证修复正确
(目标驱动,测试闭环)
## 禁用触发
在收到以下关键词时,必须停止并应用法则:
- "帮我写个..." → 先问需求细节
- "修复这个" → 先写测试复现
- "添加功能" → 先确认最小范围
## 来源
- Karpathy原始观察: https://x.com/karpathy/status/2015883857489522876
- forrestchang/andrej-karpathy-skills: https://github.com/forrestchang/andrej-karpathy-skills
- CLAUDE.md原文: https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.md_meta.json
{
"ownerId": "kn71pk44ca87scz3pstt90r66n80xhaa",
"slug": "karpathy-principles",
"version": "1.0.0",
"publishedAt": 1777346596935
}skill-card.md
## Description: Karpathy编程四大原则用于引导AI编程代理在代码审查、代码生成和Bug修复中先思考、保持简单、精准修改并通过测试闭环验证。 This skill is ready for commercial/non-commercial use. ## Publisher: [534422530](https://clawhub.ai/user/534422530) ### License/Terms of Use: MIT-0 ## Use Case: Developers and coding agents use this skill to keep AI-assisted coding work focused on clarified requirements, minimal implementations, targeted edits, and test-backed verification. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: Broad Chinese trigger wording can make the skill influence ordinary coding requests more often than intended. Mitigation: Use narrower or opt-in trigger wording in deployments that require explicit activation. ## Reference(s): - [ClawHub skill page](https://clawhub.ai/534422530/skills/karpathy-principles) - [Karpathy original observation](https://x.com/karpathy/status/2015883857489522876) - [forrestchang/andrej-karpathy-skills](https://github.com/forrestchang/andrej-karpathy-skills) - [CLAUDE.md source material](https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.md) ## Skill Output: **Output Type(s):** [Text, Markdown, Guidance] **Output Format:** [Markdown guidance with checklists, workflows, and review criteria] **Output Parameters:** [1D] **Other Properties Related to Output:** [Markdown-only skill; no installers, commands, or runtime dependencies.] ## Skill Version(s): 1.0.0 (source: server release evidence and SKILL.md frontmatter) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/534422530/skills/karpathy-principles",
"sourceUrl": "https://clawhub.ai/534422530/skills/karpathy-principles",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T11:13:47.928Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-534422530-karpathy-principles/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-534422530-karpathy-principles/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T11:13:47.928Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.5K downloads",
"href": "https://clawhub.ai/534422530/karpathy-principles",
"sourceUrl": "https://clawhub.ai/534422530/karpathy-principles",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T11:13:47.928Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.0",
"href": "https://clawhub.ai/534422530/karpathy-principles",
"sourceUrl": "https://clawhub.ai/534422530/karpathy-principles",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-28T03:23:16.935Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-534422530-karpathy-principles/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-534422530-karpathy-principles/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.0",
"description": "初始版本",
"href": "https://clawhub.ai/534422530/karpathy-principles",
"sourceUrl": "https://clawhub.ai/534422530/karpathy-principles",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-28T03:23:16.935Z",
"isPublic": true
}
]
}Record generated Oct 10, 2026.
