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
/autoskillit:arch-lens-deployment or /autoskillit: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
/autoskillit: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 (relative to the current working directory)
After writing the diagram file, emit a structured output line:
diagram_path = {absolute_path_to_diagram_file}
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 `/autoskillit: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
- `/autoskillit:make-arch-diag` - Parent skill for lens selection
- `/autoskillit:mermaid` - MUST BE LOADED before creating diagram
- `/autoskillit: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---5
6# Deployment/Physical Architecture Lens
7
8**Cognitive Mode:** Physical
9**Primary Question:** "Where does it run?"
10**Focus:** Infrastructure Topology, Process Boundaries, Data Storage Locations, Network Communication
11
12## When to Use
13
14- Need to understand physical deployment
15- Documenting infrastructure and processes
16- Analyzing where components execute
17- User invokes `/autoskillit:arch-lens-deployment` or `/autoskillit:make-arch-diag deployment`
18
19## Critical Constraints
20
21**NEVER:**
22- Modify any source code files
23- Include code-level details
24- Show internal logic
25
26**ALWAYS:**
27- Focus on PHYSICAL deployment
28- Show process boundaries
29- Include network/communication protocols
30- Document storage locations
31- BEFORE creating any diagram, LOAD the `/autoskillit:mermaid` skill using the Skill tool - this is MANDATORY
32
33---
34
35## Analysis Workflow
36
37### Step 1: Launch Parallel Exploration Subagents
38
39Spawn Explore subagents to investigate:
40
41**Process Boundaries**
42- Find main process entry points
43- Identify subprocess spawning
44- Look for: main, entry_points, subprocess, process spawning, daemon processes
45
46**Container/Docker**
47- Find containerization config
48- Identify services
49- Look for: Dockerfile, docker-compose.yml, container definitions, Kubernetes configs
50
51**Local Storage**
52- Find file storage locations
53- Identify database paths
54- Look for: data directories, database files, storage volumes, persistent storage
55
56**Network Services**
57- Find service definitions
58- Identify ports and protocols
59- Look for: port, bind, listen, server, API, endpoint, network services
60
61**External Services**
62- Find external API calls
63- Identify cloud services
64- Look for: external APIs, cloud services, third-party integrations
65
66**Web/Frontend**
67- Find frontend deployment
68- Identify static file serving
69- Look for: web servers, frontend builds, static assets, CDN
70
71### Step 2: Map Physical Topology
72
73| Component | Location | Technology | Port/Protocol |
74|-----------|----------|------------|---------------|
75| {name} | {where} | {tech} | {port/protocol} |
76
77**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?
82
83For 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)
87
88Label all connections with direction (reads, writes, or both)
89
90### Step 3: Identify Communication Paths
91
92- Process-to-process (IPC, subprocess)
93- Network (HTTP, WebSocket, gRPC)
94- File system (shared files)
95- Database (connections)
96
97### Step 4: Create the Diagram
98
99Use flowchart with:
100
101**Direction:** `TB` for infrastructure layers
102
103**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)
109
110**Node Styling:**
111- `cli` class: Main processes
112- `stateNode` class: Local storage, databases
113- `output` class: File artifacts
114- `handler` class: Services, APIs
115- `phase` class: Frontend, web UI
116- `integration` class: External services
117
118**Connection Labels:**
119- Show protocols (HTTP, subprocess, file)
120- Show ports where relevant
121
122### Step 5: Write Output
123
124Write the diagram to: `temp/arch-lens-deployment/arch_diag_deployment_{YYYY-MM-DD_HHMMSS}.md` (relative to the current working directory)
125
126After writing the diagram file, emit a structured output line:
127
128```
129diagram_path = {absolute_path_to_diagram_file}
130```
131
132---
133
134## Output Template
135
136```markdown
137# Deployment Diagram: {System Name}
138
139**Lens:** Deployment/Physical
140**Question:** Where does it run?
141**Date:** {YYYY-MM-DD}
142**Scope:** {What was analyzed}
143
144## Deployment Topology
145
146| Component | Port | Technology | Purpose |
147|-----------|------|------------|---------|
148| {name} | {port} | {tech} | {purpose} |
149
150## Deployment Diagram
151
152```mermaid
153%%{init: {'flowchart': {'nodeSpacing': 50, 'rankSpacing': 60, 'curve': 'basis'}}}%%
154flowchart TB
155 %% CLASS DEFINITIONS %%
156 classDef cli fill:#1a237e,stroke:#7986cb,stroke-width:2px,color:#fff;
157 classDef stateNode fill:#004d40,stroke:#4db6ac,stroke-width:2px,color:#fff;
158 classDef handler fill:#e65100,stroke:#ffb74d,stroke-width:2px,color:#fff;
159 classDef phase fill:#6a1b9a,stroke:#ba68c8,stroke-width:2px,color:#fff;
160 classDef output fill:#00695c,stroke:#4db6ac,stroke-width:2px,color:#fff;
161 classDef integration fill:#c62828,stroke:#ef9a9a,stroke-width:2px,color:#fff;
162
163 subgraph LocalMachine ["LOCAL MACHINE"]
164 direction TB
165 MAIN["Main Process<br/>━━━━━━━━━━<br/>Runtime<br/>Orchestration"]
166 SUB["Subprocess<br/>━━━━━━━━━━<br/>Isolated execution"]
167 end
168
169 subgraph LocalStorage ["LOCAL STORAGE"]
170 direction TB
171 DB[("Database<br/>━━━━━━━━━━<br/>Technology<br/>Location")]
172 FILES["Files<br/>━━━━━━━━━━<br/>Artifacts<br/>Path"]
173 end
174
175 subgraph Docker ["DOCKER STACK"]
176 direction TB
177 SERVICE1["Service<br/>━━━━━━━━━━<br/>:port<br/>Purpose"]
178 end
179
180 subgraph Web ["WEB STACK"]
181 direction TB
182 API["API Server<br/>━━━━━━━━━━<br/>:port<br/>Protocol"]
183 FRONTEND["Frontend<br/>━━━━━━━━━━<br/>:port<br/>Technology"]
184 end
185
186 subgraph External ["EXTERNAL"]
187 direction TB
188 CLOUD["Cloud API<br/>━━━━━━━━━━<br/>Protocol<br/>Third-party"]
189 end
190
191 %% CONNECTIONS %%
192 MAIN -->|"spawns"| SUB
193 MAIN -->|"reads/writes"| DB
194 MAIN -->|"writes"| FILES
195 MAIN -->|"HTTPS"| CLOUD
196
197 SERVICE1 -->|"connects"| DB
198 API -->|"REST"| FRONTEND
199
200 %% CLASS ASSIGNMENTS %%
201 class MAIN,SUB cli;
202 class DB,FILES stateNode;
203 class SERVICE1,API handler;
204 class FRONTEND phase;
205 class CLOUD integration;
206```
207
208**Color Legend:**
209| Color | Category | Description |
210|-------|----------|-------------|
211| Dark Blue | Processes | Local CLI and subprocess |
212| Teal | Storage | Databases and file storage |
213| Orange | Services | Backend services and APIs |
214| Purple | Frontend | Web UI |
215| Red | External | External/cloud services |
216
217## Communication Protocols
218
219| From | To | Protocol | Purpose |
220|------|-----|----------|---------|
221| {source} | {target} | {protocol} | {purpose} |
222
223## Storage Locations
224
225| Data | Location | Technology |
226|------|----------|------------|
227| {data} | {path} | {tech} |
228```
229
230---
231
232## Pre-Diagram Checklist
233
234Before creating the diagram, verify:
235
236- [ ] LOADED `/autoskillit:mermaid` skill using the Skill tool
237- [ ] Using ONLY classDef styles from the mermaid skill (no invented colors)
238- [ ] Diagram will include a color legend table
239
240---
241
242## Related Skills
243
244- `/autoskillit:make-arch-diag` - Parent skill for lens selection
245- `/autoskillit:mermaid` - MUST BE LOADED before creating diagram
246- `/autoskillit:arch-lens-c4-container` - For container-level view