review-software-architecture
关于
This skill reviews software architecture for key quality attributes like coupling, cohesion, SOLID principles, and scalability. It evaluates system designs, reviews Architecture Decision Records (ADRs), and provides improvement recommendations. Use it to assess proposed or existing systems for technical debt, security, and readiness for scaling.
快速安装
Claude Code
推荐npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/review-software-architecture在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
審軟構
於系等評軟構之質屬、設則之循、長之可守。
用時
- 施前評議構乃用
- 為擴、守、安察現系乃用
- 審項目之 ADR 乃用
- 行技債察乃用
- 評系備大擴或功廣乎乃用
- 與行等碼審分(其專於 PR 等變)乃用
入
- 必要:系碼庫或構文(圖、ADR、README)
- 必要:系之用、尺、限之境
- 可選:非功需(延、量、可達之的)
- 可選:團之大與技組
- 可選:技限或喜
- 可選:知痛點或憂區
法
第一步:解系境
圖系界與介:
## System Context
- **Name**: [System name]
- **Purpose**: [One-line description]
- **Users**: [Who uses it and how]
- **Scale**: [Requests/sec, data volume, user count]
- **Age**: [Years in production, major versions]
- **Team**: [Size, composition]
## External Dependencies
| Dependency | Type | Criticality | Notes |
|-----------|------|-------------|-------|
| PostgreSQL | Database | Critical | Primary data store |
| Redis | Cache | High | Session store + caching |
| Stripe | External API | Critical | Payment processing |
| S3 | Object storage | High | File uploads |
得: 系行何與依何之明像 敗則: 若構文缺,自碼構、配、部署文導其境
第二步:評構之質
耦合之察
審諸模相依之緊:
- 依向:依一向流(層)或環?
- 介界:諸模由所定介/契連,或由直施引?
- 共態:諸模間共可變態?
- 庫耦:諸服直讀寫同表?
- 時耦:諸操必依特序而無明調?
# Detect circular dependencies (JavaScript/TypeScript)
npx madge --circular src/
# Detect import patterns (Python)
# Look for deep cross-package imports
grep -r "from app\." --include="*.py" | sort | uniq -c | sort -rn | head -20
凝聚之察
評各模有單明責乎:
- 模名:名準述模行何乎?
- 文大:文或類過大乎(>500 行示多責)?
- 變頻:無關功需變同模乎?
- 神物:諸物所依之類/模存乎?
| 耦合等 | 述 | 例 |
|---|---|---|
| 低(善) | 諸模由介通 | 服 A 呼服 B 之 API |
| 中 | 諸模共數構 | 共 DTO/模庫 |
| 高(憂) | 諸模引他內 | 諸模間直庫訪 |
| 病 | 諸模改他內態 | 全可變態 |
得: 耦合與凝聚已察附碼之具例 敗則: 若碼庫過大不能手審,取 3-5 要模與最常變之文
第三步:察 SOLID 諸則
| 則 | 問 | 紅旗 |
|---|---|---|
| Single Responsibility | 各類/模有單變因乎? | 有 >5 公法於無關憂之類 |
| Open/Closed | 行可擴而不改現碼乎? | 為各新功常改核類 |
| Liskov Substitution | 子類可代基類而不破行乎? | 類察(instanceof)散於用碼 |
| Interface Segregation | 諸介專且少乎? | 「肥」介使用者施未用法 |
| Dependency Inversion | 高層依抽象,非依細乎? | 業邏中直立基設類 |
## SOLID Assessment
| Principle | Status | Evidence | Impact |
|-----------|--------|----------|--------|
| SRP | Concern | UserService handles auth, profile, notifications, and billing | High — changes to billing risk breaking auth |
| OCP | Good | Plugin system for payment providers | Low |
| LSP | Good | No type-checking anti-patterns found | Low |
| ISP | Concern | IRepository has 15 methods, most implementors use 3-4 | Medium |
| DIP | Concern | Controllers directly instantiate database repositories | Medium |
得: 各則以至少一具例察 敗則: 非凡則皆等施於諸構式。記則於少要時(如 ISP 於函碼庫較少要)
第四步:審 API 設
為示 API 之系(REST、GraphQL、gRPC):
- 恆:命規、誤式、頁形齊
- 版:策存且施(URL、首、內議)
- 誤處:誤應構、恆、不露內
- 認/授:於 API 層正執
- 限速:防濫用之護
- 文檔:OpenAPI/Swagger、GraphQL schema、protobuf 定守
- 冪等:變操(POST/PUT)安處重試
## API Design Review
| Aspect | Status | Notes |
|--------|--------|-------|
| Naming consistency | Good | RESTful resource naming throughout |
| Versioning | Concern | No versioning strategy — breaking changes affect all clients |
| Error format | Good | RFC 7807 Problem Details used consistently |
| Auth | Good | JWT with role-based scopes |
| Rate limiting | Missing | No rate limiting on any endpoint |
| Documentation | Concern | OpenAPI spec exists but 6 months out of date |
得: API 設對常標審附具得 敗則: 若無 API 示,略此步而專注內模介
第五步:察擴與信
- 無態:應用可平擴乎(無局態)?
- 庫擴:諸詢索引乎?schema 合數量乎?
- 緩策:緩於宜層(庫、應、CDN)施乎?
- 敗處:依不可時何發(斷路、重、退)?
- 可察:諸日、指、跡施乎?
- 數合:終合可受或需強合?
得: 擴與信對述非功需察 敗則: 若非功需未書,議為首步定之
第六步:察技債
## Technical Debt Inventory
| Item | Severity | Impact | Estimated Effort | Recommendation |
|------|----------|--------|-----------------|----------------|
| No database migrations | High | Schema changes are manual and error-prone | 1 sprint | Adopt Alembic/Flyway |
| Monolithic test suite | Medium | Tests take 45 min, developers skip them | 2 sprints | Split into unit/integration/e2e |
| Hardcoded config values | Medium | Environment-specific values in source code | 1 sprint | Extract to env vars/config service |
| No CI/CD pipeline | High | Manual deployment prone to errors | 1 sprint | Set up GitHub Actions |
得: 技債已錄附重、影、估力 敗則: 若債錄過大,依影/力比排前 5 入
第七步:審 Architecture Decision Records(ADR)
若 ADR 存,評:
- 諸決有明境(解何患)
- 諸替已慮且書
- 衡明
- 諸決仍當(非無書代)
- 諸新要決有 ADR
若 ADR 不存,議為要決立之。
第八步:書構審報
## Architecture Review Report
### Executive Summary
[2-3 sentences: overall health, key concerns, recommended actions]
### Strengths
1. [Specific architectural strength with evidence]
2. ...
### Concerns (by severity)
#### Critical
1. **[Title]**: [Description, impact, recommendation]
#### Major
1. **[Title]**: [Description, impact, recommendation]
#### Minor
1. **[Title]**: [Description, recommendation]
### Technical Debt Summary
[Top 5 debt items with prioritized recommendations]
### Recommended Next Steps
1. [Actionable recommendation with clear scope]
2. ...
得: 審報可行附排序之議 敗則: 若審時限,明述所覆與所未察
驗
- 系境已書(用、尺、依、團)
- 耦合與凝聚已察附碼具例
- SOLID 諸則於可施處察
- API 設已審(若可)
- 擴與信對需察
- 技債已錄且排
- ADR 已審或記其闕
- 諸議具、排、可行
陷
- 審碼非審構:本技為系等設,非行等碼質。用
code-reviewer行 PR 等反 - 指特技:構審宜識患,非令具具,除非有明技由
- 忽團境:3 人團之「最善」構異於 30 人團。慮組之限
- 求全:凡系皆有技債。專於致實痛或阻來勞之債
- 假尺:勿為 100 用戶之應議分系。匹構於實需
參
security-audit-codebase— 安專之碼與配審configure-git-repository— 庫構與規design-serialization-schema— 數 schema 之設與化review-data-analysis— 析正之審(補視)
GitHub 仓库
相关推荐技能
executing-plans
设计该Skill用于当开发者提供完整实施计划时,以受控批次方式执行代码实现。它会先审阅计划并提出疑问,然后分批次执行任务(默认每批3个任务),并在批次间暂停等待审查。关键特性包括分批次执行、内置检查点和架构师审查机制,确保复杂系统实现的可控性。
requesting-code-review
设计该Skill可在完成任务、实现主要功能或合并代码前自动调度代码审查子代理,确保实现符合需求和计划。它支持通过指定git SHA范围进行精准的代码变更审查,帮助开发者在关键节点及时发现潜在问题。核心原则是"早审查、勤审查",适用于开发流程的各个关键阶段。
connect-mcp-server
设计这个Skill指导开发者如何将MCP服务器连接到Claude Code,支持HTTP、stdio和SSE三种传输协议。它涵盖了从安装配置到认证安全的完整流程,适用于集成GitHub、Notion、数据库等外部服务。当开发者需要添加集成、配置外部工具或提及MCP相关功能时,这个Skill能提供实用的操作指南。
web-cli-teleport
设计该Skill帮助开发者根据任务特性选择Claude Code的Web或CLI界面,并指导如何在两种环境间无缝迁移会话。它能分析任务复杂度、迭代需求等要素,推荐最优工作界面和工作流。关键特性包括会话状态管理、环境切换指导和上下文优化建议。
