Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/yaniv-golan/pretext-skill/pretextnpx skills add yaniv-golan/pretext-skill --skill pretextgit clone --depth 1 https://github.com/yaniv-golan/pretext-skillWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/yaniv-golan/pretext-skill/pretext)<a href="https://agentmods.dev/skills/yaniv-golan/pretext-skill/pretext"><img src="https://agentmods.dev/badge/skills/yaniv-golan/pretext-skill/pretext.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00182 | $0.04690 |
| Opus 5 | $0.00091 | $0.02345 |
| Sonnet 5 | $0.00036 | $0.00938 |
| Haiku 4.5 | $0.00018 | $0.00469 |
Grade A, and why
pretext scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 284 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pretext Integration Guide
You are helping a developer use @chenglou/pretext — a small, tree-shakable TypeScript library by Cheng Lou that computes exact text metrics using pure math (no DOM reflows). It uses CanvasRenderingContext2D.measureText internally, segments text, measures once, caches, then does arithmetic for all subsequent layouts. The package ships proper ESM with subpath exports (. for core, ./rich-inline for inline rich text) and is sideEffects: false — modern bundlers tree-shake unused entrypoints.
When Pretext Is the Right Tool
Use Pretext when the developer needs to:
- Know text dimensions before rendering — virtual scrolling, masonry layouts, card height estimation
- Auto-fit text to a container — find the largest font size that keeps text within N lines (CSS has no equivalent)
- Flow text around obstacles — magazine-style layouts where text wraps around shapes, images, or interactive elements
- Measure text in canvas/SVG/WebGL — Pretext's measurements are exact for
fillText - Render rich inline text — mentions, chips, code spans with browser-like boundary whitespace collapse, via the
@chenglou/pretext/rich-inlinesubpath - Measure many text items fast — each
layout()call is ~0.0002ms after the firstprepare()per font
When NOT to Use Pretext
- CSS float/flex already handles it — don't reimplement text flow that CSS does natively
- Content is HTML, not plain text — Pretext measures plain text strings. Tables, code blocks, nested elements need DOM measurement
- TanStack Virtual + Pretext height estimation — this integration is fragile. Height errors compound over many items, and
measureElementcorrection loops cause desyncing. For <500 items, just render all and use CSS transitions. For 1000+, use Pretext estimates as seeds but rely on DOM correction - Accordion content height — if content has HTML structure, use off-screen DOM measurement (
visibility: hidden; position: absolute)
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 284 lines · 182 tokens per session scan A ecc5a89291d3
pretext is a skill published in the GitHub repository yaniv-golan/pretext-skill (15 stars, last pushed 1mo ago), licensed MIT. It adds 182 tokens to every session and 4,690 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
fec-typescript-project-standard
用于创建、配置、审查或调试前端应用、库、SDK、CLI、monorepo 包中的 TypeScript 项目规范,包括 tsconfig、strictness、module/moduleResolution、路径别名、project references、声明文件、package exports、公共 API 类型、DTO、高级泛型、判别联合、类型守卫、类型收窄或类型级回归。React/Vue/Next/Nuxt 组件架构优先使用框架项目 skill;中文触发词包括 TypeScript 项目规范、TS 项目规范、TypeScript 类型安全、类型建模、泛型、判别联合、类型收窄、tsconfig、声明文件。.
fec-vue3-project-standard
用于设计或审查 Vue 3 + TypeScript 项目结构、SFC/组件边界、composables 组织、路由组合、Pinia 归属、API/错误/样式默认约定、directives 或仓库级 Vue 规范。表单、数据获取、测试、无障碍、虚拟列表、动画或安全深挖优先使用更窄的 skill;中文触发词包括 Vue 3 项目规范、Vue 组件架构。.
feathers-service
Scaffold or extend a FeathersJS v5 (Dove) service using the idiomatic four-file pattern ( .ts, .class.ts, .schema.ts, .shared.ts), register it with app.configure, and wire it into the ServiceTypes declaration. Use this whenever the user wants to add a new resource, endpoint, collection, table-backed CRUD service, or…
ultracite
Ultracite is a zero-config linting and formatting preset for JavaScript/TypeScript projects. Use when: (1) Setting up or initializing Ultracite in a project (ultracite init), (2) Running linting or formatting commands (check, fix, doctor), (3) Writing or reviewing JS/TS code in a project that uses Ultracite — to…
microsoft-typescript
TypeScript is a language for application scale JavaScript development. ALWAYS use when editing or working with .ts, .tsx, .mts, .cts files or code importing "typescript". Consult for debugging, best practices, or modifying typescript, TypeScript.
better-auth
Skill for integrating Better Auth - comprehensive TypeScript authentication framework for Cloudflare D1, Next.js, Nuxt, and 15+ frameworks. Use when adding auth, encountering D1 adapter errors, or implementing OAuth/2FA/RBAC features.