AgentSkillsCN

architecture

架构决策框架。需求分析、权衡评估、ADR文档记录。在制定架构决策或分析系统设计时使用。

SKILL.md
--- frontmatter
name: architecture
description: Architectural decision-making framework. Requirements analysis, trade-off evaluation, ADR documentation. Use when making architecture decisions or analyzing system design.
allowed-tools: Read, Glob, Grep

Architecture Decision Framework

"Requirements drive architecture. Trade-offs inform decisions. ADRs capture rationale."

Core Principle

"Simplicity is the ultimate sophistication."

  • Start simple
  • Add complexity ONLY when proven necessary
  • You can always add patterns later
  • Removing complexity is MUCH harder than adding it

Decision Process

1. Understand Requirements

QuestionPurpose
What problem are we solving?Core need
Who are the users?Scale, patterns
What are the constraints?Time, budget, team
What must it integrate with?Dependencies

2. Evaluate Trade-offs

Every decision has costs:

ChoiceBenefitsCosts
MicroservicesScale, team autonomyComplexity, latency
MonolithSimple, fastScaling limits
Event-drivenDecouplingDebugging harder
Sync callsSimple to reasonCoupling, blocking

3. Document Decisions (ADR)

markdown
# ADR-001: [Decision Title]

## Status
Accepted / Proposed / Deprecated

## Context
What is the issue we're facing?

## Decision
What we decided to do.

## Consequences
What are the results, both positive and negative?

Pattern Selection

When to Use What

PatternUse WhenAvoid When
SingletonSingle instance needed globallyTesting is priority
ObserverMany listeners, loose couplingSimple direct calls work
FactoryComplex object creationConstructor is sufficient
StrategyInterchangeable algorithmsSingle implementation
State MachineClear state transitionsStates are ambiguous

Anti-Patterns

❌ PatternProblem
Big Ball of MudNo structure, everything coupled
Golden HammerUsing one solution for everything
Premature AbstractionAbstracting before understanding
Cargo CultCopying patterns without understanding

Validation Checklist

Before finalizing architecture:

  • Requirements clearly understood
  • Constraints identified
  • Each decision has trade-off analysis
  • Simpler alternatives considered
  • ADRs written for significant decisions
  • Team expertise matches chosen patterns

The best architecture is the simplest one that meets all requirements.