skills/pretext-check/SKILL.md
Check @chenglou/pretext dependency status, version, and DOM measurement tech debt. Use when working in frontend/JS/TS projects to assess Pretext adoption, scan for reflow-triggering DOM measurement patterns, and monitor the dependency chain. Triggered automatically by frontend-touching commands or explicitly via /pretext-check.
npx skillsauth add rdfitted/claude-code-setup pretext-checkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Check if @chenglou/pretext is installed, compare to latest version, and scan for DOM measurement patterns that Pretext could replace.
--install: Install or update @chenglou/pretext if not present or outdated--scan-only: Skip version check, only scan for DOM measurement tech debt1. Check for package.json (Node/JS project)
2. If no package.json found, report "No JS/TS project detected" and skip to Step 3 (scan-only)
# Check if pretext is installed
grep -s "pretext" package.json
# Check installed version
npm ls @chenglou/pretext 2>/dev/null || echo "NOT INSTALLED"
# Check latest available version
npm view @chenglou/pretext version 2>/dev/null || echo "REGISTRY UNREACHABLE"
# Check for changelog/breaking changes if update available
npm view @chenglou/pretext --json 2>/dev/null
If --install flag and not installed or outdated:
npm install @chenglou/pretext
Scan the codebase for patterns that Pretext could replace. These are reflow-triggering DOM measurement calls used on text elements:
High-confidence patterns (directly replaceable by Pretext):
- getBoundingClientRect() — on text containers
- offsetHeight / offsetWidth — on text elements
- scrollHeight / scrollWidth — for text overflow detection
- clientHeight / clientWidth — on text containers
- getComputedStyle() — for font/line-height reads
- ResizeObserver callbacks — that measure text height
- measureText() — canvas measureText without Pretext
Medium-confidence patterns (may benefit from Pretext):
- useLayoutEffect — with height/width reads inside
- requestAnimationFrame — with measurement inside
- MutationObserver — watching text size changes
- "layout shift" / "CLS" — comments indicating awareness of the problem
Search using Grep across JS/TS/JSX/TSX files:
Grep: getBoundingClientRect glob: "*.{js,ts,jsx,tsx}"
Grep: offsetHeight|offsetWidth glob: "*.{js,ts,jsx,tsx}"
Grep: scrollHeight|scrollWidth glob: "*.{js,ts,jsx,tsx}"
Grep: clientHeight|clientWidth glob: "*.{js,ts,jsx,tsx}"
Grep: getComputedStyle glob: "*.{js,ts,jsx,tsx}"
Grep: measureText glob: "*.{js,ts,jsx,tsx}"
Grep: useLayoutEffect glob: "*.{js,ts,jsx,tsx}"
For each match, read surrounding context (5 lines) to determine if it's text-measurement related vs. general layout.
If @chenglou/pretext is installed, check:
# Check dependency tree depth
npm ls @chenglou/pretext --all 2>/dev/null
# Check for peer dependency conflicts
npm ls --json 2>/dev/null | grep -A5 "pretext"
# Check bundle size impact
npm pack --dry-run @chenglou/pretext 2>/dev/null
Output a structured report:
## Pretext Dependency Status
| Item | Status |
|------|--------|
| Installed | YES / NO |
| Current Version | x.y.z / N/A |
| Latest Version | x.y.z |
| Update Available | YES / NO |
| Breaking Changes | WARNING / None |
## DOM Measurement Tech Debt
### High Priority (Direct Pretext Replacements)
- `file:line` — `getBoundingClientRect()` on text container — **Replaceable**
- ...
### Medium Priority (Potential Pretext Benefits)
- `file:line` — `useLayoutEffect` with height read — **Review needed**
- ...
### Summary
- **X** high-priority patterns found (directly replaceable)
- **Y** medium-priority patterns found (review needed)
- **Estimated lift**: LOW / MEDIUM / HIGH
## Recommendations
- [ ] Install/update @chenglou/pretext
- [ ] Replace X direct measurement patterns
- [ ] Review Y potential patterns
- [ ] Run /perf-audit after changes to measure impact
This skill is called automatically by:
/build — when frontend code is being implemented (Phase 0.6 check)/kickoff — during Phase 3 doc generation for frontend projects/scope — during Phase 2 scouting for frontend-impacting scopes/create-issue — when issue involves text layout or measurement/plan — when planning frontend features/perf-audit — as part of the full performance auditWhen called from another command, return a condensed summary (not full report) for inclusion in that command's output.
development
Restore from the Kopia backup repo in one of two opinionated modes. **wikis** (frequent, default) syncs per-project `.ai-docs/` directories from backup to local project trees — used to move compound-knowledge wikis between machines via the backup drive as sneakernet. **full** (rare) restores all sources to original paths for greenfield machine rebuild. Use when the user says "restore wikis", "sync wikis from backup", "pull the wikis", "I plugged in the backup drive on this machine", "rebuild this machine", "greenfield restore", or "restore everything". For ad-hoc single-file restores, use `backup-ops restore` instead.
documentation
# /bp-iterate Iterate the Fitted Business Plan(s). Manages the **internal canonical** and the **external partner/investor variant**, snapshot-on-version-bump lineage, redaction enforcement between variants, and cross-document coupling. ## When this runs - User says `/bp-iterate`, "iterate the BP," "bump the BP," "update the business plan," "version up the BP," "create / update / refresh the external variant" - A material trigger fires per the BP's own Iteration Log (first 2 new closes / fundi
tools
Run Kopia-based backups of key Windows files and config to an external drive. Use when the user says "back up", "run a backup", "snapshot", "the backup drive is plugged in", or wants to set up / configure backups for the first time. Handles initial repo setup, drive detection by volume label, source enumeration, and snapshot creation with structured exclusions.
testing
Secondary backup operations against the Kopia repo — verify integrity, run maintenance/prune, mirror to a second destination, restore files/folders, or run a quick top-up snapshot of hot directories. Use when the user says "verify backups", "check backup integrity", "prune old snapshots", "restore from backup", "mirror backups to cloud", "quick backup", "top up the backup", or asks about backup health. For the primary backup run, use the `backup` skill instead.