docs: add Claude Code usage skill for pretext - #197
Open
GuyNachshon wants to merge 1 commit into
Open
Conversation
Adds .claude/skills/pretext/SKILL.md, a usage-oriented skill that helps Claude Code (and contributors using it) apply the library correctly: - leads with the prepare-once / layout-many model and the "never re-prepare the same input" rule - a decision guide for choosing between the fast path (prepare/layout), rich manual layout (prepareWithSegments/walkLineRanges/layoutNextLineRange), and the rich-inline helper - an accuracy contract (sync font/lineHeight/letterSpacing with CSS, avoid system-ui, await font load, empty-string clamp) - supported vs. out-of-scope CSS surface, recipes, and a best-practices checklist Points back to README.md as the authoritative API reference per CLAUDE.md, so the skill stays a thin decision/usage layer rather than duplicating signatures. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
also created this as a separate repo -> https://github.com/GuyNachshon/pretext-claude-skill |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
.claude/skills/pretext/SKILL.md— a Claude Code skill that teaches the assistant how to use@chenglou/pretextcorrectly. Since the repo already ships aCLAUDE.md, this lets anyone working in the repo with Claude Code get accurate, on-demand guidance without re-reading the full README each time.It's a single Markdown file, no code or build changes.
Why a skill instead of more README
The README is (rightly) the exhaustive API reference. A skill is a thin decision/usage layer on top of it — it loads only when relevant and focuses on the judgment calls the reference doesn't foreground:
prepare-once /layout-many model and the "never re-prepare()the same(text, font, options)" rule, since most correct usage follows from respecting that seam.prepare/layout), rich manual layout (prepareWithSegments+walkLineRanges/layoutNextLineRange/layoutWithLines), and therich-inlinehelper.font/lineHeight/letterSpacingwith CSS, avoidsystem-ui, await font load, clamp empty strings.It explicitly points back to
README.mdas the authoritative API reference (per the repo'sCLAUDE.mdconvention), so it stays a usage layer rather than a second copy of the signatures that could drift.Notes
0.0.7exports insrc/layout.tsandsrc/rich-inline.ts.CLAUDE.md/DEVELOPMENT.mdalready cover).docs/) or drop it if a tool-specific directory isn't wanted in the repo.🤖 Generated with Claude Code