PluginWorks in Claude CodeCurrent
Miro
Secure access to Miro boards. Enables AI to read board context, create diagrams, and generate code with enterprise-grade security.
0
Try it
See what this would do for you. No sign-up needed.
Install in Claude Code
Run these in Claude Code, in order. The first adds the marketplace, the second installs the plugin.
Step 1
/plugin marketplace add anthropics/claude-plugins-official
Step 2
/plugin install miro@claude-plugins-official
Review commands before running them. Promptu never runs code on your machine or pushes changes to your repo.
What's inside
3 skills
- miro-code-explain-on-board
- miro-code-review
- miro-code-spec
1 MCP server
Security scan
Flagged
Promptu's text scan flagged something in this plugin. Read its files before you install it.
credential-access in skills/miro-code-review/SKILL.md:30
Details
# Miro Plugin
Secure access to Miro boards. Enables AI to read board context, create diagrams, and generate code with enterprise-grade security.
## Components
| Type | Details |
|--------|---------|
| Skills | `miro-code-explain-on-board`, `miro-code-review`, `miro-code-spec` |
| MCP | Miro MCP server (`https://mcp.miro.com/`) |
## Installation
1. Ensure Miro MCP is configured (OAuth).
2. Enable this plugin in your AI tool settings.
## Usage
Ask Claude in natural language with a Miro board URL — the relevant skill loads automatically. For example:
- *"Explain this codebase on `https://miro.com/app/board/...`"* → `miro-code-explain-on-board`
- *"Review PR 123 on `https://miro.com/app/board/...`"* → `miro-code-review`
- *"Extract specs from `https://miro.com/app/board/...`"* → `miro-code-spec`
Creating content on a board — diagrams, documents, tables, stickies, standalone formats — needs no skill. Ask for it directly and the Miro MCP server's own tools handle it, including the authoring guidance they load on demand.
## License
MIT
## skills/miro-code-explain-on-board/SKILL.md
---
name: miro-code-explain-on-board
description: Use when the user wants to explain or visualize a codebase on a Miro board — produces a minimal, notation-correct set of architecture / structure / behavior diagrams (flowchart, UML class, UML sequence, ERD) plus a short companion document, grounded in real repo artifacts.
---
# Explain a Codebase on a Miro Board
You are a senior software engineer and visual architect. Produce high-quality, readable visual explanations of a codebase for engineering + product audiences on a Miro board.
Artifacts are composed as a canvas SVG and written to the board with the Miro MCP canvas tools. Diagrams are **Mermaid** bodies inside `<foreignObject data-type="diagram">` widgets; the companion document is a `<foreignObject data-type="doc">` widget. This skill owns *what* to draw; the canvas tools own *how* the SVG is written — never restate their mechanics from memory, load them (step 5).
**Artifact-first:** cite repo symbols (files / modules / types) only when known. Do NOT invent. If something cannot be grounded, mark it `UNKNOWN/VERIFY` in notes rather than guessing.
## 0. Inputs
1. **Board URL.** If missing, ask. Required to place artifacts. To target a specific frame, the URL may include `?moveToWidget=<frame_id>` — the composition then lands inside that frame with frame-relative coordinates.
2. **What to explain.** A repo, subsystem, or specific question. If unclear, ask for scope before analyzing.
## Core diagramming principles
Apply these throughout. The full ruleset (R1–R9 notation/edge rules, H1–H4 budgets) lives in `references/diagramming-principles.md` — **read it before drafting.** The essentials:
- **Separate views, one question per diagram (R1/R2).** Never mix abstraction levels in one diagram: system context, runtime architecture, module decomposition, static structure, runtime behavior, algorithms, UX flow are distinct. Split when dense.
- **Notation must match semantics (R3).** UML class = real code types with members. UML sequence = one concrete time-ordered scenario. ERD = persistent entities/tables. Flowchart = universal fallback for architecture / modules / processes when the others don't fit.
- **Typed edges only (R4/R8).** Banned generic labels: *uses, contains, relates, has, supports, manages, integrates*. Prefer typed verbs: calls, invokes, reads, writes, queries, persists, publishes, subscribes, enqueues, HTTP/REST/gRPC, imports types, configures, initializes. If you can't ground the relation, label it `UNKNOWN` + add a verify note.
- **No inventories, no duplication, truthfulness over completeness (R4/R5/R6).** Every diagram adds unique value and answers a real question.
- **5-second scan (H1).** ~10–15 nodes per diagram (split at >15, MUST split at >20). Target ~4–6 diagrams total. Sequence: ~5–8 lifelines, ~12–20 messages. Class: ~3–5 high-signal members each. ERD overview: PK/FK/UQ + 2–4 distinguishing fields, note omissions.
## Workflow
### 1. Analyze the repo — extract candidate views (no rendering yet)
Identify, as available:
- **Runtime units:** apps / services / jobs / workers, datastores, external systems
- **Code structure:** modules / packages / bounded contexts
- **Domain model:** key entities / types
- **Behaviors:** request lifecycles, pipelines, events, background jobs
- **Algorithms:** localized control flow worth visualizing
Keep candidate views separate (R1).
### 2. Design the minimal diagram set (PLAN) — announce it in chat
Produce a diagram plan and state it before creating anything, so the user can redirect. For each diagram:
- **id** (D1, D2, …) and **title**
- **audience** (eng / product / both)
- **question it answers** (explicit, one question)
- **scope:** included / excluded
- **notation:** flowchart / uml_class / uml_sequence / entity_relationship
- **edge semantics** (one line — required for flowchart): e.g. "compile-time dependencies", "runtime calls", "data reads/writes"
- **key elements** that must appear
- optionally 1–3 **code anchors** (file/module/function) for human navigation
Keep it the minimal set that conveys core understanding (R2/R5); prefer several small diagrams over one mega-diagram (R7).
Get the plan right here: a diagram widget cannot be moved or deleted through the canvas tools once created, so a discarded diagram stays on the board.
### 3. Draft each diagram (notation-bound, format-free)
Draft content consistent with the chosen notation's semantics, using typed edges. Add `UNKNOWN/VERIFY` notes where needed. Do not write Mermaid yet.
### 4. Pre-compilation checks (MANDATORY, before writing any Mermaid)
- **Split check:** any draft >15 elements → split into "Overview" + "Deep dive"; >20 → MUST split.
- **Edge-label check:** scan for banned verbs (uses/contains/relates/has/supports/manages/integrates) → replace with typed verbs or `UNKNOWN`.
- **Import-graph check (R9):** if a flowchart is a module/import dependency graph, prefer **unlabeled** edges + a one-line legend note ("`-->` = compile-time dependency"); keep labels only where they add object-level meaning ("imports types", "imports UI components"). Containment is a cluster/subgraph or note — never a "contains" edge.
- **Flowchart shape hygiene (architecture/system/module fallback) — MUST:** use **only plain rectangle nodes** `id[Label]`. Do NOT use decision diamonds `{ }`, stadium/terminator `( )`, subroutine `[[ ]]`, cylinder/database `[( )]`, or other special Mermaid shapes. Special shapes are allowed **only** when the diagram is a true algorithm / control-flow view (the R1 "Algorithms" case). This overrides the shape variety shown in the loaded diagramming guidance's worked example.
- **ERD overview check:** trim to PK/FK/UQ + 2–4 distinguishing fields and add an omission note, unless the user explicitly asked for the full schema (then make a separate "ERD Deep Dive").
### 5. Load the canvas guidance
Before composing anything, load two pieces of guidance from the Miro MCP server: first the canvas composer guidance (the SVG board format), then the diagramming format guidance for the notation you are drawing — `flowchart`, `entity_relationship`, `uml_class`, or `uml_sequence`. Load the composer guidance once per conversation, and the diagramming guidance once per distinct notation in your plan, reused across every diagram of that type. Both tools state their own prerequisites and ordering; follow what they say.
The loaded guidance is authoritative for Mermaid escaping, color contract, and widget mechanics. Follow it over anything remembered: in particular, arrows inside a diagram body are XML-escaped (`-->`, not `-->`), and a raw `&`, `<`, or `>` anywhere in the SVG fails the whole request.
Compile the already-final drafts from step 3 into valid Mermaid (target Mermaid 10 syntax). Do **not** change diagram intent during compilation. Apply the guidance's coloring conventions to aid the 5-second scan.
**Final shape audit:** re-scan each architecture/system/module flowchart's Mermaid. If it contains any non-rectangle shape syntax (`{ }`, `( )`, `[[ ]]`, `[( )]`, `> ]`, etc.) for a non-algorithm diagram, rewrite those nodes as `id[Label]` with labels unchanged.
### 6. Compose and create
Build **one** SVG composition holding every diagram plus the companion doc, and send it with the canvas create tool in a single call.
- One `<foreignObject data-type="diagram">` per diagram, with `data-title` set to the title from the plan and the compiled Mermaid as the body.
- The board fixes every diagram widget at 1600x900 regardless of what you author, so lay them out on that pitch — e.g. a row every 1600 + gap in x, a new row every 900 + gap in y — in scan order, left to right. Overlapping placements are the most common failure here.
- Place the companion doc (step 7) in the same composition, to the left of or above the first diagram.
Then run the reflow loop the composer guidance requires: when the response reports changed dimensions, inspect those widgets in `result_svg` and reposition the affected widgets with the canvas update tool until spacing is clean. Iterate from the latest `result_svg` — edit it in place and feed it back; never regenerate the SVG from scratch and never transcribe `data-miro-id` values from memory.
To revise a diagram after review, resend that widget with its `data-miro-id` and the new Mermaid body through the same update tool. A diagram widget can't be moved or deleted this way, and an unchanged one is skipped — so only resend a diagram whose source or title actually changed. Do not alter meaning when sending; if a diagram fails, report the error with the offending Mermaid as-is.
### 7. Companion document
One short `<foreignObject data-type="doc">` (markdown body, starts with an H1) to help humans interpret the set: what each diagram answers, coverage and assumptions, any `UNKNOWN/VERIFY` items, and what to inspect next. Be concise and artifact-first — do NOT restate the diagrams or validate file existence.
Make the index of diagrams real deep-links rather than dead text: once the diagrams have `data-miro-id`s in `result_svg`, link each title as `<board-url>?moveToWidget=<data-miro-id>` so a reader can jump straight to it. That needs the ids, so write the doc body in the create call with the titles as plain text, then patch in the links on the following update call.
## Output
Report in chat:
1. Link to the board (or frame, if `moveToWidget` was provided).
2. The diagrams created (id, title, notation) and the companion doc.
3. Any `UNKNOWN/VERIFY` assumptions worth confirming.
## References
- `references/diagramming-principles.md` — the full R1–R9 / H1–H4 ruleset. Read before drafting (step 3).
## skills/miro-code-review/SKILL.md
---
name: miro-code-review
description: Use when the user wants to create a visual code review on a Miro board from a pull/merge request (GitHub, GitLab, or any forge), local uncommitted changes, or a branch comparison — produces a file-changes table, summary/architecture/security docs, and architecture diagrams, then links them back from the PR/MR.
---
# Visual Code Review
Generate a comprehensive visual code review on a Miro board from a pull/merge request, local changes, or a branch comparison. Includes architecture analysis, security review, and optionally enriches with enterprise documentation. After the artifacts are created, link them back from the PR/MR description so reviewers can find them without leaving their forge.
The user provides a Miro board URL plus one source: a PR/MR number, `owner/repo#number` (or `group/project!number`), a full PR/MR URL, the keyword "local changes", or a branch name to compare against the default branch. The skill is platform-agnostic: it detects the forge from the URL or the configured git remote and uses whichever CLI is available locally.
## Workflow
### 1. Identify the source from the user's request
Determine the source type and infer the platform from the URL or configured git remote:
- A bare number → PR/MR in the current repo (infer the platform from the configured git remote: `git remote get-url origin`)
- `owner/repo#number` (or `group/project!number` for GitLab-style) → PR/MR in an external repo on the same platform as the current remote, unless a host is given
- A full URL → extract host, owner/group, repo/project, and PR/MR number from the URL; the host determines the platform
- "local changes" / uncommitted work → local diff only, no PR
- A branch name → local diff against the default branch (`main` or whatever the remote shows as default)
#### Tool selection
Pick the CLI based on what's installed and what the source points at. Do not assume `gh`. Run `command -v <cli>` to check availability before invoking:
- GitHub URLs / `github.com` remote → `gh` CLI if available
- GitLab URLs / `gitlab.com` or self-hosted GitLab → `glab` CLI if available
- If no first-party CLI is available for the detected platform, fall back to authenticated REST via `curl` using whatever credentials the user already has configured (e.g. `~/.netrc`, env var tokens like `$GITHUB_TOKEN`, `$GITLAB_TOKEN`)
- For local / branch-comparison sources, plain `git` is sufficient — no platform CLI needed
State the detected platform and tool in chat output before proceeding.
### 2. Extract Changes
Fetch two things, regardless of platform:
1. **Metadata**: title, description/body, author, list of changed files with additions/deletions per file
2. **Unified diff** of the change
Use whichever CLI matches the platform detected in §1; the JSON/text shape will differ between forges — normalize fields downstream.
**GitHub example (`gh`):**
```bash
# Current repo
gh pr view $PR_NUMBER --json title,body,author,files,additions,deletions
gh pr diff $PR_NUMBER
# External repo
gh pr view $PR_NUMBER --repo $OWNER/$REPO --json title,body,author,files,additions,deletions
gh pr diff $PR_NUMBER --repo $OWNER/$REPO
```
**GitLab example (`glab`):**
```bash
# Current project
glab mr view $MR_NUMBER -F json
glab mr diff $MR_NUMBER
# External project
glab mr view $MR_NUMBER -R $GROUP/$PROJECT -F json
glab mr diff $MR_NUMBER -R $GROUP/$PROJECT
```
**REST fallback (any platform):** issue an authenticated `curl` to the platform's REST endpoint for the PR/MR and its diff. Use the user's configured token (`$GITHUB_TOKEN`, `$GITLAB_TOKEN`, etc.) and pass `Accept: application/vnd.github.v3.diff` (or platform equivalent) for the diff.
**For Local Changes:**
```bash
git status --porcelain
git diff HEAD
```
**For Branch Comparison:**
```bash
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
git log $DEFAULT_BRANCH..HEAD --oneline
git diff $DEFAULT_BRANCH...HEAD
```
#### Determine the source-link base URL
Capture once and reuse for every file reference in §5 (table cells, document bullets, diagram labels). Pin links to the head SHA so they survive force-pushes. Record:
- `LINK_HOST`, `LINK_OWNER`/`LINK_REPO` (or `LINK_GROUP`/`LINK_PROJECT`) — from §1
- `LINK_SHA` — PR/MR head commit SHA (fall back to `git rev-parse HEAD` for local/branch sources)
- `LINK_BASE_SHA` — base commit SHA (PR/MR target tip, or `git merge-base` for branch comparisons); required by §5 "Showing change". If unreachable, skip "before" diagrams and announce once in chat.
- `LINK_TEMPLATE` — host-shaped blob URL with a `{path}` placeholder and optional `#L<start>-L<end>` anchor. For **no-remote sources** (`local changes` or a branch with no remote/PR) set it to `""` and render plain paths — never invent URLs.
State the chosen template in chat before creating artifacts. See `references/source-links.md` for the per-platform SHA-fetch commands, URL templates by forge, and the no-remote / unreachable-base handling.
### 3. Analyze Changes
For each changed file, determine:
**Basic Analysis:**
- **Status**: Added, Modified, or Deleted
- **Change Summary**: Brief description combining what changed and review points
- **Risk Level**: See risk assessment below
**Architecture Analysis:**
- New components or modules introduced
- Dependency changes (new imports, package updates)
- Interface/API modifications
- Pattern changes (design patterns introduced or violated)
- Breaking changes requiring consumer updates
**Security Analysis:**
- Input validation and sanitization
- Authentication/authorization changes
- Sensitive data handling (logging, storage)
- Injection vulnerabilities (SQL, XSS, command)
- Cryptography usage
- Configuration security
### 4. Risk Assessment
| Risk Level | Criteria |
|------------|----------|
| **High** | Security-sensitive, auth/authz, database migrations, core business logic, breaking API changes, cryptography |
| **Medium** | API changes, configuration, shared utilities, new dependencies, data model changes |
| **Low** | Tests, documentation, styling, localization, internal refactoring |
### 4.5 Triage: decide what (if anything) to create
Every artifact must earn its place. Before doing any creation work, decide whether the PR is worth visualizing at all and which artifact types would actually help a reviewer.
**Bail-out rule.** If **all** of the following hold, create no Miro artifacts and report only in chat:
- ≤ 2 files changed, AND
- < 20 lines changed (additions + deletions combined), AND
- No file marked **High** risk in §4, AND
- No security-sensitive paths touched (auth, crypto, config, migrations).
In that case, the entire skill output is a single chat message of the form:
> PR is trivial (N files, ±M lines, no high-risk areas). Skipping Miro visualization — a board would not add review value. PR/MR description was not modified.
Skip §5 and §6 entirely.
**Value gate (per artifact).** When the bail-out does not apply, still only create an artifact if it tells a reviewer something the diff itself does not already make obvious:
- **Table** — create when ≥ 3 files changed *or* mixed risk levels exist. For 1–2 file PRs that don't bail out, skip the table.
- **Summary doc** — create when the PR has non-trivial intent that isn't already captured in the PR title/body, OR when ≥ 2 high-risk items need callouts. Skip if it would just paraphrase the PR description.
- **Architecture doc** — create only if structural changes are detected (new modules, modified public interfaces, dependency changes, breaking changes). Skip otherwise.
- **Security doc** — create only when security-sensitive paths are touched (see §3 "Security Analysis"). Never create as a checklist-only artifact.
- **Diagram** — create only when the change involves multi-component flow, control/data path changes, or structural relationships that are hard to grasp from the diff. Render as a **side-by-side before/after pair** by default (see §5 "Showing change"); use a **single annotated "after" diagram** only when the change is purely additive and touches ≤ 3 elements. Explicitly skip diagrams that would be a single node, two nodes with one arrow, or a literal restatement of the diff.
**Announce the plan in chat** before creating anything, e.g.:
> Plan: 1 table, 1 summary doc, no diagrams (changes are localized to a single function).
This makes the triage visible and lets the user redirect before any board content is created.
### 5. Create Miro Board Content
**Principle:** every artifact must earn its place. If an artifact would not help a reviewer understand the PR faster than the diff alone, do not create it. See §4.5 for the triage rules.
**Scale content *up to* these caps based on PR size, and apply the §4.5 value gates — fewer artifacts is fine.**
#### Linking conventions
Every file reference produced in §5 must be a clickable hyperlink to the source platform when a base URL is available. Use the `LINK_TEMPLATE` and `LINK_SHA` captured in §2.
- **When `LINK_TEMPLATE` is set** (PR/MR or branch with a known remote): build the URL by substituting the file `{path}`. Add a line anchor `#L<start>-L<end>` when calling out a specific hunk (high-risk files, security findings, architecture callouts). Resolve start/end from the diff hunks captured in §2 (`@@ -a,b +c,d @@`, use the new-file range). Skip the anchor if the reference spans multiple non-contiguous hunks.
- **When `LINK_TEMPLATE` is empty** (`local changes` or no remote): render every file reference as a plain path. Do not invent URLs.
Per-artifact rules:
- **Table → File column**: put the full URL as the cell content. Miro renders URLs in text cells as clickable links. With no remote, put the plain path.
- **Documents**: use markdown links — `[path/to/file.ts](url)` for whole-file references and `[path/to/file.ts:42-58](url#L42-L58)` for hunk references. Apply this in *every* file mention (Overview, Key Changes, High-Risk Areas, Architecture > New Components / Modified Interfaces, Security > Security-Sensitive Changes, etc.).
- **Diagrams**: keep node labels as plain paths — the Miro diagram tool does not document clickable nodes. When a node corresponds to a single source file, append the URL as a second line in the node label so a reader can copy it.
**Positioning:**
Prefer laying artifacts out in a single row so the reviewer can scan them left-to-right. Pass placement to the Miro MCP tools per their schemas.
#### Scaling Guidelines
| PR Size | Files | LOC (±) | Documents | Diagrams |
|---------|-------|---------|-----------|----------|
| Trivial | 1–2 | < 20 | none (bail out per §4.5) | none |
| Small | 1–5 | < 100 | 0–1 summary | 0–1 flow |
| Medium | 6–15 | < 500 | 1–2 (summary + deep-dive if needed) | 1–3 |
| Large | 16–30 | < 1500 | 2–3 (summary + architecture + security if applicable) | 2–4 |
| Very Large | 30+ | ≥ 1500 | 3+ (by subsystem) | 3+ |
> A side-by-side before/after pair counts as **one** diagram for the budgets above — the column limits conceptual artifacts, not raw board widgets.
---
#### File Changes Table
Create first (appears at board center). Using the Miro MCP table tool, create a table with four columns in this order:
1. **Status** — a fixed-set column with values *Added*, *Modified*, *Deleted*, color-coded green / orange / red respectively.
2. **File** — a text column containing the full source URL built per §5 "Linking conventions" (Miro renders URLs in text cells as clickable). Use the plain path when no remote URL is available.
3. **Change** — a text column with a brief summary of changes and key review points.
4. **Risk** — a fixed-set column with values *Low*, *Medium*, *High*, color-coded green / orange / red respectively.
Pick the column types and option shape from the table tool's live schema.
For very large PRs (30+ files), create separate tables:
- High-risk changes table
- Standard changes table
---
#### Documents
**Document 1: Main Summary** — create when the §4.5 value gate for the summary doc passes. Skip if the PR description already covers the same ground.
**Document 2: Architecture Analysis** — create only when the §4.5 architecture-doc value gate passes (the diff introduces new modules, modifies public interfaces, changes dependencies, or adds breaking changes). Skip otherwise, even on Medium/Large PRs.
**Document 3: Security Analysis** — create only when security-sensitive paths are touched (auth, crypto, config, migrations, input handling). Never create as a checklist-only artifact on a PR with no security-relevant diff.
**Additional Documents** — for Very Large PRs, create per-subsystem documents in the same row ("API Changes Analysis", "Database Migration Review", "UI/Frontend Changes", etc.).
See `references/document-templates.md` for the full markdown template of each document.
---
#### Diagrams
Create diagrams based on the type of changes. Position after the last document (continue x increments of 800).
##### Showing change: before/after vs. annotated
Every diagram must make the *delta* visible at a glance, not just the post-change state.
- **Default: side-by-side before/after pair.** Build two diagrams of the same type with the same DSL conventions and place them adjacently on the same y-row. Build the "before" from the `LINK_BASE_SHA` revision (use `git show $LINK_BASE_SHA:path` when the unified diff doesn't carry enough surrounding structure), and the "after" from `LINK_SHA`.
- **Single annotated "after" diagram instead** when *all* of these hold:
- The change is purely additive (no deleted files, no removed classes/components, no removed edges in the relevant subsystem), AND
- The additions do not rearrange existing relationships (no rewired callers, no moved responsibilities), AND
- There are ≤ 3 new nodes/edges to mark.
- If `LINK_BASE_SHA` is unreachable (shallow clone, history pruned), degrade every pair to a single annotated "after" diagram and reuse the chat announcement from §2.
##### Marking convention
Primary signal is the **label prefix** (per-element styling is not guaranteed by the Miro Mermaid renderer): `[ADDED]` (after diagram only), `[REMOVED]` (before diagram only), `[UPDATED]` (both diagrams, prefix in the after only); unmarked elements are unchanged context. Prefixes alone must be self-sufficient. Additionally emit Mermaid `classDef` directives as a best-effort colour layer.
See `references/diagram-conventions.md` for the full prefix semantics and the `classDef` block to emit.
**Diagram Selection Guide:**
| Change Type | Diagram Type | Pattern | Purpose |
|-------------|--------------|---------|---------|
| Feature addition (purely additive) | flowchart | Single annotated (after) | Show new components and how they wire in |
| Refactoring | class diagram | Side-by-side before/after | Structural rearrangement is the whole point |
| API/integration change | sequence diagram | Side-by-side before/after | Flow shape changes |
| DB migration / schema change | ER diagram | Side-by-side before/after | Schema delta is the focus |
| Bug fix | flowchart | Single annotated (after) | Mark the fix point in the flow |
| Data pipeline restructure | flowchart | Side-by-side before/after | Data flow shape changes |
| Mixed / large refactor | per-subsystem | Side-by-side per subsystem | One pair per affected boundary |
**Diagram Positions:**
Place a side-by-side pair adjacent to each other so the delta is visible at a glance. Otherwise let the row layout from §5 "Positioning" carry — pass placement to the Miro MCP diagram tool per its schema.
| Diagram (or pair) | When to create |
|-------------------|----------------|
| Main flow/architecture pair | Always |
| Component relationships pair | Medium+ PRs with structural change |
| Sequence/interaction pair | API/integration changes |
| ER pair | Data pipeline / schema changes |
| Single annotated (additions only) | Purely additive change, ≤ 3 new elements |
**Each diagram should show:**
- Affected components/modules (highlighted)
- Data/control flow through changed code
- Dependencies between changed files
- Trust boundaries (for security-relevant changes)
- Where a node corresponds to a single source file, append its URL on a second line of the label so a reader can copy it (paths only — diagram nodes are not clickable). Skip the URL when no remote is available. Use `LINK_BASE_SHA` in URLs on *before* diagrams; use `LINK_SHA` on *after* diagrams.
- The change markers from §5 "Marking convention" applied to every modified/added/removed element — the diagram or pair must make the delta visible at a glance.
### 6. Post link back to PR/MR
Once the artifacts are created, surface the link from the PR/MR itself so reviewers see it without leaving their forge.
**Skip this step entirely** when:
- The source is "local changes"
- The source is a branch with no associated open PR/MR
In those cases the link is reported only in chat output (see §Output below).
Append a delimited block (reusing the same `<!-- miro-pr-docs:start -->` … `<!-- miro-pr-docs:end -->` markers each run) to the existing description, replacing it in place if already present and never overwriting the user-authored portion. Use the same CLI selection from §1 to read, splice, and write the body back; if editing fails for lack of permission, post the block as a PR/MR comment instead and note it in chat.
See `references/pr-linking.md` for the exact block format, link rules, idempotency rules, and per-platform (`gh`/`glab`/REST) commands.
## Output
If the §4.5 bail-out applied, the entire output is the trivial-PR chat message — no board link, no description update, nothing else.
Otherwise, after completion provide:
1. Link to the Miro board (or frame, if `moveToWidget` was provided)
2. Confirmation that the PR/MR description was updated, or that we left a comment as a fallback, or that the post step was skipped because the source was local / branchless
3. Summary of elements created (X docs, Y diagrams as N pairs + M single annotated, Z table rows). Mention base revision `<short LINK_BASE_SHA>` and head revision `<short LINK_SHA>` in this chat summary only — do **not** place these SHAs on the Miro board. Also note which artifact types were intentionally skipped per §4.5, with a one-line reason.
4. High-risk files requiring careful review
5. Security findings (if any critical/high)
6. Architecture concerns (if any breaking changes)
## References
- `references/risk-assessment.md` — detailed scoring criteria
- `references/review-patterns.md` — review patterns
- `references/source-links.md` — per-platform SHA-fetch commands and blob-URL templates for §2
- `references/diagram-conventions.md` — diagram change-marking prefixes and the Mermaid `classDef` block (§5)
- `references/document-templates.md` — full markdown templates for the summary, architecture, and security documents (§5)
- `references/pr-linking.md` — block format, link/idempotency rules, and per-platform commands for posting the link back to the PR/MR (§6)
- `references/background.md` — review philosophy, visual-review benefits, the artifact-selection table, and the board layout reference
## skills/miro-code-spec/SKILL.md
---
name: miro-code-spec
description: Use when the user wants to extract a Miro board's specs (documents, diagrams, prototypes, tables, frames, images) to local `.miro/specs/` files for AI-assisted planning and implementation — accepts a board URL or single-item URL.
---
# Extract Miro Specs
Extract specification content from a Miro board or item and save to `.miro/specs/` so it can be referenced during planning and implementation without repeated API calls.
The user provides one URL: a board URL (extract all spec items) or an item URL with a `moveToWidget` / `focusWidget` parameter (extract that single item). Miro MCP must be available.
## Workflow
### 1. Identify the URL from the user's request
- If the user provided a Miro URL, use it.
- If not, ask the user for one.
### 2. Determine URL Scope
Decide whether the user gave a **board URL** (extract every spec item on the
board) or a **single-item URL** — i.e. a board URL with a `moveToWidget` or
`focusWidget` query parameter naming one item. Pass the URL through to Miro
MCP as-is — MCP handles the URL.
### 3. Check/Prepare Output Directory
- Check if `.miro/specs/` exists and has content.
- If it has content, ask the user:
- "The `.miro/specs/` directory already contains files. What should I do?"
- Options:
- "Clean and extract fresh" — remove existing content
- "Add to existing" — keep existing files
- "Cancel" — abort operation
- Create the directory structure if needed:
```
.miro/specs/
├── documents/ # Markdown documents
├── diagrams/ # Diagram descriptions
├── prototypes/ # Containers (Markdown) and screens (HTML)
├── tables/ # Table JSON data
├── frames/ # Frame summaries
├── other/ # Unknown types (slides, etc.)
└── images/ # Extracted images
```
### 4. Discover Items to Extract
**For Board URLs:**
- Use the Miro MCP board-overview tool with the board URL.
- Each returned item includes its type, URL (with `moveToWidget` parameter), and title.
- Collect all items with their types, URLs, and titles for extraction.
**For Item URLs:**
- Create a single-item URL list.
### 5. Create Tasks for Extraction (MANDATORY)
🚨 **THIS STEP IS MANDATORY — DO NOT SKIP**
Create an internal checklist item for EVERY item discovered so nothing is missed.
**Task structure:**
- **Subject:** "Extract [type]: [title]" (use title if available from the board-overview tool, otherwise use id)
- **Description:** Include item type, id, URL, and target file path
- **activeForm:** "Extracting [type]: [title]" (use title if available, otherwise use id)
**Example with title:**
```
Subject: "Extract document: Product Requirements"
Description: "Extract document item 3458764612345 from board. Save to .miro/specs/documents/3458764612345.md"
activeForm: "Extracting document: Product Requirements"
```
**Example without title:**
```
Subject: "Extract diagram: 3458764612347"
Description: "Extract diagram item 3458764612347 from board. Save to .miro/specs/diagrams/3458764612347.md"
activeForm: "Extracting diagram: 3458764612347"
```
**⚠️ IMPORTANT: Task Count by Type**
Create tasks according to this exact breakdown:
- Each document → **1 task**
- Each diagram → **1 task**
- Each prototype container → **1 task**
- Each prototype screen → **3 tasks** (HTML + Images + URLs)
1. "Get and save HTML: [title]"
2. "Extract images: [title]"
3. "Update image URLs: [title]"
- Each frame → **1 task**
- Each table → **1 task**
- Each other item → **1 task**
- Final step → **1 task** "Finalize metadata index"
**Critical:** Prototype screens are NOT 1 task, they are 3 tasks. If you create only 1 task per screen, images will be missed.
**Naming Convention:**
- Use titles from the board-overview tool for readability
- Use item IDs in file paths for uniqueness and filesystem safety
**This task creation step ensures:**
✓ All items are tracked
✓ Nothing gets skipped
✓ Progress is visible
✓ Extraction workflow is structured
### 6. Initialize Metadata Index
Create `.miro/specs/index.json` with initial structure:
```json
{
"board_url": "original board URL",
"extracted_at": "ISO timestamp",
"items": [],
"images": [],
"summary": {
"total_items": 0,
"by_type": {},
"total_images": 0
}
}
```
This file will be updated progressively as each item is extracted.
### 7. Extract Content from Each Item
**CRITICAL: You MUST write all content received from MCP tools to the file system immediately. Do not skip the file-writing step.**
**Workflow for each item (with task tracking and progressive index updates):**
**For most items (documents, diagrams, containers, frames, tables, other):**
1. Update your internal checklist to mark the item's entry as `in_progress`
2. Call the appropriate MCP tool to get content
3. **IMMEDIATELY** write the content to disk
4. Read current `index.json`, add this item to the items array, then write the updated `index.json`
5. Update your internal checklist to mark the item's entry as `completed`
**For prototype screens (MANDATORY subagent workflow):**
- Launch a subagent for each screen to avoid context bloat
- The subagent performs all 3 steps: Get HTML → Extract images → Update URLs
- Large HTML content stays in subagent context, never enters main context
**Document items:**
- Call the appropriate Miro MCP item-retrieval tool with the item URL
- **MUST write** content to `.miro/specs/documents/<board item ID>.md`
- Extract title from content if available
- Update `index.json` with this item
**Diagram items:**
- Call the appropriate Miro MCP item-retrieval tool with the item URL
- **MUST write** content to `.miro/specs/diagrams/<board item ID>.md`
- Update `index.json` with this item
**Prototype container items:**
- Call the appropriate Miro MCP item-retrieval tool with the item URL
- **MUST write** to `.miro/specs/prototypes/<board item ID>-container.md`
- Update `index.json` with this item
**Prototype screen items (MANDATORY 3-task workflow via subagent):**
⚠️ **EACH PROTOTYPE SCREEN REQUIRES A SUBAGENT WITH 3 SEPARATE TASKS**
**Why subagent:** the Miro MCP context tool returns large HTML for prototype screens, which bloats the main agent's context. A subagent keeps this contained — the large HTML never enters the main conversation.
For each prototype screen, launch a **single subagent** (with `subagent_type: "general-purpose"`) that performs all 3 steps sequentially. Pass the subagent all necessary context:
**Subagent prompt template:**
```
Extract prototype screen and its images from Miro board.
Context:
- Miro board URL targeting the prototype screen: [url]
Execute these 3 tasks in order:
Task 1: Get and save HTML
- Call the appropriate Miro MCP item-retrieval tool with the item URL
- Save the returned raw HTML to .miro/specs/prototypes/<board item ID>-screen.html
- Read index.json, add this item to items array, Write updated index.json
Task 2: Extract images
- Read the saved HTML file
- Parse HTML for ALL image URLs in `src` attributes
- For EACH image URL found:
1. Extract resource ID from URL path
2. Call the appropriate Miro MCP image tool to obtain a download URL for the image
3. Take the download URL from response
4. Download: `curl -sL -o .miro/specs/images/<image resource ID>.png "[download_url]"`
5. Read index.json, add image entry to images array, Write updated index.json:
{"id": "<image resource ID>", "path": "images/<image resource ID>.png", "referenced_by": ["prototypes/<board item ID>-screen.html"]}
- If any download fails: log warning, continue with others
Task 3: Update image URLs in HTML
- Read the HTML file from .miro/specs/prototypes/<board item ID>-screen.html
- Replace ALL original image URLs with relative paths: src="../images/<image resource ID>.png"
- Save the updated HTML
- Verify all image src attributes now point to ../images/
Report back: number of images found, downloaded, and any failures.
```
**Main agent workflow for each screen:**
1. Update your internal checklist to mark "Get and save HTML: [title]" as `in_progress`
2. Launch subagent with the prompt above
3. When subagent completes, mark all 3 tasks for this screen as `completed`
4. Move to next screen
**⚠️ CRITICAL REQUIREMENTS FOR PROTOTYPE SCREENS:**
- ✗ DO NOT call the Miro MCP context tool for screens from the main agent (context bloat)
- ✓ ALWAYS use a subagent for each prototype screen
- ✓ CREATE 3 tasks per prototype screen (for visibility)
- ✓ Subagent completes all 3 tasks: HTML → Images → URLs
- ✓ Use the Miro MCP image tool to obtain a download URL, then curl to download
- ✓ ALL image URLs must be replaced with local paths before moving on
**Frame items:**
- Call the appropriate Miro MCP item-retrieval tool with the item URL
- **MUST write** content to `.miro/specs/frames/<board item ID>.md`
- Update `index.json` with this item
**Table items:**
- Call the appropriate Miro MCP table-retrieval tool for the table item
- **MUST write** JSON content to `.miro/specs/tables/<board item ID>.json`
- Include column definitions and all row data in JSON
- Update `index.json` with this item
**Unknown/Other item types** (e.g., slides, or any new types):
- Call the appropriate Miro MCP item-retrieval tool with the item URL
- **MUST write** content to `.miro/specs/other/<board item ID>.md`
- Preserve original type name in metadata for reference
- Update `index.json` with this item
### 8. Finalize Metadata Index
Read the current `index.json` and calculate the summary section:
- Count `total_items` from items array
- Count `by_type` (group items by type field)
- Count `total_images` from images array
Update `index.json` with the calculated summary:
```json
{
"summary": {
"total_items": 8,
"by_type": {
"document": 2,
"diagram": 2,
"prototype": 2,
"table": 1,
"frame": 1
},
"total_images": 3
}
}
```
**MUST write** t

