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
- Run subagents in the background (
run_in_background: true is prohibited)
ALWAYS:
Arguments
/autoskillit:arch-lens-deployment [context_path]
- context_path (optional) — Absolute path to a PR context file containing new files
(★-prefixed) and modified files (●-prefixed) from the PR diff. When provided, read
this file before beginning analysis and focus the diagram on the architectural areas
affected by these specific files. When absent, explore the full CWD.
Analysis Workflow
Step 0: Read PR context (when provided)
If a context_path positional argument is present:
- Read the file at
context_path
- Extract: new files list (★-prefixed), modified files list (●-prefixed)
- Focus Step 1 exploration on the modules/components these files belong to
- Apply ★ prefix on diagram nodes representing new files/components
- Apply ● prefix on diagram nodes representing modified files/components
If no context_path is provided, skip this step and explore the full CWD in Step 1.
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: {{AUTOSKILLIT_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:
IMPORTANT: Emit the structured output tokens as literal plain text with no
markdown formatting on the token names. Do not wrap token names in **bold**,
*italic*, or any other markdown. The adjudicator performs a regex match on the
exact token name — decorators cause match failure.
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---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 `/autoskillit:arch-lens-deployment` or `/autoskillit:make-arch-diag deployment`1819## Critical Constraints2021**NEVER:**22- Modify any source code files23- Include code-level details24- Show internal logic25- Run subagents in the background (`run_in_background: true` is prohibited)2627**ALWAYS:**28- Focus on PHYSICAL deployment29- Show process boundaries30- Include network/communication protocols31- Document storage locations32- BEFORE creating any diagram, LOAD the `/autoskillit:mermaid` skill using the Skill tool - this is MANDATORY33- If the Skill tool cannot be used (disable-model-invocation) or refuses this invocation, do NOT proceed with diagram creation. Abort this step and omit the diagram from output.34- After writing the diagram file, emit the **absolute path** as a structured output35 token as your final output. Resolve the relative `temp/arch-lens-deployment/...`36 save path to absolute by prepending the full CWD:37 ```38 diagram_path = /absolute/cwd/temp/arch-lens-deployment/{filename}.md39 ```40 This token is MANDATORY — the pipeline cannot proceed without it.4142## Arguments4344`/autoskillit:arch-lens-deployment [context_path]`4546- **context_path** (optional) — Absolute path to a PR context file containing new files47 (★-prefixed) and modified files (●-prefixed) from the PR diff. When provided, read48 this file before beginning analysis and focus the diagram on the architectural areas49 affected by these specific files. When absent, explore the full CWD.5051---5253## Analysis Workflow5455### Step 0: Read PR context (when provided)5657If a `context_path` positional argument is present:581. Read the file at `context_path`592. Extract: new files list (★-prefixed), modified files list (●-prefixed)603. Focus Step 1 exploration on the modules/components these files belong to614. Apply ★ prefix on diagram nodes representing new files/components625. Apply ● prefix on diagram nodes representing modified files/components6364If no `context_path` is provided, skip this step and explore the full CWD in Step 1.6566### Step 1: Launch Parallel Exploration Subagents6768Spawn Explore subagents to investigate:6970**Process Boundaries**71- Find main process entry points72- Identify subprocess spawning73- Look for: main, entry_points, subprocess, process spawning, daemon processes7475**Container/Docker**76- Find containerization config77- Identify services78- Look for: Dockerfile, docker-compose.yml, container definitions, Kubernetes configs7980**Local Storage**81- Find file storage locations82- Identify database paths83- Look for: data directories, database files, storage volumes, persistent storage8485**Network Services**86- Find service definitions87- Identify ports and protocols88- Look for: port, bind, listen, server, API, endpoint, network services8990**External Services**91- Find external API calls92- Identify cloud services93- Look for: external APIs, cloud services, third-party integrations9495**Web/Frontend**96- Find frontend deployment97- Identify static file serving98- Look for: web servers, frontend builds, static assets, CDN99100### Step 2: Map Physical Topology101102| Component | Location | Technology | Port/Protocol |103|-----------|----------|------------|---------------|104| {name} | {where} | {tech} | {port/protocol} |105106**CRITICAL - Analyze Read/Write Direction:**107For EVERY process and storage location:108- **Reads from**: What does this process READ? (files, databases, APIs)109- **Writes to**: What does this process WRITE? (files, databases, APIs)110- **Network direction**: Client->Server or bidirectional?111112For storage locations:113- **Read/write storage**: Process both reads and writes (databases, state files)114- **Write-only storage**: Process writes, humans or other systems read (logs, artifacts)115- **Read-only sources**: Process reads, doesn't modify (config, external APIs)116117Label all connections with direction (reads, writes, or both)118119### Step 3: Identify Communication Paths120121- Process-to-process (IPC, subprocess)122- Network (HTTP, WebSocket, gRPC)123- File system (shared files)124- Database (connections)125126### Step 4: Create the Diagram127128Use flowchart with:129130**Direction:** `TB` for infrastructure layers131132**Subgraphs by Physical Location:**133- Developer Machine (local processes)134- Local Storage (files, DBs)135- Docker Stack (if containerized)136- Web Stack (if applicable)137- External Services (cloud, APIs)138139**Node Styling:**140- `cli` class: Main processes141- `stateNode` class: Local storage, databases142- `output` class: File artifacts143- `handler` class: Services, APIs144- `phase` class: Frontend, web UI145- `integration` class: External services146147**Connection Labels:**148- Show protocols (HTTP, subprocess, file)149- Show ports where relevant150151### Step 5: Write Output152153Write the diagram to: `{{AUTOSKILLIT_TEMP}}/arch-lens-deployment/arch_diag_deployment_{YYYY-MM-DD_HHMMSS}.md` (relative to the current working directory)154155After writing the diagram file, emit a structured output line:156157> **IMPORTANT:** Emit the structured output tokens as **literal plain text with no158> markdown formatting on the token names**. Do not wrap token names in `**bold**`,159> `*italic*`, or any other markdown. The adjudicator performs a regex match on the160> exact token name — decorators cause match failure.161162```163diagram_path = {absolute_path_to_diagram_file}164```165166---167168## Output Template169170```markdown171# Deployment Diagram: {System Name}172173**Lens:** Deployment/Physical174**Question:** Where does it run?175**Date:** {YYYY-MM-DD}176**Scope:** {What was analyzed}177178## Deployment Topology179180| Component | Port | Technology | Purpose |181|-----------|------|------------|---------|182| {name} | {port} | {tech} | {purpose} |183184## Deployment Diagram185186```mermaid187%%{init: {'flowchart': {'nodeSpacing': 50, 'rankSpacing': 60, 'curve': 'basis'}}}%%188flowchart TB189 %% CLASS DEFINITIONS %%190 classDef cli fill:#1a237e,stroke:#7986cb,stroke-width:2px,color:#fff;191 classDef stateNode fill:#004d40,stroke:#4db6ac,stroke-width:2px,color:#fff;192 classDef handler fill:#e65100,stroke:#ffb74d,stroke-width:2px,color:#fff;193 classDef phase fill:#6a1b9a,stroke:#ba68c8,stroke-width:2px,color:#fff;194 classDef output fill:#00695c,stroke:#4db6ac,stroke-width:2px,color:#fff;195 classDef integration fill:#c62828,stroke:#ef9a9a,stroke-width:2px,color:#fff;196197 subgraph LocalMachine ["LOCAL MACHINE"]198 direction TB199 MAIN["Main Process<br/>━━━━━━━━━━<br/>Runtime<br/>Orchestration"]200 SUB["Subprocess<br/>━━━━━━━━━━<br/>Isolated execution"]201 end202203 subgraph LocalStorage ["LOCAL STORAGE"]204 direction TB205 DB[("Database<br/>━━━━━━━━━━<br/>Technology<br/>Location")]206 FILES["Files<br/>━━━━━━━━━━<br/>Artifacts<br/>Path"]207 end208209 subgraph Docker ["DOCKER STACK"]210 direction TB211 SERVICE1["Service<br/>━━━━━━━━━━<br/>:port<br/>Purpose"]212 end213214 subgraph Web ["WEB STACK"]215 direction TB216 API["API Server<br/>━━━━━━━━━━<br/>:port<br/>Protocol"]217 FRONTEND["Frontend<br/>━━━━━━━━━━<br/>:port<br/>Technology"]218 end219220 subgraph External ["EXTERNAL"]221 direction TB222 CLOUD["Cloud API<br/>━━━━━━━━━━<br/>Protocol<br/>Third-party"]223 end224225 %% CONNECTIONS %%226 MAIN -->|"spawns"| SUB227 MAIN -->|"reads/writes"| DB228 MAIN -->|"writes"| FILES229 MAIN -->|"HTTPS"| CLOUD230231 SERVICE1 -->|"connects"| DB232 API -->|"REST"| FRONTEND233234 %% CLASS ASSIGNMENTS %%235 class MAIN,SUB cli;236 class DB,FILES stateNode;237 class SERVICE1,API handler;238 class FRONTEND phase;239 class CLOUD integration;240```241242**Color Legend:**243| Color | Category | Description |244|-------|----------|-------------|245| Dark Blue | Processes | Local CLI and subprocess |246| Teal | Storage | Databases and file storage |247| Orange | Services | Backend services and APIs |248| Purple | Frontend | Web UI |249| Red | External | External/cloud services |250251## Communication Protocols252253| From | To | Protocol | Purpose |254|------|-----|----------|---------|255| {source} | {target} | {protocol} | {purpose} |256257## Storage Locations258259| Data | Location | Technology |260|------|----------|------------|261| {data} | {path} | {tech} |262```263264---265266## Pre-Diagram Checklist267268Before creating the diagram, verify:269270- [ ] LOADED `/autoskillit:mermaid` skill using the Skill tool271- [ ] Using ONLY classDef styles from the mermaid skill (no invented colors)272- [ ] Diagram will include a color legend table273274---275276## Related Skills277278- `/autoskillit:make-arch-diag` - Parent skill for lens selection279- `/autoskillit:mermaid` - MUST BE LOADED before creating diagram280- `/autoskillit:arch-lens-c4-container` - For container-level view