/skills:drawio-nf-core-metromapsfrom skills
Use when creating, updating, or exporting an nf-core / Nextflow pipeline metro map (subway-style workflow diagram) with draw.io (app.diagrams.net) through Claude in Chrome: redrawing the map for a new release, adding or removing module stations and lanes, editing an existing draw.io metro map, drawing a map of how several pipelines chain (stations = pipelines with their logos), or exporting light and dark PNG/SVG versions into docs/images. Not for maps drawn with Inkscape, the nf-metro plugin, or other tools.
Ships in skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The map is a draw.io file (usually in Google Drive) edited in the user's Chrome through Claude in
Chrome. You draw it with scripts/mm_core.js, a helper library pasted into javascript_tool. You
export it with the same library, and scripts/install_metromaps.sh puts the exports into the
pipeline repo. Load the anthropic-skills:chrome-browser skill before the first browser call.
| Tried | Result | Do instead |
|---|---|---|
Google Drive connector on the .drawio file ID from the #G<id> URL | "Requested entity was not found" | Edit in the open draw.io tab |
fetch from app.diagrams.net to a localhost relay | Blocked by CSP; a relay server also trips the auto-mode classifier | Do not move data through the network |
Reading big data out through javascript_tool output | Cut at ~1.5k characters; anything that looks like a URL, token or k=v returns [BLOCKED: ...] | Return short summaries; read the diagram locally from the repo's exported SVG/PNG with scripts/dump_drawio_svg.py |
Pasting large files (images) into javascript_tool | Very expensive | Put a temporary <input type=file> on the page (MM.logoInput()), then find + file_upload. It only takes paths this session may read (a file in another repo was refused): copy the file into the scratchpad first |
Loading the helper script from a file (<input type=file> + eval) or from localhost | eval and fetch to localhost are blocked by the page CSP | Paste the script as the javascript_tool code itself; dropping comment-only lines cuts about 20% |
window.ui / App._instances | Not exposed | MM.getUi() hooks EditorUi.prototype.windowResized and getCurrentFile, then fires synthetic resize and focus events; no click needed. Hooking refresh does not work, because a resize never reaches it |
a.click() download from javascript_tool | Silently dropped | MM.downloadButton(), then click the button with the computer tool. With "Ask where to save" on, Chrome opens a native Save dialog you cannot see: ask the user to press Save |
| Clicking the draw.io status bar "Unsaved changes. Click here to save" right after a large build | Froze the renderer and disconnected the extension | MM.waitSaved() and let autosave finish; if it stays unsaved, ask the user to save |
Re-running MM.build() after the user edited the page | Wipes their edits | After hand-off, make only targeted edits (find cells by id, geometry or style) |
Plain #FFFFFF / #000000 on stations, icon labels, bars and triangles | draw.io inverts them in the dark export (black stations, unreadable icon labels) | light-dark(X,X); mm_core writes them that way, and MM.pinDarkColors() fixes older pages |
exportSvg with fonts off | Maven Pro not embedded | MM.exportAll() passes embedFonts = true |
| Committing draw.io SVGs as exported | nf-core end-of-file-fixer hook fails | install_metromaps.sh appends the final newline |
Adding a lane to a hand-drawn map (curves are shape=stencil cells and stations shape=image 30x29, not edge points; MGnifams 2026-11) | Edge points show only straight segments; MM.build would wipe the page | Extrapolate one lane further from each existing pair: new geometry = 2 x inner lane - outer lane (x, y, w, h), for straight edges and for cloned stencils recoloured. Re-centre stations on the three lanes (move a few px, or 32x32 when lanes are 11 apart), widen output bars by one lane, and bring vertices to front with g.orderCells(false, ...) (z-order is mixed on old pages) |
| Dark export of a page whose file icons are SVG images (black body, white label text) | draw.io inverts the SVG images: white icons, invisible labels; adaptiveColors=none on the image cells does not help | Ship one light export on a white background (exportToCanvas background #ffffff, transparent false): it reads in GitHub light and dark |
exportSvg with embedFonts true on a Helvetica-only page | 2.6 MB instead of 462 KB, over a 2,048 KB check-added-large-files limit | Pass embedFonts false when the page uses no web font |
A box number placed with spacingTop larger than the box can hold | Its text box overflows below the box and the export gets an empty band at the bottom | Anchor it with verticalAlign / spacingBottom, then check the graph bounds (text bounding boxes included) before exporting |
javascript_tool results containing k=v text (styles, JSON.stringify of a=b) | [BLOCKED: Cookie/query string data] | Return booleans, counts and _-joined numbers; replace = before returning |
Putting a draw.io SVG under the nf-core website's src/assets | Netlify main-site preview fails in about 30 s: Astro's image-size only looks at the first 1000 bytes for the end of the root <svg> tag, and draw.io keeps the editable diagram (hundreds of KB) in an attribute of it, so NoImageMetadata | Ship only the PNGs there (they carry the same diagram); keep the SVGs in the project repo. Reproduce locally with Node 24 and astro build in sites/main-site |
g.removeCells(g.getChildCells(P)) to wipe a page | getChildCells skips hidden cells, so the hidden dark logos pile up on every rebuild and bloat the export (fixed in MM.build) | g.removeCells(M.getChildren(P).slice(), true) |
eval(fn.toString().replace(...)) to patch a helper in place | Blocked by the page CSP (unsafe-eval), even though it worked earlier in the same tab | Paste the whole edited function again, or edit cell geometry directly |
fetch or file_upload for pipeline logos | fetch is blocked by the CSP; upload only takes files the user shared | new Image() with crossOrigin='anonymous' from raw.githubusercontent.com/nf-core/<p>/HEAD/docs/images/..., drawn to a canvas, toDataURL (see references/meta-omics-sig-map.js) |
Relabelling a library asset by setting its text to plain FASTA | Loses the asset's white <font> wrapper: the label vanishes on the black file icon | Set <b>fasta</b> and put fontColor=light-dark(#FFFFFF,#FFFFFF) in the text child's style |
| Line colours as plain hex | draw.io's dark palette dims yellow to near-invisible | light-dark(X,X) per line; give the dark brown MAG line its own dark value |
| Two lanes close together, one crossing the other at a corner | The crossing lands inside the arc: a kink. arcSize on an edge is twice the corner radius (80 = 40 px) | Cross on straight segments only, and keep corners 40 px clear of other lanes |
| Embedding raw pipeline logos (about 30 KB each, three copies per logo) | PNG 1.8 MB, SVG 2.5 MB | Palette-quantize them in the page (quant in references/meta-omics-sig-map.js: premultiplied RGBA, true-average palette, falls back to the original PNG when the error is too high): about 40% smaller exports, same pixels. Quantizing straight RGBA merges nearly transparent pixels into opaque white and the text goes grey |
| Box sizes and gaps typed in by hand | Review comments on nf-core/website#4561, one round each: gaps between boxes unequal, bottom padding too large in one box and too small in another, stations unevenly spaced, one box's corners rounder | Compute each box from its content (fixed bottom PAD, fixed GAP, see references/meta-omics-sig-map.js), then await MM.check() before every export |
Relative arcSize on boxes | Each box gets a different corner radius, by its size | absoluteArcSize=1;arcSize=20 on every box (mm_core does this now) |
| Parallel vertical lanes spread out with gaps | Horizontal lanes touched (10 px apart), verticals did not; the reviewer asked for the same (#4561) | Bundle verticals 10 px apart with concentric corners (radii 50/40/30 = arcSize 100/80/60). Only a lane that crosses another lane next to its own corner keeps a corner's width of space |
| Fixed box width with stations far from the edge | Box wider than its content | Put stations a fixed distance into the box and size the box from its rightmost label + PAD |
| Logos placed from their raw PNG bounds | The repos' PNGs carry uneven transparent padding: label-to-pill gaps varied 8-21 px and one station looked detached (#4561) | Trim each logo to its alpha bounding box before scaling, then place it a fixed gap from the pill |
| Branches off one trunk leaving it in different directions | Reviewer: "should go the same way" (#4561) | Leave the trunk the same way every time; reorder lanes at shared stations so no branch crosses another lane inside a corner |
| A box whose station column is a few px off its centre | The widest label made it visible ("last node not centred", #4561) | Size the box around the column; the SIG script's check (references/meta-omics-sig-map.js) flags an off-centre column of >= 3 stations with logos above |
| Every logo stored at one fixed width (360 px) | A wide logo drawn at 320 px has almost no headroom and looks blurry next to the others | Store each logo at 2x its drawn width (check flags < 1.9x) |
| A logo composed at full size (thousands of px) and left for draw.io to scale down | Dark-mode text came out grey (221 vs 255 on the other logos) | Shrink on a canvas to 2x the drawn width first, then whiten the neutral text pixels after the shrink |
Parallel lanes that turn together with one arcSize | Gaps of about 4 px at the corner (the lanes are not concentric) | Route lanes so they only turn apart, or vary the radius per lane |
| A line that zigzags or hairpins to reach a station two rows away | Reviewer: swap the stations' rows so the line runs straight (#4561: viralmetagenome moved above mag/magmap, the red line ran straight into phyloplace and its hairpin went) | Before adding a jog, try reordering rows or stations; a station row next to its downstream station's row lets the line cross the trunk on a straight segment |
| Stacked boxes in one column with different left or right edges | Reviewer: "could subgraph 4 be left aligned with 3?" (#4561) | Boxes in one column share both edges: one x, and one width from the widest content of the column |
| Widening one box of a hand-drawn map by moving every cell whose centre lies right of a line (MGnifams 2026-11) | Boxes that span the line (a wide box below) have their centre on the right too: they moved instead of widening, and the legend text left its swatch edges behind | Decide boxes first: a box that starts left of the line and ends at the right edge gets width += dx; then move the other vertices by centre and every edge point right of the line by dx (horizontal segments stretch). Check the bottom row of boxes and the legend after the shift |
ui.renamePage(page, name) from javascript_tool | Opens a rename dialog that stays on screen | ui.actions.get('duplicatePage').funct(), then graph.model.execute(new RenamePage(ui, ui.currentPage, name)); position the view with graph.zoomTo(s) and graph.container.scrollLeft/Top = (x + view.translate.x) * s |
| A line that climbs or bends to reach a station or output sitting off its lane (MGnifams 2026-11, the DB lines from box 9 to 11) | Maintainer: "ALWAYS prefer straight lines where possible" | Move the station, terminus bar, icon and their labels onto the lane's y (centre stations between parallel lanes); bend only where the route itself turns |
A box number (fontSize=50, html) anchored with verticalAlign=bottom | Its text box is ~200 px tall and the glyph draws at the top of it, mid-box, where the lanes pass | verticalAlign=top;spacingTop=0, as the other boxes |
| Looking for clipped items on a hand-drawn page by eye | Slow, and misses small overlaps | await MM.check() now reports overlap: A / B (text bounding boxes getState(cell).text.boundingBox, screen px / scale - translate, against shapes and other labels; curves, boxes, hidden cells and a label inside its own cell are skipped). Zoom into each hit, since touching boxes are often fine |
MM.downloadButton() after editing the page, without a fresh export | The zip holds the previous MM.files: the user downloaded the old layout | Always MM.exportAll() → previews → MM.waitSaved() → MM.downloadButton(), in that order, after every change; open the downloaded PNG and check it shows the change before installing |
includes of modules/nf-core/ and
subworkflows/nf-core/ reached from workflows/<pipeline>.nf, and follow every local
subworkflow. Leave out local modules, but keep the data flow they carry.meta key added inside the workflow. That decides solid vs dotted.nextflow run . -profile test -preview -with-dag dag.mmd --outdir out twice, once with the
defaults and once with the parameters that switch optional steps on (from nextflow_schema.json).
Processes only in the second graph are the optional ones. Run it in a scratch folder, and read
the code for branches the parameters did not select. A preview run starts no tasks.assets/schema_input.json) and final outputs from
docs/output.md. Draw final outputs only, not per-step intermediates.Map conventions this user approved:
MM.COLORS for other modes).w/h).resize_window to about 1600×1300, since the default viewport is too small to review.scripts/mm_core.js into javascript_tool. Do this again after every page reload.python3 scripts/dump_drawio_svg.py <repo>/docs/images/<pipeline>_workflow_light.svg (or .png) locally.await MM.harvestImages(). It lists the embedded images with
their sizes: the stacked file icon is about 100×110, the single one 80×89, and the logo wide.references/proteinfamilies-v3-spec.js, which has the format and a
full worked example. Set spec.page to a new name (e.g. the release) so the old page survives.await MM.build(SPEC), then await MM.view(0.62) and take a screenshot. Iterate: fix
collisions, labels on lines, and captions overlapping icons. Small edits to SPEC plus a rebuild
are cheap at this stage.computer zoom on a region.MM.build on that page.Worked example: references/meta-omics-sig-map.js (the nf-core meta-omics SIG map: 19 pipelines, six data-type lines, four sections). It does not use MM.build; it draws one polyline per route, which is simpler when lines fork and rejoin.
metromapTheme=light|dark; MM.exportAll swaps them in memory. Look in each pipeline's docs/images for a custom-art variant (*_custom_*, *_mascot_*, *_flat_*, *_tax): names are not uniform, and the file for LIGHT backgrounds can be the one called "black" or "dark". A repo with only a light mascot logo (bacmodel) gets a dark copy by recolouring its text white on a canvas. Size labels by the "nf-core/" text, not by image width: aspect ratios differ.nf-core_components library has FASTA/FASTQ file icons. Ask the user to drag one onto the page, then clone the group (g.cloneCells), move it, set the label (pinned white), delete the stand-in shapes.jumpStyle=arc;jumpSize=20 to that edge's style and draw it last. The hop survives the SVG and PNG export.The dark map differs from the light one only by the logo. Keep both logos on the page, tagged:
await MM.logoCandidates() to find the light logo cell id.MM.logoInput(), then find "file input", then file_upload with
<repo>/docs/images/nf-core-<pipeline>_logo_dark.png. The file must be one the user shared,
e.g. attached in chat.await MM.addDarkLogo('<light id>'). This tags metromapTheme=light and adds a hidden
metromapTheme=dark copy.await MM.pinDarkColors() if the page predates mm_core. Then run await MM.waitSaved().No second page or tab is needed. The export swaps the logos in memory only.
await MM.check() must return ok (box gaps, bottom
padding, absolute corner radius, station spacing, dark logo text white, logo resolution, overlapping
labels and shapes; it also works on hand-edited pages). Then look for what the check cannot see, which reviewers
also flagged: stations meant to share a row at exactly the same y, stations centred in their
box rather than pushed wide, all logos equally sharp at 100% zoom.await MM.exportAll('<pipeline>_workflow'). It returns file sizes and gives light and dark
PNG + SVG: transparent, scale 1, border 0, the editable diagram embedded, fonts embedded.MM.preview('<pipeline>_workflow_dark.png') and take a screenshot. Run
MM.preview('<pipeline>_workflow_light.png', '#ffffff') too, then MM.preview(null).await MM.downloadButton('<pipeline>_metromaps.zip'), then find the "Download metro maps"
link and left_click it. Tell the user they may need to press Save in Chrome's dialog, and
wait for them to confirm.scripts/install_metromaps.sh <pipeline>_metromaps <repo>/docs/images. It takes the newest
zip, removes it, and warns about any older duplicates. Duplicates come from repeated Save
dialogs; delete them only after checking with unzip -p that their contents match.file shows the expected sizes.grep -o 'color-scheme: [a-z]*' matches each SVG's theme.grep -c @font-face > 0.grep -a -c mxfile on the PNGs is 1.pre-commit run --files <the four images> passes.git cat-file -s HEAD:<file>. Smaller or similar needs no compression.
Never strip the embedded diagram or fonts.| File | Purpose |
|---|---|
scripts/mm_core.js | Browser library (window.MM): getUi, harvestImages, build, view, check (layout lint), pinDarkColors, logoInput, logoCandidates, addDarkLogo, exportAll, preview, downloadButton, waitSaved, and the pure helpers offset (parallel lanes) and arrowPoints (arrows snapped onto dashes) |
scripts/test_mm_core.js | node scripts/test_mm_core.js: self-check for the geometry helpers |
scripts/install_metromaps.sh | Unzip the newest export into docs/images and fix the SVGs' final newline |
scripts/dump_drawio_svg.py | One line per cell of the diagram embedded in an exported SVG/PNG (--xml writes the XML) |
references/proteinfamilies-v3-spec.js | Full spec of the nf-core/proteinfamilies v3.0.0 map, with layout notes |
references/meta-omics-sig-map.js | Self-contained script for the meta-omics SIG pipeline-chain map: route polylines, station logos with dark pairs (stored at 2x), content-sized boxes, check, useAssetIcon, export. The canonical copy lives in meta-omics-sig's update-metro-map skill |
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub vagkaratzas/skills --plugin skills10 skills in this plugin
/migrate-nf-core-static-typesUse when migrating, or reviewing a PR that migrates, an nf-core / Nextflow pipeline to typed
parameters or static types — e.g. "add parameter types", "typed params block", "strict typing",
"nextflow.enable.types", "convert to records", bumping to Nextflow >= 26.04, or nf-core lint
failing on nextflow_config / schema_params after moving params into main.nf.
/plan-nf-core-releasesUse when creating, revising, or re-prioritising a release roadmap (ROADMAP.md) for an nf-core / Nextflow pipeline: deciding what goes into the next version, splitting a large feature across releases, choosing minor vs major (breaking) version, or mapping open GitHub issues, PRs, and a maintainer's to-do list onto upcoming releases. Do not trigger for writing the CHANGELOG, cutting/tagging a release, or implementing roadmap items.
/redesignUse this skill only when the user explicitly asks to redesign code, such as "redesign this code", "redesign this module", or invokes $redesign. Do not trigger for ordinary code review, refactoring, cleanup, naming, documentation, or comment-writing requests unless the user specifically asks for a redesign.
/token-saviourPick the most token-efficient tool for a coding task instead of reflexively reading whole files, dumping raw command output into context, or writing more code than asked. Use this skill BEFORE you explore or explain a codebase, locate a symbol/definition/callers, trace a call path, map an architecture, plan or implement a feature across layers, or run verbose commands (tests, builds, git, grep, directory listings) — and whenever context/token budget, cost, or "make this use fewer tokens" comes up. It routes the scenario to serena, rtk, caveman, Ponytail, or plain tools, with concrete commands and the combinations to use vs. avoid. Reach for it even when the user doesn't name a tool: if you're about to `cat`/Read several files, or about to generate a big implementation, that's the trigger.
/using-depictio-nf-coreUse when turning nf-core / Nextflow pipeline results into interactive Depictio dashboards: installing or starting Depictio locally, running `depictio ingest` on an outdir, picking a template or its variables (samplesheet, GROUP_COL), checking whether a pipeline version has a Depictio template, fixing a blank or failing dashboard, auto-ingesting runs from Nextflow, or adding/updating a pipeline template after its output layout changed.
/uv-auditPython dependency security auditor using uv. Use this skill whenever asked to audit dependencies, check for security vulnerabilities or CVEs, update packages, fix outdated dependencies, run pip-audit, or keep a Python project's pyproject.toml current and safe. Trigger proactively when the user mentions dependency hygiene, wants to harden their Python project, or asks anything about package versions, security issues, or dependency updates — even if they don't use the word "audit".