Target state (TO-BE) architecture design — C4 L2 containers, ADRs, nightmare scenario mitigations, MVP component, phased Strangler Fig migration. Use when the user asks to "design the target architecture", "create a TO-BE architecture", "plan a migration strategy", "define ADRs for a new system", "mitigate nightmare scenarios", or mentions Strangler Fig, C4 diagrams, saga pattern, anti-corruption layer, or legacy modernization.
From maonpx claudepluginhub javimontano/mao-discovery-frameworkThis skill is limited to using the following tools:
examples/README.mdexamples/sample-output.htmlexamples/sample-output.mdprompts/metaprompts.mdprompts/use-case-prompts.mdreferences/adr-templates.mdreferences/architecture-patterns.mdreferences/body-of-knowledge.mdreferences/knowledge-graph.mmdreferences/nightmare-scenarios.mdreferences/state-of-the-art.mdEnables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Designs future-state architecture enabling legacy system gradual retirement while maintaining zero data loss and regulatory compliance. Produces C4 L2 container diagram, 6+ ADRs, nightmare scenario mitigations, MVP component design, and phased Strangler Fig migration plan.
Diseñar el futuro sin entender el presente es ficción arquitectónica. La arquitectura TO-BE se construye sobre evidencia del AS-IS, decisiones del escenario aprobado, y restricciones validadas en feasibility. Cada container, cada servicio, cada patrón tiene un WHY documentado en un ADR. No se diseña para impresionar — se diseña para migrar.
The user provides a system or project name as $ARGUMENTS. Parse $1 as the system/project name used throughout all output artifacts.
Parameters:
{MODO}: piloto-auto (default) | desatendido | supervisado | paso-a-paso
{FORMATO}: markdown (default) | html | dual{VARIANTE}: ejecutiva (~40% — C4 diagram + trade-offs + migration phases) | técnica (full, default)Before generating architecture, detect codebase context:
!find . -name "*.ts" -o -name "*.java" -o -name "*.py" -o -name "*.go" -o -name "*.cs" -o -name "*.tf" | head -30
Load reference materials for detailed ADR templates and nightmare scenario patterns:
Read ${CLAUDE_SKILL_DIR}/references/adr-templates.md
Read ${CLAUDE_SKILL_DIR}/references/nightmare-scenarios.md
Requires: Approved scenario from prior discovery/analysis. Architecture is tailored to selected scenario constraints (Conservative/Moderate/Aggressive). Without prior approval, architecture design is premature.
Cloud-eligible: Assumes workloads are cloud-ready. If on-prem only, adjust: replace Kubernetes with VM-based deployment; replace managed cloud services with self-hosted equivalents.
Blueprint-level scope: Architecture is L2 container diagram + design decisions. Does NOT include class diagrams, API implementation code, or data schema DDL. Those are detailed design deliverables.
Performance unvalidated: Architecture proposes patterns (Saga, CQRS, Event Sourcing) but cannot validate performance without PoC. Include spike tasks to validate latency, throughput, consistency guarantees.
Team skill availability: Assumes team can adopt microservices patterns. If team has no microservices experience, architecture risk increases (flag in ADRs; add training phase).
Legacy system data accessibility: Assumes legacy systems expose data via API or database connector. If legacy is pure black box, Sidecar pattern becomes required (adds complexity/cost).
IF Conservative scenario selected:
IF Moderate scenario selected:
IF Aggressive scenario selected:
IF budget is constrained:
IF team expertise unavailable:
Client mandates specific technology: Override choice; document constraint in relevant ADR with trade-off analysis.
No cloud allowed: Replace K8s with VM-based deployment (Terraform + Ansible) or on-prem K8s (OpenShift). Replace managed services with self-hosted. Operational overhead increases.
Team has no microservices experience: Start with monolith + modular boundaries (DDD packages). Plan 2-week training phase. Add risk flag: "Learning curve increases deployment risk by 20%."
Legacy system has no API: Sidecar becomes critical path. Wrap legacy in process bridge; expose via message queue or REST. Data extraction via database-level CDC if schema accessible. Cost & complexity increase significantly.
Multiple legacy systems with conflicting schemas: Federated data model; ACL per system maintains logical separation. EDW aggregates for analytics (separate from OLTP). Data consistency becomes eventual.
Regulatory mandate for on-prem data residency: Data layer stays on-prem. Application layer can be cloud. Encrypted tunnel (VPN/DX) between layers. Document in Zero Trust and Data Storage ADRs.
When to split a service vs keep monolithic:
Service boundary heuristics:
When CQRS adds value vs over-engineering:
Produce a layered architecture diagram with these layers:
Document trade-offs for each major decision:
| Decision | TO-BE Choice | Alternative 1 | Alternative 2 | Trade-off |
|---|---|---|---|---|
| Service Communication | Event-Driven + REST | Pure REST | Pure Event-Driven | Complexity vs Resilience |
| Consistency Model | Saga + Local Transactions | Distributed Transactions | 2PC | Latency vs Strong Consistency |
| Security | Zero Trust (mTLS + OAuth2) | Network Perimeter | API Keys Only | Ops Complexity vs Security |
| Legacy Integration | ACL + Sidecar + Strangler Fig | Big Bang | No Migration | Time-to-Modern vs Risk |
| Data Storage | Event Sourcing + CQRS | Traditional CRUD | Snapshot-only | Complexity vs Audit Trail |
| Deployment | Kubernetes + GitOps | Traditional VMs | Serverless | Ops Overhead vs Control |
Each ADR includes:
Minimum ADR topics:
See ${CLAUDE_SKILL_DIR}/references/adr-templates.md for detailed ADR templates with banking/enterprise examples.
For each scenario, document: Problem, Trigger Conditions, Mitigations (Defense in Depth), Monitoring & Early Detection (alert definitions), Acceptance Criteria (Go/No-Go).
Minimum scenarios:
See ${CLAUDE_SKILL_DIR}/references/nightmare-scenarios.md for detailed monitoring alert definitions and acceptance criteria per scenario.
Design the first deployable component (typically Authentication & Session Management):
Phase 1: Assessment & Wrapping (Months 1-2)
Phase 2: Modern Service Introduction (Months 3-5)
Phase 3: Capability Migration (Months 6-12)
Phase 4: Legacy Sunset (Months 13+)
Migration Risk Mitigation:
| Phase | Risk | Mitigation |
|---|---|---|
| 1 | Incorrect legacy understanding | Detailed discovery + technical archaeology |
| 2 | Canary impacts production | Shadow mode: compare but don't apply |
| 3 | Data inconsistency | Reconciliation service + nightly batch |
| 4 | Legacy data inaccessibility | Data lake backup + read-only ACL |
| Activity | Delivery Team | Client | Shared |
|---|---|---|---|
| Architecture Design & ADRs | R,A | C | I |
| Legacy System Documentation | C | R,A | I |
| Microservice Development | R | C | A |
| Testing & QA | C | R,A | I |
| Deployment & Infrastructure | R | C | A |
| Security Review & mTLS Setup | R | C | A |
| Migration Planning & Execution | A | R | C |
| Training & Knowledge Transfer | R | A | C |
| Production Support (6 months) | R | C | A |
Legend: R=Responsible, A=Accountable, C=Consulted, I=Informed
{VARIANTE} | {FORMATO} | Archivo generado | Contenido |
|---|---|---|---|
| técnica | markdown | 04_Arquitectura_TO-BE_Deep.md | C4 L2, trade-offs, 6+ ADRs, 5+ nightmares, MVP, migration, RACI |
| técnica | html | 04_Arquitectura_TO-BE_Deep.html | Mismo contenido, HTML con estilos brand |
| técnica | dual | Ambos archivos | Markdown + HTML |
| ejecutiva | markdown | 04_Arquitectura_TO-BE_Ejecutiva.md | C4 diagram, trade-off matrix, migration phases (~40%) |
| ejecutiva | html | 04_Arquitectura_TO-BE_Ejecutiva.html | Mismo contenido ejecutivo, HTML con estilos brand |
| ejecutiva | dual | Ambos archivos | Markdown + HTML |
| Caso | Estrategia de Manejo |
|---|---|
| Cliente impone tecnologia especifica | Override la eleccion; documentar constraint en ADR relevante con trade-off analysis explicito. |
| No cloud permitido | Reemplazar K8s con VM-based deployment (Terraform + Ansible) o on-prem K8s (OpenShift). Managed services por self-hosted. |
| Equipo sin experiencia en microservicios | Iniciar con monolito + modular boundaries (DDD packages). Training phase +2-3 semanas. Flag riesgo elevado. |
| Legacy system sin API | Sidecar critico. Wrap legacy via message queue o REST. Data extraction via CDC si schema accesible. |
| Multiples legacy systems con schemas conflictivos | Federated data model; ACL por sistema mantiene separacion logica. EDW agrega para analytics. Consistencia eventual. |
| Regulacion de data residency on-prem | Data layer on-prem, application layer en cloud. Encrypted tunnel (VPN/DX) entre capas. Documentar en ADRs de Zero Trust y Data Storage. |
| Decision | Alternativa Descartada | Justificacion |
|---|---|---|
| Strangler Fig sobre Big-Bang | Migracion Big-Bang completa | Strangler Fig reduce riesgo con fases independientemente reversibles. Big-bang maximiza blast radius y no permite aprendizaje incremental. |
| Nightmare-first design (5 escenarios) | Happy-path-first design | Si la arquitectura no sobrevive los peores escenarios, no se construye. Disenar para nightmares primero asegura resiliencia antes de optimizar el happy path. |
| MVP valida arquitectura antes de escalar | Implementar todos los servicios en paralelo | El MVP prueba patterns, performance y operational readiness con un componente real. Si falla, la arquitectura se ajusta antes de multiplicar el error. |
| Saga + Outbox sobre 2PC | Distributed 2PC transactions | 2PC tiene latencia prohibitiva y single point of failure (coordinator). Saga + Outbox es resiliente, idempotente, y auditable. |
graph TD
subgraph Core["Conceptos Core"]
C4["C4 L2 Container Diagram"]
ADR["Architecture Decision Records"]
NIGHTMARE["Nightmare Scenarios"]
MVP["MVP Component"]
STRANGLER["Strangler Fig Migration"]
end
subgraph Inputs["Entradas"]
ASIS["AS-IS Analysis"]
SCENARIO["Approved Scenario"]
CONSTRAINTS["Constraints & NFRs"]
LEGACY["Legacy System Docs"]
end
subgraph Outputs["Salidas"]
TOBE["TO-BE Architecture Doc"]
TRADEOFF["Trade-off Matrices"]
MIGRATION["Phased Migration Plan"]
RACI["RACI Matrix"]
end
subgraph Related["Skills Relacionados"]
SWARCH["software-architecture"]
SOLARCH["solutions-architecture"]
INFRAARCH["infrastructure-architecture"]
DEVSEC["devsecops-architecture"]
ENTARCH["enterprise-architecture"]
end
ASIS --> C4
SCENARIO --> ADR
CONSTRAINTS --> ADR
LEGACY --> STRANGLER
C4 --> TOBE
ADR --> TOBE
NIGHTMARE --> TOBE
MVP --> TOBE
STRANGLER --> MIGRATION
TOBE --> TRADEOFF
TOBE --> RACI
SWARCH -.-> C4
SOLARCH -.-> C4
INFRAARCH -.-> MVP
DEVSEC -.-> STRANGLER
ENTARCH -.-> ADR
Formato Markdown (default):
# Arquitectura TO-BE: {project}
## 1. C4 Level 2 Container Architecture
### Mermaid Diagram
### Layer Descriptions
## 2. Trade-off Matrix
| Decision | TO-BE Choice | Alternative 1 | Alternative 2 | Trade-off |
...
## 3. ADRs (6+)
### ADR-001: {title}
- Decision: ...
- Alternatives Considered: ...
- Trade-off: ...
- Consequences: ...
## 4. Nightmare Scenarios (5+)
### NS-001: {name}
- Problem | Trigger | Mitigations | Monitoring | Go/No-Go
## 5. MVP Component
## 6. Phased Migration (Strangler Fig)
## RACI Matrix
Formato PPTX (bajo demanda):
Slide 1: Portada — Arquitectura TO-BE: {project}
Slide 2: Executive Summary — scenario + key architectural decisions
Slide 3: C4 L2 Container Diagram
Slide 4: Trade-off Matrix (top decisions)
Slide 5-6: Nightmare Scenarios — top-3 con mitigaciones
Slide 7: MVP Component Architecture
Slide 8: Migration Phases (Strangler Fig timeline)
Slide 9: RACI Matrix
Slide 10: Next Steps + Validation Gates
Formato HTML (bajo demanda):
04_Arquitectura_TO-BE_{project}_{WIP}.htmlFormato DOCX (bajo demanda):
{fase}_{entregable}_{cliente}_{WIP}.docxFormato XLSX (bajo demanda):
{fase}_{entregable}_{cliente}_{WIP}.xlsx| Dimension | Peso | Criterio |
|---|---|---|
| Trigger Accuracy | 10% | Activacion correcta ante keywords de TO-BE, target architecture, ADRs, Strangler Fig, migration, nightmare scenarios, C4 diagrams. |
| Completeness | 25% | 6 entregables: C4 L2, trade-offs, 6+ ADRs, 5+ nightmares, MVP, migration plan. RACI incluido. |
| Clarity | 20% | ADRs documentan decision + alternativas + trade-off + consecuencias. C4 diagram legible por audiencia tecnica y ejecutiva. |
| Robustness | 20% | Conditional logic per scenario (Conservative/Moderate/Aggressive). Edge cases (no cloud, no API, team sin experiencia) cubiertos. |
| Efficiency | 10% | Variante ejecutiva reduce a C4 + trade-offs + migration phases (~40%). Reusa scenario aprobado sin re-evaluar. |
| Value Density | 15% | Nightmare scenarios con mitigaciones defense-in-depth. MVP valida arquitectura antes de escalar. Migration plan reversible por fase. |
Umbral minimo: 7/10. Debajo de este umbral, revisar ADR completeness y nightmare scenario mitigations.
Primary: 04_Arquitectura_TO-BE_Deep.html — C4 L2 diagram, trade-off matrices, nightmare scenarios with mitigations, MVP component design, ADRs, migration roadmap, acceptance criteria, RACI matrix.
Autor: Javier Montaño | Última actualización: 12 de marzo de 2026