init-jean-json
Use if onboarding a repo to Jean — jean.json and .worktreeinclude setup, run, teardown, ports.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use if onboarding a repo to Jean — jean.json and .worktreeinclude setup, run, teardown, ports.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use if driving agent-browser for webpage interaction, screenshots, @ref snapshots, tabs, UI verification, CDP attach, Steel Browser, or cloud providers (Browser Use, Browserbase, Browserless, Kernel).
Use if verifying claimed-done work or auditing session/plan/branch completion with evidence.
Use if creating, redesigning, or merging a Claude skill, with research before writing SKILL.md.
Use skill if you are running repeatable Codex reviews across lenses or branches, optionally verifying and fixing confirmed findings in isolated worktrees.
Use if running deep multi-file research over 5+ entities or a market — wave-dispatched corpus.
Use if finishing a project — review and merge every branch/worktree into main, retire dead branches.
| name | init-jean-json |
| description | Use if onboarding a repo to Jean — jean.json and .worktreeinclude setup, run, teardown, ports. |
Onboard a repository to Jean (coollabsio/jean — worktree-per-agent dev environment) by authoring its automation manifest from evidence, then proving it in a real throwaway worktree before committing anything. The deliverable is not a file — it is a verified worktree bootstrap: a fresh worktree that installs, runs, and tears down cleanly with zero manual steps.
Every schema claim here is verified against Jean source (src-tauri/src/projects/{types,git,commands}.rs) — exact contracts in references/jean-json-spec.md.
jean.json created or fixed.env, reinstalling node_modules every time, orphaned containers) and you must optimize it.worktreeinclude manifest (which gitignored files travel into new worktrees)jean.json that was written but never executed in a fresh worktree is a draft, not a deliverable.git worktree list + git branch --list 'jean-test-*' both empty of your artifacts.jean.json and .worktreeinclude must be committed (tracked). Jean reads jean.json from the project root when creating worktrees — a gitignored manifest silently does nothing for teammates.rm/destructive command with the env vars Jean validates ($JEAN_WORKSPACE_PATH, $JEAN_ROOT_PATH are guaranteed non-empty absolute paths — plain relative rm -rf is not similarly guarded).Build a bootstrap inventory. Do not guess — read the repo:
git rev-parse --show-toplevel && git status --porcelain --ignored -- . | head -50
cat .gitignore 2>/dev/null
ls -d .env* .envrc .claude .agents .cursor .vscode config/secrets* 2>/dev/null
cat package.json 2>/dev/null | jq '{pm: .packageManager, scripts}'
ls pnpm-lock.yaml yarn.lock bun.lockb package-lock.json Cargo.toml pyproject.toml go.mod compose*.y*ml docker-compose*.y*ml Makefile 2>/dev/null
cat jean.json .worktreeinclude AGENTS.md CLAUDE.md 2>/dev/null
Answer these six questions (they map 1:1 onto the manifest):
| # | Question | Feeds |
|---|---|---|
| 1 | Which gitignored-but-required files exist? (.env*, .claude/settings.local.json, .agents/, secrets, local certs) | .worktreeinclude + setup copy lines |
| 2 | What is the install command and can it be made instant? (pnpm store, cp -c clone of node_modules, cargo target dir) | setup |
| 3 | What is the dev run command? Multiple processes? | run (string or array) |
| 4 | Which ports does the dev stack listen on? Do parallel worktrees collide? | ports[] + port strategy |
| 5 | What does a worktree leave running when abandoned? (containers, daemons, tunnels) | teardown |
| 6 | Does an existing jean.json/.worktreeinclude/AGENTS.md already cover part of this? | revise, don't duplicate |
If the repo has databases/containers per worktree, or parallel-port collisions, read references/worktree-optimization.md (port strategy, shared caches, COW copies) before drafting.
Author from references/jean-json-spec.md (exact schema, env vars, shell semantics) and references/templates.md (per-stack starting points: node/pnpm, bun, python, rust, go, docker-compose, monorepo).
Principles:
.worktreeinclude is the declaration; jean.json setup is the executor. Jean does not read .worktreeinclude (verified against source) — so the setup script must perform the copies itself using $JEAN_ROOT_PATH. The .worktreeinclude file still ships for Claude Code WorktreeCreate hooks, other tools, and humans. Keep the two in sync; generate the setup copy-lines from the include list..env*, .claude/, .agents/) with cp; clone big artifacts (node_modules/, target/, .venv/) with COW (cp -Rc on APFS — measured ~3ms for what a normal copy takes seconds on) or skip them for store-backed installs (pnpm install --prefer-offline is already near-instant).node_modules across worktrees — parallel agents would mutate shared state and realpath-resolving tools break.run uses the array form when there are independent processes (api + web + worker).docker compose down --remove-orphans || true).Simulate exactly what Jean does, with the same env contract:
ROOT=$(git rev-parse --show-toplevel)
TB="jean-test-$(date +%s)"
WT="$(mktemp -d)/$TB"
git -C "$ROOT" worktree add -b "$TB" "$WT"
# replicate Jean's execution: login shell, cwd=worktree, three env vars
JEAN_WORKSPACE_PATH="$WT" JEAN_ROOT_PATH="$ROOT" JEAN_BRANCH="$TB" \
zsh -l -c "cd '$WT' && <setup script verbatim from your draft jean.json>"
Verify each contract, not vibes:
ls "$WT"/.env* etc.).curl -fsS localhost:<port> or nc -z) until up or a deadline; capture the failure output if not.lsof -i :<port> empty), then run it again to prove idempotence.references/worktree-optimization.md and re-test.Any failure → fix the draft, re-run the phase. Do not weaken a check to pass it. Three distinct failed approaches on the same step → surface the evidence and ask.
Only after Phase 3 is green:
jean.json + .worktreeinclude at the repo root..worktreeinclude's entries are actually gitignored (intersection rule: only ignored∩listed files copy) and that jean.json itself is not gitignored.references/templates.md#agents-md-section: what jean.json is, the manual equivalent (git worktree add + the same setup commands + the env vars), the ports table, and the teardown expectation. If AGENTS.md doesn't exist but CLAUDE.md does, put it there; if neither, create AGENTS.md.feat(dev-env): add jean.json worktree automation or repo's convention).git -C "$ROOT" worktree remove --force "$WT"
git -C "$ROOT" branch -D "$TB"
git -C "$ROOT" worktree prune
git -C "$ROOT" worktree list && git -C "$ROOT" branch --list 'jean-test-*' # both must show no test leftovers
Also kill anything the run test started (final lsof -i :<port> check). Report ends with: files committed, setup wall-clock time, proof summary, cleanup confirmation.
jean.json present → diff-and-improve, never blind-overwrite; keep working script lines unless evidence says they're wrong..env with real credentials) → copy them via setup/include as designed, but never print their contents into output or commit them; verify they remain gitignored.run = test or build watcher, ports omitted; don't invent a server.scripts/setup-worktree.sh etc.) → have jean.json call it instead of duplicating logic.jean.json; scope setup/run to the package(s) actually developed, per references/templates.md.cp -c, fall back to store-backed installs (pnpm/uv/cargo already dedupe globally).| File | Read when |
|---|---|
references/jean-json-spec.md | Writing any jean.json field — exact schema, $JEAN_* env contract, shell/exec semantics, failure behavior, and .worktreeinclude semantics (intersection rule, tool support matrix). |
references/worktree-optimization.md | Setup is slow, ports collide across parallel worktrees, big dependency dirs, docker-compose per worktree, shared caches. |
references/templates.md | Drafting — per-stack jean.json + .worktreeinclude starters and the AGENTS.md section template. |
jean.json without having read .gitignore and package scripts → back to Phase 1.git worktree list still shows a jean-test-* path in the final report → cleanup incomplete.rm -rf on a variable path → rewrite using $JEAN_WORKSPACE_PATH prefix..worktreeinclude lists a tracked file → it will never copy (intersection rule); remove it or untrack the file.