coding-philosophy-cce

coding-philosophy-cce is a skill for Claude Code, Codex from luochang212/cc-enhance. It costs 85 tokens per session (1,310 once invoked), scanned A, original, MIT.

A decision framework for writing, changing, refactoring, and reviewing code, based on weighing benefits against side effects.

In plain words
What is it for?
Use it to plan small code changes, assess abstractions and duplication, keep tests alongside changes, and review code for errors, dead paths, misleading names, and needless complexity.
Why use it?
It helps prevent unnecessary features, broad refactors, inconsistent fixes, and claims that work was completed without verification.

Skill for Claude CodeCodex

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

Good fit Use it to plan small code changes, assess abstractions and duplication, keep tests alongside changes, and review code for errors, dead paths, misleading names, and needless complexity.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/luochang212/cc-enhance/coding-philosophy-cce
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 luochang212/cc-enhance --skill coding-philosophy-cce
Clone the repo
git clone --depth 1 https://github.com/luochang212/cc-enhance

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 coding-philosophy-cce

README.md
[![agentmods](https://agentmods.dev/badge/skills/luochang212/cc-enhance/coding-philosophy-cce.svg)](https://agentmods.dev/skills/luochang212/cc-enhance/coding-philosophy-cce)
Your own site
<a href="https://agentmods.dev/skills/luochang212/cc-enhance/coding-philosophy-cce"><img src="https://agentmods.dev/badge/skills/luochang212/cc-enhance/coding-philosophy-cce.svg" alt="Measured on agentmods" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,310 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.00085 $0.01310
Opus 5 $0.00043 $0.00655
Sonnet 5 $0.00017 $0.00262
Haiku 4.5 $0.00009 $0.00131

Measured 8d ago against content hash 468ffd9b1991, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

coding-philosophy-cce 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 8d 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/coding-philosophy-cce/SKILL.md · 94 lines

What it actually says

来自 cc-enhance-cce 后缀表示此技能由 cc-enhance 项目安装,避免与本地同名技能冲突。

哲学

代码有两种运动方向。写新代码是熵增——向系统添加新东西。审代码是熵减——在添加之前阻止劣质增量,在添加之后清理冗余。

两者共享一个根基:收益必须大于副作用

开发(熵增)

写新代码的核心张力:每行代码都是负债。它今天解决问题,明天就要被维护、理解、调试。

做 vs 不做

不做
从第一性原理推理 盲目跟随惯例
陈述假设和权衡 默默选择一种理解
三行相似代码放原地 为一个用途建抽象
匹配已有代码风格 沿途「顺手」重构
一致地修改全局模式 只修一个实例制造不一致
验证完再声称完成 假装运行过

核心原则

  • 用最少代码解决问题。不要加没人要的功能。不要为单次使用建抽象。不要为不可能发生的场景写错误处理。
  • 依赖尽量用最新稳定版。代码会逐渐腐化,一开始就是最新版,可以让代码保质期更长一些。
  • 只碰必须碰的。不改相邻代码。不修不是你搞坏的东西。只删你的改动导致不再需要的 import。
  • 从第一性原理出发。把问题剥到可验证的事实。「大家都这么做」不是事实。
  • 一致性是承重结构。设计决策改变时,找到每个假设旧方案的地方——旧代码是还没暴露的 bug。
  • 识别局部最优。当增量改动暴露出更彻底的解决方案时,停下来和用户讨论,不要默默把小任务变成大规模重构。
  • 测试跟着代码走。在同一轮改动中写好测试。「不重要所以不用测」的代码才是最容易出 bug 的。

审查(熵减)

代码审查的核心张力:不是所有问题都值得修。每次修改都有引入 bug、破坏一致性、让代码变复杂的风险。

永远值得修

  • lint/typecheck 错误
  • 未使用的 import
  • 死代码分支(相同分支的三元表达式、不可达代码)
  • 误导性命名
  • 无意义包装(只转发给另一个函数的 useCallback、和另一个函数完全相同签名的函数体)

值得评估(收益 > 副作用?)

  • 重复逻辑——相同的非平凡表达式出现在 2+ 处
  • 重复的 JSX 结构
  • 近乎相同的函数
  • 跨文件的重复样板

通常不值得修

  • 会分别演化的两处重复
  • 简单 HTML 外壳的重复
  • 单次使用的抽象机会
  • 有语义差异的机械重复——不同层职责的相同字段 struct、含义不同的相同值
  • 项目级模式的半修复——修一个留一个制造不一致
  • 不减少重复的「提取到文件」

判断启发式

原则 说明
显式 > 短 一组相似函数共享平凡结构,不值得用工厂函数包装。可见的重复好于不可见的意图
语义重复 ≠ 机械重复 两层有相同字段但属于不同契约——这是隔离,不是浪费
不要为假想的未来设计 没有辅助函数、抽象层、配置开关,除非现在就有第二个调用方
修复规模和问题规模匹配 两行 bug 不值得重构整个模块。测试标准:只修问题本身,下一个人还能理解吗?能→补丁,不能→重构
遵循已有模式,要么全改 有问题模式要么是项目级惯例要么是项目级问题。没造成实际 bug 别碰,造成了单独一个 commit 全改

审查流程

结构:Summary → Critical(bug/安全/破坏性)→ Improvements → Nitpicks → Conclusion(Approve / Request Changes)

并行读,顺序写。审查时并行读所有文件收集发现。修复时顺序写——两个 agent 同时编辑同一文件会静默覆盖。

参考

更详细的示例和论证:

环境依赖

依赖 用途 安装方式 磁盘 必需
Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 94 lines · 85 tokens per session scan A 468ffd9b1991

Subscribe to this mod's changes

coding-philosophy-cce is a skill published in the GitHub repository luochang212/cc-enhance (7 stars, last pushed 3mo ago), licensed MIT. It adds 85 tokens to every session and 1,310 once invoked, about $0.0004 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-08-31.