super-code
它能做什么
这个“技能”可以让 AI 编写尽可能简短、正确且易于理解的代码。它的重点是避免多余的代码,并让 AI 高效地工作。
适用场景
- ✓每当你让 AI 编写或修改代码时。
- ✓当你让 AI 审查或改进现有代码时。
- ✓当你希望生成的代码尽可能简洁明了时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/super-code/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请写一个 Python 函数来实现两个数相加,要求尽可能简洁且正确。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会先考虑解决问题最简单的方式。然后,它会运用该编程语言的最佳实践,去掉所有不必要的代码和注释,确保剩下的代码易于阅读并且运行正常。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Super Code Skill
Overview
Produce code that is short, correct, idiomatic, and maintainable — in that priority order. This skill addresses two distinct inefficiency types that must be fixed independently:
- Code-token inefficiency — the artifact itself is bloated (unnecessary lines, boilerplate, over-abstraction)
- Generation-token inefficiency — how the agent operates during a session (full-file rewrites, unrequested files, prose padding before/after changes)
Both matter. Fixing only one is not enough.
When to Use This Skill
- Apply this skill automatically on EVERY coding task in the IDE.
- Use whenever the user asks to write, edit, refactor, generate, or review code in any language.
- This is a standing house style, not an on-demand pass — always apply it.
Priority Order (never violate this ranking)
Correctness → Clarity → Necessary robustness → Conciseness → Micro-performance
Conciseness never wins over correctness or readability. If a compression would drop error handling for a case that can actually occur, or produce code a human couldn't read in six months, undo that specific compression. Short bad code is worse than long correct code.
Workflow — apply to every coding task
Step 1: Commit to minimal correct shape BEFORE writing
Before touching a file, decide:
- What is the smallest surface area that correctly solves this problem?
- What does the caller actually need from this function/class/module?
- Is there a stdlib/framework primitive that already does this?
Write that down mentally (not in a prose block to the user). This is the target shape.
Step 2: Write using language-idiomatic patterns
Read the relevant reference file for the language in use:
- Bash/Shell →
bash/SKILL.md - C →
c/SKILL.md - C++ →
cpp/SKILL.md - C# →
csharp/SKILL.md - Dart/Flutter →
dart/SKILL.md - Elixir/Erlang →
elixir/SKILL.md - Go →
go/SKILL.md - Java →
java/SKILL.md - Kotlin/Compose →
kotlin/SKILL.md - PHP →
php/SKILL.md - Python →
python/SKILL.md - Ruby →
ruby/SKILL.md - Rust →
rust/SKILL.md - Scala →
scala/SKILL.md - Swift →
swift/SKILL.md - TypeScript/JavaScript →
typescript/SKILL.md
Apply idiomatic patterns from that file. They replace verbose imperative code with correct, concise equivalents that are still readable.
Step 3: Compression pass on your own draft
Before presenting any code, scan it for:
| Anti-pattern | Fix |
|---|---|
| Comment restates what code does | Delete comment, or rewrite to say why |
| Single-use helper function/class | Inline it |
| Stdlib/framework already does this | Replace with the primitive |
| Defensive handling for impossible case | Remove |
| Verbose loop replaceable by idiomatic expression | Replace |
| Logging/print nobody asked for | Remove |
| Extra config/files/parameters not requested | Remove |
| Unused import or variable | Remove |
Step 4: Guardrail check — run this before presenting
Ask yourself (silently):
- Did I remove handling for a case that can actually happen?
- Did I make this harder to read for a human six months from now?
- Did I drop correctness or security to save lines?
If yes to any: undo that specific compression and keep the rest.
Step 5: Present output — generation-token rules
Always:
- Edit files via targeted patches/diffs, not full rewrites, unless the file is new or the change touches >70% of lines
- Present only what was asked for
Never:
- Generate unrequested files (tests, READMEs, configs, types) unless the user asked
- Add prose blocks before/after code explaining what you're about to do or just did — just do it
- Re-explain the user's own requirement back to them before writing
- Restate what changed in a paragraph after showing the diff — the diff is self-evident
Universal Anti-Pattern Checklist
These apply in every language. The language-specific files extend this list.
Comments
- ❌
// Loop through the list and add each item→ ❌ delete - ✅
// Order matters: process refunds before charges→ ✅ keep (explains why) - Rule: if the comment could be generated mechanically from reading the code, it adds no value
Defensive coding
- Only handle error cases that can actually occur given the call site
- If the caller guarantees non-null, don't null-check inside the function
- If a catch block can only log and rethrow, consider removing the try/catch
Abstractions
…
常见问题
为什么代码要简洁?
简洁的代码更容易阅读、理解和维护,而且占用的计算资源更少。
“惯用写法”(idiomatic)是什么意思?
它指的是使用该编程语言中常见且被普遍接受的写法和模式,这样其他程序员更容易看懂代码。
AI 会删除重要的注释吗?
不会。它只删除那些仅仅重复代码内容的注释。解释实现“为什么这样做”的注释会被保留。
详情
作者的原始描述
Standing house style to enforce dense, correct, and idiomatic code on all coding tasks. Minimizes code bloat and agent operation overhead.
热度
- GitHub 星标
- 48k
- 排名
- #5885
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。