code-arch-optimizer

code-arch-optimizer is a skill for Claude Code, Codex from serejaris/kimi-skills. It costs 85 tokens per session (1,008 once invoked), scanned A, original, MIT.

A skill for examining a codebase and finding architecture problems, such as tightly connected modules or code that is difficult to test. It then develops several possible interface designs for a chosen restructuring.

In plain words
What is it for?
It is for exploring refactoring opportunities, combining closely related modules, improving testability, and preparing a GitHub Issue-style request for architectural changes.
Why use it?
It helps locate boundaries that make code harder to understand, test, or change, and turns those findings into a detailed refactoring proposal.

Skill for Claude CodeCodex

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

Good fit It is for exploring refactoring opportunities, combining closely related modules, improving testability, and preparing a GitHub Issue-style request for architectural changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/serejaris/kimi-skills/code-arch-optimizer
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 serejaris/kimi-skills --skill code-arch-optimizer
Clone the repo
git clone --depth 1 https://github.com/serejaris/kimi-skills

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 code-arch-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/serejaris/kimi-skills/code-arch-optimizer/github.svg)](https://agentmods.dev/skills/serejaris/kimi-skills/code-arch-optimizer)
Your own site
<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.

agentmods 80×15 button for code-arch-optimizer

Your own site · 80×15
<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>
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,008 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.01008
Opus 5.5 $0.00034 $0.00403
Sonnet 5.5 $0.00017 $0.00202
Haiku 4.5 $0.00009 $0.00101

Measured 3mo ago against content hash 02c57fcba3b2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

skills/code-arch-optimizer/SKILL.md · 77 lines

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(如适用):"围绕端口与适配器模式设计跨边界依赖"

每个子代理输出:

  1. 接口签名(类型、方法、参数)
  2. 使用示例,展示调用方如何使用
  3. 内部隐藏了哪些复杂度
  4. 依赖策略(如何处理依赖——参见 REFERENCE.md)
  5. 权衡取舍

依次展示各方案,然后用文字进行对比分析。

对比完成后,给出你自己的推荐:你认为哪个方案最优,理由是什么。如果不同方案中的元素可以很好地组合,提出一个混合方案。要有立场——用户需要的是有力的判断,而不仅仅是一份菜单。

6. 用户选择接口方案(或接受推荐)

7. 创建 GitHub Issue

使用 gh issue create 创建重构 RFC 的 GitHub Issue。使用 REFERENCE.md 中的模板。不要让用户在创建前审阅——直接创建并分享链接。

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. 3mo ago First seen · 77 lines · 85 tokens per session scan A 02c57fcba3b2

Subscribe to this mod's changes

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.

Related

code-arch-optimizer compared with skills from other repositories

code-arch-optimizer next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
code-arch-optimizerserejaris/kimi-skillsSkill134mo agoMITA85Claude Code, Codex
code-review-checklistmohitagw15856/pm-claude-skillsSkill1.6ktodayMITA88Claude Code, Codex
resolve-pr-feedbacktobihagemann/turboSkill428todayMITA49Claude Code
assess-technical-debttobihagemann/turboSkill428todayMITA50Claude Code
review-codetobihagemann/turboSkill428todayMITA48Claude Code
reply-to-pr-threadstobihagemann/turboSkill428todayMITA48Claude Code
fetch-pr-commentstobihagemann/turboSkill428todayMITA38Claude Code