본문으로 건너뛰기
cccskills
무료GitHub에 공개

runnable-worktrees

Make builder worktrees runnable — the `.codev/config.json` `worktree` block (symlinks, postSpawn, devCommand), the `afx dev` CLI, VSCode dev controls, and per-stack config recipes. Use when configuring a repo so reviewers can run a builder's branch, when `afx dev` fails to bind or start, when a dev process is orphaned holding a port, or when asked why worktree dev uses the same ports as main.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cluesmith/codev스타 290(GitHub 290 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md6.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Runnable worktrees

When configured, each builder worktree (.builders/<id>/) becomes runnable: reviewers can run whatever your dev command starts — a dev server, cargo run, expo start, a test watcher, a build script — against the builder's branch without cd'ing, installing, or hunting for the command. Opt-in via .codev/config.json; unconfigured repos see zero behavior change.

Config: the worktree block

{
  "worktree": {
    "symlinks":   ["..."],   // globs symlinked from the workspace root into each new worktree
    "postSpawn":  ["..."],   // shell commands run inside each new worktree after createWorktree
    "devCommand": "..."      // consumed by `afx dev <builder-id|main>`
  }
}
  • symlinks — globs resolve from the workspace root and link into the worktree at the same relative path. Root .env and .codev/config.json are always symlinked regardless. Symlinks, not copies, so edits to main's env files reflect instantly in a running dev session. A directory match is silently skipped (a glob cannot mask the worktree's own source) unless the entry ends in a slash: ".local-user-data/" is treated as a literal path and links the directory whole — shared with the parent, not branch-isolated. A dangling link is fine if the source does not exist yet.
  • postSpawn — commands run sequentially with cwd = worktree path. A non-zero exit aborts the spawn loudly; the half-built worktree stays for inspection.
  • devCommand — the foreground command that starts your dev process. Required for afx dev.

Codev does not auto-detect your stack. Pick a recipe below.

CLI

afx dev <builder-id>     # start dev in that builder's worktree
afx dev main             # start dev in the MAIN workspace (Codev-managed)
afx dev --stop           # stop the running dev PTY (builder or main)
afx setup <builder-id>   # re-apply symlinks + postSpawn to an existing worktree (idempotent)

One dev PTY at a time, across {main + all builders} — deliberate; see URLs are load-bearing. main is a reserved target running worktree.devCommand in the main checkout as a Codev-managed, swappable PTY, symmetric with builders. Starting a second target prompts to swap; a same-target request prints the existing terminal URL and exits. Dev PTYs are non-persistent — a Tower restart or crash kills them; re-run to restart.

Start main's dev with afx dev main, not a bare pnpm dev. A hand-run pnpm dev is invisible to Codev (which never kills what it did not spawn), so a builder dev started while it holds the ports either fails to bind or — worse — serves main's code under the worktree URL. afx dev main makes it a managed PTY that swap-detection can stop cleanly. This only helps if used consistently.

VSCode

Right-click a builder row in the Codev sidebar (Builders or Needs Attention):

  • Open Builder Terminal — that builder's AI terminal in a tab (same as left-click).
  • Open Worktree Folder — .builders/<id>/ in the OS file manager.
  • Run Worktree Setup — re-applies worktree.symlinks and worktree.postSpawn to an existing worktree (the git steps are skipped). Idempotent. Use when the lockfile changed, when symlinks/postSpawn grew after the builder spawned, when a link was deleted, or when the original setup aborted. Streams install output in a fresh terminal. CLI: afx setup <id>.
  • View Diff — unified main...HEAD diff for that worktree with a file-list pane.
  • Run Dev / Stop Dev — spawn or kill the dev PTY as a Codev: <name> (dev) tab; prompts to swap if another dev is running.

The sidebar's Workspace view carries a dev control for whatever folder the window is rooted at — the main checkout resolves to main, a .builders/<id>/ window resolves to that builder. The row tooltip names the resolved target. Commands are also in the palette (Cmd+Shift+P); no default keybindings.

URLs are load-bearing

The dev PTY intentionally uses the same ports and URLs as main. OAuth callbacks, CORS allowlists, cookie scoping, CSP connect-src and webhook URLs are all keyed off origin, so running a worktree on a different port would break them.

Consequence: stop main's dev before starting a builder's, or the spawned dev fails at bind time with EADDRINUSE.

Cleanup and orphan recovery

afx dev --stop and the swap path kill the entire PTY process group (SIGTERM, then SIGKILL after 5s), which signals every grandchild of a monorepo orchestrator (pnpm dev, turbo dev, pnpm -r --parallel run dev) at once. Ports are reclaimed by the OS as a consequence — Codev never manipulates ports directly.

If Tower hard-crashes mid-dev and a process is left holding a port outside Codev's records:

lsof -ti :<port> | xargs kill
lsof -ti :3000,:3001,:4000 | xargs kill

Recipes

pnpm monorepo (Next.js / Turbo)

{"worktree": {"symlinks": [".env.local", ".env.development.local", "packages/*/.env", "packages/*/.env.local", "turbo.json"], "postSpawn": ["pnpm install --frozen-lockfile"], "devCommand": "pnpm dev"}}

npm — {"symlinks": [".env.local", ".env.development"], "postSpawn": ["npm ci"], "devCommand": "npm run dev"}

yarn — {"symlinks": [".env.local"], "postSpawn": ["yarn install --frozen-lockfile"], "devCommand": "yarn dev"}

bun — {"symlinks": [".env.local"], "postSpawn": ["bun install --frozen-lockfile"], "devCommand": "bun dev"}

cargo — {"symlinks": [".env"], "postSpawn": [], "devCommand": "cargo run"}

poetry / uv — {"symlinks": [".env", ".env.local"], "postSpawn": ["uv sync"], "devCommand": "uv run python -m myapp"}

go mod — {"symlinks": [".env"], "postSpawn": ["go mod download"], "devCommand": "go run ./cmd/server"}

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

afx

무료

Agent Farm CLI — the tool for spawning builders, managing Tower, workspaces, and cron tasks. ALWAYS consult this skill BEFORE running any `afx` command to get the exact syntax. This prevents wasting time guessing flags that don't exist. Use this whenever you need to spawn a builder, check status, send messages, clean up worktrees, manage Tower, or run cron tasks. If you're about to type `afx` followed by anything, check here first.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cluesmith/codev2902026년 10월 24일 업데이트

arch-init

무료

Adopt an architect identity and recover its state from codev/state/<name>.md. Use when an architect terminal needs to (re)establish which architect it is — after a restart, context loss, or session handoff — or when the user says "/arch-init", "you are the X architect", or "recover your architect state". Identity resolves via `afx whoami` (an explicit name argument overrides); if neither resolves, ask the human — never guess.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cluesmith/codev2902026년 10월 24일 업데이트

arch-save

무료

Save an architect's state, clear its context, and re-init automatically — the packaged save→clear→re-init refresh cycle. Use when the owner directs a context refresh, or says "/arch-save", "save and clear", "refresh your context". Runs on the owner's direction; an architect does not invoke it autonomously mid-task. Counterpart to /arch-init, which recovers the state this writes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cluesmith/codev2902026년 10월 24일 업데이트

Refresh a builder's own context at a protocol boundary — save working state, verify it, clear, and re-orient. Use when porch emits a context-refresh task, or the builder is told to "refresh your context" / "run a self-refresh". A builder does not invoke this autonomously mid-task; porch chooses the moment. Counterpart to the architect's /arch-save.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cluesmith/codev2902026년 10월 24일 업데이트

codev

무료

Codev project management CLI — init, adopt, bootstrap-docs, update, and doctor commands. Check this skill before running any `codev` command (except `consult`, `porch`, or `afx` which have their own skills). Use when setting up new projects, adding codev to existing repos, updating framework files, or diagnosing missing dependencies.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cluesmith/codev2902026년 10월 24일 업데이트

consult

무료

AI consultation CLI — query Gemini, Codex, or Claude for reviews and analysis. ALWAYS check this skill before running any `consult` command. Use when reviewing specs, plans, implementations, or PRs with external models, running parallel 3-way reviews (cmap), or checking consultation stats. The `-m` model flag is always required except for `consult stats`.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cluesmith/codev2902026년 10월 24일 업데이트

cluesmith의 스킬 모두 보기

이 스킬의 문제 신고