chenglou / chenglou/pretext

Agent skill for Pretext — helps AI coding agents use the library correctly

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
50.3k
Forks
2.7k
Avg merge
2h 40m
Merged PRs (30d)
69

Description

Hey! I built an agent skill for Pretext that teaches AI coding agents (Claude Code, Cursor, Copilot, etc.) how to use the library correctly, picking the right API path, caching `prepared` handles, matching font/CSS strings, and avoiding common mistakes like re-preparing on resize.

**Install:**
```bash
npx skills add asharibali/pretext-skills
```

**Repo:** https://github.com/asharibali/pretext-skills

**What it covers:**
- Fast path (`prepare` → `layout`) vs rich path (`prepareWithSegments` → line APIs)
- When to use `layoutWithLines` vs `walkLineRanges` vs `layoutNextLine`
- Caching strategy, `pre-wrap` mode, `system-ui` gotcha
- Real patterns: virtualized lists, auto-sizing textareas, canvas rendering, flow-around-image, shrink-wrap

The skill references the actual READMEs as bundled resources so agents get accurate, up-to-date guidance.

Would love any feedback, and happy to update if anything is inaccurate or if the API evolves. Also open to this being linked from the official README if you think it'd be useful for developers using AI tools with Pretext.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the official README and reviewing the linked pretext-skills repository, especially its bundled README resources and documented API paths. Determine whether the skill is accurate and whether a README link is appropriate; done means the requested feedback or documentation decision is recorded and any agreed README change is made.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
developer-experience, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.