Astro guide
Scaffold and build a distill.pub-inspired Astro documentation guide with data-driven D3.js grid diagrams, built with bun. Single page by default, or a multi-chapter "docbook" with a left sidebar. Use when the user asks to create a technical guide, documentation microsite, design/architecture write-up rendered as a web page, or clean D3/SVG diagrams for docs — especially "distill.pub-style", "guide with diagrams", "docbook / chapter sidebar", or "explain this design as a site".From its SKILL.md
npx -y skills add omahdi/astro-guide-skill --skill astro-guideAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.8 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
astro-guide
Build a single-page, distill.pub-style Astro guide (serif body, right-margin
callouts, hairline rules, restrained palette) with grid-based D3.js SVG diagrams.
The assets/ here are the exact, build-tested scaffold — copy them in and author.
For a larger guide, extend that single page into a multi-chapter docbook with
a persistent left sidebar — see reference/DOCBOOK.md.
Quick start
- Scaffold into the target dir (e.g.
doc/guides/<name>/), using bun:DEST=doc/guides/<name> SKILL="$(git rev-parse --show-toplevel)/skills/astro-guide" # or the install dir of this skill mkdir -p "$DEST" cp -R "$SKILL/assets/." "$DEST/" mv "$DEST/gitignore" "$DEST/.gitignore" (cd "$DEST" && bun install && bun run build && bun run check) # must be clean - Author content in
src/pages/index.astro— see reference/CONTENT.md. Key rule: put every multi-line code snippet in a frontmatter template-string const and render<pre class="code"><code>{const}</code></pre>(Astro parses{}). - Add diagrams — one module per figure in
src/diagrams/<name>.ts(copy_sample.ts), referenced by<D3Figure name="<name>" .../>. Grid contract, archetypes, and layout pitfalls: reference/DIAGRAMS.md. - Verify — visually, not just the build (see below).
What you get (the stack)
- Astro (static, bun) ·
d3. Components:Base.astro(article shell),MarginNote.astro(sidenote — sparingly),Figure.astro,D3Figure.astro(client-renders a diagram module). src/diagrams/grid.ts— the shared D3 toolkit:grid()layout,palette,createSvg,drawNode/drawEdge/drawLegend. Convention: solid = today, dashed = planned, with a legend where both appear.src/styles/distill.css— the design system (tune the CSS custom properties at the top:--measure,--gutter,--c-accent, serif/sans/mono stacks). Styles prose, code, tables, figures, and margin notes;.tokis an inline enum/status token (monospace, accent) for status matrices and enums.
Workflow checklist
- Copy
assets/,bun install, confirmbun run build+astro checkare clean. - Sections as direct children of
<Base>; 3–6 anchored<h2>s; abstract states current state. - One diagram per section; 6–12 nodes each; pick an archetype (DIAGRAMS.md).
- Static box diagrams by default; for a before/after or what-if, make it an interactive state-stepper — controls + linked table (INTERACTIVE.md). Figure must read complete in its default state.
- Margin notes: essential asides only, ≤ ~5 total.
- Verify every load-bearing fact against the source (not design docs).
- Screenshot the running site and fix diagram layout (CONTENT/DIAGRAMS pitfalls).
- Keep
node_modules/,dist/,.astro/git-ignored (bundled.gitignore).
Verify diagrams visually (required)
A green build does NOT mean diagrams look right — D3 renders in the browser and labels clip / nodes overlap silently. Serve and screenshot:
(cd "$DEST" && bun run build && bun run preview --port 4399 &) # serve
# in a scratch dir: bun add playwright && bunx playwright install chromium
node "$SKILL/scripts/shot.mjs" http://localhost:4399/ ./shots # $SKILL = this skill's dir (see above)
shot.mjs auto-discovers every [data-diagram], prints each one's rendered
svgChildren (0 ⇒ module failed), and writes per-diagram + top-of-page PNGs.
Read them; fix the diagram modules (DIAGRAMS.md lists the exact common fixes).
shot.mjs visits ONE url — for a multi-page docbook, run it once per chapter
route that has a diagram (node "$SKILL/scripts/shot.mjs" http://localhost:4399/<slug>/ ./shots/<slug>).
More
- Diagram contract, archetypes, pitfalls, Distill principles → reference/DIAGRAMS.md
- Interactive figures (state-steppers, linked tables, hover linking) → reference/INTERACTIVE.md
- Content register, brace-safety, callouts, accuracy → reference/CONTENT.md
- Multi-chapter docbook (sidebar nav across pages) → reference/DOCBOOK.md
- Building a large guide with parallel subagents → reference/ORCHESTRATION.md
What ships with it: 19 files
76.1 KB alongside SKILL.md, 5 of them executable
assets/
- astro.config.mjsruns453 B
- gitignore109 B
- package.json477 B
- src/components/D3Figure.astro3.7 KB
- src/components/Figure.astro1.1 KB
- src/components/MarginNote.astro845 B
- src/diagrams/grid.tsruns9.7 KB
- src/diagrams/interactive.tsruns4.2 KB
- src/diagrams/_sample.tsruns2.9 KB
- src/layouts/Base.astro2.0 KB
- src/pages/index.astro1.9 KB
- src/styles/distill.css13.7 KB
- tsconfig.json425 B
reference/
- CONTENT.md2.7 KB
- DIAGRAMS.md8.1 KB
- DOCBOOK.md12.3 KB
- INTERACTIVE.md6.7 KB
- ORCHESTRATION.md2.7 KB
scripts/
- shot.mjsruns2.3 KB