cochange-churn
静态切面看不到的架构问题,往往在**版本历史**里暴露。这是来自代码审查 git-history lens 的高信号视角。仅当处于 git 仓库时启用。
$ npx -y skills add AgentsMesh/AgentsMesh --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
Context preview
The summary Claude sees to decide when to auto-load this agent.
静态切面看不到的架构问题,往往在**版本历史**里暴露。这是来自代码审查 git-history lens 的高信号视角。仅当处于 git 仓库时启用。
Agent definition
cochange-churn.mdLens E —— 时间维度:共变更 / churn
静态切面看不到的架构问题,往往在**版本历史**里暴露。这是来自代码审查 git-history lens 的高信号视角。仅当处于 git 仓库时启用。
1. 共变更耦合 (Co-change / Logical Coupling)
**核心信号:总是一起改、却分属不同模块的文件 = 隐藏耦合。** 物理上分开,逻辑上绑死——说明概念边界划错了。
**探测:**
# 列出最近 N 次提交里,哪些文件经常出现在同一个 commit
git log --since='12 months ago' --name-only --pretty=format: \
| grep -v '^$' | sort | uniq -c | sort -rn | head -40
# 更准:对一对可疑文件,看它们共同出现在多少 commit
git log --pretty=format:'%H' --name-only \
| awk '...' # 构建 file-pair 共现计数(或用 code-maat / git-of-theseus)
工具:`code-maat`(专门做 logical coupling)、`git-of-theseus`。
**判读:**
- 两文件共变更率高(如 >60% 的改动同时碰它俩)但分属不同模块/目录 → 报"隐藏耦合:概念边界与改动边界不一致",建议合并或显式化接口。
- 证据:给出共现的若干 commit hash + 两文件路径。
2. 上帝文件 / 变更热点 (Churn Hotspot)
**核心信号:人人都动的文件 = 职责过载或抽象失败。**
**探测:**
# 按改动次数排序文件(churn)
git log --since='12 months ago' --name-only --pretty=format: \
| grep -v '^$' | sort | uniq -c | sort -rn | head -20
# 结合体量:高 churn × 大文件 = 最该拆的热点
**判读:** churn 排名靠前 + 行数大 + 触碰它的作者多 → 上帝文件,优先级高于普通"文件过大"。
3. 不稳定抽象 (Unstable Abstraction)
**核心信号:本应稳定的底层/领域模型却高频变动 = 抽象没立住。**
**探测:** 对照「依赖方向」稳定性排序——越靠近领域模型/被依赖越多的模块,churn 应越低。
git log --since='12 months ago' --name-only --pretty=format: \
| grep 'src/domain/' | sort | uniq -c | sort -rn
**判读:** 被很多模块依赖(in-degree 高)但又高频改动的模块 → "不稳定抽象",每次它一改就涟漪扩散。报出来并建议固化其接口。
启用与降级
- **在 git 仓库** → 跑全部三项(#1 共变更尽量用 code-maat)。
- **不在 git 仓库 / 浅克隆无历史** → 跳过本 lens,并在报告里注明"未做时间维度分析"。
> 共变更/churn 的结论也要接地:给出真实 commit hash 与文件路径,别报"我觉得这俩经常一起改"。
Read more
Lens E —— 时间维度:共变更 / churn
静态切面看不到的架构问题,往往在**版本历史**里暴露。这是来自代码审查 git-history lens 的高信号视角。仅当处于 git 仓库时启用。
1. 共变更耦合 (Co-change / Logical Coupling)
**核心信号:总是一起改、却分属不同模块的文件 = 隐藏耦合。** 物理上分开,逻辑上绑死——说明概念边界划错了。
**探测:**
# 列出最近 N 次提交里,哪些文件经常出现在同一个 commit git log --since='12 months ago' --name-only --pretty=format: \ | grep -v '^$' | sort | uniq -c | sort -rn | head -40 # 更准:对一对可疑文件,看它们共同出现在多少 commit git log --pretty=format:'%H' --name-only \ | awk '...' # 构建 file-pair 共现计数(或用 code-maat / git-of-theseus)
工具:`code-maat`(专门做 logical coupling)、`git-of-theseus`。
**判读:**
- 两文件共变更率高(如 >60% 的改动同时碰它俩)但分属不同模块/目录 → 报"隐藏耦合:概念边界与改动边界不一致",建议合并或显式化接口。
- 证据:给出共现的若干 commit hash + 两文件路径。
2. 上帝文件 / 变更热点 (Churn Hotspot)
**核心信号:人人都动的文件 = 职责过载或抽象失败。**
**探测:**
# 按改动次数排序文件(churn) git log --since='12 months ago' --name-only --pretty=format: \ | grep -v '^$' | sort | uniq -c | sort -rn | head -20 # 结合体量:高 churn × 大文件 = 最该拆的热点
**判读:** churn 排名靠前 + 行数大 + 触碰它的作者多 → 上帝文件,优先级高于普通"文件过大"。
3. 不稳定抽象 (Unstable Abstraction)
**核心信号:本应稳定的底层/领域模型却高频变动 = 抽象没立住。**
**探测:** 对照「依赖方向」稳定性排序——越靠近领域模型/被依赖越多的模块,churn 应越低。
git log --since='12 months ago' --name-only --pretty=format: \ | grep 'src/domain/' | sort | uniq -c | sort -rn
**判读:** 被很多模块依赖(in-degree 高)但又高频改动的模块 → "不稳定抽象",每次它一改就涟漪扩散。报出来并建议固化其接口。
启用与降级
- **在 git 仓库** → 跑全部三项(#1 共变更尽量用 code-maat)。
- **不在 git 仓库 / 浅克隆无历史** → 跳过本 lens,并在报告里注明"未做时间维度分析"。
> 共变更/churn 的结论也要接地:给出真实 commit hash 与文件路径,别报"我觉得这俩经常一起改"。
The AI Agent Workforce Platform. Run a hundred AI coding agents across your own machines — schedule, isolate, and steer them all from one console.
Repo: AgentsMesh/AgentsMesh
Other agents on agentsmesh.
- concept-modeling
架构的本质是**概念的识别与组织**。这是优先级最高的 lens。
Open agent - evidence-and-detection
LLM 架构审查的头号失败模式:**凭空断言结构**——声称"A 依赖 B""这里有循环""X 被多处写",却没真去查。本文件给出强制接地原则 + 各语言的实际探测命令。
Open agent - report-format
范围小用 SKILL.md 里的精简版即可。下面是全量审计的结构化报告。
Open agent - responsibility-causality
这是本 skill 最独特、最能抓**真实结构性 bug** 的 lens:职责归属、机制/策略分离、因果与不变量(并发/状态契约)、属性三分。
Open agent - solid-grasp-yagni
经典原则做交叉验证。**这一 lens 最容易产出假阳性(教科书式建议)——严格用置信度门控,不报"理论上更优雅但无实际危害"的项。**
Open agent - structure-modularity
目录结构是架构的外在表现。这一 lens 必须配合实际的依赖图/环检测(用工具跑,别凭空想象)。
Open agent

