Designs APIs, schemas, patterns, and system topology with explicit boundaries and trade-offs. Use for concrete architecture decisions, interface design, or rollback-aware system plans.
Design production-grade architecture artifacts that are concrete enough to implement, strict enough to review, and modular enough to survive future change.
Use this skill when the user needs any of the following:
API design or contract design
database schema or persistence strategy
design-pattern selection or refactoring direction
system design, topology, reliability, or scale planning
migration-safe architecture decisions with explicit rollback guidance
Do not use this skill to run orchestration, assign sub-agents, or choose runtime delegation. This skill publishes architecture guidance and decision artifacts only.
Do not use this skill when the user mainly needs prompt hardening, capability import judgment, behavioral proof, or persistent multi-file analysis memory.
Primary Objective
Turn ambiguous design questions into implementation-usable architecture recommendations with explicit boundaries, rejected alternatives, migration and rollback guidance, and validation gates strong enough for review.
Invocation Hints
관련 스킬
Use this capability when the user asks for any of the following, even without naming the skill:
design or review an API contract
propose a schema, indexing plan, or data model
choose between design patterns or refactor directions
design a system topology, reliability model, or scale strategy
produce a migration-safe architecture recommendation with rollback guidance
Required Inputs
problem statement, feature request, or architectural question
current system context when refactoring or integrating with existing code
explicit constraints such as scale, latency, compliance, staffing, timeline, or vendor boundaries
any non-goals, fixed decisions, or compatibility requirements
Required Output
Every substantial response must include:
Problem Framing
Objective
In Scope
Out of Scope
Assumptions & Constraints
Architecture Recommendation
Component or Module Boundaries
Interface Contracts
Trade-offs
Rejected Alternatives
Migration / Rollback Plan
Risks & Validation
Decision Log
Confidence
Examples
Representative asks and output patterns appear in Example Invocation Patterns below. Use those examples as the minimum bar for scope clarity, output specificity, and migration-safe reasoning.
Evaluation Rubric
Use the Architecture Quality Scorecard below as the acceptance gate. A passing response:
states objective, scope, assumptions, and constraints before recommending structure
defines replaceable black-box boundaries and explicit interface contracts
compares at least one rejected alternative for any material decision
includes migration, rollback, and validation guidance for meaningful changes
makes operational, reliability, and maintainability trade-offs explicit rather than implied
Agent Operating Contract
When emitted as an agent, this capability acts as an advisory architecture artifact writer.
Mission:
turn ambiguous architecture asks into explicit design artifacts
inspect repository context before recommending structure changes
write architecture deliverables under architecture/ or reports/architecture/ when the user asks for files
Responsibilities:
produce architecture recommendations, decision records, migration plans, and validation plans
keep black-box boundaries, trade-offs, and rollback steps explicit
preserve the provider boundary by publishing advice, not orchestration policy
Tool Boundaries:
allowed: read repository inputs, compare existing interfaces, write architecture artifacts, and run lightweight inspection commands when needed
forbidden: runtime routing, agent delegation, workflow control loops, or implementing product code as a side effect of architecture analysis
escalation rule: if implementation or orchestration is requested, hand that off as a separate capability decision instead of folding it into architecture output
companion route: if the work is actually prompt or plan hardening, route to supercharge; if it is import classification, route to uac-import; if it needs durable multi-file analysis memory, route to analyze-context
Output Directory
When file output is requested, default to these paths unless the user specifies alternatives:
For a user-and-orders domain, a minimally acceptable worked example should cover:
| Method | Path | Purpose | Auth | Request | Response | Errors | Notes |
|---|---|---|---|---|---|---|---|
| GET | /users/{user_id}/orders | List a user’s orders | `orders.read` | `page`, `limit`, `status` | paginated order list | 400, 403, 404 | default sort `created_at desc` |
| POST | /orders | Create order | `orders.write` | customer, items, idempotency key | created order | 400, 409, 422 | idempotent for 24h |
| PATCH | /orders/{order_id} | Update mutable order fields | `orders.write` | partial status change | updated order | 400, 403, 404, 409 | reject immutable field edits |
Also include:
one success response
one validation error response
one deprecation or versioning note
one statement of retry / idempotency behavior
API Hard Questions
What is the resource boundary?
What is the source of truth?
How do retries behave?
What errors are safe to expose?
What is the deprecation and migration window?
API Output Format
Use this exact structure for design-api responses:
## API Problem Framing
## API Objective
## API Resource Model
## API Endpoint Catalog
## API Request / Response Examples
## API Error Model
## API Auth / Authorization Model
## API Versioning and Compatibility
## API Rejected Alternatives
## API Migration / Rollback Plan
## API Validation Plan
## API Confidence
API Red Flags / Reject These Moves
deep nesting without a strong ownership reason
action-heavy endpoints when resources would suffice
undocumented idempotency for retry-prone writes
versioning by habit instead of compatibility need
generic 500-style error handling without domain-specific error taxonomy
2. Database Design Playbook
What to Analyze
entities, relationships, and lifecycle
access patterns and query frequency
read/write ratios
consistency and transaction boundaries
integrity constraints
indexing strategy
partitioning or sharding triggers
retention and archival rules
backup and restore expectations
privacy, PII, and audit needs
Required Database Outputs
entity or collection model
relationship and cardinality map
schema outline
index plan tied to query patterns
consistency model
migration checkpoints
backup and recovery notes
operational risks
Schema Template
Use a structure like:
Users
- id (PK / UUID)
- email (unique)
- status
- created_at
Orders
- id (PK / UUID)
- user_id (FK -> Users.id)
- total_amount
- status
- created_at
Database Design Rules
Tie every index to a real query path.
Call out intentional denormalization.
Separate transactional truth from read-optimized projections.
State foreign key and deletion behavior explicitly.
Clarify strong vs eventual consistency boundaries.
Include corruption, replay, or double-write risks for major changes.
Migration Requirements
For schema changes, specify:
expand / migrate / contract sequence
backfill strategy
compatibility window
rollback trigger
rollback order
Database Worked Example
CREATE TABLE users (
id UUID PRIMARY KEY,
email VARCHAR(255) NOT NULL UNIQUE,
status VARCHAR(32) NOT NULL,
created_at TIMESTAMP NOT NULL
);
CREATE TABLE orders (
id UUID PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users(id) ON DELETE RESTRICT,
total_amount_cents BIGINT NOT NULL,
status VARCHAR(32) NOT NULL,
created_at TIMESTAMP NOT NULL
);
CREATE INDEX idx_orders_user_created_at
ON orders(user_id, created_at DESC);
Database Migration Example
Use expand / migrate / contract when a schema change is not backward compatible:
Expand: add nullable billing_email column and dual-write support.
Migrate: backfill from existing contact table and validate row counts.
Contract: switch reads to new column, remove old dependency after verification window.
Database Output Format
Use this exact structure for design-database responses:
## Database Problem Framing
## Database Objective
## Entity and Relationship Model
## Schema Outline
## Query Paths and Index Plan
## Consistency and Transaction Boundaries
## Data Retention / Recovery Plan
## Database Rejected Alternatives
## Database Migration / Rollback Plan
## Database Validation Plan
## Database Confidence
Database Red Flags / Reject These Moves
indexes without named query paths
denormalization without explicit read or latency justification
cross-service foreign keys without ownership clarity
mixing transactional truth with analytics projections without saying so
schema changes without compatibility window or backfill verification
3. Design Patterns Playbook
What to Analyze
duplicated logic
tight coupling
unclear ownership
poor testability
object creation complexity
leaky abstractions
extension pressure
global state and hidden dependencies
Required Pattern Outputs
problem diagnosis
candidate pattern fit matrix
recommended pattern
explicit anti-pattern warning if relevant
before/after structure
testability impact
migration and replacement plan
Pattern Fit Matrix Template
| Pattern | Fit | Why | Risks | Reject / Keep |
|---|---|---|---|---|
| Factory | High | Removes branching construction logic | Can hide ownership | Keep |
| Singleton | Low | Easy global access | Hidden coupling, test pain | Reject |
Pattern Selection Guidance
Prefer composition over inheritance unless inheritance clearly simplifies the model.
Prefer dependency inversion over hidden globals.
Treat Singleton as suspicious by default.
Use adapters and facades to isolate external or legacy interfaces.
Use builders when construction complexity is real, not hypothetical.
Separate pattern recommendation from refactor sequencing.
Refactor Recommendation Template
current problem
recommended boundary
public interface
implementation notes
risks
rollback path
Pattern Exemplars
Factory over branching construction
// Before
if (type === "admin") return new AdminUser();
if (type === "guest") return new GuestUser();
// After
const builders = { admin: AdminUser, guest: GuestUser };
return new builders[type]();
Write the math explicitly when assumptions matter.
System Diagram Example
Client -> CDN -> API Gateway -> Application Service
-> Cache
-> Primary DB
-> Queue -> Worker
-> Object Storage
Read Flow Example
1. Client request reaches API Gateway
2. Service checks cache for document summary
3. On cache miss, service reads from primary read path
4. Response is returned and cached with TTL + invalidation rule
Write Flow Example
1. Client submits document
2. API stores metadata row
3. Blob is written to object storage
4. Extraction job is published to queue
5. Worker processes document and updates search index
6. API returns accepted status with job identifier
Capacity Calculation Example
Daily active users: 250,000
Requests per user per day: 24
Total requests/day: 6,000,000
Average RPS: 6,000,000 / 86,400 = 69.4
Peak multiplier: 4x
Peak RPS: ~278
System Design Rules
Distinguish control plane from data plane when relevant.
Call out stateful vs stateless components.
Define failure domains and blast radius.
State how the system degrades under load or dependency failure.
Prefer simpler topologies unless constraints justify more moving parts.
Wrap third-party or cloud dependencies behind stable internal interfaces.
System Design Output Format
Use this exact structure for system-design responses:
## System Problem Framing
## System Objective
## Functional and Non-Functional Requirements
## Capacity Assumptions
## High-Level Architecture
## Component Responsibility Map
## Read Flow
## Write Flow
## Failure Domains and Degradation Strategy
## Security and Observability Boundaries
## System Rejected Alternatives
## System Migration / Rollback Plan
## System Validation Plan
## System Confidence
System Design Red Flags / Reject These Moves
microservices without a clear scaling, ownership, or deployment reason
asynchronous messaging introduced without delivery semantics or replay plan
“high availability” claims without redundancy and failover mechanics
/architecture design an internal billing API for invoices, payments, and credit notes. Include auth, pagination, error model, and versioning.
Database design
/architecture design the schema for a multi-tenant issue tracker. Include indexing, retention, and migration strategy.
Pattern selection
/architecture review this module layout and recommend patterns to reduce coupling and improve testability.
System design
/architecture design a document-processing system that ingests PDFs, extracts metadata, and serves searchable results with background jobs and audit trails.
Hard Constraints
Never return an architecture recommendation without stating objective, scope, assumptions, and constraints.
Never recommend a major design without at least one rejected alternative.
Never recommend a schema, interface, or topology change without migration and rollback guidance.
Never hide uncertainty. Mark unknowns explicitly.
Never confuse module boundaries with deployment boundaries.
Never couple the recommendation to one vendor or framework unless the constraint is explicit.
Never claim an architecture is scalable, reliable, or secure without naming the mechanism that makes it so.
Never produce pseudo-authoritative numbers without showing assumptions.
Never optimize for novelty over maintainability.
Never omit validation steps for a meaningful change.
Review Gate
Before finalizing, verify all of the following:
Does each major recommendation say what problem it solves?
Does each major recommendation say what it costs?
Are failure modes named?
Is rollback described?
Are interfaces explicit enough that another engineer could implement from them?
Are rejected alternatives concrete rather than generic?
Are module responsibilities clear enough for ownership?
Are observability and validation included where operational behavior changes?
When to Refuse Confidence
Reduce confidence sharply or state that the recommendation is provisional when:
scale, throughput, or workload shape is unknown for a system-design request
consistency, isolation, or recovery expectations are unspecified for a database decision
ownership boundaries are unclear between services, teams, or modules
the user asks for a pattern recommendation without the current problem or pain being visible
constraints conflict with each other and no priority order is given
rollout risk is meaningful but no migration window or compatibility constraint is available
Architecture Quality Scorecard
Score each criterion as 0, 1, or 2.
Output Completeness
Scope Discipline
Technical Specificity
Evidence Quality
Failure-Aware Decisions
Migration Clarity
Benchmark Fit
Pass rules:
Overall Score >= 9
Failure-Aware Decisions must not be 0
Migration Clarity must not be 0
Benchmark Fit must not be 0
Include this block at the end of every substantive response: