Skip to content

TsukiNi22/ai-utils / skills/docs/explain-doc

explain-doc

Verified

Explanation pages in the user's HTML style (html-style) that make a concept understood rather than list an API - an algorithm, a data structure, a protocol, an architecture, a piece of math or physics, how a system or a feature works - each page in two versions switched in place (Simple - analogies, plain words, concrete numbers; Technical - precise terms, formulas, complexity, edge cases, code, sources) with diagrams (inline SVG), step-by-step animations (stepper with play / step controls), formulas (MathML, offline), interactive examples (sliders / inputs computing live results and charts, simulations checking the formulas), worked examples, pitfalls, check-yourself questions and a glossary. Static self-contained page. Use whenever the user asks to explain how something works with a page / visual / interactive explanation, a tutorial for understanding, an explainer, or "une explication simple et une technique".

FileKindSize
SKILL.mdskill md13.5 KB
requires.txtmarkdown11 B
templates/actions.htmlother298 B
templates/explain.body.htmlother20.0 KB
templates/explain.cssother12.7 KB
templates/explain.jsscript18.0 KB

templates/explain.css

View on GitHub
/* ---------- Explanation pages (explain-doc), on top of html-style (its layout is kept as is) ---------- */
/* Level switch (Simple | Technical): same pill as the language switch */
.level-switch { display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--code-bg); }
.level-switch button { height: 26px; border: 0; background: none; color: var(--text); cursor: pointer; font: 600 12px system-ui, sans-serif; letter-spacing: .03em; padding: 0 10px; border-radius: 999px; white-space: nowrap; transition: background .2s, color .2s; }
.level-switch button.on { background: var(--accent); color: var(--surface); }
.level-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Only the content of the active level is shown (no data-level = both levels) */
:root[data-level="simple"] [data-level="technical"], :root[data-level="technical"] [data-level="simple"] { display: none !important; }
.level-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); vertical-align: middle; }
/* One-sentence summary: as wide as the cards under it */
.tldr { font-size: 18px; line-height: 1.5; padding: 16px 20px; border-radius: 10px; background: var(--accent-soft); border-left: 3px solid var(--accent); margin: 0 0 24px; max-width: none; }
.tldr strong { color: var(--accent); }
/* Small print under a section (sources) */
p.small { font-size: 13px; color: var(--muted); }
/* Stepper: animated diagram, one state per step; controls + caption above the drawing */
.stepper .view svg { max-height: min(400px, 58vh); margin-inline: auto; }
.stepper:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.stepper svg [data-show], .stepper svg [data-text], .stepper svg [data-at] { transition: opacity .16s ease, transform .45s ease, fill .3s; }
.stepper svg .off, .stepper svg .fading { opacity: 0; }
.stepper svg rect, .stepper svg circle, .stepper svg path { transition: fill .25s, stroke .25s; }
.stepper svg .hl { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.4; }
.stepper svg .hl-warn { fill: var(--warn-soft); stroke: var(--warn); stroke-width: 2.4; }
.stepper svg :is(.edge, .edge-accent, .curve, .curve-2):is(.hl, .hl-warn) { fill: none; } /* a line stays a line, never a filled area */
.stepper svg text.hl, .stepper svg text.hl-warn { stroke: none; }
.stepper svg text.hl, .stepper svg text.changed { fill: var(--accent); font-weight: 700; }
.stepper svg text.hl-warn { fill: var(--warn); }
.stepper.init *, .stepper.init *::before, .stepper.init *::after { transition: none !important; }
/* The head follows the scroll only when the figure is taller than the screen (class set by explain.js) */
.stepper.tall .step-head { position: sticky; top: 64px; }
.stepper .step-head { z-index: 5; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.stepper .controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stepper .controls button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; min-width: 32px; padding: 0 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; font: 500 13px/1 system-ui, sans-serif; white-space: nowrap; }
.stepper .controls button svg { width: 14px; height: 14px; flex: none; fill: currentColor; }
.stepper .controls button.play { min-width: 76px; padding: 0 12px; }
.stepper .controls button:hover { border-color: var(--accent); color: var(--accent); }
.stepper .controls button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stepper .controls .count { color: var(--muted); font-size: 13px; margin-left: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stepper .progress { flex: 1; min-width: 80px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.stepper .progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
/* Captions stacked in one cell: cross-fade, the height of the longest one (the drawing doesn't jump); the cell never wider than the head */
.stepper .captions { display: grid; grid-template-columns: minmax(0, 1fr); list-style: none; padding: 0; margin: 10px 0 0; }
.stepper .captions > li { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s .2s; font-size: 15px; line-height: 1.5; }
.stepper .captions > li.on { opacity: 1; visibility: visible; transition: opacity .2s ease .1s, visibility 0s; }
.stepper .captions > li b:first-child { color: var(--accent); }
/* Formula: MathML block + its variables. What does not fit scrolls from its start: never centered past the left edge */
.formula { display: flex; align-items: center; gap: 16px; margin: 16px 0; padding: 14px 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow-x: auto; }
.formula:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.formula math { flex: 1 0 auto; font-size: 1.25em; }
.formula .num { flex: none; color: var(--muted); font-size: 13px; }
/* Playground: inputs -> computed outputs / drawing */
.playground { margin: 16px 0; padding: 18px 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.playground > :last-child { margin-bottom: 0; }
.playground .inputs { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: end; margin-bottom: 14px; }
.playground .inputs > * { min-width: 0; max-width: 100%; }
/* A label reads as a sentence (text and <output> on one line), its field under it; a box or a radio stays in front of its text */
.playground label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.playground label > :is(input:not([type="checkbox"], [type="radio"]), select, textarea) { display: block; margin-top: 4px; max-width: 100%; }
.playground label > input:is([type="checkbox"], [type="radio"]) { margin: 0 6px 0 0; vertical-align: -2px; }
.playground :is(input, select, textarea) { font-weight: 400; }
.playground input[type="range"] { width: min(320px, 70vw); accent-color: var(--accent); }
.playground input[type="text"], .playground input[type="number"] { font: 15px ui-monospace, Menlo, Consolas, monospace; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.playground input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The action of a playground; the copy button of a code block and the tabs keep their own look */
.playground button:not(pre > button, .ctabs > button) { min-height: 32px; padding: 4px 12px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: var(--surface); cursor: pointer; font: 600 13px system-ui, sans-serif; }
.playground button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A box per output, as wide as its longest word: a value never cut in two as long as it fits the playground */
.playground .outputs { display: flex; flex-wrap: wrap; gap: 10px; }
.playground .out { flex: 1 1 150px; max-width: 100%; padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.playground .out span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.playground .out b { font: 600 22px ui-monospace, Menlo, Consolas, monospace; color: var(--text); font-variant-numeric: tabular-nums; }
.playground output { font-variant-numeric: tabular-nums; color: var(--text); }
/* Charts drawn in SVG by the page scripts */
svg .axis { stroke: var(--muted); stroke-width: 1; }
svg .grid { stroke: var(--border); stroke-width: 1; }
svg .curve { fill: none; stroke: var(--accent); stroke-width: 2.2; }
svg .curve-2 { fill: none; stroke: var(--warn); stroke-width: 2.2; stroke-dasharray: 6 4; }
svg .dot { fill: var(--accent); }
svg .dot-2 { fill: var(--warn); }
svg .mark { stroke: var(--text); stroke-width: 1; stroke-dasharray: 3 3; }
/* Glossary terms: the definition opens in one box of the page, placed on the term inside the screen by explain.js (nothing clips it) */
dfn[data-def] { font-style: normal; border-bottom: 1px dashed var(--accent); cursor: help; }
dfn[data-def]:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.dfn-pop {
  position: fixed; z-index: 40; width: max-content; max-width: min(320px, calc(100vw - 16px)); max-height: min(60vh, 420px); overflow-y: auto; overflow-wrap: break-word;
  padding: 8px 10px; border-radius: 6px; background: var(--text); color: var(--bg); font: 400 13px/1.45 system-ui, sans-serif;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2); transition: none;
}
.dfn-pop:focus { outline: none; }
.dfn-pop code { background: none; color: inherit; } /* the box is inverted: a chip of a page script keeps its text readable */
/* Check yourself: the answer's blocks keep their own padding (a code block, a callout) */
details.quiz { margin: 10px 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
details.quiz summary { padding: 10px 14px; margin: 0; cursor: pointer; font-weight: 600; }
details.quiz summary::marker { color: var(--accent); }
details.quiz[open] summary { border-bottom: 1px solid var(--border); }
details.quiz > :not(summary) { margin-inline: 14px; }
/* Compare cards (two approaches side by side) */
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; margin: 14px 0; }
.compare > div { padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.compare > div > :first-child { margin-top: 0; }
.compare > div > :last-child { margin-bottom: 0; }
.compare h4 { margin: 0 0 6px; font-size: 15px; }
@media (max-width: 860px) {
  /* Drawings keep readable labels: they scroll in their box instead of shrinking (never drawn above their viewBox: --drawn-min, explain.js) */
  .stepper .view, figure > .view { overflow-x: auto; }
  .stepper .view:focus-visible, figure > .view:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .stepper .view svg, figure > .view svg { min-width: var(--drawn-min, 0); }
  .stepper.tall .step-head { top: 56px; }
  .level-switch button { padding: 0 8px; }
  .formula { flex-direction: column; }
  .formula math { flex: none; align-self: flex-start; width: max-content; min-width: 100%; }
  .playground input[type="text"], .playground input[type="number"] { font-size: 16px; } /* under 16px iOS zooms the page on focus */
}
@media (max-width: 480px) {
  .brand .repo-name { display: none; } /* room for the level and theme switches */
}
@media (prefers-reduced-motion: reduce) {
  .stepper svg *, .stepper .progress i, .stepper .captions > li { transition: none !important; }
}
/* Phones and touch screens */
@media (max-width: 600px) {
  .tldr { font-size: 16px; padding: 12px 14px; }
  .playground { padding: 14px 12px; }
  .playground .inputs { gap: 12px; }
  .playground input[type="range"] { width: 100%; }
  .playground label { width: 100%; }
  .playground label > :is(input:not([type="checkbox"], [type="radio"]), select, textarea) { width: 100%; }
  .playground .out b { font-size: 19px; }
  .formula { padding: 10px 12px; }
  .stepper .controls .progress { flex-basis: 100%; order: 5; }
}
@media (pointer: coarse) {
  .stepper .controls button { height: 44px; min-width: 44px; }
  .playground button:not(pre > button, .ctabs > button) { min-height: 44px; }
  .playground input[type="range"] { height: 32px; }
  .level-switch { height: 40px; }
  .level-switch button { height: 32px; min-width: 52px; }
  details.quiz summary { display: list-item; } /* keeps its marker, and a long word wraps */
}
/* The smallest phones with the two switches and the theme: the bar holds them, nothing sticks out of the page */
@media (max-width: 400px) {
  .topbar:has(.lang-switch) .top-actions { gap: 4px; }
  .topbar:has(.lang-switch) :is(.level-switch, .lang-switch) button { min-width: 0; padding: 0 6px; font-size: 11.5px; letter-spacing: 0; }
}
@media (max-width: 350px) {
  .topbar:has(.lang-switch) .brand { display: none; }
}
@media print {
  .stepper .controls, .level-switch, .dfn-pop { display: none; }
  /* The last state of the drawing (explain.js) with every caption under the other, not one state and a blank */
  .stepper.tall .step-head { position: static; }
  .stepper .captions { display: block; margin: 0; padding-left: 20px; list-style: decimal; }
  .stepper .captions > li { opacity: 1; visibility: visible; }
  .stepper .view, figure > .view, .formula { overflow: visible; }
  .stepper .view svg { max-height: none; }
}
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall