Skill

/hanzo-web:preview-local

Levanta el proyecto en local, abre las páginas afectadas, las compara con PRE y te explica cómo comprobar el cambio.

Fuente: plugins/hanzo-web/skills/preview-local/SKILL.md · hanzo-web v0.2.0

  • Claude Code /hanzo-web:preview-local
  • Cursor /preview-local

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-finder o 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

Start a Hanzo Next.js + Strapi site locally (Strapi from the main checkout + Next from the feature worktree) for the right site, find the pages that use the changed module, open them in the built-in browser, compare with PRE, and tell the user exactly where and how to check the change.

Cuándo usarlo

Use when the user says:
  • "levanta el local"
  • "pruébalo en local"
  • "¿dónde/cómo lo compruebo?"
or a change needs a visual check.

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).

  1. Which worktree and site? Worktree of the current task; site from the task (config.sites[].id). One Next process = one site.
  2. Strapi from the main checkout only: if curl -s -m 3 http://127.0.0.1:<config.local.strapiPort>/_health fails, cd <main>/<config.apps.strapi> && npm run dev in 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.
  3. Next from the worktree: node_modules symlink from the main checkout; a worktree copy of <config.apps.next>/.env with the site's values from config.sites[].envFile (plus any extra vars in Project facts); npm run dev on config.local.nextPort in the background. Never edit the main checkout's .env. If every route 404s, the navigation env vars are wrong for that site.
  4. Pages to open: hanzo-web:usage-finder agent or a read-only query on config.local.strapiDb (<collection>_components by component_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>).
  5. 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 with resize_window preset mobile when layout can change. CMS content differences are expected, style differences are not. For larger checks delegate to hanzo-web:qa-parity.
  6. 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.
  7. 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.