算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
walkthrough【设计与创意】Use when turning a repo, pull request, plan/design doc, architecture, article, blog post, book, lecture, or transcript into an interactive learning artifact — a self-contained offline walkthrough.html and/or a deployable learning hub. Triggers include "onboarding guide", "walk me through this PR/codebase/design", "interactive explainer", "teaching si…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Turn any source into a deployable learning site: self-contained, offline
walkthrough.html "routes" organized by a React/Vite hub (the document center) that also
renders plan.md / design.md. You author content for a target audience; a build script
renders polished, consistent HTML; CI publishes to GitHub Pages.
Core principle: you author Markdown DSL, not HTML. The build script owns syntax highlighting, diagram rendering, the TOC, quizzes, and progress — so every route is consistent and offline-capable. Hand-writing HTML (or hand-drawing SVG, or hand-tokenizing code) is the anti-pattern this skill exists to prevent.
Audience principle (hard rule): everything that renders in the browser is for the
learner and no one else — never the author, a reviewer, or an agent. Never render
authoring meta-commentary ("an older draft said…", "myth correction", "verified against
source", "don't teach the old version", "TODO"). State the correct thing plainly as
settled fact; keep any correction-of-the-source in your reply to the user, not on the page.
The build runs an audience linter that flags these; treat hits as defects. See
references/pedagogy.md → The learner is the only reader.
Theme: every generated page (routes and hub) ships both a light and a dark palette baked in — default light, with a persisted toggle (no flash on load, no runtime fetch). Code highlighting uses Shiki dual themes (CSS-variable mode), so light/dark switch offline.
These are two different deliverables. Always confirm which one the user wants before
authoring — do not assume the full site. Ask plainly, e.g. "Do you want a single
standalone walkthrough.html you can open/email offline, or a full deployable learning hub
site (multiple walkthroughs + plans, published to Pages)?"
walkthrough.html. Do steps
1–3 only — author DSL, run build-walkthrough.mjs --out <anywhere>.html, hand over the
file. Skip the hub, config, and deploy. Fully self-contained.If the user is ambiguous or names only one source, default to asking rather than building the whole site.
When not to use: live Socratic tutoring with mastery gating → use the teach skill.
A one-paragraph answer → just answer.
walkthrough.html files. Inline CSS, pre-rendered SVG
diagrams, pre-highlighted code, tiny JS. Open by double-click, emailable, work offline..walkthrough/ and committed; CI
builds and publishes to Pages.digraph wt {
rankdir=TB; node [shape=box];
analyze [label="1. ANALYZE\nIngest source via its recipe\n(repo / PR / plan / URL / transcript)"];
author [label="2. AUTHOR (for the audience)\nWrite Markdown DSL: sections, examples,\n:::reveal, :::quiz, :::callout, mermaid"];
render [label="3. RENDER\nbuild-walkthrough.mjs -> self-contained\ncontent/routes/<slug>.html"];
manifest[label="4. REGISTER\nadd route/plan to walkthrough.config.json"];
deploy [label="5. DEPLOY\nbuild-hub.mjs locally to preview;\ncommit; CI publishes to Pages"];
analyze -> author -> render -> manifest -> deploy;
}
references/source-recipes.md.references/dsl-syntax.md, structured with
the non-gating pedagogy in references/pedagogy.md. Order prerequisites first; use
:::reveal for try-then-show and :::quiz for non-gating self-checks.node scripts/build-walkthrough.mjs <src>.md --out .walkthrough/content/routes/<slug>.html.walkthrough.config.json.bash scripts/setup-deploy.sh --repo <target> --base /repo/.
To preview locally, build the hub with --base / (not /repo/) and serve it over HTTP
without single-page mode (cd .walkthrough/dist && npx serve -l 3000 .) — see the
preview footguns in references/deployment.md. Then tell the user to commit and enable
Pages (Settings → Pages → Source = "GitHub Actions", or the first run fails at
Configure Pages and the site keeps serving the repo README). Deploys fire only on
pushes to the default branch. See references/deployment.md.The build scripts have npm dependencies. First use: npm install in scripts/. Installing
the optional @mermaid-js/mermaid-cli enables light pre-rendered SVG diagrams; without
it diagrams still render offline via an inlined runtime (larger files).
| Need | Do |
|---|---|
| Author content | Markdown DSL (references/dsl-syntax.md) — never raw HTML |
| Highlight code | fenced ```lang — Shiki, automatic |
| Diagram | ```mermaid — pre-rendered SVG (or offline runtime) |
| Self-check (non-gating) | :::quiz with - ( ) / - (x) + > explanation |
| Try-then-reveal | :::reveal <prompt> |
| Custom UI | :::html (self-contained only) |
| Render a route | node scripts/build-walkthrough.mjs src.md --out …/routes/slug.html |
| Customize code themes | --light-theme <name> --dark-theme <name> (Shiki themes; default github-light/night-owl) |
| Build hub for deploy | node scripts/build-hub.mjs --root …/.walkthrough --base /repo/ |
| Preview hub locally | build with --base /, then cd …/.walkthrough/dist && npx serve -l 3000 . (no -s) |
| Scaffold a repo | bash scripts/setup-deploy.sh --repo <repo> --base /repo/ |
:::html for genuinely custom widgets.teach skill, not this one.)<script>/<link> tags. Anything fetched at runtime breaks offline/emailable.walkthrough.config.json — the hub won't show it.references/pedagogy.md.references/dsl-syntax.md — the authoring DSL (frontmatter, code, mermaid, containers)references/source-recipes.md — per-source ingestion + shapingreferences/pedagogy.md — non-gating, audience-aware, Bloom-informed authoringreferences/deployment.md — .walkthrough/ layout, config, setup, CI, GitLab-laterteach skill — pedagogy evidence base (gated tutoring; complementary, not this)