plugins/spec-plugin/skills/setup-env/SKILL.md
Bring a fresh worktree/checkout to a runnable state — verify base HEAD, copy gitignored files (.env), allocate per-agent DB/test env, install deps, run the smoke gate. Deterministic, mechanical. Reports a single ready/blocked verdict.
npx skillsauth add jaisonerick/spec-plugin setup-envInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run this to make a fresh worktree actually runnable, the same way every time, so no engineer or QA agent has to rediscover the setup dance. This is the single most-repeated waste across past runs (manual .env copies, stale HEAD, per-agent DB collisions). Execute it deterministically.
This skill runs in an isolated forked Explore child and returns only its tight conclusion — so the caller's context stays clean.
If the caller points you at a setup-playbook.md (e.g. specs/<version>/setup-playbook.md), it is authoritative — follow it exactly. If you discover a step it's missing, append the fix to the playbook so the next agent doesn't rediscover it. If there's no playbook, run the generic checklist below and write what worked into a playbook for reuse.
Fix-forward on worktree-removal blockers. When you (or an engineer) hit an untracked-artifact directory that blocks git worktree remove (a test/coverage/temp dir a tool created), append it to the env definition — add it to the worktree .gitignore and the setup-playbook — so the next agent doesn't rediscover it. Same discipline as appending a missing step to the playbook.
git rev-parse HEAD matches; if it's behind, git reset --hard <base> (worktree only) or report. Your CWD is not the worktree — run git against it with git -C <worktree> … and prefix other commands with cd <worktree> && …; CWD resets between Bash calls (see references/toolkit.md → "Code-workspace facts"). For a local integration checkout with no remote, don't git pull; verify the expected commit with git -C <worktree> log per the setup-playbook. In the playbook's reusable worktree-creation command, base the worktree on the branch ref <code_branch> (git worktree add <path> -b <story-branch> <code_branch>), never a frozen commit SHA — the playbook is reused across stories as the branch advances, so a pinned SHA becomes stale..env.example, config that loads env, fixtures referenced by tests). A library/SDK usually needs NONE — do not copy or invent a .env it doesn't use. Don't copy .tool-versions either: a worktree of the repo already has it (it's tracked). For an app that does read .env, copy .env/.env.local/.env.test/credentials from the main checkout.
.gitignore excludes test/coverage output dirs (coverage/, .pytest_cache/, tmp/). Tools like SimpleCov leave untracked artifacts there that otherwise block git worktree remove. Add any missing entries.TEST_ENV_NUMBER (e.g. dinie_test3) and create/load schema (bin/rails db:create db:schema:load, or the project's equivalent).root: true (eslint/jest) if a parent config leaks in. Tool versions resolve via asdf automatically (.tool-versions); if a command still hits the wrong version, the worktree is missing a .tool-versions or the runtime isn't installed — report that, don't paper over it.node_modules/gems aren't inherited): bun install --frozen-lockfile / pnpm install / npm ci / bundle install — use the project's lockfile-respecting command. Unset corporate proxies if a hermetic install needs it.scripts/check-env.sh if present, or the cheapest "is it alive" command (build, --version, health endpoint).ENV: ready | blocked
WORKTREE: <path> @ <sha>
DID: <one line per step actually performed>
PLAYBOOK: <updated | created | followed as-is>
BLOCKED ON: <only if blocked — exactly what's wrong so an engineer can fix it>
Mechanical only — do not write application code or fix bugs. If a step fails for a non-mechanical reason (real code error, missing service), STOP and report blocked with the exact error.
tools
Assess how the LATEST spec-plugin version is performing across every previous session that invoked it — aggregate run efficiency (thinking%, compactions, exploration-vs-skills, preload firing, fresh-per-story), process adherence, and recurring spec-quality issues — then propose concrete, evidence-backed improvements for the NEXT version (plugin skills/agents/hooks, and spec/process patterns). Read-only: proposes, never self-modifies. Not tied to a single run.
development
Confirm whether a code symbol (method/class/field/endpoint/flag) actually exists and return its REAL signature + definition location — or the nearest match. Uses LSP/introspection, never grep-spelunking. Cheap and fast.
development
Walk one value or action end-to-end across every layer/hop — go-to-definition by go-to-definition, or with a debugger breakpoint — and report the real state transitions and where the contract/shape diverges. The workhorse for architecture sketches and cross-layer debugging.
development
Find out how code ACTUALLY behaves by executing the real classes in a REPL — the real request/response shape, the real return value — without relying on a live staging environment. Beats writing a test for 'how does this behave?'.