Skip to content

skills: add pretext (creative demos with @chenglou/pretext)#17259

Merged
OutThisLife merged 2 commits into
mainfrom
bb/pretext-skill
Apr 29, 2026
Merged

skills: add pretext (creative demos with @chenglou/pretext)#17259
OutThisLife merged 2 commits into
mainfrom
bb/pretext-skill

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Context

Adds a pretext skill under skills/creative/ so Hermes can make cool browser demos with @chenglou/pretext — Cheng Lou's 15KB zero-dep DOM-free text-layout library that's been going viral on X for its wild creative demos (text flowing around dragged sprites, ASCII dragons, text-made-of-Tetris, etc.).

The author literally tweeted "throw your AI into making cool demos for it" — so this skill teaches that AI how.

What's in the skill

  • SKILL.md (13.5 KB) — positions pretext as a creative primitive, not plumbing. Covers both use-cases (height-only prepare/layout and manual-render prepareWithSegments/layoutNextLineRange), a creative-standard section, workflow, perf notes, 8 named pitfalls, verification checklist, and links to the community demo corpus at pretext.cool.
  • references/patterns.md (8 KB) — 7 copy-pasteable demo recipes: flow-around-obstacle, text-as-geometry game, shatter/particles, proportional ASCII surfaces, editorial multi-column, multiline shrink-wrap, kinetic type, plus a font-stack palette table.
  • templates/hello-orb-flow.html — minimal starter: a paragraph flows around a mouse-tracked glowing orb using layoutNextLineRange with a per-row corridor-width function.
  • templates/donut-orbit.html — the money demo: a full 3D Sloane torus rendered entirely from prose graphemes, with orbit controls (drag to rotate, scroll to zoom, idle auto-rotate). Amber-on-black CRT aesthetic, z-buffer keyed by screen cell, 60fps on my laptop.

Verified

Both templates tested in-browser via a local static server. No console errors, measureLineStats returns a real value, drag+zoom confirmed working, ~60fps measured.

Conventions

  • Frontmatter validated against tools/skill_manager_tool.py constraints (name ≤64, description ≤1024, body ≤100k — all well within).
  • Structure matches peer skills in skills/creative/ (overview → when-to-use → creative standard → stack → patterns → workflow → pitfalls → checklist).
  • related_skills all resolve in-repo (p5js, claude-design, excalidraw, architecture-diagram).
  • Pretext pulled via esm.sh CDN, pinned to @0.0.6. No build step, no Node deps added.

How to try the donut

cd skills/creative/pretext/templates
python3 -m http.server 8765
# open http://localhost:8765/donut-orbit.html

Drag to orbit, scroll to zoom. Let go and it idle-rotates.

Adds a 'pretext' skill under skills/creative/ for building cool browser
demos with @chenglou/pretext — the 15KB DOM-free text-layout library by
Cheng Lou.

The skill documents pretext as a creative primitive (not plumbing): text
flowing around obstacles, text-as-geometry games, proportional ASCII
surfaces, shatter/particle typography, editorial multi-column, kinetic
type, and multiline shrink-wrap. Each pattern pairs with copy-pasteable
snippets in references/patterns.md.

Two single-file HTML templates, both verified in a browser:

  templates/hello-orb-flow.html
    Minimal starter: long paragraph flows around a mouse-tracked orb
    using layoutNextLineRange + a per-row corridor-width function.

  templates/donut-orbit.html
    Full 3D Sloane torus with orbit controls (drag to rotate, scroll to
    zoom, idle auto-rotate). Each 'luminance pixel' is a real grapheme
    sampled in reading order from a prose corpus via pretext's
    prepareWithSegments + layoutWithLines + Intl.Segmenter. Amber-on-
    black CRT aesthetic, z-buffer keyed by screen cell, 60fps.

Related skills: p5js, claude-design, excalidraw, architecture-diagram.
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) labels Apr 29, 2026
Capture the reusable layout and animation lessons from the advanced Pretext demo so the skill teaches measured obstacle fields, morphing geometry, and polished browser examples.
@OutThisLife OutThisLife merged commit 456955c into main Apr 29, 2026
9 of 10 checks passed
@OutThisLife OutThisLife deleted the bb/pretext-skill branch April 29, 2026 19:57
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
skills: add pretext (creative demos with @chenglou/pretext)
jsboige pushed a commit to jsboige/hermes-agent that referenced this pull request May 14, 2026
skills: add pretext (creative demos with @chenglou/pretext)
dannyJ848 pushed a commit to dannyJ848/hermes-agent that referenced this pull request May 17, 2026
skills: add pretext (creative demos with @chenglou/pretext)
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
skills: add pretext (creative demos with @chenglou/pretext)
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
skills: add pretext (creative demos with @chenglou/pretext)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants