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.
npx skills add serejaris/kimi-skills --skill code-arch-optimizergit clone --depth 1 https://github.com/serejaris/kimi-skillsWrote 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.
[](https://agentmods.dev/skills/serejaris/kimi-skills/code-arch-optimizer)<a href="https://agentmods.dev/skills/serejaris/kimi-skills/code-arch-optimizer"><img src="https://agentmods.dev/badge/skills/serejaris/kimi-skills/code-arch-optimizer/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.
<a href="https://agentmods.dev/skills/serejaris/kimi-skills/code-arch-optimizer"><img src="https://agentmods.dev/badge/skills/serejaris/kimi-skills/code-arch-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00085 | $0.01008 |
| Opus 5.5 | $0.00034 | $0.00403 |
| Sonnet 5.5 | $0.00017 | $0.00202 |
| Haiku 4.5 | $0.00009 | $0.00101 |
Grade A, and why
code-arch-optimizer 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 3mo 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.
What it actually says
代码库架构深度重构
像 AI 一样探索代码库,发现架构摩擦点,挖掘可测试性改进机会,并以 GitHub Issue RFC 的形式提出模块深化重构方案。
深模块(John Ousterhout 著《软件设计哲学》)指接口简洁但隐藏了大量实现细节的模块。深模块更易测试、更便于 AI 导航,并且可以在边界处测试,而无需深入内部。
流程
1. 探索代码库
使用 Agent 工具(subagent_type=Explore)自然地浏览代码库。不要机械地套用规则——以有机的方式探索,留意你遇到摩擦的地方:
- 哪里理解一个概念需要在许多小文件之间来回跳转?
- 哪些模块过于浅薄,接口几乎和实现一样复杂?
- 哪些纯函数只是为了可测试性而被提取出来,但真正的 bug 却藏在调用方式中?
- 哪些紧耦合的模块在它们之间的接缝处产生了集成风险?
- 代码库中哪些部分缺少测试,或者难以测试?
你遇到的摩擦本身就是信号。
2. 展示候选项
以编号列表的形式展示深化机会。每个候选项需说明:
- 聚类:涉及哪些模块/概念
- 耦合原因:共享类型、调用模式、概念共同归属
- 依赖类别:参见 REFERENCE.md 中的四种分类
- 测试影响:哪些现有测试将被边界测试替代
此时不要提出接口设计。问用户:"你想深入探索哪一个?"
3. 用户选择候选项
4. 描述问题空间
在启动子代理之前,为用户编写所选候选项的问题空间说明:
- 任何新接口需要满足的约束条件
- 需要依赖的外部依赖
- 一个粗略的示意代码草图,使约束条件更加具体——这不是正式方案,只是用来让约束可感知
向用户展示后,立即进入第 5 步。用户可以在阅读和思考问题的同时,让子代理并行工作。
5. 设计多种接口方案
使用 Agent 工具并行启动 3 个以上子代理。每个子代理必须为深化后的模块产出一个截然不同的接口方案。
为每个子代理提供独立的技术简报(文件路径、耦合细节、依赖类别、需要隐藏的内容)。该简报独立于第 4 步的用户说明。给每个代理设定不同的设计约束:
- 代理 1:"最小化接口——目标是最多 1-3 个入口点"
- 代理 2:"最大化灵活性——支持多种用例和扩展"
- 代理 3:"针对最常见的调用方优化——让默认场景极简"
- 代理 4(如适用):"围绕端口与适配器模式设计跨边界依赖"
每个子代理输出:
- 接口签名(类型、方法、参数)
- 使用示例,展示调用方如何使用
- 内部隐藏了哪些复杂度
- 依赖策略(如何处理依赖——参见 REFERENCE.md)
- 权衡取舍
依次展示各方案,然后用文字进行对比分析。
对比完成后,给出你自己的推荐:你认为哪个方案最优,理由是什么。如果不同方案中的元素可以很好地组合,提出一个混合方案。要有立场——用户需要的是有力的判断,而不仅仅是一份菜单。
6. 用户选择接口方案(或接受推荐)
7. 创建 GitHub Issue
使用 gh issue create 创建重构 RFC 的 GitHub Issue。使用 REFERENCE.md 中的模板。不要让用户在创建前审阅——直接创建并分享链接。
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.
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.
- 3mo ago First seen · 77 lines · 85 tokens per session scan A 02c57fcba3b2
code-arch-optimizer is a skill published in the GitHub repository serejaris/kimi-skills (13 stars, last pushed 4mo ago), licensed MIT. It adds 85 tokens to every session and 1,008 once invoked, about $0.0003 per session on Opus 5.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.
code-arch-optimizer compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| code-arch-optimizerserejaris/kimi-skills | Skill | 13 | 4mo ago | MIT | A | 85 | Claude Code, Codex |
| code-review-checklistmohitagw15856/pm-claude-skills | Skill | 1.6k | today | MIT | A | 88 | Claude Code, Codex |
| resolve-pr-feedbacktobihagemann/turbo | Skill | 428 | today | MIT | A | 49 | Claude Code |
| assess-technical-debttobihagemann/turbo | Skill | 428 | today | MIT | A | 50 | Claude Code |
| review-codetobihagemann/turbo | Skill | 428 | today | MIT | A | 48 | Claude Code |
| reply-to-pr-threadstobihagemann/turbo | Skill | 428 | today | MIT | A | 48 | Claude Code |
| fetch-pr-commentstobihagemann/turbo | Skill | 428 | today | MIT | A | 38 | Claude Code |