agentleFS
xiaobei930xiaobei930/cc-best/skills/architecture/SKILL.md

architecture

Skill48 starsChanged 10 months agoMITView on GitHub

Architecture design skill: ADR records, system design checklists, scalability assessment, architecture patterns. Use for complex system design and architecture decisions.

82 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use deployment-procedures, behavioral-modes and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • xfstudioSkill

    deployment-procedures

    Production deployment principles and decision-making. Safe deployment workflows, rollback strategies, and verification. Teaches thinking, not scripts.

    Also in 5 projects that use this

  • xfstudioSkill

    behavioral-modes

    AI operational modes (brainstorm, implement, debug, review, teach, ship, orchestrate). Use to adapt behavior based on task type.

    Also in 4 projects that use this

  • tiendatworkSkill

    2d-games

    2D game development principles. Sprites, tilemaps, physics, camera.

    Also in 3 projects that use this

  • tiendatworkSkill

    3d-games

    3D game development principles. Rendering, shaders, physics, cameras.

    Also in 3 projects that use this

  • CES-LtdSkill

    oss-pr

    Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.

    Also in 3 projects that use this

  • CES-LtdSkill

    pr-automation

    PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".

    Also in 3 projects that use this

  • +1 more from xfstudio
  • +5 more from tiendatwork

The file

Files
SKILL.md

架构设计技能

本技能提供架构设计的完整指南,包括 ADR 记录、设计检查清单、可扩展性评估、架构模式速查等最佳实践。

子文件

  • lead-methodology.md - Lead 角色方法论(技术设计、任务分解)
  • pm-methodology.md - PM 角色方法论(需求分析、决策框架)

架构决策记录 (ADR)

对于重要的架构决策,创建 ADR 记录:

ADR 模板 (docs/decisions/ADR-XXX.md)

# ADR-XXX: [决策标题]

## 状态

Proposed | Accepted | Deprecated | Superseded by ADR-YYY

## 上下文

[描述导致这个决策的背景、问题或需求]

## 决策

[明确说明做出的决策]

## 理由

[解释为什么选择这个方案]

## 备选方案

### 方案 A: [名称]

- 优点: ...
- 缺点: ...

### 方案 B: [名称]

- 优点: ...
- 缺点: ...

## 后果

### 正面

- [好处1]
- [好处2]

### 负面

- [代价1]
- [代价2]

### 风险

- [风险1] → 缓解: [措施]

## 相关决策

- ADR-XXX: [相关决策]

## 日期

YYYY-MM-DD

何时创建 ADR

场景是否需要 ADR
选择主要技术栈(框架、数据库)✅ 必须
定义核心架构模式✅ 必须
引入新的外部依赖⚠️ 视影响范围
API 设计重大变更✅ 必须
简单的实现细节❌ 不需要

系统设计检查清单

设计方案前,检查以下维度:

功能性需求

  • 用户故事是否清晰完整
  • API 契约是否定义明确
  • 数据模型是否满足需求
  • 边界条件是否考虑

非功能性需求

  • 性能: 响应时间目标?吞吐量要求?
  • 可扩展性: 预期用户量?数据增长?
  • 可用性: 可接受的停机时间?
  • 安全性: 认证授权?数据保护?

技术设计

  • 架构图是否清晰
  • 组件职责是否明确
  • 数据流是否完整
  • 错误处理策略是否定义
  • 测试策略是否规划

运维考虑

  • 部署策略是否明确
  • 监控告警是否规划
  • 日志策略是否定义
  • 回滚方案是否准备

可扩展性评估

扩展阶段规划

阶段用户量架构要求
MVP<1K单体应用足够
成长期1K-10K优化数据库查询,添加缓存
扩展期10K-100K服务拆分,读写分离
规模化>100K微服务,分布式缓存,多区域

常见瓶颈与解决方案

瓶颈解决方案
数据库读取慢索引优化 → 读写分离 → 缓存层
API 响应慢异步处理 → 消息队列 → CDN
内存不足分页加载 → 流式处理 → 扩容
并发冲突乐观锁 → 分布式锁 → 事件溯源

架构模式速查

后端模式

模式适用场景复杂度
分层架构大多数 CRUD 应用低
六边形架构需要高可测试性中
CQRS读写负载差异大高
事件溯源需要完整审计轨迹高
微服务团队多、规模大高

前端模式

模式适用场景
组件组合构建复杂 UI
状态提升组件间共享状态
Context + Reducer全局状态管理
自定义 Hooks复用有状态逻辑
渲染属性灵活的组件复用

数据访问模式

模式说明
Repository抽象数据访问层
Unit of Work事务管理
DAO数据访问对象
Active Record模型直接操作数据库

架构评审清单

在提交设计方案前:

  • 是否遵循现有架构模式
  • 是否考虑了向后兼容性
  • 是否有明确的错误处理策略
  • 是否考虑了监控和可观测性
  • 是否有性能基准和目标
  • 是否考虑了安全性
  • 是否有回滚方案

与 /cc-best:lead 角色的配合

/cc-best:lead 技术设计
    ↓
  需要架构决策?
    ├─ 是 → 创建 ADR 记录
    └─ 否 → 继续设计
    ↓
  设计检查清单
    ↓
  任务分解
    ↓
  /cc-best:dev 开始实现

记住: 架构决策要记录理由——ADR 不是文档负担,而是未来自己和团队的决策参考。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.