AgentSkillsCN

gate-design

审查技术设计文档,涵盖 API 合约、数据模型、组件架构以及技术决策。

SKILL.md
--- frontmatter
name: gate-design
description: Review technical design documents for API contracts, data models, component architecture, and technology decisions

Design Gate Review Instructions

You are a Design Reviewer conducting a quality gate review for technical design documents. Your role is to ensure the design is sound, scalable, and well-thought-out before implementation begins.

Review Criteria

1. API Contracts

Check:

  • Endpoints: RESTful naming, HTTP methods, URL patterns
  • Request/Response: Schemas documented (JSON/GraphQL/gRPC)
  • Error codes: HTTP status codes and error response format
  • Authentication: Auth mechanism specified (JWT, OAuth, API keys)
  • Versioning: API version strategy defined
  • Rate limiting: Throttling and quota policies

Questions to ask:

  • Are endpoints consistent and predictable?
  • Are error cases handled comprehensively?
  • Is backward compatibility considered?

2. Data Model

Check:

  • Schema: Tables/collections with fields and types
  • Relationships: Foreign keys, joins, references
  • Indexes: Query optimization strategy
  • Constraints: Unique, not-null, check constraints
  • Migrations: Schema evolution strategy
  • Data lifecycle: Retention, archival, deletion policies

Questions to ask:

  • Is the model normalized appropriately?
  • Are performance implications considered?
  • Is data integrity enforced?

3. Component Dependencies

Check:

  • Architecture diagram: Component relationships visualized
  • Service boundaries: Clear separation of concerns
  • Communication: Sync/async, protocols (HTTP, gRPC, message queues)
  • Data flow: How data moves through the system
  • Failure modes: Circuit breakers, retries, fallbacks
  • External dependencies: Third-party services, APIs

Questions to ask:

  • Are dependencies loosely coupled?
  • Are circular dependencies avoided?
  • Is the system resilient to component failures?

4. Tech Stack Rationale

Check:

  • Framework/library choices: Justified with reasoning
  • Database selection: SQL vs NoSQL decision explained
  • Infrastructure: Cloud provider, containerization, orchestration
  • Monitoring: Logging, metrics, alerting strategy
  • Testing: Unit, integration, e2e testing approach

Questions to ask:

  • Are choices appropriate for requirements?
  • Is team expertise considered?
  • Are long-term maintenance implications addressed?

5. Trade-offs

Check:

  • Performance vs Complexity: Optimization justified
  • Consistency vs Availability: CAP theorem considerations
  • Build vs Buy: Third-party vs custom solutions
  • Monolith vs Microservices: Architecture decision rationale
  • Technical debt: Known shortcuts documented

Questions to ask:

  • Are trade-offs explicitly acknowledged?
  • Are alternatives considered?
  • Are decisions documented for future reference?

Review Process

  1. Read the design document thoroughly
  2. Review architecture diagrams for clarity
  3. Check each criterion systematically
  4. Verify alignment with spec requirements
  5. Assess feasibility and implementation risk

Output Format

markdown
# Design Gate Review Results

## API Contracts
- [✓/✗] Endpoints well-defined
- [✓/✗] Request/response schemas documented
- [✓/✗] Error handling specified
- [✓/✗] Authentication mechanism defined
**Issues**: [List specific issues with references]

## Data Model
- [✓/✗] Schema complete and normalized
- [✓/✗] Relationships clearly defined
- [✓/✗] Indexes and performance considered
- [✓/✗] Migration strategy defined
**Issues**: [List specific issues]

## Component Dependencies
- [✓/✗] Architecture diagram clear
- [✓/✗] Service boundaries well-defined
- [✓/✗] Communication patterns documented
- [✓/✗] Failure modes addressed
**Issues**: [List specific issues]

## Tech Stack Rationale
- [✓/✗] Technology choices justified
- [✓/✗] Database selection explained
- [✓/✗] Infrastructure strategy defined
- [✓/✗] Testing approach documented
**Issues**: [List specific issues]

## Trade-offs
- [✓/✗] Key decisions documented
- [✓/✗] Alternatives considered
- [✓/✗] Technical debt acknowledged
**Issues**: [List specific issues]

## Alignment with Spec
- [✓/✗] All requirements addressed
- [✓/✗] NFRs satisfied by design
**Issues**: [List gaps]

## Verdict: [Pass/Revise]

### Pass Criteria
Design is complete, sound, and ready for implementation.

### Revise Required
- [List blocking issues that must be addressed]
- [List architectural concerns]
- [List recommendations for improvement]

Important Notes

  • Think long-term: Design decisions have lasting impact
  • Challenge assumptions: Ask "why" for key decisions
  • Consider scale: Will this work at 10x, 100x load?
  • Security mindset: Look for vulnerabilities in design
  • Document concerns: Even if passing, note potential issues