bascik-migrate
Installation
SKILL.md
Migrating to Bascik
Requires the bascik skill for component rules and the bascik-scripts skill for build-time data.
To have coding agents refactor a live site to production parity at every breakpoint and 100 in all five Lighthouse categories, install the opt-in bascik-refactor skill (npx skills add bascikdev/bascik --skill bascik-refactor) and read node <skills-dir>/bascik/scripts/read-doc.mjs /how-to/agent-migration.
Procedure
- Inventory. List every URL, shared layout region (
<head>tags, header, footer, nav), repeated widget, data source, and client behavior. Runnode <skills-dir>/bascik/scripts/list-components.mjsif Bascik components already exist. - Read the framework guide.
node <skills-dir>/bascik/scripts/read-doc.mjs /switch/from-<framework>(react,next,vue,svelte,astro,eleventy,hugo,wordpress). Read it before writing any code; it maps each framework feature to its Bascik equivalent. - Pages first. One
.htmlper URL insrc/pages/, each with its own<html>,<head>, and<body>. Parameterized URLs become dynamic route templates. - Extract components. Each page ends up as a list of tags, not a pasted block of the old site's HTML. Shared head becomes
<site-head />; header, footer, and nav become components; each section with a nameable job (hero, pricing, reviews, signup form) becomes a component; repeated widgets become one component with props and slots. Follow the old site's component boundaries where they are sound, but do not copy wrappers that only existed for the framework (providers, layout shells, one-element components) or props threaded through layers: use a slot instead. Usenew-component.mjs(in thebascikskill) for the folder layout, and thebascik-componentsskill for where to split. Keep or improve the semantics. Carry over every semantic element the old site has (<nav>,<header>,<main>,<article>,<button>,<label>, heading levels), and never turn semantic markup into<div>s to make a component fit. Make each component's root the element for its job (a nav component's root is the<nav>, not a<div>around it), and replace framework div soup with the right element where it is safe: a clickable<div>becomes a<button type="button">, a list of links becomes a<ul>. Checklist:node <skills-dir>/bascik/scripts/read-doc.mjs /component-best-practices#use-htmls-elements. - Keep TypeScript. A TypeScript source site stays TypeScript: component logic moves to a
.tscompanion or an inline<script type="text/typescript">and keeps its types (prop types become the@bascikcomment and the types of what the script reads), and data loaders become typed helpers insrc/lib/*.ts. A JavaScript site gets TypeScript for every new file unless the person says otherwise. Erasable syntax works with no setup; forenum, decorators, or npm packages in the browser, use esbuild (thescripts.typescriptsnippet in thebascikskill). Docs:/scoped-javascript#typescript-in-component-scripts,/configuration#scriptstypescript,/how-to/bundling-npm-packages. - Move styles. Delete framework scoped-style mechanisms and put the CSS in each component's companion
.css. Class names stay the same; Bascik scopes them. Global styles go tosrc/pages/css/styles.css. - Move behavior. Replace state and effects with a TypeScript script per component, targeting elements by
id. Prefer HTML and CSS solutions where they exist: a framework disclosure becomes<details>, a modal becomes<dialog>, a dropdown becomespopover. Attach click handlers to<button>and<a>elements, not to<div>s, and put state a screen reader needs in ARIA attributes (aria-expanded,aria-pressed). - Move data. Framework data loaders become
data-bascik-buildscripts that call typed helpers insrc/lib/. Escape every interpolated value. - Verify.
node <skills-dir>/bascik/scripts/verify.mjs --buildandnode <skills-dir>/bascik/scripts/audit-components.mjs(exit 0, or each kept warning explained), then compare old and new pages URL by URL.