B1 add worktree
Skill jporre/sveltekit-verticalslices/skills/b1-add-worktree
Crea un git worktree aislado para una branch. Usar cuando el usuario pida un worktree o un workspace aislado para trabajar. Requiere el nombre del worktree como argumento.From its SKILL.md
npx -y skills add jporre/sveltekit-verticalslices --skill b1-add-worktreeAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.2 KB, as published. Nobody here has run it
Create Git Worktree
Create an isolated git worktree for feature development with symlinks to shared resources and a new terminal session.
Argumentos recibidos
$ARGUMENTS
Skill
context: fork: el subagente solo ve esteSKILL.md. El placeholder$ARGUMENTSes la ÚNICA vía por la que el nombre del worktree tipeado llega al fork — el harness lo sustituye.
Workflow
-
Parse the name: Extract the worktree name from the argument. Si
$ARGUMENTSllega vacío o sin sustituir (el placeholder literal no cuenta como nombre), pedir el nombre al usuario.The name is used as-is for the branch (including any prefix like
feat/,fix/,chore/). The folder underworktrees/uses only the segment after the final/, so the worktrees directory stays flat.Examples:
feat/83-crm-fase-1-schema→ branchfeat/83-crm-fase-1-schema, folderworktrees/83-crm-fase-1-schemafix/timezone-bug→ branchfix/timezone-bug, folderworktrees/timezone-bugmi-feature→ branchmi-feature, folderworktrees/mi-feature
-
Confirm the branch name: Show the user the exact branch name and folder path that will be created, and ask them to confirm (or suggest a prefix like
feat//fix/if the provided name has none and it seems appropriate). -
Ask the base branch: Ask the user:
Create worktree from current branch (
<current-branch>) or from la rama default? (la resuelve el script víabp_default_branch)En los pasos siguientes,
<plugin-root>es la raíz del plugin. Resolverla portable como"${CLAUDE_PLUGIN_ROOT:-$(cat "$HOME/.claude/b-pipeline.root" 2>/dev/null || ls -d "$HOME"/.claude/plugins/marketplaces/b-pipeline* 2>/dev/null | head -1)}"— funciona con el plugin instalado vía Claude Code marketplace o en el dev location.<skill-dir>es<plugin-root>/skills/b1-add-worktree. -
Ensure clean working tree: Before running the script, run
bash <skill-dir>/scripts/assert-clean.sh . --fixen el repo padre y actuar según exit code:0= continuar;6= código sin commitear — commitear primero (pedir confirmación al usuario);7= artefactos persistentes — revisarlos a mano con el usuario antes de seguir. -
Env-check runtimes + DB — MANDATORY: Before creating the worktree, verify the environment blockers that make
setup-worktree.shfail late (missingpnpm/node, DB unreachable). Run only the runtime and DB checks of b7'senv-check(viaB_ENV_CHECKS=bin,db); it emits oneB_ENV name=<check> status=ok|fail|warn hint=<action>line per check and exits19if any hard check fails. If it exits non-zero, stop and report — do not attempt the worktree.B_ENV_CHECKS=bin,db bash "<plugin-root>/skills/b7-issue-to-pr/scripts/guardrails.sh" env-check -
Run the script — MANDATORY: You MUST invoke
setup-worktree.shexactly as shown. Do NOT callgit worktree adddirectly, do NOT recreate the steps inline, do NOT skip ahead by symlinking.envor runningpnpm installyourself. El script aprovisiona todo lo que el worktree necesita para quedar "ready for dev/test"; el detalle vive solo en el script.bash <skill-dir>/scripts/setup-worktree.sh "<worktree-name>"Sin
base-branch, el script resuelve la rama default víabp_default_branch. Si el usuario eligió otra base (ej. la rama actual), pasarla como segundo argumento:bash <skill-dir>/scripts/setup-worktree.sh "<worktree-name>" "<base-branch>".Si el usuario pide no abrir una ventana de Terminal, agregar
--headlessal comando.If the script fails, report the failure to the user and stop. Do not work around it by running pieces manually — the failure usually points to real state that needs human attention (dirty tree, branch already exists, port detection failure).
-
Report the result: Relatar al usuario el resumen final que imprime el script: path, branch, puerto dev y la instrucción de correr
./dev.sh.