architecture-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseArchitecture Review
架构审查
Analyze, audit, and improve project structure.
分析、审计并优化项目结构。
Key Principles
核心原则
- Measure before changing — Map structure and identify concrete issues before proposing changes
- Clear boundaries — Layers (UI, logic, data) separated with consistent dependency direction
- Colocation — Related code together; easy to find, change, and delete features
- Incremental migration — Refactor in phases, validate each step with tests
- 先度量再变更 —— 在提出变更前,先梳理现有结构并明确具体问题
- 清晰的边界 —— 各层级(UI、逻辑、数据)分离,依赖方向保持一致
- 就近组织 —— 相关代码放在一起;便于查找、修改和删除功能
- 增量迁移 —— 分阶段重构,每一步都通过测试验证
Quick Assessment
快速评估要点
- No circular dependencies
- Consistent directory naming and grouping (by feature or by type)
- Single responsibility per file/module, reasonable file sizes (<500 lines)
- External dependencies isolated, shared code properly extracted
- New developers can navigate and find code for any feature easily
- 无循环依赖
- 目录命名与分组保持一致(按功能或按类型)
- 每个文件/模块单一职责,文件大小合理(少于500行)
- 外部依赖隔离,共享代码已正确提取
- 新开发者能够轻松导航并找到任意功能的代码
Quick Start Checklist
快速启动检查清单
- Map current structure: directory tree, dependency graph, module boundaries
- Identify issues: circular deps, god modules, leaky abstractions, deep nesting
- Classify severity: critical (blocks dev), high (maintenance burden), medium/low (friction)
- Propose target structure with migration plan
- Execute incrementally, validating with tests after each move
- 梳理当前结构:目录树、依赖图谱、模块边界
- 识别问题:循环依赖、上帝模块、抽象泄漏、过深嵌套
- 划分严重程度:严重(阻碍开发)、高(维护负担)、中/低(开发摩擦)
- 提出目标结构及迁移计划
- 增量执行,每次移动后通过测试验证
References
参考资料
| Reference | Description |
|---|---|
| analysis-techniques.md | Dependency graphs, complexity metrics, code analysis |
| refactoring-patterns.md | Safe refactoring techniques, migration strategies |
| structural-patterns.md | Directory structures for different project types |
| dependency-management.md | Circular deps, coupling, module boundaries |
| cleanup-strategies.md | Dead code removal, consolidation, naming conventions |
| anti-rationalization.md | Iron Law, common rationalizations, red flag STOP list for architecture discipline |
| 参考文档 | 描述 |
|---|---|
| analysis-techniques.md | 依赖图谱、复杂度指标、代码分析 |
| refactoring-patterns.md | 安全重构技术、迁移策略 |
| structural-patterns.md | 不同项目类型的目录结构 |
| dependency-management.md | 循环依赖、耦合性、模块边界 |
| cleanup-strategies.md | 死代码移除、代码合并、命名规范 |
| anti-rationalization.md | 铁律、常见合理化借口、架构规范的红色预警停止清单 |