← 返回 Skills 市场
nmww

精准编程四大原则

作者 nmww · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
16
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install precise-coding-principles
功能描述
编程原则技能,源于 Andrej Karpathy 的 LLM 编程四大通病与核心原则。 Use when: (1) writing or reviewing code, (2) user asks to build/create/refactor a feature, (3) code is becoming...
使用说明 (SKILL.md)

Karpathy Principles — Precision Coding

Core Philosophy

LLM coding四大通病:

  1. 做错误假设(不确定就蒙头跑)
  2. 代码越来越臃肿(100行能搞定写1000行)
  3. 误改无关代码
  4. 没有验证标准

Four Principles

1. Think Before Coding

不假设、不藏困惑、主动暴露权衡。

  • 不确定的地方 → 先问,不要猜
  • 遇到歧义 → 列出方案,让用户选
  • 遇到不清楚 → 停下来,说清楚再动手

2. Simplicity First

用最少的代码解决问题。不做 speculative 的事。

  • 没被要求的功能,一个字都不加
  • 没被用到的抽象,一个都不写
  • 写完自问:"高级工程师会觉得这过度设计吗?" → 会就重写
  • 200行能写成50行 → 重写

3. Surgical Changes

只碰该碰的。只清理自己造成的垃圾。

  • 不"顺便"优化无关代码/注释/格式
  • 不重构没有坏掉的东西
  • 匹配已有风格
  • 验证标准:每一行改动都要能追溯到用户的原始请求

4. Goal-Driven Execution

定义成功标准,循环直到验证通过。

把命令式任务变成可验证的目标:

而不是... 变成...
"修这个 bug" "写一个能复现它的测试,然后让它通过"
"添加验证" "写无效输入的测试,然后让它们通过"
"重构 X" "确保重构前后测试都通过"

When to Apply

任务类型 是否启用完整流程
简单 typo 修复 ❌ 直觉判断
明显 one-liner ❌ 直觉判断
新功能/复杂重构 ✅ 完整四原则
不确定用户意图 ✅ Think Before Coding
代码突然变得很复杂 ✅ Simplicity First
要改多个文件 ✅ Surgical Changes
Bug 修复 ✅ Goal-Driven Execution

详细原则与案例:见 references/karpathy-principles.md

安全使用建议
This skill appears safe to install as general coding-process guidance. It does not add tools or permissions; users should simply expect it to make the agent ask clarifying questions, avoid unnecessary changes, and prefer testable success criteria during non-trivial coding tasks.
功能分析
Type: OpenClaw Skill Name: precise-coding-principles Version: 1.0.0 The skill bundle provides behavioral guidelines for the AI agent based on Andrej Karpathy's coding principles (Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution). The instructions in SKILL.md and references/karpathy-principles.md are designed to improve code quality and reduce errors by encouraging the agent to ask for clarification and minimize unnecessary changes. There is no evidence of malicious intent, data exfiltration, or unauthorized execution.
能力评估
Purpose & Capability
The artifacts coherently describe a programming-principles skill intended to make coding tasks more deliberate, minimal, and verifiable.
Instruction Scope
The instructions are limited to coding workflow guidance such as asking clarifying questions, avoiding over-engineering, making surgical changes, and validating work.
Install Mechanism
There is no install spec and no executable code; the registry describes this as an instruction-only skill.
Credentials
No environment variables, binaries, credentials, configuration paths, OS-specific access, network calls, or local file indexing are requested.
Persistence & Privilege
The artifacts do not show persistence, background execution, privilege escalation, account access, or retained memory behavior.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install precise-coding-principles
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /precise-coding-principles 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
首次发布:基于Karpathy的LLM编程四大通病与核心原则,防止代码过度设计和盲目假设
元数据
Slug precise-coding-principles
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

精准编程四大原则 是什么?

编程原则技能,源于 Andrej Karpathy 的 LLM 编程四大通病与核心原则。 Use when: (1) writing or reviewing code, (2) user asks to build/create/refactor a feature, (3) code is becoming... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 16 次。

如何安装 精准编程四大原则?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install precise-coding-principles」即可一键安装,无需额外配置。

精准编程四大原则 是免费的吗?

是的,精准编程四大原则 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

精准编程四大原则 支持哪些平台?

精准编程四大原则 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 精准编程四大原则?

由 nmww(@nmww)开发并维护,当前版本 v1.0.0。

💬 留言讨论