跳到正文
Skillpedia
通用编程29k · #9568

minimalist

它能做什么

在编写任何新代码之前,它会应用一份简短的检查清单,例如询问该功能是否真的需要,以及标准库是否已经能实现它。适合希望代码精简、依赖较少的人。

适用场景

  • ✓当你希望智能体不要把一个小任务过度设计时。
  • ✓当你想减少项目中的依赖时。
  • ✓当你要求用最少的代码解决某个问题时。

技能链接

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/minimalist/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/alirezarezvani/claude-skills/blob/main/engineering/minimalist/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请用尽可能少的代码解决这个问题;如果标准库能完成,就不要添加新的软件包。”

每周 5 个新技能,1 分钟读完。

工作原理

在写任何内容之前,智能体会按照一个由易到难的选项阶梯逐步推进,从询问功能是否真的需要,到复用现有代码,然后才编写最小的可用版本。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Minimalist

You are highly efficient. The best code is the code never written.

Overview

Use this skill whenever the goal is to solve a problem with the least code possible. It prevents common AI failure modes: inventing helper classes for single-use logic, installing packages for one-line operations, and producing boilerplate that the user will never need.

The Efficiency Ladder

Before writing any new code, stop at the first rung that holds:

  1. YAGNI — Does this need to be built at all? If the user hasn't asked for it, don't build it.
  2. Reuse — Does it already exist in this codebase? Find the helper, util, or pattern and reuse it.
  3. Standard Library — Does the standard library already do this? Use it directly.
  4. Native Platform — Does a native platform feature cover it? Use it.
  5. Existing Dependency — Does an already-installed dependency solve it? Use it.
  6. One-Liner — Can this be one line? Make it one line.
  7. Minimum Code — Only then, write the minimum code that works.

Rules of Engagement

  • No unrequested abstractions: Do not invent interfaces, base classes, or generics for future-proofing unless the user explicitly asks.
  • No unnecessary dependencies: If the standard library can do it cleanly, do not install a package.
  • No boilerplate: Deletion over addition. Boring over clever. Fewest files possible.
  • Question complex requests: Ask "Do you actually need X, or does Y cover it?" before building X.
  • Shortest working diff wins: But only once you understand the problem. The smallest change in the wrong place isn't lazy — it's a second bug.

Workflow

When asked to implement something:

  1. Pause before writing code.
  2. Walk the ladder — can rungs 1–6 resolve this without new code?
  3. State your decision — "Using stdlib pathlib instead of a custom file helper."
  4. Write minimum code only if the ladder doesn't resolve it.
  5. Do not add comments, logging, or error handling that wasn't asked for.

Anti-Patterns

Anti-Pattern What to do instead
Installing a package for a one-liner Use the standard library
Writing a class for a single function Write the function
Adding a config file for a single hardcoded value Hardcode it until there are 2+ uses
Creating a utility module before it's reused anywhere Write inline, extract later
Adding docstrings/comments the user didn't ask for Skip them
Building error handling for errors that can't happen Skip it
Adding logging before the code works Ship the code first

Cross-References

  • Related: engineering/strict-api — prevents hallucinated APIs when writing minimal code; use together.
  • Related: engineering/zero-hallucination-coder — enforces verified-only API usage.
  • Related: engineering/karpathy-coder — Karpathy-inspired behavioral guidelines for LLM-assisted coding.
常见问题

它会跳过我要求的功能吗?

不会。它避免你没有要求的功能,但仍会交付任务所需的内容。

它会安装软件包吗?

当标准库或现有依赖能完成工作时,它会避免使用新的软件包。

它问的第一个问题是什么?

这项工作是否真的需要做。因为最好的代码,就是从未被编写的代码。

详情

作者的原始描述

Use when asked to avoid over-engineering, cut dependencies or write the least code. Applies a strict ladder before any new code: YAGNI, reuse, stdlib, native platform, existing deps.

repo: alirezarezvani/claude-skills

热度

GitHub 星标
29k
排名
#9568
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能