Sparc Architecture
Quick Start
# Invoke SPARC Architecture phase
# Or directly in Claude Code
# "Use SPARC architecture to design the system components for auth service"
When to Use
- Designing system components and their boundaries
- Creating API contracts and interface definitions
- Selecting technology stacks based on requirements
- Planning for scalability and high availability
- Defining deployment and infrastructure architecture
Prerequisites
- Completed specification and pseudocode phases
- Understanding of system design principles
- Knowledge of distributed systems patterns
- Familiarity with cloud infrastructure options
Core Concepts
SPARC Architecture Phase
The Architecture phase transforms algorithms into system designs:
- Define system components and boundaries - Microservices, modules
- Design interfaces and contracts - REST, gRPC, events
- Select technology stacks - Languages, frameworks, databases
- Plan for scalability and resilience - Horizontal scaling, failover
- Create deployment architectures - Kubernetes, containers
Architecture Patterns
| Pattern |
Use Case |
Trade-offs |
| Monolith |
Small teams, early stage |
Simple but hard to scale |
| Microservices |
Large teams, complex domains |
Scalable but complex |
| Event-Driven |
Async workflows, decoupling |
Eventual consistency |
| Serverless |
Variable workloads |
Cost-efficient but cold starts |
Implementation Pattern
High-Level Architecture (Mermaid)
graph TB
subgraph "Client Layer"
WEB[Web App]
MOB[Mobile App]
API_CLIENT[API Clients]
end
subgraph "API Gateway"
GATEWAY[Kong/Nginx]
*See sub-skills for full details.*
### Component Architecture
```yaml
components:
auth_service:
name: "Authentication Service"
type: "Microservice"
technology:
language: "TypeScript"
framework: "NestJS"
runtime: "Node.js 18"
*See sub-skills for full details.*
### Data Architecture (SQL)
```sql
-- Entity Relationship Diagram
-- Users Table
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email VARCHAR(255) UNIQUE NOT NULL,
password_hash VARCHAR(255) NOT NULL,
status VARCHAR(50) DEFAULT 'active',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
*See sub-skills for full details.*
## Metrics & Success Criteria
- All components have defined interfaces
- Database schema includes appropriate indexes
- API specification is complete and versioned
- Security architecture covers auth, encryption, compliance
- Scalability plan with measurable triggers
## Integration Points
### MCP Tools
```javascript
// Store architecture decisions
action: "store",
key: "sparc/architecture/components",
namespace: "coordination",
value: JSON.stringify({
services: ["auth-service", "user-service"],
database: "postgresql",
cache: "redis",
messaging: "rabbitmq",
timestamp: Date.now()
})
}
Hooks
# Pre-architecture hook
# Post-architecture hook
Related Skills
References
Version History
- 1.0.0 (2026-01-02): Initial release - converted from agent to skill format
Sub-Skills
- Configuration
- Example 1: API Architecture (OpenAPI) (+1)
- Example 3: Security Architecture (+1)
- Best Practices
Sub-Skills
- Execution Checklist
- Error Handling
1---2name: sparc-architecture-23description: SPARC Architecture phase specialist for system design, component architecture, interface design, scalability planning, and technology selection4---56# Sparc Architecture78## Quick Start910```bash11# Invoke SPARC Architecture phase1213# Or directly in Claude Code14# "Use SPARC architecture to design the system components for auth service"15```1617## When to Use1819- Designing system components and their boundaries20- Creating API contracts and interface definitions21- Selecting technology stacks based on requirements22- Planning for scalability and high availability23- Defining deployment and infrastructure architecture2425## Prerequisites2627- Completed specification and pseudocode phases28- Understanding of system design principles29- Knowledge of distributed systems patterns30- Familiarity with cloud infrastructure options3132## Core Concepts3334### SPARC Architecture Phase3536The Architecture phase transforms algorithms into system designs:37381. **Define system components and boundaries** - Microservices, modules392. **Design interfaces and contracts** - REST, gRPC, events403. **Select technology stacks** - Languages, frameworks, databases414. **Plan for scalability and resilience** - Horizontal scaling, failover425. **Create deployment architectures** - Kubernetes, containers43### Architecture Patterns4445| Pattern | Use Case | Trade-offs |46|---------|----------|------------|47| Monolith | Small teams, early stage | Simple but hard to scale |48| Microservices | Large teams, complex domains | Scalable but complex |49| Event-Driven | Async workflows, decoupling | Eventual consistency |50| Serverless | Variable workloads | Cost-efficient but cold starts |5152## Implementation Pattern5354### High-Level Architecture (Mermaid)5556```mermaid57graph TB58 subgraph "Client Layer"59 WEB[Web App]60 MOB[Mobile App]61 API_CLIENT[API Clients]62 end6364 subgraph "API Gateway"65 GATEWAY[Kong/Nginx]6667*See sub-skills for full details.*68### Component Architecture6970```yaml71components:72 auth_service:73 name: "Authentication Service"74 type: "Microservice"75 technology:76 language: "TypeScript"77 framework: "NestJS"78 runtime: "Node.js 18"798081*See sub-skills for full details.*82### Data Architecture (SQL)8384```sql85-- Entity Relationship Diagram86-- Users Table87CREATE TABLE users (88 id UUID PRIMARY KEY DEFAULT gen_random_uuid(),89 email VARCHAR(255) UNIQUE NOT NULL,90 password_hash VARCHAR(255) NOT NULL,91 status VARCHAR(50) DEFAULT 'active',92 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,93 updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,9495*See sub-skills for full details.*9697## Metrics & Success Criteria9899- All components have defined interfaces100- Database schema includes appropriate indexes101- API specification is complete and versioned102- Security architecture covers auth, encryption, compliance103- Scalability plan with measurable triggers104105## Integration Points106107### MCP Tools108109```javascript110// Store architecture decisions111 action: "store",112 key: "sparc/architecture/components",113 namespace: "coordination",114 value: JSON.stringify({115 services: ["auth-service", "user-service"],116 database: "postgresql",117 cache: "redis",118 messaging: "rabbitmq",119 timestamp: Date.now()120 })121}122```123### Hooks124125```bash126# Pre-architecture hook127128# Post-architecture hook129```130### Related Skills131132- [sparc-specification](../sparc-specification/SKILL.md) - Requirements phase133- [sparc-pseudocode](../sparc-pseudocode/SKILL.md) - Previous phase: algorithms134- [sparc-refinement](../sparc-refinement/SKILL.md) - Next phase: TDD implementation135136## References137138- [Kubernetes Documentation](https://kubernetes.io/docs/)139- [OpenAPI Specification](https://swagger.io/specification/)140- [12-Factor App](https://12factor.net/)141142## Version History143144- **1.0.0** (2026-01-02): Initial release - converted from agent to skill format145146## Sub-Skills147148- [Configuration](configuration/SKILL.md)149- [Example 1: API Architecture (OpenAPI) (+1)](example-1-api-architecture-openapi/SKILL.md)150- [Example 3: Security Architecture (+1)](example-3-security-architecture/SKILL.md)151- [Best Practices](best-practices/SKILL.md)152153## Sub-Skills154155- [Execution Checklist](execution-checklist/SKILL.md)156- [Error Handling](error-handling/SKILL.md)