agentleFS
definite-ddefinite-d/agent-skills/skills/specular/SKILL.md

specular

Skill2 starsChanged 4 months agoMITView on GitHub

Build a zero-build viewer for a folder of markdown: grouped sidebar navigation, filter search, light/dark themes, syntax highlighting, copy buttons, a raw-source toggle, previous and next links, and scroll restore that only applies to reloads. Ships the finished viewer. Use when someone wants to read specs, ADRs, RFCs, prompts, runbooks, or notes in a decent UI, or asks for a "spec browser", "docs viewer", "markdown reader", "documentation portal", or "single file, no build". Skip it for public sites that need SEO, real routing, auth, or multi-user editing.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Code colors: keep the --code-* palette.

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Specular

The viewer is already built and styled: references/viewer.html. Copy it, point it at the documents, add the libraries. Do not redesign it.

1. Ask one question

One file or folder?

  • One file (default). A single HTML with marked, marked-highlight, highlight.js, and the font inlined. About 640KB, mostly the font.
  • Folder. index.html, style.css, app.js, and vendor/ for people who want to inspect or edit the parts.

Both come from the same file.

2. Edit four things

  1. <title> and <span class="brand">.
  2. SPECS and PROMPTS: one { num, name, file } per document, paths relative to the viewer root. The same order drives the sidebar and the previous/next links at the end of each document.
  3. Optional: the color tokens in :root and .light.
  4. Optional: the sidebar group labels in the markup.

3. Libraries

The app script expects three UMD builds loaded before it: marked 12 (window.marked.marked), marked-highlight 2.1 (window.markedHighlight.markedHighlight), and the highlight.js 11 common build (global hljs). Inter 4 variable is the webfont the CSS points at, ./vendor/fonts/InterVariable.woff2. Later versions work if they keep those globals.

One file: inline the three scripts where the <!-- specular:libs --> marker sits, embed the font as base64, and drop the preload link. Folder: copy the files to vendor/ and vendor/fonts/, link them at the marker in the same order, and move the <style> block to style.css and the app script to app.js.

4. Serve

Any static server works, for example python3 -m http.server 8000. There are no module imports, and the viewer fetches with cache: "no-cache", so revalidation is covered. Opening the file from file:// will not load documents.

Traps

The viewer already handles these. If you rewrite one, keep the reason.

  • Sidebar collapse: animate width on the aside and keep the grid at auto 1fr. display: none on a grid child auto-places the reader into the empty column.
  • Theme flash: set the class from an inline <head> script, before the stylesheet. Doing it on load flashes.
  • Code colors: keep the --code-* palette. Third-party hljs themes are tuned to another background and look faded here. Every token clears 4.5:1 against --code-bg.
  • Highlighting: the common build only, langPrefix: "hljs language-", no highlightAuto(). Unlabeled fences stay plain on purpose.
  • Markdown in markdown: four backticks around the outer block, labelled markdown. CommonMark closes at the first fence of equal length, so three backticks truncate silently.
  • Scroll: restore only on the initial load from sessionStorage, clear it on navigation, and null the current file before swapping innerHTML.
  • Stale documents: fetch with cache: "no-cache". Servers send Last-Modified without Cache-Control, so browsers otherwise serve an hour-old copy.
  • Motion: nothing over 300ms, and respect prefers-reduced-motion.

Ship

Open it in a browser: both themes, collapse the sidebar, search, copy a block, toggle the source view, walk previous/next to the last document and back, reload mid-document. That is the test.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.