Skill
/hanzo-web:preview-local
Fuente: plugins/hanzo-web/skills/preview-local/SKILL.md · hanzo-web v0.2.0
Cuándo usarlo
Cuando un cambio afecta a cómo se ve la web y quieres revisarlo antes del MR.
Qué hace
- Arranca Strapi desde el checkout principal y Next desde el worktree de la tarea, con la configuración del sitio que corresponde.
- Busca las páginas que usan el módulo cambiado, con
usage-findero consultando la base de datos local. - Las abre en el navegador integrado, mide estilos y tamaños, y las compara con PRE en el mismo tamaño de pantalla (también en móvil si puede cambiar el layout).
- Al terminar, para solo los procesos que ha arrancado.
Qué te entrega
Una lista de URL, qué mirar y resultado esperado; y, si hay opciones nuevas en el CMS, la URL del admin de Strapi y el campo que hay que activar.
Pídelo así
/hanzo-web:preview-local
O con tus palabras: «levanta el local», «pruébalo en local», «¿dónde/cómo lo compruebo?».
A tener en cuenta
Strapi nunca se arranca desde un worktree, salvo que el cambio toque esquemas; en ese caso pregunta antes y usa una copia de la base de datos.
Definición en el plugin
Las instrucciones que sigue la skill, tal como están en el plugin (en inglés).
Qué hace
Cuándo usarlo
- "levanta el local"
- "pruébalo en local"
- "¿dónde/cómo lo compruebo?"
Values come from the main checkout's .claude/hanzo-project.json (config) and the Project facts / Local preview notes in its CLAUDE.local.md (navigation single type per site, DB tables, extra env vars).
- Which worktree and site? Worktree of the current task; site from the task (
config.sites[].id). One Next process = one site. - Strapi from the main checkout only: if
curl -s -m 3 http://127.0.0.1:<config.local.strapiPort>/_healthfails,cd <main>/<config.apps.strapi> && npm run devin the background. Never from a worktree unless the change adds/changes schemas — then ask first, explain that the admin won't show new fields otherwise, and use a copy of the DB. - Next from the worktree:
node_modulessymlink from the main checkout; a worktree copy of<config.apps.next>/.envwith the site's values fromconfig.sites[].envFile(plus any extra vars in Project facts);npm run devonconfig.local.nextPortin the background. Never edit the main checkout's.env. If every route 404s, the navigation env vars are wrong for that site. - Pages to open:
hanzo-web:usage-finderagent or a read-only query onconfig.local.strapiDb(<collection>_componentsbycomponent_type); map to URLs with the navigation API. If no local page uses the module or the new option, say so and give the admin steps to add/toggle it (http://localhost:<port>/admin/content-manager/collection-types/api::<type>.<type>/<id>?plugins[i18n][locale]=<l>). - Check in the built-in browser: scroll the module into view (animations need it), screenshot, measure computed styles and bounding boxes with
javascript_tool; same URL on PRE (config.environments.pre) in a second tab at the same viewport; mobile withresize_windowpresetmobilewhen layout can change. CMS content differences are expected, style differences are not. For larger checks delegate tohanzo-web:qa-parity. - Tell the user: a short list
URL → what to look at → expected result, plus admin URL + field for CMS options. Ask whether to leave the servers running. - Clean up when done: stop only the processes you started (
pkill -f "next dev -p <port>",pkill -f "strapi develop"), close the PRE tab, reset the viewport.