Skip to content
Agentmart
Submit a tool

coding-guidelines

减少常见 LLM 编码失误的行为准则。Use when "写代码", "改代码", "重构", "code", "refactor", "implement", "review code", "编写/修改本仓库代码" — 即任何在本项目里写、改、重构、审查代码之前。 四条原则:先想后写 / 极简优先 /…

Skill by sunchendd

IndexedMIT★ 3
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/sunchendd-coding-guidelines

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

减少常见 LLM 编码失误的行为准则。Use when "写代码", "改代码", "重构", "code", "refactor", "implement", "review code", "编写/修改本仓库代码" — 即任何在本项目里写、改、重构、审查代码之前。 四条原则:先想后写 / 极简优先 / 外科手术式改动 / 目标驱动执行。 Derived from Andrej Karpathy's observations on LLM coding pitfalls.

Use cases: ml

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/coding-guidelines

What's inside

Skill name
coding-guidelines
Description
减少常见 LLM 编码失误的行为准则。Use when "写代码", "改代码", "重构", "code", "refactor", "implement", "review code", "编写/修改本仓库代码" — 即任何在本项目里写、改、重构、审查代码之前。 四条原则:先想后写 / 极简优先 / 外科手术式改动 / 目标驱动执行。 Derived from Andrej Karpathy's observations on LLM coding pitfalls.
License
MIT
Instructions
67 lines in SKILL.md · view on GitHub

Files (2)

  • EXAMPLES.md
  • SKILL.md

SKILL.md (first lines)

# Coding Guidelines

减少常见 LLM 编码失误的四条行为准则,源自 [Andrej Karpathy 对 LLM 编码缺陷的观察](https://x.com/karpathy/status/2015883857489522876)。

**权衡:** 这些准则偏向「稳」而非「快」。琐碎任务(改错别字、明显的一行修复)用判断力即可,不必套用全套。

## 1. 先想后写 / Think Before Coding

**不要默认假设,不要掩饰困惑,主动摆出权衡。**

动手前:
- 把假设明说出来。不确定就问,别猜。
- 存在多种合理解读时,列出来让用户选,不要默默挑一个。
- 有更简单的做法时,直说;该顶回就顶回。
- 搞不清的地方,停下,指出哪里困惑,再问。

## 2. 极简优先 / Simplicity First

**用解决问题的最少代码,不写任何投机性的东西。**

- 不做没被要求的功能。
- 一次性代码不抽象。
- 不加没被要求的「灵活性」「可配置性」。
- 不为不可能发生的场景写错误处理。
- 200 行能写成 50 行,就重写。

自问:「资深工程师会不会觉得这过度复杂?」会,就简化。

## 3. 外科手术式改动 / Surgical Changes

**只动该动的地方,只清理自己造成的烂摊子。**

改已有代码时:
- 不「顺手优化」相邻的代码、注释、格式。
- 不重构没坏的东西。
- 沿用既有风格,哪怕你不会这么写。
- 发现无关的死代码,提一句,不要删。

自己的改动产生孤儿时:
- 删掉因**你的改动**而变得无用的 import / 变量 / 函数。
- 不删既有的死代码,除非被要求。

检验标准:每一行改动都能直接追溯到用户的请求。

## 4. 目标驱动执行 / Goal-Driven Execution

**定义成功标准,循环到验证通过为止。**

把任务转成可验证的目标:
- 「加校验」→「为非法输入写测试,再让测试通过」
- 「修 bug」→「写一个能复现的测试,再让它通过」
- 「重构 X」→「改动前后测试都通过」

多步任务先给简短计划:
```
1. [步骤] → 验证:[检查]
2. [步骤] → 验证:[检查]
3. [步骤] → 验证:[检查]
```

强成功标准让你能独立循环推进;弱标准(「让它能跑」)会逼着用户反复澄清。

---

**准则生效的信号:** diff 里没有多余的改动、不会因过度复杂而返工、澄清问题出现在动手前而非出错后。

From sunchendd/good_skills, MIT.

More from sunchendd/good_skills

Signals

Stars
3
Forks
1
Open issues
0
Last commit (this folder)
Jul 4, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from sunchendd

Cite this page

coding-guidelines skill. Agent Mart. https://agentmart.dev/skills/sunchendd-coding-guidelines (last updated 2026-10-24)