Write paseo.json so Paseo worktrees install dependencies and get a `check` script. Use once per project, or when worktree checks fail on missing dependencies.
2 stars
0 votes
0 copies
0 views
Added December 6, 2026
ai-agentspythonrustgokotlinshellnodedockergitapi
Works with
terminal
cli
api
mcp
Security analysis
A92/100
mediumInstalls packages at runtime which could introduce malicious dependencies
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Worktree Setup?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/veqzo-worktree-setup)
---
name: worktree-setup
description: Write paseo.json so Paseo worktrees install dependencies and get a `check` script. Use once per project, or when worktree checks fail on missing dependencies.
---
Write `paseo.json` in the repo root. A new Paseo worktree then installs its dependencies, and agents run one named `check` script instead of guessing the check command.
Schema source: https://paseo.sh/docs/worktrees.md. Read it again if a field below fails.
## Facts about paseo.json
- Paseo reads `paseo.json` from the **committed** base branch, not from uncommitted changes.
- `worktree.setup`: string or array of strings. Runs once after the worktree is created, in the worktree directory.
- `worktree.teardown`: same format. Runs on archive. `worktree.teardownTimeoutMs`: default 60000.
- `scripts.<name>.command`: a named script, started from the app, the CLI or the MCP tool `start_workspace_script`.
- `scripts.<name>.type: "service"`: a supervised long-running process. Paseo assigns a port. Optional `port` (integer) fixes it.
- Environment: `PASEO_SOURCE_CHECKOUT_PATH` (original checkout), `PASEO_WORKTREE_PATH`, `PASEO_BRANCH_NAME`. Services also get `PASEO_PORT`, `PASEO_URL`, `HOST` and `PASEO_SERVICE_<NAME>_PORT` / `_URL` for other services.
## Steps
1. If `paseo.json` exists, read it and keep the keys that you do not change. If the repo uses an allowlist `.gitignore` (`*` then `!path`), add `!paseo.json`.
2. Detect the stack from the files. Use the lockfile to pick the install command. Use frozen installs so a worktree never changes the lockfile.
| Files | `worktree.setup` |
|---|---|
| `package-lock.json` | `npm ci` |
| `pnpm-lock.yaml` | `pnpm install --frozen-lockfile` |
| `yarn.lock` | `yarn install --immutable` |
| `bun.lock` / `bun.lockb` | `bun install --frozen-lockfile` |
| `pyproject.toml` + `uv.lock` | `uv sync --locked` |
| `build.gradle.kts` | `./gradlew --no-daemon testClasses` (downloads dependencies and compiles once) |
| `Cargo.toml` | `cargo fetch` (add `--locked` when `Cargo.lock` is committed) |
For a monorepo or nested packages, add one install per package (for example `npm ci --prefix web`).
3. Write a `check` script. Use only the tools that the project already configures (scripts in `package.json`, `[tool.*]` sections in `pyproject.toml`, Gradle plugins, `clippy`). Join the steps with `&&` so the first failure stops the script.
| Stack | Typical `check` |
|---|---|
| Node | `npm run lint && npm run typecheck && npm test` |
| Python (uv) | `uv run ruff check . && uv run pytest` (add the type checker if configured) |
| Kotlin (Gradle) | `./gradlew --no-daemon check` |
| Rust | `cargo clippy --all-targets -- -D warnings && cargo test` |
4. Add a service only when the project has a dev server. Its command must bind to `$PASEO_PORT`. Do not set a fixed `port` unless the project cannot read the port from the environment.
5. Secrets and env files:
- Never copy a real `.env` into a worktree. Do not add `.env` to `.worktreeinclude`.
- If tests need env values, use `.env.example` defaults or values from OpenBao. A setup step may copy `.env.example` to `.env` only when `.env` is git-ignored and `.env.example` holds no secrets.
6. Add `worktree.teardown` only when setup starts something that must stop (for example `docker compose down || true`).
7. Commit `paseo.json` on a feature branch. Never commit on `master` or `main`.
8. Verify in one test worktree:
- Create it from the feature branch with the Paseo MCP tool `create_workspace` (`isolation: "worktree"`, `baseBranch: <feature branch>`).
- Wait until the setup has finished. `create_workspace` returns before the setup ends, and a check that starts too early fails on missing modules. Confirm that the dependency folders are complete.
- Run `check` once with `start_workspace_script` and read the result with `capture_terminal`. This proves that Paseo finds the script.
- The script terminal stays open after the command ends, so a second `start_workspace_script` fails with "already running". For later runs, run the same command in the worktree shell. Fix and repeat until it passes.
- A check that passes in your own checkout can fail in the test worktree, because the worktree has only committed files. Trust the worktree result.
- Archive the test workspace with `archive_workspace`.
9. Report the setup commands, the `check` command and the test result. Ask before you push.
## Example
```json
{
"worktree": {
"setup": ["npm ci", "uv sync --locked --directory api"]
},
"scripts": {
"check": { "command": "npm run lint && npm run typecheck && npm test && uv run --directory api pytest" },
"web": { "type": "service", "command": "npm run dev -- --port $PASEO_PORT" }
}
}
```
## Limits
- Setup commands run in the host shell. On Windows, verify that `./gradlew` and `&&` work in the test worktree. If not, use `gradlew` or a Node script.
- Keep setup idempotent and fast. Do not run the full test suite in setup.