Deployment/Physical Architecture Lens
Cognitive Mode: Physical
Primary Question: "Where does it run?"
Focus: Infrastructure Topology, Process Boundaries, Data Storage Locations, Network Communication
When to Use
- Need to understand physical deployment
- Documenting infrastructure and processes
- Analyzing where components execute
- User invokes
/arch-lens-deployment or /make-arch-diag deployment
Critical Constraints
NEVER:
- Modify any source code files
- Include code-level details
- Show internal logic
ALWAYS:
- Focus on PHYSICAL deployment
- Show process boundaries
- Include network/communication protocols
- Document storage locations
- BEFORE creating any diagram, LOAD the
/mermaid skill using the Skill tool - this is MANDATORY
Analysis Workflow
Step 1: Launch Parallel Exploration Subagents
Spawn Explore subagents to investigate:
Process Boundaries
- Find main process entry points
- Identify subprocess spawning
- Look for: main, entry_points, subprocess, process spawning, daemon processes
Container/Docker
- Find containerization config
- Identify services
- Look for: Dockerfile, docker-compose.yml, container definitions, Kubernetes configs
Local Storage
- Find file storage locations
- Identify database paths
- Look for: data directories, database files, storage volumes, persistent storage
Network Services
- Find service definitions
- Identify ports and protocols
- Look for: port, bind, listen, server, API, endpoint, network services
External Services
- Find external API calls
- Identify cloud services
- Look for: external APIs, cloud services, third-party integrations
Web/Frontend
- Find frontend deployment
- Identify static file serving
- Look for: web servers, frontend builds, static assets, CDN
Step 2: Map Physical Topology
| Component |
Location |
Technology |
Port/Protocol |
| {name} |
{where} |
{tech} |
{port/protocol} |
CRITICAL - Analyze Read/Write Direction:
For EVERY process and storage location:
- Reads from: What does this process READ? (files, databases, APIs)
- Writes to: What does this process WRITE? (files, databases, APIs)
- Network direction: Client->Server or bidirectional?
For storage locations:
- Read/write storage: Process both reads and writes (databases, state files)
- Write-only storage: Process writes, humans or other systems read (logs, artifacts)
- Read-only sources: Process reads, doesn't modify (config, external APIs)
Label all connections with direction (reads, writes, or both)
Step 3: Identify Communication Paths
- Process-to-process (IPC, subprocess)
- Network (HTTP, WebSocket, gRPC)
- File system (shared files)
- Database (connections)
Step 4: Create the Diagram
Use flowchart with:
Direction: TB for infrastructure layers
Subgraphs by Physical Location:
- Developer Machine (local processes)
- Local Storage (files, DBs)
- Docker Stack (if containerized)
- Web Stack (if applicable)
- External Services (cloud, APIs)
Node Styling:
cli class: Main processes
stateNode class: Local storage, databases
output class: File artifacts
handler class: Services, APIs
phase class: Frontend, web UI
integration class: External services
Connection Labels:
- Show protocols (HTTP, subprocess, file)
- Show ports where relevant
Step 5: Write Output
Write the diagram to: temp/arch-lens-deployment/arch_diag_deployment_{YYYY-MM-DD_HHMMSS}.md
Output Template
# Deployment Diagram: {System Name}
**Lens:** Deployment/Physical
**Question:** Where does it run?
**Date:** {YYYY-MM-DD}
**Scope:** {What was analyzed}
## Deployment Topology
| Component | Port | Technology | Purpose |
|-----------|------|------------|---------|
| {name} | {port} | {tech} | {purpose} |
## Deployment Diagram
```mermaid
%%{init: {'flowchart': {'nodeSpacing': 50, 'rankSpacing': 60, 'curve': 'basis'}}}%%
flowchart TB
%% CLASS DEFINITIONS %%
classDef cli fill:#1a237e,stroke:#7986cb,stroke-width:2px,color:#fff;
classDef stateNode fill:#004d40,stroke:#4db6ac,stroke-width:2px,color:#fff;
classDef handler fill:#e65100,stroke:#ffb74d,stroke-width:2px,color:#fff;
classDef phase fill:#6a1b9a,stroke:#ba68c8,stroke-width:2px,color:#fff;
classDef output fill:#00695c,stroke:#4db6ac,stroke-width:2px,color:#fff;
classDef integration fill:#c62828,stroke:#ef9a9a,stroke-width:2px,color:#fff;
subgraph LocalMachine ["LOCAL MACHINE"]
direction TB
MAIN["Main Process<br/>━━━━━━━━━━<br/>Runtime<br/>Orchestration"]
SUB["Subprocess<br/>━━━━━━━━━━<br/>Isolated execution"]
end
subgraph LocalStorage ["LOCAL STORAGE"]
direction TB
DB[("Database<br/>━━━━━━━━━━<br/>Technology<br/>Location")]
FILES["Files<br/>━━━━━━━━━━<br/>Artifacts<br/>Path"]
end
subgraph Docker ["DOCKER STACK"]
direction TB
SERVICE1["Service<br/>━━━━━━━━━━<br/>:port<br/>Purpose"]
end
subgraph Web ["WEB STACK"]
direction TB
API["API Server<br/>━━━━━━━━━━<br/>:port<br/>Protocol"]
FRONTEND["Frontend<br/>━━━━━━━━━━<br/>:port<br/>Technology"]
end
subgraph External ["EXTERNAL"]
direction TB
CLOUD["Cloud API<br/>━━━━━━━━━━<br/>Protocol<br/>Third-party"]
end
%% CONNECTIONS %%
MAIN -->|"spawns"| SUB
MAIN -->|"reads/writes"| DB
MAIN -->|"writes"| FILES
MAIN -->|"HTTPS"| CLOUD
SERVICE1 -->|"connects"| DB
API -->|"REST"| FRONTEND
%% CLASS ASSIGNMENTS %%
class MAIN,SUB cli;
class DB,FILES stateNode;
class SERVICE1,API handler;
class FRONTEND phase;
class CLOUD integration;
Color Legend:
| Color |
Category |
Description |
| Dark Blue |
Processes |
Local CLI and subprocess |
| Teal |
Storage |
Databases and file storage |
| Orange |
Services |
Backend services and APIs |
| Purple |
Frontend |
Web UI |
| Red |
External |
External/cloud services |
Communication Protocols
| From |
To |
Protocol |
Purpose |
| {source} |
{target} |
{protocol} |
{purpose} |
Storage Locations
| Data |
Location |
Technology |
| {data} |
{path} |
{tech} |
---
## Pre-Diagram Checklist
Before creating the diagram, verify:
- [ ] LOADED `/mermaid` skill using the Skill tool
- [ ] Using ONLY classDef styles from the mermaid skill (no invented colors)
- [ ] Diagram will include a color legend table
---
## Related Skills
- `/make-arch-diag` - Parent skill for lens selection
- `/mermaid` - MUST BE LOADED before creating diagram
- `/arch-lens-c4-container` - For container-level view
1---2name: arch-lens-deployment3description: Create Deployment/Physical architecture diagram showing infrastructure topology, process boundaries, and network communication. Physical lens answering "Where does it run?"4---56# Deployment/Physical Architecture Lens78**Cognitive Mode:** Physical9**Primary Question:** "Where does it run?"10**Focus:** Infrastructure Topology, Process Boundaries, Data Storage Locations, Network Communication1112## When to Use1314- Need to understand physical deployment15- Documenting infrastructure and processes16- Analyzing where components execute17- User invokes `/arch-lens-deployment` or `/make-arch-diag deployment`1819## Critical Constraints2021**NEVER:**22- Modify any source code files23- Include code-level details24- Show internal logic2526**ALWAYS:**27- Focus on PHYSICAL deployment28- Show process boundaries29- Include network/communication protocols30- Document storage locations31- BEFORE creating any diagram, LOAD the `/mermaid` skill using the Skill tool - this is MANDATORY3233---3435## Analysis Workflow3637### Step 1: Launch Parallel Exploration Subagents3839Spawn Explore subagents to investigate:4041**Process Boundaries**42- Find main process entry points43- Identify subprocess spawning44- Look for: main, entry_points, subprocess, process spawning, daemon processes4546**Container/Docker**47- Find containerization config48- Identify services49- Look for: Dockerfile, docker-compose.yml, container definitions, Kubernetes configs5051**Local Storage**52- Find file storage locations53- Identify database paths54- Look for: data directories, database files, storage volumes, persistent storage5556**Network Services**57- Find service definitions58- Identify ports and protocols59- Look for: port, bind, listen, server, API, endpoint, network services6061**External Services**62- Find external API calls63- Identify cloud services64- Look for: external APIs, cloud services, third-party integrations6566**Web/Frontend**67- Find frontend deployment68- Identify static file serving69- Look for: web servers, frontend builds, static assets, CDN7071### Step 2: Map Physical Topology7273| Component | Location | Technology | Port/Protocol |74|-----------|----------|------------|---------------|75| {name} | {where} | {tech} | {port/protocol} |7677**CRITICAL - Analyze Read/Write Direction:**78For EVERY process and storage location:79- **Reads from**: What does this process READ? (files, databases, APIs)80- **Writes to**: What does this process WRITE? (files, databases, APIs)81- **Network direction**: Client->Server or bidirectional?8283For storage locations:84- **Read/write storage**: Process both reads and writes (databases, state files)85- **Write-only storage**: Process writes, humans or other systems read (logs, artifacts)86- **Read-only sources**: Process reads, doesn't modify (config, external APIs)8788Label all connections with direction (reads, writes, or both)8990### Step 3: Identify Communication Paths9192- Process-to-process (IPC, subprocess)93- Network (HTTP, WebSocket, gRPC)94- File system (shared files)95- Database (connections)9697### Step 4: Create the Diagram9899Use flowchart with:100101**Direction:** `TB` for infrastructure layers102103**Subgraphs by Physical Location:**104- Developer Machine (local processes)105- Local Storage (files, DBs)106- Docker Stack (if containerized)107- Web Stack (if applicable)108- External Services (cloud, APIs)109110**Node Styling:**111- `cli` class: Main processes112- `stateNode` class: Local storage, databases113- `output` class: File artifacts114- `handler` class: Services, APIs115- `phase` class: Frontend, web UI116- `integration` class: External services117118**Connection Labels:**119- Show protocols (HTTP, subprocess, file)120- Show ports where relevant121122### Step 5: Write Output123124Write the diagram to: `temp/arch-lens-deployment/arch_diag_deployment_{YYYY-MM-DD_HHMMSS}.md`125126---127128## Output Template129130```markdown131# Deployment Diagram: {System Name}132133**Lens:** Deployment/Physical134**Question:** Where does it run?135**Date:** {YYYY-MM-DD}136**Scope:** {What was analyzed}137138## Deployment Topology139140| Component | Port | Technology | Purpose |141|-----------|------|------------|---------|142| {name} | {port} | {tech} | {purpose} |143144## Deployment Diagram145146```mermaid147%%{init: {'flowchart': {'nodeSpacing': 50, 'rankSpacing': 60, 'curve': 'basis'}}}%%148flowchart TB149 %% CLASS DEFINITIONS %%150 classDef cli fill:#1a237e,stroke:#7986cb,stroke-width:2px,color:#fff;151 classDef stateNode fill:#004d40,stroke:#4db6ac,stroke-width:2px,color:#fff;152 classDef handler fill:#e65100,stroke:#ffb74d,stroke-width:2px,color:#fff;153 classDef phase fill:#6a1b9a,stroke:#ba68c8,stroke-width:2px,color:#fff;154 classDef output fill:#00695c,stroke:#4db6ac,stroke-width:2px,color:#fff;155 classDef integration fill:#c62828,stroke:#ef9a9a,stroke-width:2px,color:#fff;156157 subgraph LocalMachine ["LOCAL MACHINE"]158 direction TB159 MAIN["Main Process<br/>━━━━━━━━━━<br/>Runtime<br/>Orchestration"]160 SUB["Subprocess<br/>━━━━━━━━━━<br/>Isolated execution"]161 end162163 subgraph LocalStorage ["LOCAL STORAGE"]164 direction TB165 DB[("Database<br/>━━━━━━━━━━<br/>Technology<br/>Location")]166 FILES["Files<br/>━━━━━━━━━━<br/>Artifacts<br/>Path"]167 end168169 subgraph Docker ["DOCKER STACK"]170 direction TB171 SERVICE1["Service<br/>━━━━━━━━━━<br/>:port<br/>Purpose"]172 end173174 subgraph Web ["WEB STACK"]175 direction TB176 API["API Server<br/>━━━━━━━━━━<br/>:port<br/>Protocol"]177 FRONTEND["Frontend<br/>━━━━━━━━━━<br/>:port<br/>Technology"]178 end179180 subgraph External ["EXTERNAL"]181 direction TB182 CLOUD["Cloud API<br/>━━━━━━━━━━<br/>Protocol<br/>Third-party"]183 end184185 %% CONNECTIONS %%186 MAIN -->|"spawns"| SUB187 MAIN -->|"reads/writes"| DB188 MAIN -->|"writes"| FILES189 MAIN -->|"HTTPS"| CLOUD190191 SERVICE1 -->|"connects"| DB192 API -->|"REST"| FRONTEND193194 %% CLASS ASSIGNMENTS %%195 class MAIN,SUB cli;196 class DB,FILES stateNode;197 class SERVICE1,API handler;198 class FRONTEND phase;199 class CLOUD integration;200```201202**Color Legend:**203| Color | Category | Description |204|-------|----------|-------------|205| Dark Blue | Processes | Local CLI and subprocess |206| Teal | Storage | Databases and file storage |207| Orange | Services | Backend services and APIs |208| Purple | Frontend | Web UI |209| Red | External | External/cloud services |210211## Communication Protocols212213| From | To | Protocol | Purpose |214|------|-----|----------|---------|215| {source} | {target} | {protocol} | {purpose} |216217## Storage Locations218219| Data | Location | Technology |220|------|----------|------------|221| {data} | {path} | {tech} |222```223224---225226## Pre-Diagram Checklist227228Before creating the diagram, verify:229230- [ ] LOADED `/mermaid` skill using the Skill tool231- [ ] Using ONLY classDef styles from the mermaid skill (no invented colors)232- [ ] Diagram will include a color legend table233234---235236## Related Skills237238- `/make-arch-diag` - Parent skill for lens selection239- `/mermaid` - MUST BE LOADED before creating diagram240- `/arch-lens-c4-container` - For container-level view