--- name: up-arch-risk-spike description: Score every use case on architectural risk (data isolation/multi-tenancy, external integration dependency, financial/transactional sensitivity, high-volume/real-time streaming, novelty/complexity), shortlist architecturally significant ones, then build and validate a thin end-to-end architecture walking skeleton (HLD + LLD + deployment) against only that shortlist before full-breadth design begins. Covers Stages 6-7 (Elaboration) of the UP-AI v1.0 Process (process/AI_Native_Unified_Process_v1.md). --- # up-arch-risk-spike — Stages 6–7 (Elaboration) ## Objective Retire architecture risk early by proving the hardest parts of the system (data isolation, highest-risk integrations, state machines, high-volume data paths) against a small, representative slice of use cases — before committing full design effort across all use cases. ## When to invoke - After `up-traceability-gate` (Gate 5.1) passes for the use-case set in scope. - In Greenfield projects: can be run as Stage 1B/6 to validate the core walking skeleton. - Before `up-srs-derive` (Stage 8) and `up-hld-lld-generate` (Stage 9) begin full-breadth design. ## Read first - `tech-profile.yaml` (identifies architecture pattern, database model, auth provider, and external sandboxes) - `04_generated_documentation/03_requirements/use_cases/` (all authored use cases) - `04_generated_documentation/00_process_control/master_context.md` - `process/AI_Native_Unified_Process_v1.md` §5 "Stage 6" and "Stage 7" ## Procedure **Stage 6 — Architectural Risk Ranking:** Read every use case and evaluate against 5 standard architectural risk dimensions (scored 1 to 5): 1. **Data Isolation & Multi-Tenancy:** Cross-tenant boundaries, Row-Level Security (PostgreSQL RLS), schema isolation, or site-based isolation (e.g. Frappe `database_per_tenant` sites). 2. **External Integration Dependency:** Third-party APIs, webhooks, payment gateways, messaging systems. 3. **Financial & Transactional Sensitivity:** Balances, ledgers, irreversible state transitions, atomic operations. 4. **Throughput & Concurrency:** Real-time ingestion, streaming, heavy background queues, lock contention. 5. **Novelty & Technical Uncertainty:** Unfamiliar algorithms, complex business logic, or lack of precedent. Compute total `RISK-xxx` score. Mark the top 15–20% (or any UC scoring 4–5 on any single dimension) as "Architecturally Significant" in `00_process_control/architecture_risk_register.md`. **Stage 7 — Architecture Spike / Walking Skeleton:** Using only the architecturally significant use cases, design: 1. Architecture component boundaries (HLD) matching `tech-profile.yaml` architecture pattern (e.g. modular monolith, Frappe app modules, Django apps, Spring Boot services). 2. LLD detail (internal APIs, database schema/DocTypes, domain events, state machines) for these components. 3. Explicitly validate: data-scoping models, authentication/token propagation, sandbox mock contracts, and error resilience. Produce `architecture_spike_report.md` documenting: - Validated architectural patterns and baseline service templates (folder layouts, API contract shapes, repository patterns). - Invalidated assumptions, logged as `DEC-xxx` or `AMB-xxx`. ## Output expected `04_generated_documentation/00_process_control/architecture_risk_register.md`; scoped `04_generated_documentation/04_architecture_design/hld.md` and `lld/LLD-xxx_*.md` covering significant use cases; `architecture_spike_report.md`. ## Exit criteria Architecturally significant use cases have a validated walking skeleton HLD/LLD; service template is documented; human lead signs off on spike findings. ## Sample invocation > "Run up-arch-risk-spike against all authored use cases to identify high-risk integration and data-isolation bottlenecks." ## Related skills Previous: `up-traceability-gate` (Gate 5.1). Next: `up-srs-derive` (Stage 8), then `up-hld-lld-generate` (Stage 9).