关于 document
这项 skill 将模块化审查整理为 Markdown 和 HTML 文档,涵盖架构发现、耦合集成及问题严重性,并为 Balanced Coupling 概念添加 coupling.dev 链接。HTML 输出须使用随 skill 提供的模板。
主要功能
- 01输出 Markdown 和 HTML 审查文档
- 02编写执行摘要与耦合概览表
- 03按严重程度记录失衡问题
- 04为模型概念添加 coupling.dev 链接
- 05使用指定模板生成 HTML
适用场景
- 01以两种格式记录模块化评估
- 02整理耦合问题及其严重程度
- 03分享带模型参考链接的审查文档
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ vladikk/ modularity --skill document安装后在 Claude Code 中输入/document确认已加载。
附带文件assets/template.html
详细介绍
文档
你需要以 Markdown(.md)和 HTML(.html)两种格式生成最终的模块化审查文档。两个文件的内容必须完全相同。
文档结构
标题
# Modularity Review
**Scope**: [what was analyzed]
**Date**: [date]
执行摘要
用一段简短文字(3-5 句话)概述:
- 项目的功能(核心功能)
- 整体模块化状况(健康、需要关注、存在严重问题)
- 审查中最重要的发现
耦合概览表
总结所有关键集成。表头 MUST 链接到 coupling.dev:
| Integration | [Strength](https://coupling.dev/posts/dimensions-of-coupling/integration-strength/) | [Distance](https://coupling.dev/posts/dimensions-of-coupling/distance/) | [Volatility](https://coupling.dev/posts/dimensions-of-coupling/volatility/) | [Balanced?](https://coupling.dev/posts/core-concepts/balance/) |
| ----------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------- |
| A -> B | ... | ... | ... | ... |
问题
针对发现的每个失衡,撰写一个章节:
## Issue: [Short descriptive title]
**Integration**: [Component A] -> [Component B]
**Severity**: [Critical / Significant / Minor]
### Knowledge Leakage
What knowledge is shared that shouldn't be, or is shared implicitly when it should be explicit. Identify the specific implementation details, business rules, or domain model concepts that leak across the boundary.
### Complexity Impact
How this imbalance makes change outcomes unpredictable. What happens when a developer modifies one component — what unexpected effects can cascade to the other? How does this exceed cognitive capacity (the 4+/-1 units of working memory)?
### Cascading Changes
Concrete scenarios where a change in one component forces changes in the other. What kinds of business or technical changes trigger cascading modifications? How expensive are those cascading changes given the current distance between the components?
### Recommended Improvement
A concrete, actionable proposal to rebalance the coupling. Ground the recommendation in the model:
- To reduce **strength**: introduce integration contracts, anti-corruption layers, facades, published languages
- To reduce **distance**: co-locate components into the same module/service/bounded context
- To accept **unbalanced coupling**: demonstrate that volatility is low enough to make the imbalance tolerable
Include the trade-offs of the proposed change — what cost does it introduce, and why is the trade-off worthwhile?
页脚
在每份审查文档的末尾,包含以下原文——不得改写、扩展或添加说明:
---
_This analysis was performed using the [Balanced Coupling](https://coupling.dev) model by [Vlad Khononov](https://vladikk.com)._
严重程度标准
- 严重:强度高 + 距离远 + 易变性高。是复杂性的直接来源。此区域的变更频繁、成本高且难以预测。优先修复。
- 显著:在易变性中等的区域存在不平衡耦合,或存在隐藏集成点的隐式耦合。随着系统演进,这会带来问题。
- 轻微:在低易变性区域存在不平衡耦合,或内聚性低,增加了认知负担,但不会导致连锁变更。可视情况处理。
链接到 coupling.dev(必需)
**只要文档提及平衡耦合概念,就必须添加指向 coupling.dev 的超链接。**这适用于 Markdown 和 HTML 两种输出。无需考虑使用哪个链接——请使用此查找表:
- 文档中的每个耦合概念都必须至少链接一次。如有疑问,请添加链接。
- 在耦合概览表中:表头始终带有链接(请参见上方模板)。表格单元格中的强度值(Contract、Model、Functional、Intrusive)也必须带有链接。
- 在问题章节中:为每个概念的首次出现添加链接。
- 在 Markdown 中:
[concept text](url) - 在 HTML 中:
<a href="url">concept text</a>
输出
将以下两个文件写入 docs/modularity-review/!date +%Y-%m-%d/:
docs/modularity-review/!date +%Y-%m-%d/modularity-review.md— Markdown 版本docs/modularity-review/!date +%Y-%m-%d/modularity-review.html— HTML 版本
生成 HTML
生成 HTML 前,必须先读取模板文件。 模板位于 ${CLAUDE_SKILL_DIR}/assets/template.html。读取该文件,然后替换:
- 将
{{TITLE}}替换为评审标题(例如 “Modularity Review”) - 将
{{CONTENT}}替换为评审正文的 HTML
不要自行生成 HTML 结构、样式或样板代码。模板已提供所有样式、主题切换(根据一天中的时间切换浅色/深色主题)和布局。请原样使用模板,只替换上述两个占位符。
HTML 必须包含与 Markdown 版本相同的 coupling.dev 链接。 将 Markdown 中的每个 [text](url) 转换为 HTML 中的 <a href="url">text</a>。转换时不要遗漏任何链接。
使用模板中的以下 CSS 类:
.meta— 用于范围/日期元数据块.issue— 用<div class="issue">包裹每个问题章节.issue-meta— 用于问题中的集成/严重程度行.severity+.severity-critical/.severity-significant/.severity-minor— 用于严重程度徽章.footer— 用于署名页脚