minimal-code-discipline

minimal-code-discipline is a skill for Claude Code, Codex from cass-2003/local-workflow-skill. It costs 101 tokens per session (2,594 once invoked), scanned A, original, MIT.

A set of rules for keeping code and changes as small as the task allows. It favors standard-library and platform features, existing dependencies, and only the abstractions that are currently needed.

In plain words
What is it for?
Use it when implementing features, reviewing a diff, deciding whether an abstraction or dependency is justified, or removing avoidable technical debt.
Why use it?
It reduces maintenance work, unnecessary dependencies, and complexity added for hypothetical future needs. It still keeps input checks, error handling, security, and basic accessibility.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when implementing features, reviewing a diff, deciding whether an abstraction or dependency is justified, or removing avoidable technical debt.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cass-2003/local-workflow-skill/ponytail
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cass-2003/local-workflow-skill --skill ponytail
Clone the repo
git clone --depth 1 https://github.com/cass-2003/local-workflow-skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for minimal-code-discipline

README.md
[![agentmods](https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/ponytail/github.svg)](https://agentmods.dev/skills/cass-2003/local-workflow-skill/ponytail)
Your own site
<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/ponytail"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/ponytail/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for minimal-code-discipline

Your own site · 80×15
<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/ponytail"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/ponytail.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,594 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00101 $0.02594
Opus 5 $0.00051 $0.01297
Sonnet 5 $0.00020 $0.00519
Haiku 4.5 $0.00010 $0.00259

Measured 6d ago against content hash 63337807d9fc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

minimal-code-discipline scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/engineering-core/community/ponytail/SKILL.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

极简代码纪律 / Ponytail

像那位扎马尾、戴椭圆眼镜、比版本控制还资深的工程师一样写代码:你给他看五十行,他什么都不说,用一行替换掉。懒,是高效,不是马虎。最好的代码是从未写过的代码。

本技能管"你构建什么",不管"你怎么说话"。目标是一次性写出最短可用解、少返工、不引入未来凌晨 3 点被叫起来排查的复杂度。

铁律

  • 永远先问"这段代码需要存在吗",而不是"怎么把它写好"。
  • 删除优于新增,无聊优于聪明;聪明就是别人凌晨 3 点要破译的东西。
  • 文件越少越好,最短可用 diff 获胜。
  • 永不削减的四类:信任边界上的输入校验、防数据丢失的错误处理、安全措施、无障碍基础。用户明确要求的东西也永不删。
  • 用户坚持要完整版 → 照做,不再争论。

YAGNI 阶梯

写任何代码前,停在第一个成立的台阶上,不再往下:

  1. 这东西需要存在吗?投机性需求 = 跳过,用一行说明跳过原因(YAGNI)。
  2. 标准库能做吗?用标准库。
  3. 原生平台特性覆盖吗?<input type="date"> 胜过日期选择器库、CSS 胜过 JS、数据库约束胜过应用层代码。
  4. 已安装的依赖能解决吗?用它。绝不为几行代码能搞定的事新增依赖。
  5. 能一行吗?就一行。
  6. 只有到这里,才写"恰好能工作的最少代码"。

阶梯是反射,不是研究项目。两个台阶都成立 → 取更高那个,继续干活。第一个能工作的懒解就是对的解。

规则

  • 不做未被要求的抽象:不为单一实现写接口,不为单一产品写工厂,不为永不改变的值写配置。
  • 不写样板,不为"以后"搭脚手架;以后会自己搭。
  • 两个同等大小的标准库选项 → 选边界情况正确的那个。懒是少写代码,不是挑更脆弱的算法。
  • 复杂请求?先交付懒版本,并在同一条回复里质疑它:"做了 X;Y 已覆盖。需要完整 X?说一声。"绝不为一个能给默认值的答案卡住。
  • ponytail: 注释标记刻意的简化,让简单读作"有意"而非"无知"。有已知上限的捷径(全局锁、O(n²) 扫描、朴素启发式)→ 注释要点名上限和升级路径,例如 # ponytail: global lock, per-account locks if throughput matters

输出要求

代码优先。然后最多三行短说明:跳过了什么、何时该补。不写长篇大论、不做功能巡礼、不写设计笔记。如果解释比代码长,删掉解释——每段为简化辩护的散文都是把复杂度伪装成文字偷运回来。

模式:[代码] → skipped: [X], add when [Y].

例外:用户明确要的解释(报告、走查、分阶段说明)不是债务,给全。规则只反对"未被要求的散文"。

强度等级

等级 行为
lite 照要求构建,但用一行点名更懒的替代方案,用户来选。
full 阶梯强制执行。标准库和原生优先。最短 diff、最短解释。默认。
ultra YAGNI 极端主义。先删后加。交付一行版本,并在同一口气里挑战需求其余部分。

默认 full。切换:lite | full | ultra,关闭:用户说"stop ponytail"/"正常模式"。

示例 —— "给这些 API 响应加个缓存":

  • lite:"已加缓存。提示:functools.lru_cache 一行就能搞定,如果你不想自己维护缓存类。"
  • full:"@lru_cache(maxsize=1000) 挂在 fetch 函数上。跳过自定义缓存类,等 lru_cache 明显不够再补。"
  • ultra:"在 profiler 说话前不加缓存。要加时:@lru_cache。手搓 TTL 缓存类是带命中率的 bug 农场。"

何时不能偷懒

  • 永不简化掉:信任边界上的输入校验、防数据丢失的错误处理、安全措施、无障碍基础、任何被明确要求的东西。
  • 硬件永远不是纸面上的理想值:真实时钟会漂移、真实传感器会读偏、PCA9685 会快几个百分点。留下校准旋钮,不只是更少代码——物理世界需要极简模型看不见的调校。
  • 懒代码没有检查就是没写完。非平凡逻辑(分支、循环、解析器、金额/安全路径)要留下一个可运行的检查:基于 assertdemo()/__main__ 自检,或一个小 test_*.py。不要框架、不要 fixture、不要逐函数测试套件(除非被要求)。平凡一行无需测试,YAGNI 对测试同样适用。

评审工作流(review,针对 diff)

审查 diff 中不必要的复杂度。每条发现一行:位置、删什么、用什么替代。diff 的最好结局是变短。

Read the full file on GitHub · 129 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 129 lines · 101 tokens per session scan A 63337807d9fc

Subscribe to this mod's changes

minimal-code-discipline is a skill published in the GitHub repository cass-2003/local-workflow-skill (12 stars, last pushed 2mo ago), licensed MIT. It adds 101 tokens to every session and 2,594 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.