/** * The UI pointers: what the generated UI blocks SAY and WHERE they go. The * markers, splicing and file handling are the engine's (`pointer-blocks.ts`). * * The UI skills get richer pointers than the other skills (a lead line per * kind of package, the search commands, the done-gate) because UI work is * where external agents went most wrong — see * docs/design/2026-10-09-repo-skills-and-ui-skill-plan.md. */ import * as fs from 'node:fs' import * as path from 'node:path' import { type AgentsTarget, type BlockSpec, mdcHeader, type MdcTarget } from './pointer-blocks.js' export const UI_BLOCK_ID = 'ui-pointer' export const UI_HEADING = 'UI work' export type UiPointerKind = 'root' | 'admin' | 'library' | 'page' | 'agent-ui' const SKILL = (name: string): string => `.claude/skills/${name}/SKILL.md` const LEAD: Readonly> = { root: '**UI work** (admin-ui, ui-library, an addon page or widget, the viewer): load the `camstack-ui` skill first — `.claude/skills/camstack-ui/SKILL.md` — then `camstack-ui-admin` or `camstack-ui-viewer`. Claude Code and Cursor list them as skills; any other agent reads them as files.', admin: '**This package is the admin UI.** Before any UI change load `camstack-ui` (`.claude/skills/camstack-ui/SKILL.md`), then `camstack-ui-admin` (`.claude/skills/camstack-ui-admin/SKILL.md`). Page patterns: `docs/ui/admin-patterns.md`.', library: '**This package is the shared component library** (host-provided to every addon page). Before any change load `camstack-ui`, then `camstack-ui-admin` (`.claude/skills/camstack-ui-admin/SKILL.md`). A new export goes in the `src/primitives` / `src/composites` barrel, with a spec, then `npm run ui:catalogue`.', page: '**This package ships an addon page** (a Module Federation remote). Before any UI change load `camstack-ui`, then `camstack-ui-admin` (`.claude/skills/camstack-ui-admin/SKILL.md`). It ships no CSS: its classes exist only because the admin-ui build scans it (D747, `npx tsx scripts/check-addon-page-css.ts`).', 'agent-ui': '**This package is the agent UI.** Before any UI change load `camstack-ui`, then `camstack-ui-admin` (`.claude/skills/camstack-ui-admin/SKILL.md`); it uses the same library and theme as the admin UI.', } const COMMON_LINES: readonly string[] = [ '- Search before building: `npm run ui:find -- ""`, `npm run ui:show -- `, `npm run ui:tokens`.', '- Library components and theme tokens only: no hex, no palette classes (`bg-red-500`), no colour or spacing in `style=`.', '- Rules: `docs/ui/README.md` (conventions, need → component, admin patterns, viewer, anti-patterns).', '- Done = the skill’s done-gate: `npm run ui:check -- ` with 0 new findings, plus `npm run ui:shots` before/after (dark + light, desktop 1440×900 + phone 390×844).', '- After `ui:shots`: **Read the PNG files** under `scratchpad/ui-shots/