Studio Worktree Setup
Brings the current linked worktree to a runnable state for Studio web development. Worktree creation is handled by external tooling — this skill only performs the follow-up steps that tools don't know about.
What it does
- Verifies the cwd is inside a linked worktree (not the main checkout). Bails otherwise.
- Copies any missing
.env.*.localfiles from the main worktree'sweb/packages/*/env/directories into the matching locations in the current worktree. Only packages that exist in the current worktree get touched (stale dirs in main are ignored). - Runs
pnpm install --frozen-lockfilefromweb/so every workspace package (studio, common, etc.) has itsnode_modules. - Reports that the worktree is ready and tells the user to
pnpm dev.
Steps
Run the script from anywhere inside the worktree — resolve its path via
git rev-parse --show-toplevelso the cwd doesn't matter:bash "$(git rev-parse --show-toplevel)/web/.agents/skills/studio-worktree/setup-worktree.sh"If the script reports the user is in the main checkout, stop and tell them to create a linked worktree first (via their tool — e.g., Claude Code's
--worktree, Cursor, orgit worktree add <path>).When the script finishes cleanly, surface the copy-pasteable command from its final line — the
cd <worktree>/web && pnpm devone-liner — so the user can start Studio without having to assemble the path themselves.
Notes
- Never read
.env.*.localcontents — they contain credentials. The script copies them viacpwithout reading. - Existing
.env.*.localfiles in the current worktree are not overwritten.