← Back to Skills Marketplace
nmww

精准编程四大原则

by nmww · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
16
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install precise-coding-principles
Description
编程原则技能,源于 Andrej Karpathy 的 LLM 编程四大通病与核心原则。 Use when: (1) writing or reviewing code, (2) user asks to build/create/refactor a feature, (3) code is becoming...
README (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

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install precise-coding-principles
  3. After installation, invoke the skill by name or use /precise-coding-principles
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
首次发布:基于Karpathy的LLM编程四大通病与核心原则,防止代码过度设计和盲目假设
Metadata
Slug precise-coding-principles
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 精准编程四大原则?

编程原则技能,源于 Andrej Karpathy 的 LLM 编程四大通病与核心原则。 Use when: (1) writing or reviewing code, (2) user asks to build/create/refactor a feature, (3) code is becoming... It is an AI Agent Skill for Claude Code / OpenClaw, with 16 downloads so far.

How do I install 精准编程四大原则?

Run "/install precise-coding-principles" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 精准编程四大原则 free?

Yes, 精准编程四大原则 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 精准编程四大原则 support?

精准编程四大原则 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 精准编程四大原则?

It is built and maintained by nmww (@nmww); the current version is v1.0.0.

💬 Comments