worktree-bootstraplisted
Install: claude install-skill damson/hard-won-skills
# Bootstrap a fresh worktree (generic)
A new worktree shares the repo's git history but is a **separate working tree** on disk. Two classes of thing do NOT come across, and both cause confusing first-run failures:
1. **.gitignored config** — `.env`, `.env.local`, service credentials, local settings. The app boots, then errors on a missing variable that "works on the other branch".
2. **Installed dependencies and generated artifacts** — `node_modules/`, a Python `.venv/`, Prisma/codegen output. These are gitignored or per-tree, so a fresh worktree has none.
This skill copies the first from a donor worktree and rebuilds the second for the detected stack, so the next `dev`/`build`/`test` works on the first try. It covers what any repo needs; where a repo ships its own bootstrap skill, defer to that instead — it will know the extra credential files, submodules and hooks this one deliberately omits.
## Procedure
### 1. Detect the stack
From the worktree root:
```bash
ls package.json pnpm-lock.yaml yarn.lock package-lock.json \
pyproject.toml poetry.lock requirements.txt go.mod \
settings.gradle settings.gradle.kts build.gradle gradlew 2>/dev/null
```
| Signal | Stack | Dep install | Common gitignored config |
|---|---|---|---|
| `pnpm-lock.yaml` | Node (pnpm) | `pnpm install` | `.env`, `.env.local`, `.env.*.local` |
| `package-lock.json` | Node (npm) | `npm ci` | `.env`, `.env.local` |
| `yarn.lock` | Node (yarn) | `yarn install --immutable` | `.env`, `.env.local` |