By GuyNachshon
Teaches Claude Code how to use @chenglou/pretext for DOM-free multiline text measurement and layout.
A Claude Code skill that teaches the assistant how to use
@chenglou/pretext — the pure-JS/TS library for DOM-free
multiline text measurement and layout — correctly and idiomatically.
The skill loads automatically when you ask Claude Code anything about measuring text height without the DOM, wrapping/laying out text to canvas/SVG, computing line counts, shrink-wrapping a container to its text, virtualizing long text lists, or laying out inline rich text with chips/mentions.
The skill is a thin decision and usage layer on top of pretext's own
README.md, which remains the authoritative API reference. It deliberately does not duplicate signatures, so it can't drift out of sync.
prepare() once, layout() many; never re-prepare the same
(text, font, options).prepare/layout), rich manual layout (prepareWithSegments + walkLineRanges /
layoutNextLineRange / layoutWithLines), and the @chenglou/pretext/rich-inline helper.font / lineHeight /
letterSpacing with your CSS, avoid system-ui, await font load, clamp empty strings.This repo is a Claude Code plugin marketplace. Inside Claude Code, run:
/plugin marketplace add GuyNachshon/pretext-claude-skill
/plugin install pretext-skill@pretext-claude-skill
That's it — no cloning, no file copying. The skill activates automatically when relevant. Later, update to the latest version with:
/plugin update pretext-skill@pretext-claude-skill
If you'd rather not use the plugin system, the skill is a single Markdown file at
plugins/pretext-skill/skills/pretext/SKILL.md.
Put it where Claude Code discovers skills.
Personal (available in every project):
git clone https://github.com/GuyNachshon/pretext-claude-skill.git
cp -r pretext-claude-skill/plugins/pretext-skill/skills/pretext ~/.claude/skills/pretext
Project-scoped (committed to a repo, shared with your team) — copy it into the repo's
.claude/skills/ so it travels with the code:
cp -r pretext-claude-skill/plugins/pretext-skill/skills/pretext <your-repo>/.claude/skills/pretext
Restart Claude Code (or start a new session) so it picks up a manually-copied skill.
In a Claude Code session, ask something like "how do I measure a paragraph's height with pretext
without touching the DOM?" — the pretext skill should activate and the answer should lead with
the prepare() / layout() split.
The API names in the skill are verified against @chenglou/pretext's published exports
(src/layout.ts, src/rich-inline.ts). If pretext ships a new minor with API changes, update
plugins/pretext-skill/skills/pretext/SKILL.md
(and bump version in plugins/pretext-skill/.claude-plugin/plugin.json) — but keep concrete
signatures pointing back to pretext's README rather than copying them here.
MIT. The skill describes the MIT-licensed @chenglou/pretext library but is an
independent community contribution and is not affiliated with or endorsed by its maintainer.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub guynachshon/pretext-claude-skill --plugin pretext-skillML engineering assistant for Hugging Face — research-first methodology, dataset auditing, HF Jobs orchestration, sandbox-driven development. Slash commands, a research subagent, and content-aware approval policy ported from the standalone ml-intern CLI.
Create and edit Obsidian vault files including Markdown, Bases, and Canvas. Use when working with .md, .base, or .canvas files in an Obsidian vault.
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Frontend design skill for UI/UX implementation
Comprehensive UI/UX design plugin for mobile (iOS, Android, React Native) and web applications with design systems, accessibility, and modern patterns
Memory compression system for Claude Code - persist context across sessions
Marketing skills for AI agents — conversion optimization, copywriting, SEO, paid ads, ad creative, and growth