Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Pages?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mycelium-io-pages)
---
name: pages
description: Write a memory that renders as a small interactive page in the app (a diagram, a chart, a widget), with the libraries and helpers it can use.
---
# Pages: memories that render in the app
A memory with `view: html` in its frontmatter renders as a small page in the
app's memory view. Its body is a plain description, which is what search
finds, and the page itself in a fenced `html` block:
````markdown
How the release moves from a merged PR to an installed app.
```html
<pre class="mermaid">
flowchart LR
PR[Merged PR] --> Tag --> Build --> Notarize --> Release
</pre>
```
````
Write it like any memory, and name the libraries it needs in `uses`:
```bash
mycelium memory set views/release-flow --file page.md -m view=html -m uses=mermaid
```
`memory get`, search, links and versions work as they do for any memory. To
change a page, start from `mycelium memory get views/release-flow --body`.
## What a page can't do
The page runs in a sandboxed frame with no network: no `fetch`, no images or
fonts from a URL, no forms, no popups, and it can't move the app. It sees
only what it's given: this memory and the memories it links to. To change
something, do it with the CLI, as yourself.
## Libraries
Name them in `uses`, separated by commas (`-m uses=plot,tailwind`). Only those
load, and all of them work offline.
- `mermaid`: diagrams. Every `<pre class="mermaid">` is drawn in the app's colors.
- `plot`: Observable Plot, with D3 (`Plot`, `d3`).
- `d3`: D3 alone (`d3`).
- `vega-lite`: charts as a JSON spec (`vegaEmbed`), in the app's colors. Give
it data inline with `values`; a `url` can't load.
- `cytoscape`: networks and graphs (`cytoscape`).
- `preact`: Preact with `htm`, no build step (`preact.html`, `preact.render`, `preact.useState`, `preact.useEffect`).
- `tailwind`: Tailwind classes, with the app's colors as `bg-surface`, `text-accent`, `border-border` and the like.
- `lucide`: icons. Write `<i data-lucide="check"></i>`, then call `lucide.createIcons()`.
- `katex`: math (`katex.render`), drawn as MathML.
- `marked`: markdown to HTML (`marked.parse`).
- `prism`: code highlighting in the app's colors, for `<code class="language-…">`:
JavaScript, TypeScript, Python, Bash, JSON, YAML, SQL, diff, HTML and CSS.
- `papaparse`: CSV (`Papa.parse`).
- `date-fns`: dates (`dateFns.format`, `dateFns.formatDistance` and the rest).
```html
<!-- vega-lite -->
<div id="chart"></div>
<script>
vegaEmbed("#chart", {
data: { values: [{ day: "Mon", n: 3 }, { day: "Tue", n: 5 }] },
mark: "line", encoding: { x: { field: "day" }, y: { field: "n", type: "quantitative" } },
});
</script>
<!-- cytoscape -->
<div id="graph" style="height: 240px"></div>
<script>
cytoscape({
container: document.getElementById("graph"),
elements: [{ data: { id: "api" } }, { data: { id: "web" } }, { data: { source: "web", target: "api" } }],
style: [{ selector: "node", style: { label: "data(id)", "background-color": mycelium.theme.colors.accent, color: mycelium.theme.colors.text } }],
layout: { name: "breadthfirst" },
});
</script>
<!-- lucide -->
<p><i data-lucide="circle-check"></i> Shipped</p>
<script>lucide.createIcons();</script>
<!-- katex -->
<p id="eq"></p>
<script>katex.render("p_{99} = \\mu + 2.33\\,\\sigma", document.getElementById("eq"));</script>
<!-- marked -->
<div id="notes"></div>
<script>document.getElementById("notes").innerHTML = marked.parse("**Done:** the retry path.");</script>
<!-- prism -->
<pre><code class="language-python">def retry(fn, times=3):
return fn()</code></pre>
<!-- papaparse -->
<script>
const rows = Papa.parse("team,open\nweb,4\napi,2", { header: true }).data;
</script>
<!-- date-fns -->
<script>
const when = dateFns.formatDistance(new Date("2026-12-01"), new Date(), { addSuffix: true });
</script>
```
## The `mycelium` helper
Every page has it.
- `mycelium.data()`: a promise of this memory and the memories it links to:
`{ memory: { key, description, meta, tags, version, updated_by, updated_at }, links: [{ key, relation, text, meta, ... }] }`.
A page shows other memories by linking them in its description, like
`[[status/release]]`, or in frontmatter, like `-m 'relates-to=["status/release"]'`.
```html
<ul id="list"></ul>
<script>
mycelium.data().then(({ links }) => {
for (const l of links) {
const li = document.createElement("li");
li.textContent = `${l.key}: ${l.text}`;
document.getElementById("list").append(li);
}
});
</script>
```
- `mycelium.theme`: the app's colors and fonts, light or dark:
`{ mode, colors: { bg, surface, text, muted-foreground, accent, green, yellow, red, ... }, fonts: { sans, mono } }`.
The same colors are CSS variables, `var(--color-accent)`.
```html
<div id="chart"></div>
<script>
const c = mycelium.theme.colors;
document.getElementById("chart").append(
Plot.barY([{ who: "a", n: 3 }, { who: "b", n: 5 }], { x: "who", y: "n", fill: c.accent }).plot(),
);
</script>
```
- `mycelium.size()`: fit the frame to the page. It happens on its own when the
page changes size; call it after drawing something it can't see.
```html
<script>
document.body.append(drawn);
mycelium.size();
</script>
```
- `mycelium.open(key)`: ask the app to open a memory or a task. The app decides.
```html
<button onclick="mycelium.open('work/release-3-2')">Open the release task</button>
```
## A small widget
```html
<div id="app"></div>
<script>
const { html, render, useState } = preact;
function Counter() {
const [n, setN] = useState(0);
return html`<button class="rounded bg-accent px-2 py-1 text-accent-fg" onClick=${() => setN(n + 1)}>
Clicked ${n} times
</button>`;
}
render(html`<${Counter} />`, document.getElementById("app"));
</script>
```
With `-m uses=preact,tailwind`.