--- // SkillPackageExplorer — the four-file skill-package picker. The interactive // version of the `data-package-file` buttons that the vanilla skills page // shipped, rewritten for the Astro chapter surface. The four package entries // mirror skills/app.js so the migration preserves content 1:1; the buttons // carry `data-skill-file` and the click handler swaps the preview panel // contents client-side. // // Page is `client:visible` rather than `client:load`: the picker sits below // the hero and grid; deferring until it scrolls into view keeps initial JS // to zero for the above-the-fold content. The page ships zero JS for the // hero/grid/footer parts — only the picker island hydrates. interface PackageFile { id: 'skill' | 'references' | 'scripts' | 'assets'; prefix: '├── ' | '└── '; label: string; /** Small caption under the file label, mirrors the vanilla source. */ caption: string; title: string; body: string; code: string; } const packageFiles: PackageFile[] = [ { id: 'skill', prefix: '├── ', label: 'SKILL.md', caption: 'trigger + workflow', title: 'The operating contract', body: 'The one file that should always be loaded. Define the exact trigger, the ordered workflow, safety limits, and the evidence the agent returns.', code: '---\nname: review-ui\ndescription: Review a changed UI for focus, reflow, and motion.\n---\n\n1. Inspect the changed interaction.\n2. Run the UI checks.\n3. Return findings with evidence.', }, { id: 'references', prefix: '├── ', label: 'references/', caption: 'conditional facts', title: 'Facts, only when needed', body: 'Keep conditional detail out of the main instruction. A dialog pattern, framework caveat, or accessibility checklist belongs here when it is not needed for every review.', code: 'references/\n└── accessibility.md\n ├── keyboard interaction patterns\n └── focus and reflow checklist', }, { id: 'scripts', prefix: '├── ', label: 'scripts/', caption: 'deterministic checks', title: 'Mechanics that should not depend on memory', body: 'Turn deterministic checks into runnable tools. The agent still judges the result, but it should not have to recreate a viewport test or filename rule by hand.', code: 'scripts/\n└── check-reflow.mjs\n └── checks 320px, 1280px, and 4K widths', }, { id: 'assets', prefix: '└── ', label: 'assets/', caption: 'templates + examples', title: 'Starting material, not hidden instructions', body: 'Use assets for templates and examples a person or agent can copy. Keep them clearly named so package readers can choose the right starting point.', code: 'assets/\n├── review-report.md\n└── focus-test-fixture.html', }, ]; ---
REVIEW-UI / SKILL PACKAGE
{ packageFiles.map((file, index) => ( )) }