Document the Radius Canvas architecture with Mermaid diagrams. Use for: generating architecture overviews, component diagrams, sequence diagrams from code, explaining how the canvas adapter and shared core work, answering architecture questions, producing entity-relationship diagrams, and distilling TypeScript/ESM code into human-readable descriptions. Writes living architecture docs to docs/architecture/. For proposing new changes with options and trade-offs, use radius-design-doc instead.
Expert skill for analyzing this repository, documenting how Radius Canvas works today, and generating accurate Mermaid diagrams grounded in actual source code. Output goes in docs/architecture/.
Architecture doc or design doc?
You want to…
Use
Explain how something works today (diagram + prose)
this skill
Propose a change, weigh options, get review sign-off
Architecture docs are descriptive and have no approval gate. Design docs are decision-making proposals that are reviewed before implementation. See docs/architecture/README.md for the distinction.
When to Use
Generate a high-level architecture overview of the system or a subsystem.
Produce component diagrams showing how packages/core, the adapters, and the plugin relate.
Create sequence diagrams that are true-to-code (reflect actual call chains).
Explain how a subsystem works in plain language (for example, how canvas pages call into the core through ports).
Answer questions about the existing architecture.
Onboard new contributors by explaining system structure.
Core Principles
Code-grounded: Every diagram and explanation must be derived from actual source code, not assumptions. Read the code before documenting it.
Progressive depth: Start with high-level overviews, then drill into details only when asked.
Accuracy over aesthetics: A correct simple diagram beats an elaborate wrong one.
Human-readable output: Distill complex code concepts into clear, jargon-minimal prose. Use diagrams to complement text, not replace it.
Procedure
Step 1: Scope the Request
Determine what the user wants documented:
Request Type
Output
"How does X work?"
Prose explanation + optional diagram
"Show me the architecture of X"
Component diagram + brief description
"Show me the flow when X happens"
Sequence diagram + step-by-step narrative
"What are the relationships between X, Y, Z?"
Entity-relationship / component diagram
"Give me an overview"
High-level system diagram + component summary
Step 2: Gather Context from Code
This is the most critical step. Do not generate diagrams from memory or assumptions.
Identify entry points: Find the canvas entry (packages/adapter-canvas/src/extension.ts), the plugin manifest (plugins/radius/plugin.json), the core's public API (packages/core/src/index.ts), and any relevant skill under plugins/radius/skills/.
Trace the call chain: Follow calls from a canvas page or action into the shared core through its ports, and out to the outside world through adapters.
Map the workspace: Understand how the pnpm workspace packages relate (pnpm-workspace.yaml, each package.json, workspace:* dependencies).
Identify key types: Find the core ports, models, and functions that define the boundary between UI-agnostic logic and adapter code.
Note patterns: Identify the ports-and-adapters (hexagonal) boundary, the canvas action/tool registration, and the build/bundle step.
Repo-Specific Investigation Techniques
Respect the core boundary: packages/core must not depend on an adapter, the Copilot SDK, HTTP, or the DOM. Anything touching the outside world goes through a port. When documenting a flow, show where it crosses that boundary.
Find port implementations: A port is defined in packages/core and implemented in an adapter (packages/adapter-canvas, packages/adapter-shared). Search for the port name across packages/adapter-* to find its concrete implementation.
Follow canvas registration: Start at packages/adapter-canvas/src/extension.ts (which calls createCanvas({ id: "radius" })), then trace how pages (pages/), the server (server.ts), and actions are wired.
Understand packaging: packages/adapter-canvas/build.mjs (esbuild) bundles the adapter and the workspace:* core into plugins/radius/dist/extension.mjs, then assembles the rest of the plugin around it. Note what is source vs. generated when documenting the build.
Read test files: *.test.ts files (for example, appgraph.test.ts, rad.test.ts) reveal expected behavior and interaction patterns.
Every node corresponds to a real package, module, type, or function in the code.
Relationships reflect actual code dependencies (imports, function calls, port implementations).
Labels use the actual names from the codebase (package names, module file names, function names).
The diagram is not overcrowded — split into multiple diagrams if >15 nodes.
Subgraphs group related components (for example, packages/core vs. packages/adapter-canvas vs. plugins/radius).
Arrow labels describe the nature of the relationship (for example, "implements port", "calls", "bundles").
Step 4: Write the Explanation
Pair every diagram with a prose explanation that:
Summarizes what the diagram shows in 1-2 sentences.
Walks through the key components and their responsibilities.
Highlights important architectural decisions or patterns (especially the core/adapter boundary).
Notes any non-obvious aspects (error handling paths, async behavior, the build/bundle step).
Writing Style
Use short paragraphs (3-4 sentences max).
Lead with the "what" and "why" before the "how".
Use bullet lists for component responsibilities.
Bold key terms on first use.
Reference specific file paths so readers can find the code.
Step 5: Save the Document
Place the finished doc in docs/architecture/ as short-name.md (living reference, no date prefix). Put supporting assets in a folder with the same name. Update the doc when the code it describes changes.
Repository Context
This is a pnpm workspace monorepo written in TypeScript and ESM. UI-agnostic product logic lives in a shared core, and adapters wire it into concrete surfaces. The core never depends on an adapter, the Copilot SDK, HTTP, or the DOM.
High-Level Components
Component
Location
Purpose
Core
packages/core/
UI-agnostic product logic: modeling, application graph, platform, and workflow generation, exposed through ports.
Canvas adapter
packages/adapter-canvas/
Wires the core into the GitHub Copilot app as the radius canvas extension (pages, server, actions).
Shared adapter
packages/adapter-shared/
Shared adapter utilities (for example, rad CLI invocation) used across surfaces.
Plugin
plugins/radius/
The Copilot plugin source: plugin.json manifest and skills/; assembled with the built canvas into dist/.
Build / packaging
packages/adapter-canvas/build.mjs
esbuild step that bundles the adapter + core and assembles plugins/radius/dist/.
Bicep generation, deployment, and infrastructure logic.
Common Patterns
Ports and adapters (hexagonal): The core defines ports; adapters implement them. Documenting a flow means showing where it crosses that boundary.
Canvas actions/tools: The canvas registers agent-callable actions alongside UI controls; skills under plugins/radius/skills/ tell the agent when to drive them.
Single bundled artifact: The plugin ships a single generated extension.mjs produced by the build; it is not hand-edited.
Changesets: Versioning and changelogs use Changesets (see RELEASING.md).
Output Format
Always structure output as:
# [Title — what is being documented]
[1-2 sentence summary]
```mermaid
[diagram]
```
## Key Components
[Bulleted list of components and responsibilities]
## How It Works
[Prose walkthrough of the flow/architecture]
## Notable Details
[Any non-obvious aspects worth calling out]
1---2name: radius-architecture-documenter3description: Document the Radius Canvas architecture with Mermaid diagrams. Use for: generating architecture overviews, component diagrams, sequence diagrams from code, explaining how the canvas adapter and shared core work, answering architecture questions, producing entity-relationship diagrams, and distilling TypeScript/ESM code into human-readable descriptions. Writes living architecture docs to docs/architecture/. For proposing new changes with options and trade-offs, use radius-design-doc instead.4---56# Architecture Documenter78Expert skill for analyzing this repository, documenting how Radius Canvas works today, and generating accurate Mermaid diagrams grounded in actual source code. Output goes in [`docs/architecture/`](../../../docs/architecture/README.md).910## Architecture doc or design doc?1112| You want to… | Use |13|----------------------------------------------------------|----------------------------------------------------|14| **Explain** how something works today (diagram + prose) | **this skill** |15| **Propose** a change, weigh options, get review sign-off | [radius-design-doc](../radius-design-doc/SKILL.md) |1617Architecture docs are descriptive and have no approval gate. Design docs are decision-making proposals that are reviewed before implementation. See [`docs/architecture/README.md`](../../../docs/architecture/README.md) for the distinction.1819## When to Use2021- Generate a high-level architecture overview of the system or a subsystem.22- Produce component diagrams showing how `packages/core`, the adapters, and the plugin relate.23- Create sequence diagrams that are true-to-code (reflect actual call chains).24- Explain how a subsystem works in plain language (for example, how canvas pages call into the core through ports).25- Answer questions about the existing architecture.26- Onboard new contributors by explaining system structure.2728## Core Principles29301. **Code-grounded**: Every diagram and explanation must be derived from actual source code, not assumptions. Read the code before documenting it.312. **Progressive depth**: Start with high-level overviews, then drill into details only when asked.323. **Accuracy over aesthetics**: A correct simple diagram beats an elaborate wrong one.334. **Human-readable output**: Distill complex code concepts into clear, jargon-minimal prose. Use diagrams to complement text, not replace it.3435## Procedure3637### Step 1: Scope the Request3839Determine what the user wants documented:4041| Request Type | Output |42|-----------------------------------------------|-----------------------------------------------|43| "How does X work?" | Prose explanation + optional diagram |44| "Show me the architecture of X" | Component diagram + brief description |45| "Show me the flow when X happens" | Sequence diagram + step-by-step narrative |46| "What are the relationships between X, Y, Z?" | Entity-relationship / component diagram |47| "Give me an overview" | High-level system diagram + component summary |4849### Step 2: Gather Context from Code5051This is the most critical step. **Do not generate diagrams from memory or assumptions.**52531. **Identify entry points**: Find the canvas entry (`packages/adapter-canvas/src/extension.ts`), the plugin manifest (`plugins/radius/plugin.json`), the core's public API (`packages/core/src/index.ts`), and any relevant skill under `plugins/radius/skills/`.542. **Trace the call chain**: Follow calls from a canvas page or action into the shared core through its ports, and out to the outside world through adapters.553. **Map the workspace**: Understand how the pnpm workspace packages relate (`pnpm-workspace.yaml`, each `package.json`, `workspace:*` dependencies).564. **Identify key types**: Find the core ports, models, and functions that define the boundary between UI-agnostic logic and adapter code.575. **Note patterns**: Identify the ports-and-adapters (hexagonal) boundary, the canvas action/tool registration, and the build/bundle step.5859#### Repo-Specific Investigation Techniques6061- **Respect the core boundary**: `packages/core` must not depend on an adapter, the Copilot SDK, HTTP, or the DOM. Anything touching the outside world goes through a **port**. When documenting a flow, show where it crosses that boundary.62- **Find port implementations**: A port is defined in `packages/core` and implemented in an adapter (`packages/adapter-canvas`, `packages/adapter-shared`). Search for the port name across `packages/adapter-*` to find its concrete implementation.63- **Follow canvas registration**: Start at `packages/adapter-canvas/src/extension.ts` (which calls `createCanvas({ id: "radius" })`), then trace how pages (`pages/`), the server (`server.ts`), and actions are wired.64- **Understand packaging**: `packages/adapter-canvas/build.mjs` (esbuild) bundles the adapter and the `workspace:*` core into `plugins/radius/dist/extension.mjs`, then assembles the rest of the plugin around it. Note what is source vs. generated when documenting the build.65- **Read test files**: `*.test.ts` files (for example, `appgraph.test.ts`, `rad.test.ts`) reveal expected behavior and interaction patterns.6667### Step 3: Generate the Diagram6869Choose the appropriate Mermaid diagram type. See [Mermaid Diagram Reference](./references/mermaid-patterns.md) for templates.7071| Situation | Diagram Type |72|-----------------------------|-----------------------------------|73| System / subsystem overview | `graph TD` (top-down flowchart) |74| Request/response flow | `sequenceDiagram` |75| Entity relationships | `classDiagram` or `erDiagram` |76| State transitions | `stateDiagram-v2` |77| Component dependencies | `graph LR` (left-right flowchart) |78| Packaging / install flow | `graph TD` with subgraphs |7980#### Diagram Quality Checklist8182- [ ] Every node corresponds to a real package, module, type, or function in the code.83- [ ] Relationships reflect actual code dependencies (imports, function calls, port implementations).84- [ ] Labels use the actual names from the codebase (package names, module file names, function names).85- [ ] The diagram is not overcrowded — split into multiple diagrams if >15 nodes.86- [ ] Subgraphs group related components (for example, `packages/core` vs. `packages/adapter-canvas` vs. `plugins/radius`).87- [ ] Arrow labels describe the nature of the relationship (for example, "implements port", "calls", "bundles").8889### Step 4: Write the Explanation9091Pair every diagram with a prose explanation that:92931. **Summarizes** what the diagram shows in 1-2 sentences.942. **Walks through** the key components and their responsibilities.953. **Highlights** important architectural decisions or patterns (especially the core/adapter boundary).964. **Notes** any non-obvious aspects (error handling paths, async behavior, the build/bundle step).9798#### Writing Style99100- Use short paragraphs (3-4 sentences max).101- Lead with the "what" and "why" before the "how".102- Use bullet lists for component responsibilities.103- Bold key terms on first use.104- Reference specific file paths so readers can find the code.105106### Step 5: Save the Document107108Place the finished doc in `docs/architecture/` as `short-name.md` (living reference, no date prefix). Put supporting assets in a folder with the same name. Update the doc when the code it describes changes.109110## Repository Context111112This is a [pnpm](https://pnpm.io/) workspace monorepo written in TypeScript and ESM. UI-agnostic product logic lives in a shared core, and adapters wire it into concrete surfaces. The core never depends on an adapter, the Copilot SDK, HTTP, or the DOM.113114### High-Level Components115116| Component | Location | Purpose |117|-------------------|-------------------------------------|-------------------------------------------------------------------------------------------------------------------|118| Core | `packages/core/` | UI-agnostic product logic: modeling, application graph, platform, and workflow generation, exposed through ports. |119| Canvas adapter | `packages/adapter-canvas/` | Wires the core into the GitHub Copilot app as the `radius` canvas extension (pages, server, actions). |120| Shared adapter | `packages/adapter-shared/` | Shared adapter utilities (for example, `rad` CLI invocation) used across surfaces. |121| Plugin | `plugins/radius/` | The Copilot plugin source: `plugin.json` manifest and `skills/`; assembled with the built canvas into `dist/`. |122| Build / packaging | `packages/adapter-canvas/build.mjs` | esbuild step that bundles the adapter + core and assembles `plugins/radius/dist/`. |123124### Key Modules in the Canvas Adapter125126| Module | Purpose |127|----------------------------------------------------|-----------------------------------------------------------------|128| `src/extension.mjs` | Canvas entry point; registers `createCanvas({ id: "radius" })`. |129| `src/pages.mjs` | Canvas page definitions (graph, environments, deployments). |130| `src/server.mjs` | Server-side canvas logic and action handlers. |131| `src/client.mjs`, `src/ui.mjs` | Client/UI rendering for the canvas surface. |132| `src/gh.mjs`, `src/ghcr.mjs` | GitHub and GHCR integration. |133| `src/bicep.mjs`, `src/deploy.mjs`, `src/infra.mjs` | Bicep generation, deployment, and infrastructure logic. |134135### Common Patterns136137- **Ports and adapters (hexagonal)**: The core defines ports; adapters implement them. Documenting a flow means showing where it crosses that boundary.138- **Canvas actions/tools**: The canvas registers agent-callable actions alongside UI controls; skills under `plugins/radius/skills/` tell the agent when to drive them.139- **Single bundled artifact**: The plugin ships a single generated `extension.mjs` produced by the build; it is not hand-edited.140- **Changesets**: Versioning and changelogs use Changesets (see `RELEASING.md`).141142## Output Format143144Always structure output as:145146````markdown147# [Title — what is being documented]148149[1-2 sentence summary]150151```mermaid152[diagram]153```154155## Key Components156157[Bulleted list of components and responsibilities]158159## How It Works160161[Prose walkthrough of the flow/architecture]162163## Notable Details164165[Any non-obvious aspects worth calling out]166````
Run npx skillmds@latest add radius-project/radius-architecture-documenter in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Document the Radius Canvas architecture with Mermaid diagrams. Use for: generating architecture overviews, component diagrams, sequence diagrams from code, explaining how the canvas adapter and shared core work, answering architecture questions, producing entity-relationship diagrams, and distilling TypeScript/ESM code into human-readable descriptions. Writes living architecture docs to docs/architecture/. For proposing new changes with options and trade-offs, use radius-design-doc instead. It is listed under Web & Frontend on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
radius-project (@radius-project) published this skill. Their other Agent Skills are listed on their SkillMD profile.