Install
openclaw skills install architecture-researchResearch the architecture of a codebase or system. Reads source code, finds external context, explains design decisions, and produces ELK diagrams. Use when asked to understand, explain, or diagram how a repo/system is built.
openclaw skills install architecture-researchActivate when the user wants to:
Clone or browse the repo. Read actual code — module structure, entry points, key abstractions. Don't rely solely on READMEs.
Focus on:
Search for official docs, blog posts, conference talks, design docs, ADRs, and community discussions that explain the why behind the architecture.
Cite what you find. If you're inferring rationale (no source), say so explicitly.
Cover at least these perspectives:
| Angle | What to show |
|---|---|
| System overview | Major components and how they connect |
| Data/control flow | What happens for a key operation (e.g., a request, a build, a deploy) |
| Design decisions | What they chose, the obvious alternative, and why |
For each major angle, generate an ELK JSON graph (elkjs format), then render it to SVG so it displays inline in markdown.
{
"id": "root",
"layoutOptions": {
"elk.algorithm": "layered",
"elk.direction": "DOWN",
"elk.spacing.nodeNode": "40"
},
"children": [
{ "id": "node1", "width": 150, "height": 60, "labels": [{ "text": "Component A" }] }
],
"edges": [
{ "id": "e1", "sources": ["node1"], "targets": ["node2"], "labels": [{ "text": "calls" }] }
]
}
This skill uses the diagrams skill for rendering. Install it if you haven't:
clawhub install diagrams
Then render ELK JSON → SVG using the diagrams skill's renderer:
# Single file
node <diagrams-skill-dir>/scripts/render-elk.mjs diagram.json output.svg
# Batch: all .json files in a folder → svg/ subfolder
node <diagrams-skill-dir>/scripts/render-elk.mjs --dir <folder>
# Batch + PNG (macOS only)
node <diagrams-skill-dir>/scripts/render-elk.mjs --dir <folder> --png
Replace <diagrams-skill-dir> with the path to the installed diagrams skill directory.
Note: elkjs must be installed locally where you run the script. See the diagrams skill's SKILL.md for full setup.
Workflow for each diagram:
.json file in the research foldernode <diagrams-skill-dir>/scripts/render-elk.mjs diagram.json diagram.svg.json (source of truth) and .svg (rendered) in the research folderelk.algorithm: "layered" for flow/dependency diagramselk.algorithm: "force" for peer-relationship diagramsCreate a research folder and markdown doc:
<output-dir>/<repo-slug>-architecture/
├── prompt.md # Original question
├── architecture.md # The deliverable
├── *.json # ELK JSON source files (editable)
└── *.svg # Rendered SVG diagrams (embedded in architecture.md)
Place output wherever makes sense for your workspace (e.g., a research/ directory).
architecture.md format:
# [Repo Name] — Architecture
**Repo:** <url>
**Researched:** <date>
## Overview
<1-2 paragraph summary of what this thing is and how it's built>
## System Diagram

<Prose explanation>
## Data/Control Flow
<Pick a key operation, walk through it>

## Design Decisions
| Decision | Alternative | Rationale | Source |
|----------|------------|-----------|--------|
| ... | ... | ... | link or "inferred" |
## Key Abstractions
<The core types/interfaces/patterns that make the system tick>
## Sources
<Links to docs, posts, talks cited above>
Send a brief summary (L2 — 75-150 words) in chat with key findings. Attach or link the full doc. Offer PDF export if wanted.