Gate 3: Technical architecture document - defines HOW/WHERE with technology-agnostic patterns before concrete implementation choices.
Creates technology-agnostic architecture documents by validating prerequisites, loading standards, and enforcing abstract patterns before implementation.
npx claudepluginhub lerianstudio/ringThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Architecture decisions (HOW/WHERE) must be technology-agnostic patterns before concrete implementation choices.
Specifying technologies in TRD creates:
The TRD answers: HOW we'll architect the solution and WHERE components will live. The TRD never answers: WHAT specific products, frameworks, versions, or packages we'll use.
This check MUST happen BEFORE any TRD work begins.
Read PRD from docs/pre-dev/{feature}/prd.md and check for UI indicators:
⛔ HARD GATE: If feature has UI, design-validation.md MUST exist and show VALIDATED verdict.
Check: docs/pre-dev/{feature}/design-validation.md
If file NOT FOUND:
→ STOP. Cannot proceed to TRD.
→ Message: "Design Validation (Gate 1.5/2.5) not completed.
Run ring:pre-dev-design-validation before TRD."
If file FOUND but verdict is NOT "DESIGN VALIDATED":
→ STOP. Cannot proceed to TRD.
→ Message: "Design Validation failed with gaps.
Fix design gaps and re-run validation before TRD."
If file FOUND and verdict is "DESIGN VALIDATED":
→ PASS. Proceed to Step 0.
Backend-only features do not require design validation. Proceed directly to tech stack definition.
| Rationalization | Why It's WRONG | Required Action |
|---|---|---|
| "Design validation is optional" | It's MANDATORY for UI features. Incomplete design = implementation rework. | STOP. Run design validation first. |
| "We'll validate design later" | Later = after architecture. Changes cascade. | STOP. Validate design NOW. |
| "The wireframes look complete" | "Look complete" ≠ validated. Run systematic check. | STOP. Run design validation. |
| "We're in a hurry, skip validation" | Hurry now = 10x rework later. | STOP. No shortcuts. |
| "TRD doesn't depend on design" | TRD for fullstack features depends on UI architecture decisions. | STOP. Validate design first. |
| "Design validation just passed informally" | Informal ≠ documented. Need design-validation.md with VALIDATED. | STOP. Run formal validation. |
| User Says | Your Response |
|---|---|
| "Skip design validation, we're behind schedule" | "Design validation prevents 10x implementation rework. CANNOT proceed to TRD without it." |
| "The designer approved it verbally" | "Verbal approval ≠ systematic validation. Need design-validation.md with VALIDATED verdict." |
| "We can validate design in parallel with TRD" | "TRD depends on complete design. Cannot architect what isn't fully specified. Run validation first." |
| "Just this once, trust me the design is complete" | "Trust but verify. Ring requires documented validation. Run ring:pre-dev-design-validation." |
This is a HARD GATE. Do NOT proceed without defining the tech stack.
Auto-detection: go.mod exists → Go | package.json with react/next → Frontend TS | package.json with express/fastify/nestjs → Backend TS
If ambiguous, AskUserQuestion: "What is the primary technology stack?" Options: Go (Backend), TypeScript (Backend), TypeScript (Frontend), Full-Stack TypeScript
| Standard | URL | Purpose |
|---|---|---|
| golang/index.md | https://raw.githubusercontent.com/LerianStudio/ring/main/dev-team/docs/standards/golang/index.md | Go patterns index (modular) |
| typescript.md | https://raw.githubusercontent.com/LerianStudio/ring/main/dev-team/docs/standards/typescript.md | TS patterns, async |
| frontend.md | https://raw.githubusercontent.com/LerianStudio/ring/main/dev-team/docs/standards/frontend.md | React, Next.js, a11y |
| devops.md | https://raw.githubusercontent.com/LerianStudio/ring/main/dev-team/docs/standards/devops.md | Docker, CI/CD |
| sre.md | https://raw.githubusercontent.com/LerianStudio/ring/main/dev-team/docs/standards/sre.md | Health checks, logging |
| Tech Stack | Load |
|---|---|
| Go Backend | golang/index.md (then required modules) + 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 |
Check: docs/PROJECT_RULES.md → docs/STANDARDS.md (legacy) → STOP if not found
Read PRD, extract requirements, suggest technologies that address each, present to user for confirmation. Document in TRD metadata for Gate 6 to create PROJECT_RULES.md.
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 technology decision)
This metadata flows to Gates 4-6.
| Pressure | Response |
|---|---|
| "Tech stack doesn't matter for architecture" | "Architecture patterns vary by language. Go patterns ≠ TypeScript patterns. Define stack first." |
| "We'll decide tech stack later" | "Later = Dependency Map. But architecture NOW needs to know capabilities. Define stack." |
| "Just use generic patterns" | "Generic patterns miss stack-specific best practices. 5 min to define saves rework." |
| "Skip to save time" | "Skipping causes Gates 4-6 to ask again. Define once here, inherit everywhere." |
| Phase | Activities |
|---|---|
| 1. Analysis (After Step 0) | PRD (Gate 1) required; Feature Map (Gate 2) 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 |
System architecture style (patterns, not products), component design with responsibilities, data architecture (ownership, flows - conceptual), API design (contracts, not protocols), security architecture (layers, threat model), integration patterns (sync/async, not tools), performance targets, deployment topology (logical)
Technology products (PostgreSQL, Redis, Kafka), framework versions (Fiber v2, React 18), language specifics (Go 1.24, Node.js 20), cloud services (AWS RDS, Azure Functions), packages (bcrypt, zod, prisma), container orchestration (Kubernetes, ECS), CI/CD details, IaC specifics
| 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" |
| Excuse | Reality |
|---|---|
| "Everyone knows we use PostgreSQL" | Assumptions prevent proper evaluation. Stay abstract. |
| "Just mentioning the tech stack for context" | Context belongs in Dependency Map. Keep TRD abstract. |
| "The team needs to know what we're using" | They'll know in Dependency Map. TRD is patterns only. |
| "It's obvious we need Redis here" | Obvious ≠ documented. Abstract to "cache", decide later. |
| "I'll save time by specifying frameworks now" | You'll waste time when better options emerge. Wait. |
| "But our project template requires X" | Templates are implementation. TRD is architecture. Separate. |
| "The dependency is critical to the design" | Then describe the capability needed, not the product. |
| "Stakeholders expect to see technology choices" | Stakeholders see them in Dependency Map. Not here. |
| "Architecture decisions depend on technology X" | Then your architecture is too coupled. Redesign abstractly. |
| "We already decided on the tech stack" | Decisions without analysis are assumptions. Validate later. |
If you catch yourself writing any of these in a TRD, STOP:
When you catch yourself: Replace the product name with the capability it provides. "PostgreSQL 16" → "Relational Database with ACID guarantees"
| Category | Requirements |
|---|---|
| Architecture Completeness | All PRD features mapped; DDD boundaries; single clear responsibilities; stable interfaces |
| Data Design | Ownership explicit; models support PRD; consistency strategy defined; flows documented |
| Quality Attributes | Performance targets set; security addressed; scalability path clear; reliability defined |
| Integration Readiness | External deps identified (by capability); patterns selected (not tools); errors considered; versioning strategy exists |
| Technology Agnostic | Zero product names; capabilities abstract; patterns named not implementations; can swap tech without redesign |
Gate Result: ✅ PASS → API Design | ⚠️ CONDITIONAL (remove product names) | ❌ FAIL (too coupled)
| Violation | Wrong | Correct |
|---|---|---|
| Tech in Architecture | Language: Go 1.24+, Framework: Fiber v2.52+, Database: PostgreSQL 16 | Style: Modular Monolith, Pattern: Hexagonal, Data Tier: Relational DB, Key-value store, Object storage |
| Framework in Components | Fiber middleware for JWT, bcrypt for passwords, passport.js for OAuth2 | Auth Component: Purpose, Inbound (HTTP endpoints), Outbound (persistence, notifications), Security (token-based, industry-standard hashing) |
| Cloud Services in Deployment | Compute: AWS ECS Fargate, Database: AWS RDS, Cache: ElastiCache | Compute: Container-based stateless, Data Tier: Managed DB with backup, Performance: Distributed caching, Traffic: Load balanced with health checks |
If feature includes list/browse, decide during TRD:
| Strategy | Best For | Trade-off | Performance |
|---|---|---|---|
| Cursor-Based | >10k records, infinite scroll, real-time | Can't jump pages | O(1) |
| Page-Based (Offset) | <10k records, admin interfaces | Degrades with large offsets | O(n) |
| Page-Based + Total Count | "Page X of Y" UI | Additional COUNT query | 2 queries |
| No Pagination | Very small bounded datasets (<100) | All data at once | - |
Document in TRD: API Patterns → Pagination → Strategy + Rationale
If feature requires authentication or authorization (as determined in Question 2 of pre-dev command):
| Auth Type | TRD Description (Abstract) | Implementation Reference |
|---|---|---|
| User authentication only | "Token-based authentication with stateless validation" | For Go: golang/security.md → Access Manager Integration |
| User + permissions | "Token-based authentication with role-based access control (RBAC)" | For Go: golang/security.md → Access Manager Integration |
| Service-to-service | "Machine-to-machine authentication with client credentials" | For Go: golang/security.md → Access Manager Integration (GetApplicationToken) |
| Full (user + S2S) | "Dual-layer authentication: user tokens for end-users, client credentials for services" | For Go: golang/security.md → Access Manager Integration |
Document in TRD: Security Architecture → Authentication/Authorization → Strategy + Implementation Reference
Key Implementation Pattern (for TRD reference):
auth.Authorize(applicationName, resource, action) on each routeNote for Go Services: Lerian's Access Manager (plugin-auth + identity + lib-auth) is the standard authentication system. Reference golang/security.md → Access Manager Integration section in the TRD so engineers know where to find implementation patterns including route middleware protection.
If feature is a licensed product/plugin (as determined in Question 3 of pre-dev command):
| License Type | TRD Description (Abstract) | Implementation Reference |
|---|---|---|
| Single-org (global) | "Global license validation at service startup with fail-fast behavior" | For Go: golang/security.md → License Manager Integration |
| Multi-org | "Per-request license validation with organization context" | For Go: golang/security.md → License Manager Integration |
Document in TRD: Security Architecture → Licensing → Strategy + Implementation Reference
Key Architecture Pattern (for TRD reference):
Note for Go Services: Lerian's License Manager (lib-license-go) is the standard licensing system. Reference golang/security.md → License Manager Integration section in the TRD so engineers know where to find implementation patterns including global middleware and graceful shutdown.
⛔ HARD GATE: If the feature is fullstack (topology.scope: fullstack), this section is MANDATORY in the TRD.
The api_pattern was determined during Topology Discovery (Q7) and persisted in research.md frontmatter.
# From research.md frontmatter
topology:
scope: fullstack
api_pattern: bff | none # bff if dynamic data, none if static
TRD must include an ## Integration Patterns section:
## Integration Patterns
### Frontend-Backend Communication
**Pattern:** [direct | bff | other]
**Rationale:** [Why this pattern was chosen]
**Architecture Implications:**
- [List architectural decisions driven by this pattern]
If api_pattern: none (Static Frontend):
### Frontend Architecture
**Pattern:** Static Frontend (no dynamic data)
**Rationale:** Pure static content, no server-side data fetching needed.
**Architecture Implications:**
- Static site generation (SSG) or client-side rendering of static content
- No API routes needed
- No backend integration
- Content embedded at build time or loaded from static files
**Data Flow:**
Build Process → Static HTML/JS → Browser
If api_pattern: bff (MANDATORY for dynamic data):
### Frontend-Backend Communication
**Pattern:** BFF (Backend-for-Frontend) layer
**Rationale:** [Multiple backend services | Complex data aggregation | Sensitive keys to hide | Request optimization needed]
**Architecture Implications:**
- Frontend calls BFF API routes (Next.js API Routes recommended)
- BFF aggregates data from multiple backend services
- Sensitive API keys stored server-side in BFF
- Response transformation happens in BFF layer
- Frontend receives optimized, frontend-specific data shapes
**Data Flow:**
Frontend Component → BFF API Route → Backend Service(s) → Database(s)
**BFF Responsibilities:**
- Data aggregation from multiple services
- Response transformation for frontend consumption
- Authentication token management (httpOnly cookies with Secure and SameSite attributes)
- Rate limiting and caching
- Error normalization
⛔ HARD GATE: If api_pattern: bff, this section MUST be included in TRD.
| Topology Scope | api_pattern | BFF Contract Required |
|---|---|---|
| fullstack | bff | Yes |
| frontend-only | bff | Yes |
| fullstack | direct | No |
| frontend-only | direct | No |
TRD MUST include a ## BFF Contracts section:
## BFF Contracts
### Purpose
Define typed contracts between BFF layer and Frontend components.
### Contract Per Feature
#### Feature: {feature_name}
**BFF Route:** `/api/{feature}/[operation]`
**Frontend Consumer:** `{ComponentName}`
**Request Contract:**
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| param1 | string | Yes | Description |
| param2 | number | No | Description |
**Response Contract:**
| Field | Type | Nullable | Description |
|-------|------|----------|-------------|
| data | object | No | Main response data |
| data.id | string | No | Entity identifier |
| data.name | string | No | Display name |
**Error Contract:**
| Error Code | Condition | Frontend Handling |
|------------|-----------|-------------------|
| VALIDATION_ERROR | Invalid input | Show field errors |
| NOT_FOUND | Resource missing | Show empty state |
| UNAUTHORIZED | Session expired | Redirect to login |
Document how BFF routes map to backend APIs:
### Backend API Mapping
| BFF Route | Backend APIs Called | Aggregation Logic |
|-----------|---------------------|-------------------|
| /api/dashboard | GET /users/:id, GET /orders?userId= | Merge user + recent orders |
| /api/profile | GET /users/:id, GET /preferences/:userId | Merge user + preferences |
If topology.scope: frontend-only AND api_pattern: bff:
The feature requires creating a NEW BFF layer to consume existing backend APIs.
TRD MUST document:
app/api/ for Next.js)### BFF Creation Plan (Frontend-only)
**BFF Framework:** Next.js API Routes / tRPC / Custom
**Existing Backend APIs (from PRD):**
- User API: GET /api/v1/users/:id
- Orders API: GET /api/v1/orders?userId=
**New BFF Routes:**
| Route | Purpose | Backend Calls | Response Shape |
|-------|---------|---------------|----------------|
| /api/dashboard | Dashboard data | users + orders | DashboardData type |
| /api/export/pdf | Generate PDF | orders | Blob |
**Type Definitions:**
- `types/api/dashboard.ts` - DashboardData, DashboardRequest
- `types/api/orders.ts` - Order, OrderList
| Excuse | Reality |
|---|---|
| "BFF contracts are implementation detail" | Contracts define component boundaries. Must be designed, not discovered. |
| "Frontend will figure out the types" | Untyped APIs cause runtime errors. Define types upfront. |
| "We'll add types as we implement" | Missing types cause frontend bugs. Specify contracts in TRD. |
| "BFF is just a pass-through" | Even pass-through needs error handling and type transformation. Document it. |
| "Backend already has types" | Backend types ≠ frontend types. BFF transforms shapes. Define both. |
⛔ HARD GATE: If api_pattern: bff, TRD MUST specify task ownership.
TRD MUST include a ## Task Ownership section when BFF is involved:
## Task Ownership
### BFF Implementation
| Task Type | Owner | Rationale |
|-----------|-------|-----------|
| BFF route creation | Frontend Engineer | BFF serves frontend, owned by consumer |
| BFF type definitions | Frontend Engineer | Types consumed by frontend components |
| Backend API integration | Frontend Engineer | BFF calls existing APIs |
| Error normalization | Frontend Engineer | Frontend defines error UX |
| Caching strategy | Frontend Engineer | Frontend knows cache requirements |
### Collaboration Points
| Activity | Frontend | Backend | Notes |
|----------|----------|---------|-------|
| BFF contract review | Author | Reviewer | Backend validates API assumptions |
| Type definitions | Author | Contributor | Shared types may exist |
| Error mapping | Author | Consultant | Backend clarifies error semantics |
| Reason | Explanation |
|---|---|
| Consumer proximity | BFF serves frontend; frontend knows data needs |
| Type safety chain | Frontend types → BFF types → seamless |
| Iteration speed | Frontend can modify BFF without backend coordination |
| Error UX | Frontend defines how errors appear to users |
| Scenario | Owner | Rationale |
|---|---|---|
| BFF includes business logic | Backend | Logic belongs with domain experts |
| BFF requires database access | Backend | Data layer is backend concern |
| BFF serves multiple frontends | Backend | Shared layer needs coordination |
### BFF Ownership Decision
**Owner:** [Frontend Engineer | Backend Engineer]
**Rationale:** [Why this assignment]
**Coordination Required:**
- [ ] Backend API documentation review
- [ ] Type definition alignment
- [ ] Error code mapping
| Excuse | Reality |
|---|---|
| "BFF is backend code" | BFF location ≠ ownership. Consumer drives ownership. |
| "Let teams figure it out" | Undefined ownership causes delays. Decide in TRD. |
| "Ownership is obvious" | Obvious to you ≠ clear to team. Document it. |
| "We can split BFF tasks" | Split ownership causes integration bugs. One owner. |
| Excuse | Reality |
|---|---|
| "Direct API calls are simpler" | FORBIDDEN. Direct client→API calls expose keys, break type safety. BFF is mandatory. |
| "BFF is overkill for our feature" | If there's dynamic data, BFF is required. Not a choice, a rule. |
| "We can call the API directly, it's just one endpoint" | Even one endpoint needs error normalization, type safety. Use BFF. |
| "API pattern doesn't affect architecture" | Pattern determines data flow, security, and layer responsibilities. Document it. |
| "Client-side fetch is fine for this" | Client-side fetch to external APIs exposes keys. Use BFF. |
Client-side code MUST NEVER call backend APIs, databases, or external services directly.
| If Feature Has... | api_pattern | Implementation |
|---|---|---|
| Dynamic data (API, DB, external) | bff | Next.js API Routes |
| Static content only | none | No API layer |
"Direct API calls" is FORBIDDEN. There is no api_pattern: direct option.
⛔ HARD GATE: If the feature includes any user-facing UI, this section is MANDATORY.
Auto-detection from package.json:
| Package Present | UI Library |
|---|---|
@lerianstudio/sindarian-ui | Sindarian UI (Radix-based) |
@radix-ui/* | Radix UI Primitives |
@shadcn/ui or shadcn in devDeps | shadcn/ui |
@chakra-ui/react | Chakra UI |
@headlessui/react | Headless UI |
@mui/material | Material UI |
| None detected | Ask user for choice |
If no UI library detected, AskUserQuestion: "What UI component library will this project use?" Options: shadcn/ui (Recommended), Chakra UI, Material UI, Headless UI, Custom components
TRD must include a ## Design System Configuration section:
## Design System Configuration
### UI Library
- **Library:** [Detected or chosen library]
- **Version:** [Package version from package.json]
### CSS Framework
- **Framework:** [TailwindCSS v4 / CSS Modules / Styled Components / etc.]
- **Config File:** [tailwind.config.ts / postcss.config.js / etc.]
### Theme Integration
- **CSS Variables Required:** Yes/No
- **Dark Mode:** prefers-color-scheme / class-based / not supported
- **Source Directive:** @source path for component styles
### Required CSS Imports
List CSS files that MUST be imported in globals.css:
- `@import "tailwindcss";`
- `@import "@library/dist/components/ui/button/styles.css";`
- etc.
### Theme Variables
Document required CSS custom properties:
- Color scale (zinc, shadcn)
- Spacing variables
- Component-specific variables (button, input, dialog)
TRD MUST document which components exist in the chosen UI library:
### Component Availability
| Component Needed | Available in Library | Notes |
|------------------|---------------------|-------|
| Button | ✅ Yes | Variants: primary, secondary, outline |
| Dialog/Modal | ✅ Yes | Use DialogTrigger pattern |
| Form | ✅ Yes | Requires Form context wrapper |
| Input | ⚠️ Partial | Requires FormField context |
| IconButton | ✅ Yes | Separate component for icon-only |
| Toast | ✅ Yes | Requires Toaster provider |
| Table | ✅ Yes | Use TableHeader, TableBody, etc. |
### Missing Components (Must Create)
- [ ] Component X - not available, need custom implementation
TRD MUST document available variants to prevent implementation errors:
### Button Variants (Example)
| Design Intent | Correct Variant | WRONG (Don't Use) |
|---------------|-----------------|-------------------|
| Primary action | `variant="primary"` | `variant="default"` |
| Secondary action | `variant="secondary"` | - |
| Cancel/neutral | `variant="outline"` | `variant="ghost"` |
| Destructive | `variant="primary" className="bg-red-600"` | `variant="destructive"` |
| Icon-only | Use `<IconButton>` | `<Button size="icon">` |
| Excuse | Reality |
|---|---|
| "Styling is implementation detail" | Styling bugs cause white screens and broken UX. Document upfront. |
| "Developers will figure out CSS" | Missing CSS variables = hours of debugging. Specify requirements. |
| "All UI libraries work the same" | They don't. Form patterns, variants, and contexts vary significantly. |
| "We'll add dark mode later" | CSS architecture for dark mode must be set from the start. |
| "Component variants are obvious" | They're not. ghost vs plain vs outline varies by library. |
| "Just use the library's defaults" | Defaults may not match design. Document exact variants needed. |
If reviewing a TRD for a UI feature and you see NONE of these, STOP and add them:
| Category | Requirements |
|---|---|
| Design System | UI library specified; CSS framework documented; theme variables listed; component availability verified; variant mapping complete |
**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]
| Factor | Points | Criteria |
|---|---|---|
| Pattern Match | 0-40 | Exact before: 40, Similar: 25, Novel: 10 |
| Complexity Management | 0-30 | Simple proven: 30, Moderate: 20, High: 10 |
| Risk Level | 0-30 | Low proven: 30, Moderate mitigated: 20, High accepted: 10 |
Action: 80+ present autonomously | 50-79 present options | <50 request clarification
This skill REQUIRES loading Ring Standards via WebFetch as part of Step 0 (Tech Stack Definition).
HARD GATE: MUST load appropriate standards based on detected/selected tech stack:
| Tech Stack | Standards to Load via WebFetch |
|---|---|
| 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 |
MUST also read PROJECT_RULES.md from docs/PROJECT_RULES.md (or docs/STANDARDS.md for legacy projects).
| Condition | Action | Severity |
|---|---|---|
| PRD (Gate 1) not validated | STOP and complete Gate 1 first | CRITICAL |
| Design Validation failed (UI features) | STOP and complete design validation first | CRITICAL |
| Tech stack cannot be determined | STOP and ask user for clarification | CRITICAL |
| Ring Standards not loaded | STOP and WebFetch required standards | CRITICAL |
| Technology product names in architecture | STOP and abstract to capabilities | HIGH |
| PROJECT_RULES.md not found (new project) | Continue but MUST create during Step 0.3 | MEDIUM |
| Component ownership unclear | STOP and define single owner per component | HIGH |
These requirements are NON-NEGOTIABLE:
| Severity | Definition | Example |
|---|---|---|
| CRITICAL | Cannot proceed with TRD | PRD not validated, design validation failed, standards not loaded |
| HIGH | TRD violates abstraction principle | PostgreSQL mentioned, framework versions included |
| MEDIUM | TRD incomplete but usable | Missing one component boundary definition |
| LOW | Minor documentation gaps | ADR rationale could be more detailed |
trd.md is a shared document - it defines architecture for the entire feature.
| Structure | trd.md Location |
|---|---|
| single-repo | docs/pre-dev/{feature}/trd.md |
| monorepo | docs/pre-dev/{feature}/trd.md (root) |
| multi-repo | Write to BOTH repos |
Multi-repo handling:
# Read topology from research.md frontmatter
if [[ "$structure" == "multi-repo" ]]; then
# Write to both repositories
mkdir -p "{backend.path}/docs/pre-dev/{feature}"
mkdir -p "{frontend.path}/docs/pre-dev/{feature}"
# Write TRD to primary (backend)
# Then copy to frontend
cp "{backend.path}/docs/pre-dev/{feature}/trd.md" "{frontend.path}/docs/pre-dev/{feature}/trd.md"
fi
Sync footer for multi-repo:
---
**Sync Status:** Architecture document maintained in both repositories.
Output to:
docs/pre-dev/{feature-name}/trd.md{backend.path}/docs/pre-dev/{feature}/trd.md AND {frontend.path}/docs/pre-dev/{feature}/trd.mdring:pre-dev-api-design)If you wrote a TRD with specific technology products, delete those sections and rewrite abstractly.
The TRD is architecture patterns only. Period. No product names. No versions. No frameworks.
Technology choices go in Dependency Map. That's the next phase. Wait for it.
Stay abstract. Stay flexible. Make technology decisions in the next phase with full analysis.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.