Skill
/hanzo-web:init
Fuente: plugins/hanzo-web/skills/init/SKILL.md · hanzo-web v0.2.0
Cuándo usarlo
La primera vez que usas el plugin en un proyecto, y después de cambios grandes (apps, sitios o entornos nuevos) para refrescar el contexto.
Qué hace
- Detecta las apps de Next y Strapi, el modelo de contenido, los sitios, la constante de versión de las releases y el CI.
- Si el proyecto ya estaba preparado, te enseña qué ha cambiado y solo lo actualiza con tu visto bueno.
- Te pregunta de una vez lo que no puede detectar: Jira, remote de GitLab, URLs de PRE y PRO, sitios y limpieza diaria de worktrees.
- Escribe
.claude/hanzo-project.jsonyCLAUDE.local.mden el checkout principal. No se versionan. - Comprueba que el contexto se carga y que el gate de CodeClimate encuentra ESLint.
Qué te entrega
Los dos ficheros de contexto, los valores que conviene revisar a mano y los agentes o skills propios del proyecto que se solapan con el plugin.
Pídelo así
/hanzo-web:init
O con tus palabras: «inicializa el proyecto», «genera el contexto», «configura hanzo-web».
A tener en cuenta
Si ya tenías un CLAUDE.local.md propio, hace una copia de seguridad antes de reescribirlo. Al terminar, abre una sesión nueva (o /clear) para cargar el contexto.
Definición en el plugin
Las instrucciones que sigue la skill, tal como están en el plugin (en inglés).
Qué hace
- detects apps, Strapi content model, sites, release constant and CI
- asks for the rest (Jira, environments)
- writes
.claude/hanzo-project.jsonandCLAUDE.local.mdso the hanzo-web rules, skills and agents work in that repository
Cuándo usarlo
- "inicializa el proyecto"
- "genera el contexto"
- "configura hanzo-web"
Paths:
${CLAUDE_PLUGIN_ROOT}is this plugin's folder (Claude Code expands it). If you see it literally (e.g. in Cursor), use the "Plugin scripts" path from the session context, or the plugin folder two levels above this skill (../../from the folder of thisSKILL.md).
Generates the project-specific half of the context. The shared half (rules, skills, agents, scripts) lives in this plugin and is injected at session start once .claude/hanzo-project.json exists.
Files it writes, all in the main checkout and local-only (excluded via .git/info/exclude, never committed unless the user asks):
.claude/hanzo-project.json— machine-readable settings used by the scripts and skills (schema:${CLAUDE_PLUGIN_ROOT}/templates/hanzo-project.example.json).CLAUDE.local.md— project facts for humans and agents (template:${CLAUDE_PLUGIN_ROOT}/templates/CLAUDE.local.md).
1. Detect
- Find the main checkout: parent of
git rev-parse --path-format=absolute --git-common-dir. Work there, not in a worktree. node "${CLAUDE_PLUGIN_ROOT}/scripts/detect-project.mjs" <main>→ JSON with git remotes and branches, Next app (version, router, static export, un-hashed CSS classes, Hanzo packages, block map), Strapi app (version, SQLite DB, content types, dynamic zones, component categories, local plugins), site env files, release constant, CI includes/stages, and existing Claude files.- If it's not a Next.js + Strapi repo (no
nextor no@strapi/strapi), say so and stop. - Fill what the JSON can't tell by reading a few files: locales (Strapi i18n locales in the DB
i18n_localetable read-only, or the Next/i18n config), the block renderer and how it maps__component, the navigation single type per site (env vars), whetherdynamic-zoneblocks are usually added to several content types.
2. Existing setup
.claude/hanzo-project.jsonexists → refresh mode: show what changed vs the detected values and update only with the user's OK.CLAUDE.local.mdexists and was not generated by this skill → don't overwrite it. Keep a copy atCLAUDE.local.md.bak-<date>, then build the new file: project-specific facts and lessons from the old file go into Project facts / Local notes; sections that the plugin now covers (Jira start question, CodeClimate, MR template, releases, local testing procedure, worktree cleanup, agents table) are dropped. Show the user the list of what was moved, kept and dropped before writing.- Project-local
.claude/agents/.claude/skillswith the same role as the plugin's (e.g.code-reviewer,release) → list them and suggest removing them once the plugin versions are validated, because both would load. Project-specific details they contain go into Project facts. Never delete them without an explicit yes.
3. Ask (one AskUserQuestion, only what wasn't detected)
- Jira project key and board URL (or "no Jira").
- GitLab remote to push to, if there are several (default: the one on the Hanzo GitLab host, usually
origin). Develop / production branch names if not detected. - PRE and PRO URLs, and whether PRE is deployed automatically or by hand.
- Sites: confirm the detected
envs-build-*files and the base path of each site. - Daily worktree cleanup (macOS launchd) yes/no and hour.
4. Write
.claude/hanzo-project.jsonfollowing the example schema:project(name,slugkebab-case),jira,gitlab(host,project,remote),git(develop,production),apps(next,strapi),codeclimate.srcDirs(fromsuggestedSrcDirs),release(versionFile,versionConst),local(strapiPort1337,nextPort3000,strapiDb),sites(id,envFile,basePath),locales,defaultLocale,environments(pre,pro),worktrees(dir.claude/worktrees,dailyCleanup).CLAUDE.local.mdfrom the template: replace every{{…}}with detected/answered values written as short prose or lists. Drop a line rather than leaving a placeholder or "unknown". Keep it factual and short; no generic rules (those are in the plugin).- Append to
.git/info/exclude(if missing):/CLAUDE.local.md,/CLAUDE.local.md.bak-*,/.claude/hanzo-project.json,/.claude/worktrees/. - Daily cleanup, if chosen: follow the "Daily automatic cleanup" section of
/hanzo-web:clean-worktrees.
5. Check and report
- Run
CLAUDE_PROJECT_DIR=<main> "${CLAUDE_PLUGIN_ROOT}/scripts/session-context.sh" | head -20to confirm the context is injected. - Run
node "${CLAUDE_PLUGIN_ROOT}/scripts/quality-gate-local.mjs" <main>to confirm the CodeClimate script finds ESLint and the source dirs. - Tell the user: files written, values that need a human check, the old project agents/skills that overlap with the plugin, and that a new session (or
/clear) loads the new context.