Gate 3: Technical architecture document - defines HOW/WHERE with technology-agnostic patterns before concrete implementation choices.
Runs before: ring:pre-dev-api-design, ring:pre-dev-task-breakdown Runs after: ring:pre-dev-prd-creation, ring:pre-dev-feature-map, ring:pre-dev-design-validation
The TRD defines HOW to architect the solution and WHERE components will live — using technology-agnostic patterns before concrete technology choices.
When specific details are not provided (tech stack, architecture, team size, deployment model, etc.):
## Assumptions section at the top of the TRD⚠️ Assumption:)Read PRD and detect UI indicators (user stories with "see", "view", "click", "page", "screen", "button", "form"; features involving login, dashboard, settings, reports, notifications).
If feature has UI:
docs/pre-dev/{feature}/design-validation.mdIf backend-only: Skip to Step 0.
go.mod exists → Gopackage.json with react/next → Frontend TSpackage.json with express/fastify/nestjs → Backend TS| Tech Stack | Standards to Load |
|---|---|
| Go Backend | golang/index.md + devops.md + sre.md |
| TypeScript Backend | typescript.md + devops.md + sre.md |
| TypeScript Frontend | frontend.md + devops.md |
| Full-Stack TypeScript | typescript.md + frontend.md + devops.md + sre.md |
WebFetch base URL: https://raw.githubusercontent.com/LerianStudio/ring/main/dev-team/docs/standards/
Check: docs/PROJECT_RULES.md → docs/STANDARDS.md (legacy) → note for creation at Gate 6 if not found.
Read PRD, extract requirements, suggest technologies per category, confirm with user.
AskUserQuestion: "What deployment model?" Options: Cloud, On-Premise, Hybrid
TRD header must include: feature, gate: 3, deployment.model, tech_stack.primary, tech_stack.standards_loaded[], project_technologies[] (category, prd_requirement, choice, rationale per decision). This flows to Gates 4-6.
| Phase | Activities |
|---|---|
| 1. Analysis | PRD (required); Feature Map (optional); identify NFRs (performance, security, scalability); map domains to components |
| 2. Architecture Definition | Choose style (Microservices, Modular Monolith, Serverless); design components with boundaries; define interfaces; model data architecture; plan integration patterns; design security |
| 3. Gate 3 Validation | All domains mapped; component boundaries clear; interfaces technology-agnostic; data ownership explicit; quality attributes achievable; no specific products named |
| Element | Say This (✅) | Not This (❌) |
|---|---|---|
| Database | "Relational Database" | "PostgreSQL 16" |
| Cache | "In-Memory Cache" | "Redis" or "Valkey" |
| Message Queue | "Message Broker" | "RabbitMQ" |
| Object Storage | "Blob Storage" | "MinIO" or "S3" |
| Web Framework | "HTTP Router" | "Fiber" or "Express" |
| Auth | "JWT-based Authentication" | "specific library" |
TRD never includes: product names with versions, package manager commands, cloud service names (RDS, Lambda), framework-specific terms, container/orchestration specifics, CI/CD tool names.
| Auth Type | TRD Description |
|---|---|
| User only | "Token-based authentication with stateless validation" |
| User + permissions | "Token-based authentication with role-based access control (RBAC)" |
| Service-to-service | "Machine-to-machine authentication with client credentials" |
| Full | "Dual-layer authentication: user tokens + client credentials for services" |
For Go services: reference golang/security.md → Access Manager Integration in TRD so engineers know implementation patterns.
| License Type | TRD Description |
|---|---|
| Single-org | "Global license validation at service startup with fail-fast behavior" |
| Multi-org | "Per-request license validation with organization context" |
For Go services: reference golang/security.md → License Manager Integration.
Read api_pattern from research.md frontmatter (bff or none).
If api_pattern: none: Document "Static Frontend — no API layer needed."
If api_pattern: bff: TRD MUST include ## Integration Patterns section:
BFF Contracts section (MANDATORY when api_pattern: bff):
data envelope)HARD RULE: Client-side code MUST NEVER call backend APIs directly. api_pattern: direct does not exist for dynamic data.
Auto-detect from package.json: @lerianstudio/sindarian-ui, @radix-ui/*, @shadcn/ui, @chakra-ui/*, @mui/material, etc.
TRD must include ## Design System Configuration section:
| Strategy | Best For | Performance |
|---|---|---|
| Cursor-Based | >10k records, infinite scroll | O(1) |
| Page-Based (Offset) | <10k records, admin interfaces | O(n) |
| Page-Based + Total Count | "Page X of Y" UI | 2 queries |
| No Pagination | Very small bounded sets (<100) | — |
Document in TRD: API Patterns → Pagination → Strategy + Rationale
**ADR-00X: [Pattern Name]**
- **Context**: [Problem needing solution]
- **Options**: [List with trade-offs - no products]
- **Decision**: [Selected pattern]
- **Rationale**: [Why this pattern]
- **Consequences**: [Impact of decision]
| Category | Requirements |
|---|---|
| Architecture Completeness | All PRD features mapped; DDD boundaries; clear responsibilities; stable interfaces |
| Data Design | Ownership explicit; models support PRD; consistency strategy; flows documented |
| Quality Attributes | Performance targets set; security addressed; scalability path clear |
| Integration Readiness | External deps identified (by capability); patterns selected; errors considered |
| Technology Agnostic | Zero product names; capabilities abstract; can swap tech without redesign |
| Design System (UI) | Library specified; CSS framework; theme variables; component matrix; variant mapping |
Gate Result: ✅ PASS → API Design | ⚠️ CONDITIONAL (remove product names) | ❌ FAIL (too coupled)
| Structure | trd.md Location |
|---|---|
| single-repo | docs/pre-dev/{feature}/trd.md |
| monorepo | docs/pre-dev/{feature}/trd.md (root) |
| multi-repo | Both repos: {backend.path}/docs/pre-dev/{feature}/trd.md AND {frontend.path}/... |