Diagram Design
cathrynlavery/diagram-design
Creates branded diagrams, from architecture, flowchart and sequence to charts and maps, as self-contained HTML with inline SVG, with import from draw.io, Mermaid and Excalidraw.
Turns one specification document into program graphs following Nielson and Nielson's definition, writing each graph as a Mermaid file, one per functional unit.
$ npx skills add NyxFoundation/speca --skill subgraph-extractor -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install NyxFoundation/speca subgraph-extractor --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/NyxFoundation/speca.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/subgraph-extractor .claude/skills/subgraph-extractor && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "subgraph-extractor" agent skill from https://github.com/NyxFoundation/speca/tree/main/.claude/skills/subgraph-extractor into .claude/skills/subgraph-extractor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "subgraph-extractor", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/NyxFoundation/speca/tree/main/.claude/skills/subgraph-extractorType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add NyxFoundation/speca --skill subgraph-extractor -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install NyxFoundation/speca subgraph-extractor --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/NyxFoundation/speca.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/subgraph-extractor .agents/skills/subgraph-extractor && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "subgraph-extractor" agent skill from https://github.com/NyxFoundation/speca/tree/main/.claude/skills/subgraph-extractor into .agents/skills/subgraph-extractor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "subgraph-extractor", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add NyxFoundation/speca --skill subgraph-extractor -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install NyxFoundation/speca subgraph-extractor --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/NyxFoundation/speca.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/subgraph-extractor .cursor/skills/subgraph-extractor && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "subgraph-extractor" agent skill from https://github.com/NyxFoundation/speca/tree/main/.claude/skills/subgraph-extractor into .cursor/skills/subgraph-extractor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "subgraph-extractor", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/NyxFoundation/speca.git --path .claude/skills/subgraph-extractor--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add NyxFoundation/speca --skill subgraph-extractor -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install NyxFoundation/speca subgraph-extractor --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/NyxFoundation/speca.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/subgraph-extractor .gemini/skills/subgraph-extractor && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "subgraph-extractor" agent skill from https://github.com/NyxFoundation/speca/tree/main/.claude/skills/subgraph-extractor into .gemini/skills/subgraph-extractor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "subgraph-extractor", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install NyxFoundation/speca subgraph-extractorInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add NyxFoundation/speca --skill subgraph-extractor -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/NyxFoundation/speca.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/subgraph-extractor .github/skills/subgraph-extractor && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "subgraph-extractor" agent skill from https://github.com/NyxFoundation/speca/tree/main/.claude/skills/subgraph-extractor into .github/skills/subgraph-extractor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "subgraph-extractor", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add NyxFoundation/speca --skill subgraph-extractor -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install NyxFoundation/speca subgraph-extractor --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/NyxFoundation/speca.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/subgraph-extractor .opencode/skills/subgraph-extractor && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "subgraph-extractor" agent skill from https://github.com/NyxFoundation/speca/tree/main/.claude/skills/subgraph-extractor into .opencode/skills/subgraph-extractor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "subgraph-extractor", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
subgraph-extractorTurns one specification document into program graphs following Nielson and Nielson's definition, writing each graph as a Mermaid file, one per functional unit.
The agent acts as a formal-methods specialist. Given a specification URL, an output directory and optionally a local copy, it reads the document (fetching it when no local file exists), splits it into functional units such as function definitions, state transitions, protocol phases and validation logic, and builds one program graph per unit. A program graph is defined by nodes, an initial and a final node, actions such as assignments and tests, and edges that link nodes through actions.
Each graph is written as a .mmd Mermaid file under the output directory, in a folder named after a short specification identifier such as fulu-beacon-chain, and the skill returns a JSON structure describing the results. It handles a single specification per call and does not write the index file, because the calling worker batches and aggregates. Mermaid syntax rules are included to avoid parse errors.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit d173893. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
readwritemcp__fetch__fetchmcp__filesystem__write_text_filemcp__tree_sitter__get_symbolsmcp__tree_sitter__run_queryFrom allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are mermaid and json).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Specification Subgraph Extractor loads about 1.6k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 560 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from NyxFoundation/speca at commit d173893, republished under its MIT licence (© NyxFoundation). 560 words, ~1,629 tokens.
.claude/skills/subgraph-extractor/SKILL.md (or your agent's skills folder).You are a Formal Methods Specialist trained in program graph extraction. Your task is to transform a single specification document into program graphs following the formal definition from Nielson & Nielson's "Formal Methods: An Appetizer" (Springer 2019).
A program graph PG = (Q, q▷, q◀, Act, E) consists of:
- Q: a finite set of nodes (program points)
- q▷, q◀ ∈ Q: initial and final nodes
- Act: a set of actions (assignments, tests/guards)
- E ⊆ Q × Act × Q: a finite set of edges
This skill processes one specification URL per invocation. A single specification typically yields multiple program graphs — one per functional unit (function, protocol phase, validation flow, etc.).
The calling worker is responsible for batching and aggregation.
The caller provides:
url — the source URL of the specification (always provided)output_dir — directory where .mmd files should be writtenlocal_path (optional) — path to a pre-downloaded copy of the specificationRead Specification: If local_path is provided and the file exists, read from it. Otherwise, fetch the content from url using mcp__fetch__fetch.
Identify Functional Units: Break down the document into logical units:
Each functional unit becomes one program graph.
Extract Program Graph Components:
For each functional unit, identify:
| Component | What to Extract |
|---|---|
| Nodes (Q) | Program points: entry, exit, decision points, intermediate states |
| Initial (q▷) | The starting point of the function/process |
| Final (q◀) | The termination point(s) |
| Actions (Act) | Assignments (x = expr), function calls, tests/guards (x > 0) |
| Edges (E) | Transitions: (source_node, action, target_node) |
Generate Mermaid Diagrams: For each program graph, write a .mmd file to:
{output_dir}/{spec_id}/{SG-ID}_{name}.mmdWhere spec_id is a short identifier derived from the specification (e.g., EIP-7594, fulu-beacon-chain).
Return Result: Return the JSON structure described in Output Format below. Do not write index.json — the calling worker handles aggregation.
CRITICAL: Follow these rules to avoid parse errors:
:= in labels: Use = instead of := for assignmentsq1 --> q2: action (space before colon is OK)<, >, {, } in labels, or use quotesq1, q_validate, etc. (alphanumeric + underscore only)---
title: "factorial (Example Spec)"
---
stateDiagram-v2
direction TB
[*] --> q1: y = 1
q1 --> q2: x > 0
q1 --> [*]: x <= 0
q2 --> q3: y = x * y
q3 --> q1: x = x - 1
note right of q3
INV-001: y equals x! at loop termination
end note[*] --> q1 : y := 1 # WRONG: space before colon, := syntax
q1 --> q2 : x > 0 # WRONG: space before colonThe skill returns one JSON object per invocation (one spec → one object).
Important: mermaid_file paths are relative to output_dir, including the spec_id directory prefix.
{
"source_url": "https://...",
"title": "EIP-7892: Blob Schedule",
"sub_graphs": [
{
"id": "SG-001",
"name": "get_blob_parameters",
"mermaid_file": "EIP-7892/SG-001_get_blob_parameters.mmd"
}
]
}Note: The structured program graph (Q, q_init, q_final, Act, E) and invariants are encoded in the .mmd file itself. The JSON output contains only references. Include all invariants as note right of blocks in the .mmd file.
---
title: "get_blob_parameters (EIP-7892: Blob Schedule)"
---
stateDiagram-v2
direction TB
[*] --> q_iter: for entry in BLOB_SCHEDULE
q_iter --> q_return: epoch >= entry.epoch
q_iter --> q_iter: epoch < entry.epoch
q_return --> [*]: return entry.params
note right of q_iter
INV-001: BLOB_SCHEDULE entries have unique epochs
end note| Type | Pattern | Mermaid Label |
|---|---|---|
| Assignment | var := expr | var = expr |
| Function Call | func(args) | func(args) |
| Test/Guard | boolean | x > 0 |
| Return | return expr | return expr |
| Revert | revert msg | revert msg |
| Loop Entry | for/while | for item in list |
| Type | Pattern | Example |
|---|---|---|
| Initial | q_init | Entry point |
| Final | q_final | Exit point |
| Validation | q_validate | Input validation |
| Iteration | q_iter | Loop body |
| Decision | q_check | Branch point |
| Processing | q_process | Main logic |
| Error | q_error | Error handling |
q1, q2, etc..mmd files must render without errorsInput (pseudocode):
function factorial(x):
y := 1
while x > 0:
y := x * y
x := x - 1
return yOutput (Mermaid) - examples/SG-factorial_factorial.mmd:
---
title: "factorial (Factorial Example)"
---
stateDiagram-v2
direction TB
[*] --> q1: y = 1
q1 --> q2: x > 0
q1 --> [*]: x <= 0
q2 --> q3: y = x * y
q3 --> q1: x = x - 1
note right of q3
INV-001: y equals x! at loop termination
INV-002: x >= 0 at every iteration
end noteOutput (JSON):
{
"id": "SG-factorial",
"name": "factorial",
"mermaid_file": "examples/SG-factorial_factorial.mmd"
}© NyxFoundation, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/subgraph-extractor of NyxFoundation/speca.
Open the folder on GitHubat commit d173893
Specification Subgraph Extractor next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Specification Subgraph Extractor this skillNyxFoundation/speca | 459 | — | ~1.6k | Automated safety check: Pass | MIT | |
| Diagram Designcathrynlavery/diagram-design | 45k | 1 repos | ~7.5k | Automated safety check: Pass | MIT | |
| Draw.io Diagram StudioAgents365-ai/drawio-skill | 10k | — | ~2.4k | Automated safety check: Notes | MIT | |
| Pretty Mermaid Rendererimxv/Pretty-mermaid-skills | 1.5k | — | ~2k | Automated safety check: Pass | MIT | |
| Mermaid Diagramsjjmartres/opencode | 133 | 6 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Eli5coldteadotai/pr-lens | 1.9k | — | ~2.3k | Automated safety check: Pass | MIT |
cathrynlavery/diagram-design
Creates branded diagrams, from architecture, flowchart and sequence to charts and maps, as self-contained HTML with inline SVG, with import from draw.io, Mermaid and Excalidraw.
Agents365-ai/drawio-skill
Creates and edits editable draw.io diagrams from descriptions, code, infrastructure files, SQL and API schemas, with sync, review, test and export tools.
imxv/Pretty-mermaid-skills
Writes and renders Mermaid diagrams as themed SVG, PNG or terminal ASCII and Unicode art with a bundled Node.js CLI that needs no browser.
jjmartres/opencode
Helps an agent pick the right Mermaid diagram type and write the syntax for class, sequence, flow, ER, C4, state and other software diagrams.
coldteadotai/pr-lens
WHAT: Explains a codebase, a folder, a feature, a command or a pull request to someone who knows nothing about it, as a PR Lens canvas whose walkthrough builds the picture one part at a time.
lexler/skill-factory
Creates C4 model diagrams at every zoom level, from system landscape to code, in ASCII, Mermaid or Structurizr, for designing or documenting software architecture.
NyxFoundation/speca
Crawls from a starting URL to find and list technical specification, whitepaper and architecture documents, writing the found URLs to a JSON file.
Works with
Categories
Turns one specification document into program graphs following Nielson and Nielson's definition, writing each graph as a Mermaid file, one per functional unit. The agent acts as a formal-methods specialist. Given a specification URL, an output directory and optionally a local copy, it reads the document (fetching it when no local file exists), splits it into functional units such as function definitions, state transitions, protocol phases and validation logic, and builds one program graph per unit.
Specification Subgraph Extractor fits situations like: converting a protocol or specification document into formal program graphs; producing Mermaid diagrams of function and state-transition logic from a spec; feeding graph inputs to a specification-based audit pipeline.
Run `npx skills add NyxFoundation/speca --skill subgraph-extractor -a claude-code`. Or copy the skill folder (.claude/skills/subgraph-extractor in NyxFoundation/speca) into .claude/skills/subgraph-extractor in your project. Claude Code loads it when a task matches its description.
Run `npx skills add NyxFoundation/speca --skill subgraph-extractor -a codex`. Or copy the skill folder (.claude/skills/subgraph-extractor in NyxFoundation/speca) into .agents/skills/subgraph-extractor in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add NyxFoundation/speca --skill subgraph-extractor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/subgraph-extractor, .gemini/skills/subgraph-extractor, .github/skills/subgraph-extractor and .opencode/skills/subgraph-extractor in your project.
SKILL.md names no scripts, command-line tools or credentials: Specification Subgraph Extractor is instructions for the agent only. Our summary lists: Fetch access to the specification URL, or a local copy of it; A writable output directory. Its frontmatter pre-approves these tools: read, write, mcp__fetch__fetch, mcp__filesystem__write_text_file, mcp__tree_sitter__get_symbols, mcp__tree_sitter__run_query.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Specification Subgraph Extractor is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Specification Subgraph Extractor: Diagram Design (cathrynlavery/diagram-design, 45k stars), Draw.io Diagram Studio (Agents365-ai/drawio-skill, 10k stars), Pretty Mermaid Renderer (imxv/Pretty-mermaid-skills, 1.5k stars) and Mermaid Diagrams (jjmartres/opencode, 133 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
NyxFoundation (a GitHub organization) maintains it in NyxFoundation/speca, which has 459 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on August 12, 2026.
Source: NyxFoundation/speca on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.