agentleFS
rakaarwakyrakaarwaky/agents-arwaky/skills/web-design/pretext/SKILL.md

pretext

Skill0 starsChanged 4 days agoMITView on GitHub

Build creative browser demos with DOM-free text layout.

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use touchdesigner-mcp, heartmula and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • john-data-chenSkill

    touchdesigner-mcp

    Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.

    Also in 7 projects that use this

  • math-incSkill

    heartmula

    Set up and run HeartMuLa, the open-source music generation model family (Suno-like). Generates full songs from lyrics + tags with multilingual support.

    Also in 6 projects that use this

  • john-data-chenSkill

    teams-meeting-pipeline

    Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.

    Also in 6 projects that use this

  • math-incSkill

    github-repo-management

    Clone, create, fork, configure, and manage GitHub repositories. Manage remotes, secrets, releases, and workflows. Works with gh CLI or falls back to git + GitHub REST API via curl.

    Also in 7 projects that use this

  • Tommy-ywSkill

    songwriting-and-ai-music

    Songwriting craft, AI music generation prompts (Suno focus), parody/adaptation techniques, phonetic tricks, and lessons learned. These are tools and ideas, not rules. Break any of them when the art calls for it.

    Also in 6 projects that use this

  • tunnckoCoreSkill

    python-debugpy

    Debug Python: pdb REPL + debugpy remote (DAP).

    Also in 8 projects that use this

  • +3 more from math-inc

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Scope: Use pretext only when the demo needs to know line breaks *before* rendering.

    line 45
  2. Very specific:

    API invariants: Call prepare()/prepareWithSegments() once per text+font pair and cache the handle.

    line 53

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “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

Pretext Creative Demos

@chenglou/pretext is a 15KB zero-dependency TypeScript library by Cheng Lou (React core, ReasonML, Midjourney) for DOM-free multiline text measurement and layout: given (text, font, width), it returns line breaks, per-line widths, per-grapheme positions, and total height via canvas measurement, no reflow. It is a creative primitive: reflow paragraphs around a moving sprite at 60fps, build games whose level geometry is real words, shatter text into particles, or pack shrink-wrapped multiline UI with zero getBoundingClientRect thrash.

This skill makes cool demos with it — the kind people post to X. The community demo corpus is at pretext.cool and chenglou.me/pretext.

Global rules

  • Creative standard. Pretext returns numbers; you draw the thing. Don't ship a "hello world" demo — the hello-orb-flow.html template is the starting point; every delivered demo adds intentional color, motion, composition, and one visual detail the user didn't ask for. Dark backgrounds with considered palettes (amber-on-black, editorial white-on-charcoal, risograph pastels). Proportional fonts are the point — lean into "not monospaced". Use real source text, never lorem ipsum. First-paint excellence: no loading states, no blank frames.
  • Scope. Use pretext only when the demo needs to know line breaks before rendering. Don't use for static CSS/HTML layouts, rich text editors, image → text (use ascii-art / ascii-video skills), or canvas generative art with no text role (use p5js).
  • Stack. Single self-contained HTML file per demo, no build step: @chenglou/pretext via esm.sh CDN, Canvas 2D for rendering, Intl.Segmenter for grapheme splits, raw DOM events for interaction. Details: references/stack-and-use-cases.md.
  • API invariants. Call prepare()/prepareWithSegments() once per text+font pair and cache the handle; set ctx.font once per frame; keep the prepare() font string exactly in sync with the rendered CSS; use Intl.Segmenter for grapheme splits. Pitfalls + verification: references/pitfalls.md.

Routing

StepReferencePurpose
API & use casesreferences/stack-and-use-cases.mdThe two use cases (measure-only vs measure+render), streaming variable-width flow, helpers, pinned CDN import.
Pick a patternreferences/patterns.mdCommunity demo patterns and which pretext API each uses. Pick one, riff on it — don't invent a new category unless asked.
Pitfalls & verificationreferences/pitfalls.mdPerformance notes, 8 common pitfalls, 10-item verification checklist.
Starterstemplates/hello-orb-flow.html, templates/donut-orbit.htmlWorking starters: reflow around a moving orb; measured ASCII logo obstacles with draggable wire shapes.
Inspirationreferences/community-demos.mdClone-worthy community demos and the official playground gallery.

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.