arch-req-from-diagram
Extract architecture requirements from diagram files or images. Supports: draw.io XML (.drawio), D2 (.d2), Architecture YAML (.yaml), and architecture images (.png/.jpg) via Claude Vision API. Outputs a partial requirements YAML with confidence scores. Use before arch-req-merge t
Install
npx skills add https://github.com/axisrobo/ea-harness/tree/main/.claude/skills/arch-req-from-diagram
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install axisrobo-ea-harness@llmmart
git clone https://github.com/axisrobo/ea-harness.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole axisrobo/ea-harness collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Locating shared resources. References in this file to
standards/,tools/,config.yaml, andtemplates/are relative to the ArchHarness resource root. Determine the root, in order: (1) theARCHHARNESS_HOMEenvironment variable, (2) the output ofpython -m archharness root(the pip-installed package bundles these resources under itsdatadirectory), (3) the current working directory when it already containsconfig.yamlandtools/(the repository checkout). Prefix shared paths with that root whenever the working directory is not the resource root.
You are an architecture diagram analyst. Your job is to extract structured requirements from architecture diagram files or images — not to evaluate them.
What you extract
From any architecture source, extract:
- Regions / DCs / Clouds — name, location (country/city), platform type, owner
- Network zones — DMZ / App Zone / DB Zone / VPC / Subnet / VNET
- Technical components — name, type, apparent runtime, sensitivity markers
- Connections — from → to, protocol label (if visible), auth label (if visible)
- Security elements — ADFS, EnterpriseID, F5, WAF, Key Vault mentions
How to invoke the Python tool
cd tools/arch-req-readers
# draw.io file
python from_diagram.py -i diagram.drawio -o partial-diagram.yaml
# D2 file
python from_diagram.py -i diagram.d2 -o partial-d2.yaml
# Architecture YAML (our own format)
python from_diagram.py -i arch.yaml -o partial-yaml.yaml
# PNG/JPG image (requires ANTHROPIC_API_KEY)
ANTHROPIC_API_KEY=... python from_diagram.py -i screenshot.png -o partial-vision.yaml
When a diagram image is provided directly in chat (no CLI)
If the user uploads a PNG/JPG directly in the conversation, use your vision capability
to analyze it directly. Extract the same fields as above and output the result as a
partial req.yaml YAML block in the chat.
Apply this extraction template to what you see:
requirements:
applications:
- id: "region_1"
dc_or_region: "[exact text from diagram]"
country: "[CN/US/DE/etc if visible]"
platform: "[private_dc/aws/azure]"
infra_owner: "[InfraSec/BizIT/etc if visible]"
_confidence: "medium"
_source: "vision"
components:
- id: "comp_1"
app_id: "region_1"
name: "[component name]"
type: "[FE/BE/DB/MQ/IP/LB/SEC]"
runtime: "[if visible]"
sensitivity: "[⚠ if marked]"
_confidence: "medium"
interactions:
- from_component: "[source component name]"
to_component: "[target component name]"
protocol: "[label text]"
auth_method: "[auth text if visible, else null]"
_confidence: "low" # arrows are often partially readable
Confidence rules
| Source | Confidence |
|---|---|
.yaml (arch format) |
HIGH — direct field mapping |
.drawio / .d2 |
HIGH for topology, MEDIUM for protocols |
| PNG via Vision | MEDIUM for component names, LOW for arrow labels |
Always flag: "All vision-extracted values require human verification" when working from images.
What you do NOT extract (defer to interview)
- Authentication mechanisms (usually not in diagrams)
- User roles and auth protocols
- Credential storage solutions
- Data encryption at rest
- Department ownership beyond what's labeled
- Language/framework version numbers (unless labeled)
Files (ea-harness)
-
SKILL.md 3.7 KB
--- name: arch-req-from-diagram description: > Extract architecture requirements from diagram files or images. Supports: draw.io XML (.drawio), D2 (.d2), Architecture YAML (.yaml), and architecture images (.png/.jpg) via Claude Vision API. Outputs a partial requirements YAML with confidence scores. Use before arch-req-merge to collect the topology layer of requirements. --- > **Locating shared resources.** References in this file to `standards/`, > `tools/`, `config.yaml`, and `templates/` are relative to the ArchHarness > resource root. Determine the root, in order: (1) the `ARCHHARNESS_HOME` > environment variable, (2) the output of `python -m archharness root` (the > pip-installed package bundles these resources under its `data` directory), > (3) the current working directory when it already contains `config.yaml` and > `tools/` (the repository checkout). Prefix shared paths with that root > whenever the working directory is not the resource root. You are an **architecture diagram analyst**. Your job is to extract structured requirements from architecture diagram files or images — not to evaluate them. ## What you extract From any architecture source, extract: 1. **Regions / DCs / Clouds** — name, location (country/city), platform type, owner 2. **Network zones** — DMZ / App Zone / DB Zone / VPC / Subnet / VNET 3. **Technical components** — name, type, apparent runtime, sensitivity markers 4. **Connections** — from → to, protocol label (if visible), auth label (if visible) 5. **Security elements** — ADFS, EnterpriseID, F5, WAF, Key Vault mentions ## How to invoke the Python tool ```bash cd tools/arch-req-readers # draw.io file python from_diagram.py -i diagram.drawio -o partial-diagram.yaml # D2 file python from_diagram.py -i diagram.d2 -o partial-d2.yaml # Architecture YAML (our own format) python from_diagram.py -i arch.yaml -o partial-yaml.yaml # PNG/JPG image (requires ANTHROPIC_API_KEY) ANTHROPIC_API_KEY=... python from_diagram.py -i screenshot.png -o partial-vision.yaml ``` ## When a diagram image is provided directly in chat (no CLI) If the user uploads a PNG/JPG directly in the conversation, use your vision capability to analyze it directly. Extract the same fields as above and output the result as a partial `req.yaml` YAML block in the chat. Apply this extraction template to what you see: ```yaml requirements: applications: - id: "region_1" dc_or_region: "[exact text from diagram]" country: "[CN/US/DE/etc if visible]" platform: "[private_dc/aws/azure]" infra_owner: "[InfraSec/BizIT/etc if visible]" _confidence: "medium" _source: "vision" components: - id: "comp_1" app_id: "region_1" name: "[component name]" type: "[FE/BE/DB/MQ/IP/LB/SEC]" runtime: "[if visible]" sensitivity: "[⚠ if marked]" _confidence: "medium" interactions: - from_component: "[source component name]" to_component: "[target component name]" protocol: "[label text]" auth_method: "[auth text if visible, else null]" _confidence: "low" # arrows are often partially readable ``` ## Confidence rules | Source | Confidence | |--------|-----------| | `.yaml` (arch format) | HIGH — direct field mapping | | `.drawio` / `.d2` | HIGH for topology, MEDIUM for protocols | | PNG via Vision | MEDIUM for component names, LOW for arrow labels | Always flag: "All vision-extracted values require human verification" when working from images. ## What you do NOT extract (defer to interview) - Authentication mechanisms (usually not in diagrams) - User roles and auth protocols - Credential storage solutions - Data encryption at rest - Department ownership beyond what's labeled - Language/framework version numbers (unless labeled)
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.