wize-dev-kit 0.26.1 → 0.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/ARCH.md +2 -1
  2. package/CHANGELOG.md +64 -0
  3. package/README.es.md +28 -6
  4. package/README.md +28 -6
  5. package/README.pt-BR.md +28 -6
  6. package/adapters/continue/render.js +2 -3
  7. package/adapters/copilot/render.js +3 -3
  8. package/adapters/cursor/render.js +2 -3
  9. package/adapters/generic/render.js +2 -3
  10. package/adapters/opencode/render.js +3 -4
  11. package/adapters/windsurf/render.js +2 -3
  12. package/docs/WORKTREES.md +150 -0
  13. package/docs/WORKTREES.pt-BR.md +150 -0
  14. package/docs/harnesses/antigravity.md +2 -0
  15. package/docs/harnesses/antigravity.pt-BR.md +2 -0
  16. package/docs/harnesses/claude-code.md +2 -0
  17. package/docs/harnesses/claude-code.pt-BR.md +2 -0
  18. package/docs/harnesses/codex.md +3 -1
  19. package/docs/harnesses/codex.pt-BR.md +3 -1
  20. package/docs/harnesses/continue.md +2 -0
  21. package/docs/harnesses/continue.pt-BR.md +2 -0
  22. package/docs/harnesses/copilot.md +2 -0
  23. package/docs/harnesses/copilot.pt-BR.md +2 -0
  24. package/docs/harnesses/cursor.md +2 -0
  25. package/docs/harnesses/cursor.pt-BR.md +2 -0
  26. package/docs/harnesses/generic.md +2 -0
  27. package/docs/harnesses/generic.pt-BR.md +2 -0
  28. package/docs/harnesses/hermes.md +2 -0
  29. package/docs/harnesses/hermes.pt-BR.md +2 -0
  30. package/docs/harnesses/kimi-code.md +2 -0
  31. package/docs/harnesses/kimi-code.pt-BR.md +2 -0
  32. package/docs/harnesses/kiro.md +2 -0
  33. package/docs/harnesses/kiro.pt-BR.md +2 -0
  34. package/docs/harnesses/opencode.md +2 -0
  35. package/docs/harnesses/opencode.pt-BR.md +2 -0
  36. package/docs/harnesses/windsurf.md +2 -0
  37. package/docs/harnesses/windsurf.pt-BR.md +2 -0
  38. package/package.json +1 -1
  39. package/src/orchestrator-skills/module.yaml +1 -1
  40. package/src/orchestrator-skills/wize/skill.md +17 -7
  41. package/src/orchestrator-skills/wize-help/skill.md +20 -7
  42. package/src/orchestrator-skills/wize-update/skill.md +33 -27
  43. package/tools/installer/commands/doctor.js +186 -40
  44. package/tools/installer/commands/document-project.js +13 -3
  45. package/tools/installer/commands/hooks.js +215 -0
  46. package/tools/installer/commands/hydrate.js +298 -0
  47. package/tools/installer/commands/sync.js +50 -23
  48. package/tools/installer/commands/update.js +596 -120
  49. package/tools/installer/commands/version-check.js +69 -10
  50. package/tools/installer/document-project/modes/full-rescan.js +1 -1
  51. package/tools/installer/document-project/modes/initial-scan.js +5 -4
  52. package/tools/installer/document-project/modes/quick.js +11 -4
  53. package/tools/installer/git-context.js +219 -0
  54. package/tools/installer/git-ops.js +211 -0
  55. package/tools/installer/install-plan.js +136 -0
  56. package/tools/installer/marker.js +67 -0
  57. package/tools/installer/project-root.js +68 -0
  58. package/tools/installer/project-status.js +171 -0
  59. package/tools/installer/render-shared.js +170 -4
  60. package/tools/installer/render-targets.js +112 -0
  61. package/tools/installer/semver.js +59 -0
  62. package/tools/installer/setup-helpers.js +89 -31
  63. package/tools/installer/templates/hydrate.sh +163 -0
  64. package/tools/installer/templates/wize-kit-update.yml +38 -0
  65. package/tools/installer/toml.js +133 -0
  66. package/tools/installer/util.js +16 -0
  67. package/tools/installer/version-check.js +167 -37
  68. package/tools/installer/wize-cli.js +216 -78
  69. package/tools/installer/sync.js +0 -29
package/ARCH.md CHANGED
@@ -205,7 +205,8 @@ wize-dev-kit install
205
205
  ├─ Se brownfield: oferece `wize-document-project`
206
206
  └─ Se ok: dispara onboarding (Wizer → Pepper/Mantis/Tony)
207
207
 
208
- wize-dev-kit update # diff + preserva customizações
208
+ wize-dev-kit update # converge: pin + .gitignore + bloco AGENTS, via branch isolada/PR
209
+ wize-dev-kit hydrate # renderiza um checkout/worktree a partir do pin, sem tocar arquivos rastreados
209
210
  wize-dev-kit uninstall # remove kit, preserva código
210
211
  wize-dev-kit agent create | edit | list
211
212
  wize-dev-kit workflow create
package/CHANGELOG.md CHANGED
@@ -7,6 +7,70 @@ Format inspired by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
7
7
  > **0.10.0 and earlier are in Brazilian Portuguese** and are kept verbatim as a
8
8
  > historical record (not back-translated).
9
9
 
10
+ ## [0.27.2] — 2026-10-19
11
+
12
+ ### Fixed
13
+
14
+ - **Publish smoke test** cleared the job-level `WIZE_SKIP_BASELINE` for its explicit `document-project quick` step, which honors that variable since 0.27.0. Neither 0.27.0 nor 0.27.1 reached npm; 0.27.2 is the first published release with the worktree-safe hydrate and automatic updates.
15
+
16
+ ## [0.27.1] — 2026-10-19
17
+
18
+ ### Fixed
19
+
20
+ - **`update` in a repo with no commits yet** (`git init`, nothing committed) failed with "cannot determine default branch". With no history there is no base to branch from and nothing committed to protect, so it now updates in place, like a non-git project. `--pr` still refuses. This failure blocked the 0.27.0 publish.
21
+
22
+ ## [0.27.0] — 2026-10-19
23
+
24
+ **0.27.0: worktree-safe hydrate and automatic updates.** A new `git worktree` used to start without `/wize` because the generated skills are gitignored, and `update` edited whatever checkout you ran it from. Now `hydrate` renders any checkout from the `kit_version` pin, agents and hooks run it on their own, and `update` prepares the bump on an isolated branch. Guide: [`docs/WORKTREES.md`](docs/WORKTREES.md).
25
+
26
+ ### Added
27
+
28
+ - **`hydrate`**: renders the current checkout from `.wize/config/project.toml`. No prompts, no stdin, no baseline, no mutating git command. Copies `user.toml` from the primary checkout (or `$ORCA_ROOT_PATH` when it belongs to the same repository) and, when no source has one, generates it from git `user.name` / `$USER`; delegates to `npx wize-dev-kit@<pin>` for pins from 0.27.0 so every worktree renders exactly the pin, and writes `.wize/.local/hydrated.json`. Always exits 0; `--strict` exits 1 on failure. Flags: `--root`, `--json`, `--quiet`, `--if-needed`, `--no-delegate`, `--no-notice`.
29
+ - **Safe writes.** It refuses any write that resolves outside the project (a skills directory symlinked elsewhere in the repository or into another repository) and any file git tracks, listing the whole repository, and refuses every existing file when git cannot list tracked files. Vetoed directories are not created. Read-only git calls use `GIT_OPTIONAL_LOCKS=0`, so a session-start hydrate never takes `index.lock` next to your own git commands.
30
+ - **Root.** `--root` > `WIZE_PROJECT_ROOT` > the project found from the current directory > `ORCA_WORKTREE_PATH` (used only when the current directory is in no project). A shell in worktree B never renders worktree A because of an inherited Orca variable.
31
+ - **Delegation.** The child receives `WIZE_PROJECT_ROOT`. The `npx` call uses `--prefer-offline` for an exact pin, turns npm's fetch retries off, sets a 20 s fetch timeout and is capped at 45 s; an attempt killed by its cap is not retried. A failed delegation prints one fallback line instead of npm's raw error (`WIZE_VERBOSE=1` shows it) and renders with the local binary. That fallback render records the targeted pin next to the binary version and a `fallback` flag, so `version-check` and `--if-needed` do not report it stale for an hour; after that the next `hydrate --if-needed` (and the managed hook) tries the exact pin again. `--if-needed` also notices a missing `wize` alias entrypoint.
32
+ - **`version-check` next action**: `--json` (schema 2) now carries the project pin, hydration state, `action` (`none|hydrate|update|use-pin|install`) and the exact `commands` to run, so agents never compare versions. `--exit-code` maps the action to 0/10/11/12/13. `--refresh --quiet` is the background cache refresher. A pin must be plain `N.N.N[-pre]` to appear in a command; otherwise the unpinned command is used and `pin_status` is `invalid` (`action: update`, `reason: pin-invalid`). A pin newer than the registry is judged on a fresh answer only: `pin-unpublished` (and the downgrade it suggests) needs a registry answer fetched just now whose published-versions list lacks the pin (a prerelease published under another dist-tag is not unpublished); a cached `latest` yields `use-pin`. `/wize`, `/wize-help` and the `AGENTS.md` bootstrap block ask before running it, phrased as a downgrade, and the commit subject says `downgrade kit`. The skills and the bootstrap block run `version-check` with `--fetch-retries=0` and skip the step when npx fails.
33
+ - **`update` modes**: `--pr` (push the branch, open the PR with `gh` or print the compare URL; when `origin` already carries the update branch it is reused and `update` goes straight to the PR step, so the weekly Action also works after its first run), `--in-place` (edit the checkout, never commit; `--no-render` skips the adapter re-render), `--check` (exit 0/11/12), `--dry-run`, `--base <ref>`, `--allow-downgrade`, `--json`. `update` compares semver properly (`0.27.0-rc.1` sorts below `0.27.0`), refuses to downgrade without `--allow-downgrade`, and re-reads `project.toml` before reporting success. `--in-place` also refuses (exit 1, nothing written) when a tracked generated file its re-render would overwrite has uncommitted edits; commit or stash them, or pass `--no-render`.
34
+ - **`hooks install|print`**: opt-in automation. `install` writes the managed `.wize/hooks/hydrate.sh` plus the config for `--claude` (SessionStart), `--cursor` (`worktrees.json`) and `--github-action` (weekly bump PR). `print` shows snippets for Orca, Claude Code, Cursor, Codex and the Action without writing anything. The script accepts only `N.N.N[-pre]` pins (anything else, such as `1.2.3.4:host/repo` that npm reads as a git spec, falls back to `@latest`), uses `--prefer-offline` for an exact pin, caps each attempt at 55 s when `timeout` exists (a capped attempt is not retried, so an offline session stays within the 180 s SessionStart timeout), and stops retrying when the registry answers `ETARGET` (the pin is not published). Like the CLI, it hydrates `CLAUDE_PROJECT_DIR`, else the project found from its working directory (up to the git boundary), and only then `ORCA_WORKTREE_PATH`; a prerelease pin of 0.27.0 counts as older than 0.27.0 and runs `sync`.
35
+ - **`doctor --json` and `--strict`**: new hydration section (marker, pin, `user.toml`, per-target status), leak checks (tracked alias files, `.gitignore` drift), directional version skew, primary-checkout or linked-worktree facts. `--strict` exits 1 on any error-level suggestion. Without a TTY `doctor` starts no background registry refresh.
36
+ - **`AGENTS.md` bootstrap block**: version-agnostic, tells any harness to run `version-check --json` and follow `action`. New `AGENTS.md` files get it; `update` adds it to a kit-generated file and never edits a foreign one.
37
+ - **Root and name flags**: `--root <dir>` and `WIZE_PROJECT_ROOT` for `sync`, `update`, `doctor`, `agent`, `document-project` and `version-check`; `install --here`, `--user-name`, `--project-name`, `--baseline`; `document-project --force`; `WIZE_SKIP_BASELINE=1` also skips `document-project quick`.
38
+ - **Docs**: `docs/WORKTREES.md` and `docs/WORKTREES.pt-BR.md`, a "Worktrees & automatic updates" section in the three READMEs, and a hydrate line in every harness doc.
39
+
40
+ ### Changed
41
+
42
+ - **`update` prepares an isolated branch by default.** In a git repo it fetches, works in a temporary worktree off `origin/<default>`, commits `chore/wize-kit-<version>` there (pin, managed `.gitignore` block, `AGENTS.md` block, `hydrate.sh`, untracked alias files) and removes the worktree. The worktree is a full checkout of the base with hooks disabled for the checkout step and LFS objects not downloaded (pointer files stay pointers). The commit still runs the project's hooks, and `update` aborts without creating or moving the branch if a hook changes files outside the plan. It removes only its own worktree registration and never runs a repo-wide `git worktree prune`. It never touches your checkout, index or branch and never commits on the default branch. Outside git it keeps editing in place. `--in-place` refuses, writing nothing, when a tracked file it would overwrite has uncommitted edits: the files it edits and every directory the configured adapters render into (including `.github/agents/` and `.opencode/commands/`); `--no-render` skips the second check. It also asks the renderer which paths it would write (a probe that writes nothing) and refuses when one resolves, through a symlinked output directory, to a tracked file with uncommitted edits, and it refuses when git cannot report status (failing closed). The PR title and body use the same verb as the commit (`bump`, `downgrade` or `converge`).
43
+ - **`install` is idempotent.** On a project that already has `project.toml` it hydrates and exits 0; conflicting `--profiles`, `--targets` or `--lang` exit 1 with a pointer to `project.toml`, before anything is printed. From a subdirectory of an installed project it refuses (`--here` overrides); with no `project.toml` and a cwd that is not the repo root, `--yes` refuses unless `--here`. In a linked worktree whose branch has no `project.toml` while the primary checkout does, `install --yes` skips quietly (exit 0) and interactive `install` exits 1, with a pointer to merge the kit or pass `--here`; in a bare repository with worktrees the kit is looked up in the default-branch worktree, then any other non-bare worktree. `version-check` and `doctor` report that situation as `action: none`, `reason: kit-not-on-branch` (a doctor warning, no `install` suggestion). Hooks that run `install --yes` never start a second install. In a linked worktree the default project name is the primary checkout's.
44
+ - **`uninstall` resolves the project root**, prints `uninstalling from <root>` and refuses from a subdirectory (exit 1) unless you pass `--root` or set `WIZE_PROJECT_ROOT`.
45
+ - **The document-project baseline is non-destructive.** `quick` and `initial_scan` keep existing files (a dated bullet survives); `--force` overwrites; `full_rescan` still rewrites. A fresh install skips the baseline when docs already exist. `doctor`'s "no scan state" hint now points at `initial_scan`, the mode that writes state.
46
+ - **`.gitignore` managed block**: each generated location gets its `wize-*` glob plus an explicit alias line (`wize/`, `wize.mdc`, `wize.md`, `wize.prompt`), and `.claude/worktrees/` is ignored. `uninstall` removes alias entries by exact path for the configured targets only.
47
+ - **Version hints never wait on the network.** The registry answer is stale-while-revalidate: cached at any age, TTL from `fetched_at`, one detached refresh per 10 minutes, none in CI, without a TTY, with `WIZE_DISABLE_UPDATE_CHECK=1` or with `WIZE_NO_BG_REFRESH=1`. The hint line itself stays silent without a TTY. `WIZE_DISABLE_UPDATE_CHECK=1` also turns the `update` action into `none`.
48
+ - **Renders write only what changed**, through atomic temp-file renames, so concurrent worktrees and agents cannot corrupt each other. `sync` and `update --in-place` write atomically but unguarded. `hydrate` and in-place `update` print "N written, M unchanged"; `sync` keeps "N file(s) emitted". A fresh `install` writes the hydration marker too.
49
+ - **`sync`** warns on skew in both directions, writes the hydration marker, never writes `user.toml`, `.gitignore` or `kit_version`, and suggests `hydrate` when the pin is 0.27.0 or later.
50
+ - **`/wize` and `/wize-help` Step 2.5** follow the `action` table: hydrate and the local update branch run without asking, with one confirmation before `update --pr`. **`/wize-update`** is now kit maintenance in five steps instead of a confirm-then-apply flow.
51
+ - **Root detection** walks up to the enclosing git checkout, so commands run from a subdirectory or a linked worktree find `project.toml`.
52
+
53
+ ### Fixed
54
+
55
+ - **`update` could write through a tracked symlink.** A symlinked `.gitignore` (common in dotfiles setups) read back as its target path and the managed block was written through the link into the user's real file. Plan sources now treat a symlink or gitlink as not a file: a symlinked `.gitignore` is left alone, and the write step refuses (exit 1, nothing written) any target, or directory above it, that is a symlink.
56
+ - **`<command> --help` ran the command.** `update --help` ran the update and `install --help` ran an install. `--help` and `-h` now print the help for every command and run nothing.
57
+ - **`update` could lower the pin and print success** when `kit_version` was not written. See the `update` modes above for the semver comparison, the downgrade guard and the verified write.
58
+ - **`doctor` in linked worktrees** treated a `.git` file as no repository and suggested `git init`; it now reads the real repository, including detached HEADs. The `head: ?` line shows the SHA.
59
+ - **`doctor` and sprint status**: `sprint-status.yaml` is recognized (the `.md` name stays as a fallback), and OpenCode counts both `.opencode/agents` and `.opencode/commands`.
60
+ - **CLI parsing**: `--key=value` keeps a value that contains `=`. **TOML**: `#` inside a quoted string is no longer read as a comment.
61
+
62
+ ### Migration
63
+
64
+ 1. In each repo, run `npx wize-dev-kit@latest update --pr` once and merge the PR.
65
+ 2. The PR untracks the alias files earlier versions committed by accident (for example `.cursor/rules/wize.mdc`). Other worktrees lose them when they pull the merge until `hydrate` runs; the session loop or a hook does that on its own, or run `npx wize-dev-kit hydrate`.
66
+ 3. Optional: `npx wize-dev-kit hooks install --claude --cursor --github-action` for hydrate on worktree creation and a weekly bump PR.
67
+
68
+ ### Breaking notes
69
+
70
+ - In a git repo `update` no longer edits the checkout unless you pass `--in-place`. Scripts that relied on that must pass the flag or merge the branch it prepares.
71
+ - `install` on an installed project is `hydrate`; flags that conflict with `project.toml` are rejected instead of ignored.
72
+ - `sync` output counts changed as well as unchanged files ("emitted"); parse `--json` outputs of `hydrate`, `update` and `version-check` instead of human text.
73
+
10
74
  ## [0.26.1] — 2026-10-19
11
75
 
12
76
  ### Fixed
package/README.es.md CHANGED
@@ -158,8 +158,9 @@ Transversales:
158
158
  /wize-check Checklist de avance de la demanda en vuelo: hecho
159
159
  (con evidencia), en curso, lo que falta — luego
160
160
  retoma el trabajo interrumpido.
161
- /wize-update Revisa si el kit está desactualizado, muestra el
162
- changelog, confirma y aplica la actualización.
161
+ /wize-update Mantenimiento del kit: hidrata un checkout sin skills,
162
+ prepara la rama del bump localmente y abre el PR
163
+ tras una confirmación de push.
163
164
  /wize-grill Entrevista-hasta-entendimiento antes de cualquier
164
165
  paso de autoría.
165
166
  /wize-no-ai-slop Higiene de escrita para texto de usuario final:
@@ -239,11 +240,31 @@ Con el perfil **Wize Security** instalado, **Natasha Romanoff** (`wize-sec-red-t
239
240
 
240
241
  ---
241
242
 
243
+ ## Worktrees y actualizaciones automáticas
244
+
245
+ Un `git worktree` nuevo no tiene las skills generadas (están en el `.gitignore`). Un comando lo resuelve:
246
+
247
+ ```bash
248
+ npx wize-dev-kit hydrate # renderiza este checkout desde project.toml; no escribe en archivos rastreados
249
+ ```
250
+
251
+ - El pin `kit_version` en `.wize/config/project.toml` decide qué kit renderiza el repo, para todo el equipo.
252
+ - `/wize` lee el pin e hidrata un checkout vacío sin preguntar. `hooks install` (Claude Code, Cursor) y `hooks print` (Orca, Codex) hacen lo mismo al crear el worktree. Una GitHub Action semanal abre el PR de bump.
253
+ - `update` prepara `chore/wize-kit-<versión>` en un worktree desechable. Nunca toca tu checkout ni la rama por defecto; `--pr` hace push y abre el PR. En un repo existente, ejecuta `npx wize-dev-kit@latest update --pr` una vez y haz el merge.
254
+ - Para desactivar la consulta al registry, usa `WIZE_DISABLE_UPDATE_CHECK=1`.
255
+
256
+ Guía completa: [`docs/WORKTREES.md`](docs/WORKTREES.md) (en inglés; también en [pt-BR](docs/WORKTREES.pt-BR.md)).
257
+
258
+ ---
259
+
242
260
  ## Comandos de la CLI
243
261
 
244
262
  ```bash
245
263
  npx wize-dev-kit install # setup interactivo
246
- npx wize-dev-kit update # actualiza un kit instalado a la versión actual
264
+ npx wize-dev-kit update # prepara la rama de bump del kit en un worktree temporal (--pr, --check, --in-place)
265
+ npx wize-dev-kit update --pr # también hace push de la rama y abre el PR
266
+ npx wize-dev-kit hydrate # renderiza un checkout/worktree nuevo desde el pin; nunca toca archivos rastreados
267
+ npx wize-dev-kit hooks <install|print> # automatización opt-in: hydrate al crear worktree/sesión, PR semanal de bump
247
268
  npx wize-dev-kit sync # re-renderiza los adapters de IDE tras editar la config
248
269
  npx wize-dev-kit list # lista agentes, skills y workflows instalados
249
270
  npx wize-dev-kit agent list # lista agentes nativos + personalizados
@@ -251,13 +272,13 @@ npx wize-dev-kit agent create # crea un nuevo agente personalizado (validado
251
272
  npx wize-dev-kit agent edit <code> # sobrescribe un agente nativo
252
273
  npx wize-dev-kit workflow list # lista workflows nativos + personalizados
253
274
  npx wize-dev-kit workflow create # crea un nuevo workflow personalizado
254
- npx wize-dev-kit doctor # diagnostica kit / proyecto / adapters / gates
275
+ npx wize-dev-kit doctor [--json] [--strict] # diagnostica kit / proyecto / hidratación / adapters / gates
255
276
  npx wize-dev-kit validate # chequeos estructurales en los assets del kit
256
- npx wize-dev-kit document-project [quick|initial_scan|full_rescan|deep_dive] [--resume] [--target <path>]
277
+ npx wize-dev-kit document-project [quick|initial_scan|full_rescan|deep_dive] [--resume] [--force] [--target <path>]
257
278
  npx wize-dev-kit uninstall # elimina .wize/ (tu código queda intacto)
258
279
  npx wize-dev-kit help # referencia de comandos
259
280
  npx wize-dev-kit version # imprime la versión instalada del kit
260
- npx wize-dev-kit version-check [--json] # instalada vs. más reciente (con caché; scriptable; nunca bloquea)
281
+ npx wize-dev-kit version-check [--json] [--exit-code] # pin, hidratación y registry; indica la siguiente acción (con caché; como máximo ~1,5 s de espera del registry)
261
282
  ```
262
283
 
263
284
  ---
@@ -269,6 +290,7 @@ npx wize-dev-kit version-check [--json] # instalada vs. más reciente (con cach
269
290
  - [`AGENTS.md`](AGENTS.md) — el roster generado + el contexto operativo que las IDEs leen en la raíz del repo.
270
291
  - [`DECISIONS.md`](DECISIONS.md) — registro de decisiones.
271
292
  - [`CHANGELOG.md`](CHANGELOG.md) — historial de releases.
293
+ - [`docs/WORKTREES.md`](docs/WORKTREES.md) — worktrees, hydrate, hooks y el flujo de update (en inglés; también en [pt-BR](docs/WORKTREES.pt-BR.md)).
272
294
  - [`docs/harnesses/`](docs/harnesses/) — un doc por [harness soportado](#harnesses-soportados), en inglés + [pt-BR](README.pt-BR.md#harnesses-suportadas).
273
295
 
274
296
  ---
package/README.md CHANGED
@@ -156,8 +156,9 @@ Cross-cutting:
156
156
  /wize-check Progress checklist for the demand in flight:
157
157
  done (with evidence), in progress, what's left —
158
158
  then resumes the interrupted work.
159
- /wize-update Checks kit version skew, shows the changelog
160
- jump, confirms, then applies the update.
159
+ /wize-update Kit maintenance: hydrates a checkout with missing
160
+ skills, prepares the kit-bump branch locally, and
161
+ opens the PR after one push confirmation.
161
162
  /wize-grill Interview-to-understanding before any authoring step.
162
163
  /wize-eli5 Explain anything to anyone — vocabulary, analogies,
163
164
  tone, depth and framing calibrated to the audience
@@ -238,24 +239,44 @@ When the **Wize Security** profile is installed, **Natasha Romanoff** (`wize-sec
238
239
 
239
240
  ---
240
241
 
242
+ ## Worktrees & automatic updates
243
+
244
+ A new `git worktree` has no generated skills (they are gitignored). One command fixes it:
245
+
246
+ ```bash
247
+ npx wize-dev-kit hydrate # render this checkout from project.toml; writes no tracked file
248
+ ```
249
+
250
+ - The `kit_version` pin in `.wize/config/project.toml` decides which kit renders the repo, for everyone.
251
+ - `/wize` reads the pin and hydrates a bare checkout without asking. `hooks install` (Claude Code, Cursor) and `hooks print` (Orca, Codex) do the same when a worktree is created. A weekly GitHub Action opens the bump PR.
252
+ - `update` prepares `chore/wize-kit-<version>` in a throwaway worktree. It never touches your checkout or the default branch; `--pr` pushes it and opens the PR. In an existing repo, run `npx wize-dev-kit@latest update --pr` once and merge.
253
+ - Opt out of registry checks with `WIZE_DISABLE_UPDATE_CHECK=1`.
254
+
255
+ Full guide: [`docs/WORKTREES.md`](docs/WORKTREES.md).
256
+
257
+ ---
258
+
241
259
  ## CLI commands
242
260
 
243
261
  ```bash
244
262
  npx wize-dev-kit install # interactive setup
245
- npx wize-dev-kit update # bring an installed kit up to the current version
263
+ npx wize-dev-kit update # prepare the kit-bump branch in a temp worktree (--pr, --check, --in-place)
264
+ npx wize-dev-kit update --pr # also push the branch and open the PR
265
+ npx wize-dev-kit hydrate # render a fresh checkout/worktree from the pin; never touches tracked files
266
+ npx wize-dev-kit hooks <install|print> # opt-in automation: hydrate on worktree/session start, weekly bump PR
246
267
  npx wize-dev-kit sync # re-render IDE adapters after editing config
247
268
  npx wize-dev-kit list # list installed agents, skills and workflows
248
269
  npx wize-dev-kit agent list # list built-in + custom agents
249
270
  npx wize-dev-kit agent create # scaffold a new custom agent (validated + dry-run)
250
271
  npx wize-dev-kit agent edit <code> # override a built-in agent
251
272
  npx wize-dev-kit workflow <create|list> # scaffold or list custom workflows
252
- npx wize-dev-kit doctor # diagnose kit / project / adapters / gates
273
+ npx wize-dev-kit doctor [--json] [--strict] # diagnose kit / project / hydration / adapters / gates
253
274
  npx wize-dev-kit validate # structural checks on the kit assets
254
- npx wize-dev-kit document-project [quick|initial_scan|full_rescan|deep_dive] [--resume] [--target <path>]
275
+ npx wize-dev-kit document-project [quick|initial_scan|full_rescan|deep_dive] [--resume] [--force] [--target <path>]
255
276
  npx wize-dev-kit uninstall # remove .wize/ (your code is left untouched)
256
277
  npx wize-dev-kit help # command reference
257
278
  npx wize-dev-kit version # print the installed kit version
258
- npx wize-dev-kit version-check [--json] # installed vs latest (cached; scriptable; never blocks)
279
+ npx wize-dev-kit version-check [--json] [--exit-code] # pin, hydration and registry; names the next action (cached; at most ~1.5 s registry wait)
259
280
  ```
260
281
 
261
282
  ---
@@ -267,6 +288,7 @@ npx wize-dev-kit version-check [--json] # installed vs latest (cached; scriptab
267
288
  - [`AGENTS.md`](AGENTS.md) — the generated roster + operating context IDEs read at the repo root.
268
289
  - [`DECISIONS.md`](DECISIONS.md) — decisions log.
269
290
  - [`CHANGELOG.md`](CHANGELOG.md) — release history.
291
+ - [`docs/WORKTREES.md`](docs/WORKTREES.md) — worktrees, hydrate, hooks and the update flow.
270
292
  - [`docs/harnesses/`](docs/harnesses/) — one doc per [supported harness](#supported-harnesses), in English + [pt-BR](README.pt-BR.md#harnesses-suportadas).
271
293
 
272
294
  ---
package/README.pt-BR.md CHANGED
@@ -157,8 +157,9 @@ Transversais:
157
157
  /wize-check Checklist de acompanhamento da demanda em voo:
158
158
  feito (com evidência), em andamento, o que falta —
159
159
  depois retoma o trabalho interrompido.
160
- /wize-update Verifica se o kit está desatualizado, mostra o
161
- changelog, confirma e aplica o update.
160
+ /wize-update Manutenção do kit: hidrata um checkout sem skills,
161
+ prepara a branch do bump localmente e abre o PR
162
+ após uma confirmação de push.
162
163
  /wize-grill Entrevista-até-entendimento antes de qualquer passo
163
164
  de autoria.
164
165
  /wize-eli5 Explique qualquer coisa a qualquer um — vocabulário,
@@ -241,24 +242,44 @@ Com o perfil **Wize Security** instalado, **Natasha Romanoff** (`wize-sec-red-te
241
242
 
242
243
  ---
243
244
 
245
+ ## Worktrees & atualizações automáticas
246
+
247
+ Um `git worktree` novo não tem as skills geradas (elas estão no `.gitignore`). Um comando resolve:
248
+
249
+ ```bash
250
+ npx wize-dev-kit hydrate # renderiza este checkout a partir do project.toml; não escreve em arquivo rastreado
251
+ ```
252
+
253
+ - O pin `kit_version` em `.wize/config/project.toml` decide qual kit renderiza o repo, para todo o time.
254
+ - O `/wize` lê o pin e hidrata um checkout vazio sem perguntar. O `hooks install` (Claude Code, Cursor) e o `hooks print` (Orca, Codex) fazem o mesmo na criação do worktree. Uma GitHub Action semanal abre o PR de bump.
255
+ - O `update` prepara `chore/wize-kit-<versão>` num worktree descartável. Nunca toca seu checkout nem a branch default; `--pr` faz push e abre o PR. Num repo existente, rode `npx wize-dev-kit@latest update --pr` uma vez e faça o merge.
256
+ - Para desligar a consulta ao registry, use `WIZE_DISABLE_UPDATE_CHECK=1`.
257
+
258
+ Guia completo: [`docs/WORKTREES.pt-BR.md`](docs/WORKTREES.pt-BR.md).
259
+
260
+ ---
261
+
244
262
  ## Comandos da CLI
245
263
 
246
264
  ```bash
247
265
  npx wize-dev-kit install # setup interativo
248
- npx wize-dev-kit update # atualiza um kit instalado para a versão atual
266
+ npx wize-dev-kit update # prepara a branch de bump do kit num worktree temporário (--pr, --check, --in-place)
267
+ npx wize-dev-kit update --pr # também faz push da branch e abre o PR
268
+ npx wize-dev-kit hydrate # renderiza um checkout/worktree novo a partir do pin; nunca toca arquivos rastreados
269
+ npx wize-dev-kit hooks <install|print> # automação opt-in: hydrate ao criar worktree/sessão, PR semanal de bump
249
270
  npx wize-dev-kit sync # re-renderiza os adapters de IDE após editar a config
250
271
  npx wize-dev-kit list # lista agentes, skills e workflows instalados
251
272
  npx wize-dev-kit agent list # lista agentes nativos + customizados
252
273
  npx wize-dev-kit agent create # cria um novo agente customizado (validado + dry-run)
253
274
  npx wize-dev-kit agent edit <code> # sobrescreve um agente nativo
254
275
  npx wize-dev-kit workflow <create|list> # cria ou lista workflows customizados
255
- npx wize-dev-kit doctor # diagnostica kit / projeto / adapters / gates
276
+ npx wize-dev-kit doctor [--json] [--strict] # diagnostica kit / projeto / hidratação / adapters / gates
256
277
  npx wize-dev-kit validate # checagens estruturais nos assets do kit
257
- npx wize-dev-kit document-project [quick|initial_scan|full_rescan|deep_dive] [--resume] [--target <path>]
278
+ npx wize-dev-kit document-project [quick|initial_scan|full_rescan|deep_dive] [--resume] [--force] [--target <path>]
258
279
  npx wize-dev-kit uninstall # remove .wize/ (seu código permanece intacto)
259
280
  npx wize-dev-kit help # referência de comandos
260
281
  npx wize-dev-kit version # imprime a versão instalada do kit
261
- npx wize-dev-kit version-check [--json] # instalada vs. mais recente (com cache; scriptável; nunca bloqueia)
282
+ npx wize-dev-kit version-check [--json] [--exit-code] # pin, hidratação e registry; indica a próxima ação (com cache; no máximo ~1,5 s de espera pelo registry)
262
283
  ```
263
284
 
264
285
  ---
@@ -270,6 +291,7 @@ npx wize-dev-kit version-check [--json] # instalada vs. mais recente (com cache
270
291
  - [`AGENTS.md`](AGENTS.md) — o roster gerado + contexto operacional que as IDEs leem na raiz do repo.
271
292
  - [`DECISIONS.md`](DECISIONS.md) — log de decisões.
272
293
  - [`CHANGELOG.md`](CHANGELOG.md) — histórico de releases.
294
+ - [`docs/WORKTREES.pt-BR.md`](docs/WORKTREES.pt-BR.md) — worktrees, hydrate, hooks e o fluxo de update.
273
295
  - [`docs/harnesses/`](docs/harnesses/) — um doc por [harness suportada](#harnesses-suportadas), em português + [English](README.md#supported-harnesses).
274
296
 
275
297
  ---
@@ -5,9 +5,8 @@
5
5
 
6
6
  'use strict';
7
7
 
8
- const fs = require('node:fs');
9
8
  const path = require('node:path');
10
- const { collectAssets, escapeYamlDouble, clipOneLine, ensureDir } = require('../../tools/installer/render-shared.js');
9
+ const { collectAssets, escapeYamlDouble, clipOneLine, ensureDir, writeFileIfChanged } = require('../../tools/installer/render-shared.js');
11
10
 
12
11
  function render(kitRoot, projectRoot, opts = {}) {
13
12
  const targetDir = path.join(projectRoot, '.continue', 'prompts');
@@ -33,7 +32,7 @@ function render(kitRoot, projectRoot, opts = {}) {
33
32
  if (opts.dryRun) {
34
33
  written.push(`[dry-run] ${a.code}.prompt`);
35
34
  } else {
36
- fs.writeFileSync(path.join(targetDir, `${a.code}.prompt`), content, 'utf-8');
35
+ writeFileIfChanged(path.join(targetDir, `${a.code}.prompt`), content);
37
36
  written.push(`${a.code}.prompt`);
38
37
  }
39
38
  }
@@ -20,14 +20,14 @@
20
20
 
21
21
  'use strict';
22
22
 
23
- const fs = require('node:fs');
24
23
  const path = require('node:path');
25
24
  const {
26
25
  collectAssets,
27
26
  renderAnthropicSkills,
28
27
  escapeYamlDouble,
29
28
  clipOneLine,
30
- ensureDir
29
+ ensureDir,
30
+ writeFileIfChanged
31
31
  } = require('../../tools/installer/render-shared.js');
32
32
 
33
33
  function render(kitRoot, projectRoot, opts = {}) {
@@ -67,7 +67,7 @@ function render(kitRoot, projectRoot, opts = {}) {
67
67
  written.push(`[dry-run] ${a.code}.agent.md`);
68
68
  continue;
69
69
  }
70
- fs.writeFileSync(path.join(agentsDir, `${a.code}.agent.md`), content, 'utf-8');
70
+ writeFileIfChanged(path.join(agentsDir, `${a.code}.agent.md`), content);
71
71
  written.push(`${a.code}.agent.md`);
72
72
  }
73
73
 
@@ -5,9 +5,8 @@
5
5
 
6
6
  'use strict';
7
7
 
8
- const fs = require('node:fs');
9
8
  const path = require('node:path');
10
- const { collectAssets, escapeYamlDouble, clipOneLine, ensureDir } = require('../../tools/installer/render-shared.js');
9
+ const { collectAssets, escapeYamlDouble, clipOneLine, ensureDir, writeFileIfChanged } = require('../../tools/installer/render-shared.js');
11
10
 
12
11
  function render(kitRoot, projectRoot, opts = {}) {
13
12
  const targetDir = path.join(projectRoot, '.cursor', 'rules');
@@ -39,7 +38,7 @@ function render(kitRoot, projectRoot, opts = {}) {
39
38
  if (opts.dryRun) {
40
39
  written.push(`[dry-run] ${a.code}.mdc`);
41
40
  } else {
42
- fs.writeFileSync(path.join(targetDir, `${a.code}.mdc`), content, 'utf-8');
41
+ writeFileIfChanged(path.join(targetDir, `${a.code}.mdc`), content);
43
42
  written.push(`${a.code}.mdc`);
44
43
  }
45
44
  }
@@ -4,9 +4,8 @@
4
4
 
5
5
  'use strict';
6
6
 
7
- const fs = require('node:fs');
8
7
  const path = require('node:path');
9
- const { collectAssets, renderAgentsMd, clipOneLine, ensureDir } = require('../../tools/installer/render-shared.js');
8
+ const { collectAssets, renderAgentsMd, clipOneLine, ensureDir, writeFileIfChanged } = require('../../tools/installer/render-shared.js');
10
9
 
11
10
  function render(kitRoot, projectRoot, opts = {}) {
12
11
  const targetDir = path.join(projectRoot, '.wize', 'agents');
@@ -21,7 +20,7 @@ function render(kitRoot, projectRoot, opts = {}) {
21
20
  if (opts.dryRun) {
22
21
  written.push(`[dry-run] ${a.code}.md`);
23
22
  } else {
24
- fs.writeFileSync(path.join(targetDir, `${a.code}.md`), content, 'utf-8');
23
+ writeFileIfChanged(path.join(targetDir, `${a.code}.md`), content);
25
24
  written.push(`${a.code}.md`);
26
25
  }
27
26
  }
@@ -10,9 +10,8 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- const fs = require('node:fs');
14
13
  const path = require('node:path');
15
- const { collectAssets, escapeYamlDouble, clipOneLine, ensureDir } = require('../../tools/installer/render-shared.js');
14
+ const { collectAssets, escapeYamlDouble, clipOneLine, ensureDir, writeFileIfChanged } = require('../../tools/installer/render-shared.js');
16
15
 
17
16
  // `owner:` in workflow/skill frontmatter is written for humans (agent code,
18
17
  // display name, "X + Y" pairings, trailing "# comment"). Resolve it to a
@@ -63,7 +62,7 @@ function render(kitRoot, projectRoot, opts = {}) {
63
62
  if (opts.dryRun) {
64
63
  written.push(`[dry-run] agents/${a.code}.md`);
65
64
  } else {
66
- fs.writeFileSync(path.join(agentsDir, `${a.code}.md`), content, 'utf-8');
65
+ writeFileIfChanged(path.join(agentsDir, `${a.code}.md`), content);
67
66
  written.push(`agents/${a.code}.md`);
68
67
  }
69
68
  } else {
@@ -85,7 +84,7 @@ function render(kitRoot, projectRoot, opts = {}) {
85
84
  if (opts.dryRun) {
86
85
  written.push(`[dry-run] commands/${a.code}.md`);
87
86
  } else {
88
- fs.writeFileSync(path.join(commandsDir, `${a.code}.md`), content, 'utf-8');
87
+ writeFileIfChanged(path.join(commandsDir, `${a.code}.md`), content);
89
88
  written.push(`commands/${a.code}.md`);
90
89
  }
91
90
  }
@@ -5,9 +5,8 @@
5
5
 
6
6
  'use strict';
7
7
 
8
- const fs = require('node:fs');
9
8
  const path = require('node:path');
10
- const { collectAssets, clipOneLine, ensureDir } = require('../../tools/installer/render-shared.js');
9
+ const { collectAssets, clipOneLine, ensureDir, writeFileIfChanged } = require('../../tools/installer/render-shared.js');
11
10
 
12
11
  function render(kitRoot, projectRoot, opts = {}) {
13
12
  const targetDir = path.join(projectRoot, '.windsurf', 'rules');
@@ -30,7 +29,7 @@ function render(kitRoot, projectRoot, opts = {}) {
30
29
  if (opts.dryRun) {
31
30
  written.push(`[dry-run] ${a.code}.md`);
32
31
  } else {
33
- fs.writeFileSync(path.join(targetDir, `${a.code}.md`), content, 'utf-8');
32
+ writeFileIfChanged(path.join(targetDir, `${a.code}.md`), content);
34
33
  written.push(`${a.code}.md`);
35
34
  }
36
35
  }
@@ -0,0 +1,150 @@
1
+ # Worktrees and automatic updates
2
+
3
+ 🌐 **Languages:** **English** · [Português (pt-BR)](WORKTREES.pt-BR.md)
4
+
5
+ ← [Back to README](../README.md)
6
+
7
+ A fresh `git worktree` has only the files git tracks. The kit's generated skills are not tracked, so a new worktree starts without `/wize` and friends. This guide covers how the kit fixes that on its own, and what each command does to your repo while it happens.
8
+
9
+ ## What lives where
10
+
11
+ | Kind | Files | In git? | Who writes it |
12
+ |---|---|---|---|
13
+ | Tracked, shared | `.wize/config/project.toml` (holds the `kit_version` pin), `.wize/config/tea.toml`, `.wize/custom/`, planning, solutioning, implementation and knowledge artifacts, `AGENTS.md`, the managed `.gitignore` block, `.wize/hooks/hydrate.sh` and the hook configs from `hooks install` | yes | `install`, `update`, and you |
14
+ | Generated | `wize-*` entries per target (`.claude/skills/`, `.cursor/rules/`, `.github/skills/`, `.agents/skills/`, `.opencode/`, `.wize/agents/`, and the rest), plus the `wize` alias beside them | no, gitignored | `hydrate`, `sync` |
15
+ | Per developer | `.wize/config/user.toml`, `.wize/scratch/`, `.wize/.local/` (the `hydrated.json` marker), `.wize/implementation/quick-dev-log.md` | no, gitignored | `hydrate` (user.toml), you |
16
+
17
+ `.claude/worktrees/` is gitignored too, so worktrees that Claude Code creates inside the repo never show up in `git status`.
18
+
19
+ ## The pin
20
+
21
+ `kit_version` in `.wize/config/project.toml` is the single source of truth for which kit renders this repo. Everyone on the team renders exactly that version, whichever `npx` they happened to run.
22
+
23
+ - `hydrate` renders the pin. For a pin of 0.27.0 or later it re-runs itself as `npx wize-dev-kit@<pin> hydrate` when the binary differs, with a guard (`WIZE_HYDRATE_DELEGATED`) against recursion. If that fails (offline, registry down; an attempt is capped at 45 s and a timed-out attempt is not retried) it renders with the binary it has and prints a warning. That fallback render counts as current for an hour, then the next `hydrate --if-needed` tries the exact pin again.
24
+ - Pins older than 0.27.0 have no `hydrate`. For those, `version-check` names `sync` as the command and never loops.
25
+ - A pin newer than the binary means your `npx` cache is stale. `update` refuses to downgrade the pin unless you pass `--allow-downgrade`.
26
+
27
+ ## New worktree checklist
28
+
29
+ ```bash
30
+ npx wize-dev-kit hydrate
31
+ ```
32
+
33
+ That is the whole checklist. `hydrate`:
34
+
35
+ - finds the project root from any subdirectory or linked worktree (`--root <dir>` or `WIZE_PROJECT_ROOT` override it);
36
+ - copies `.wize/config/user.toml` from the primary checkout, or derives one from `git config user.name`, and never overwrites an existing one;
37
+ - renders the adapters for the configured targets, skipping files whose content is unchanged;
38
+ - writes the marker `.wize/.local/hydrated.json`;
39
+ - never prompts, never reads stdin, never runs the document-project baseline, and never writes a tracked file.
40
+
41
+ Before rendering it records `git ls-files`; a render that would overwrite a tracked file is blocked, including one that would reach it through a symlinked directory. If git cannot list tracked files (git missing, or a repository git refuses as unsafe), hydrate leaves every existing file alone and warns. After rendering it compares `git status` and warns if new entries appeared, which usually means the repo's `.gitignore` predates 0.27.0.
42
+
43
+ To make it automatic, install a hook (next section).
44
+
45
+ ## The automatic loop
46
+
47
+ 1. **Session start.** An agent skill (`/wize`, `/wize-help`) runs `version-check --json` and follows its `action`: `hydrate` and `update` run without asking; the only confirmation is before `update --pr`, because that pushes. The `AGENTS.md` bootstrap block carries the same instruction for harnesses that do not load skills first.
48
+ 2. **Worktree creation.** Orca, Cursor and Claude Code can run `.wize/hooks/hydrate.sh` when a worktree or session starts (see the harness matrix).
49
+ 3. **Weekly.** A GitHub Action opens a PR that bumps the pin (`hooks install --github-action`).
50
+ 4. **After merge.** Each worktree pulls the new pin, sees that its marker is stale, and hydrates itself to the new version.
51
+
52
+ `version-check` reads the registry through a stale-while-revalidate cache in `$XDG_CACHE_HOME` (or `~/.cache`): the cached answer is returned at any age, and a stale entry starts one detached refresh, at most every 10 minutes. No refresh starts in CI, with `WIZE_DISABLE_UPDATE_CHECK=1` or with `WIZE_NO_BG_REFRESH=1`; the one-line hint after a command also stays silent without a TTY. Command hints and `hydrate` never wait on the network; an explicit `version-check` waits at most about 1.5 s for the registry when the cache is stale.
53
+
54
+ ### Opt out
55
+
56
+ `WIZE_DISABLE_UPDATE_CHECK=1` turns off the registry lookup and downgrades an `update` action to `none`. Hydration still happens. There is no team-level switch in `project.toml` yet.
57
+
58
+ ## Updating the kit
59
+
60
+ ```bash
61
+ npx wize-dev-kit@latest update # prepare the bump branch locally
62
+ npx wize-dev-kit@latest update --pr # also push it and open the PR
63
+ ```
64
+
65
+ In a git repo `update` works in a throwaway worktree:
66
+
67
+ 1. It fetches and branches off `origin/<default>` (or the local default branch if the fetch fails, and says so).
68
+ 2. In that worktree it bumps `kit_version`, refreshes the managed `.gitignore` block and the `AGENTS.md` bootstrap block (only in a kit-generated `AGENTS.md`), refreshes `hydrate.sh` when it is installed and managed, and untracks any tracked files under the 12 generated alias paths.
69
+ 3. It commits on `chore/wize-kit-<version>` and removes the worktree.
70
+
71
+ Your checkout, branch, index and uncommitted files are never touched, and `update` never commits on the default branch, so you can run it from a dirty tree or a detached HEAD. `--pr` pushes without force (a rejected push exits 1 and tells you the remote branch diverged) and opens the PR with `gh`, or prints the GitHub compare URL when `gh` is missing.
72
+
73
+ | Flag | Effect |
74
+ |---|---|
75
+ | `--pr` | Push the branch and open a PR. Counts as consent to push. |
76
+ | `--in-place` | Edit the current checkout instead, re-render, never commit. Always the mode outside a git repo. |
77
+ | `--no-render` | With `--in-place`: skip the adapter re-render. |
78
+ | `--check` | Report only. Exit 0 converged, 11 changes pending, 12 pin ahead of the binary. |
79
+ | `--dry-run` | Print the plan, write nothing, exit 0. |
80
+ | `--base <ref>` | Branch off this ref instead of the default branch. |
81
+ | `--allow-downgrade` | Let the pin move to an older version. |
82
+ | `--json` | One JSON object on stdout. |
83
+
84
+ ### Migrating an existing repo
85
+
86
+ Run `npx wize-dev-kit@latest update --pr` once per repo and merge the PR. One gotcha: the PR untracks the old alias files (for example `.cursor/rules/wize.mdc`) that earlier versions committed by accident. When another worktree pulls the merge, git deletes those files there. Run `hydrate` in that worktree, or let the session loop do it, and they come back as untracked, gitignored files.
87
+
88
+ ## Harness matrix
89
+
90
+ `npx wize-dev-kit hooks print <target>` prints the Orca, Claude Code, Cursor, Codex and weekly-Action snippets below without writing anything (the Copilot cloud agent has no print target). `hooks install` writes the managed `.wize/hooks/hydrate.sh` (POSIX sh, always exits 0, prints to stderr) plus the config you ask for with `--claude`, `--cursor` or `--github-action`; it needs at least one of those flags.
91
+
92
+ | Harness | Setup |
93
+ |---|---|
94
+ | Orca | In `orca.yaml`: `scripts.setup: sh .wize/hooks/hydrate.sh` and `setupAgentStartupPolicy: wait-for-setup`. List `.wize/config/user.toml` in `.worktreeinclude`. A non-empty setup hook saved locally in Orca overrides `orca.yaml`, so clear it in the repo settings. |
95
+ | Claude Code | `hooks install --claude` adds a `SessionStart` entry (matcher `startup`) to `.claude/settings.json`, merged with your existing hooks. Add `.wize/config/user.toml` to `.worktreeinclude` to copy it into worktrees. |
96
+ | Cursor | `hooks install --cursor` writes `.cursor/worktrees.json` with `setup-worktree: ["sh .wize/hooks/hydrate.sh"]`. |
97
+ | Codex | Set the local environment's setup script to `sh .wize/hooks/hydrate.sh`. Codex keeps this in its own config, so the kit only prints it. |
98
+ | GitHub Copilot cloud agent | Add `npx --yes wize-dev-kit hydrate` as a step in `.github/workflows/copilot-setup-steps.yml`. |
99
+ | Weekly bump PR | `hooks install --github-action` writes `.github/workflows/wize-kit-update.yml`. Enable "Allow GitHub Actions to create and approve pull requests" in the repo settings. PRs opened with `GITHUB_TOKEN` do not trigger other workflows, so required checks wait until someone pushes to the branch. |
100
+
101
+ None of these has been verified end to end in each product; see the last section.
102
+
103
+ ## What `git worktree remove` loses
104
+
105
+ Everything untracked in that worktree: `user.toml`, `.wize/scratch/`, `.wize/.local/`, `quick-dev-log.md`, and the generated adapters. All of it regenerates with `hydrate` except scratch notes and the quick-dev log, which exist only in that worktree. Commit or copy those first. `.wize/` artifacts (PRD, stories, knowledge) are tracked, so they travel with the branch.
106
+
107
+ ## Concurrency
108
+
109
+ Several worktrees, or several agents in one worktree, can render at once. Every write goes through write-if-changed plus an atomic temp-file rename, so a reader never sees a half-written skill and a second run reports every file as unchanged. The tracked-file guard means `hydrate` cannot overwrite something you committed. `sync` and `update --in-place` write atomically but unguarded: they are the explicit regenerate commands.
110
+
111
+ ## Environment variables
112
+
113
+ | Variable | Effect |
114
+ |---|---|
115
+ | `WIZE_PROJECT_ROOT` | Project root when you run a command outside it. `--root` wins over it. |
116
+ | `ORCA_WORKTREE_PATH`, `ORCA_ROOT_PATH` | Read by `hydrate` only: the worktree to render (used only when the current directory is not inside a project), and a source for `user.toml` (used only when it belongs to the same repository). |
117
+ | `WIZE_SKIP_BASELINE=1` | Skip the document-project baseline during `install`, and make `document-project quick` a no-op. |
118
+ | `WIZE_HYDRATE_DELEGATED` | Set by `hydrate` when it delegates to the pinned kit. Do not set it yourself. |
119
+ | `WIZE_DISABLE_UPDATE_CHECK=1` | No registry lookup; `update` action becomes `none`. |
120
+ | `WIZE_NO_BG_REFRESH=1` | Never start the background cache refresh. |
121
+ | `WIZE_VERBOSE=1` | Show the raw `npx` output of a failed delegated `hydrate` (normally one fallback line). |
122
+ | `CI` | Suppresses update hints and background refresh. |
123
+
124
+ ## Exit codes
125
+
126
+ Defaults stay 0 so existing scripts keep working. The strict forms are opt-in.
127
+
128
+ | Command | Codes |
129
+ |---|---|
130
+ | `hydrate` | 0 always. `--strict` returns 1 when it could not hydrate. |
131
+ | `version-check --exit-code` | 0 nothing to do, 10 `hydrate`, 11 `update`, 12 `use-pin`, 13 `install`. |
132
+ | `update --check` | 0 converged, 11 changes pending, 12 pin ahead of the binary. |
133
+ | `doctor --strict` | 1 when any error-level suggestion exists. |
134
+
135
+ `doctor --json` and `version-check --json` print one JSON object, with no banner.
136
+
137
+ ## Not in 0.27.0
138
+
139
+ - Shared `.wize` state across worktrees (symlink or state branch); sprint manifests, ID allocation for ADRs and stories, per-story document-project fragments, changelog fragments, a deterministic `index.md`, an epic NFR trigger, and `sprint-status.md` references outside `doctor`.
140
+ - Relative paths in `project-scan-report.json` (it still stores absolute paths).
141
+ - `wize-release` from a linked worktree, or release through a PR.
142
+ - A policy for `.wize/security/` (ignore or commit).
143
+ - Regenerating `AGENTS.md` beyond the bootstrap block; an `AGENTS.md` version marker.
144
+ - Pruning generated skills that a newer kit removed.
145
+ - `update` re-running itself as `@latest` from a stale pinned binary. The downgrade guard and `@latest` in the skills and the Action cover it.
146
+ - A team-level `[update] auto = false` knob. Only the environment variable exists.
147
+ - Writing `orca.yaml` or the Codex config. Both are print-only. No Windows variant of `hydrate.sh`.
148
+ - Renovate or Dependabot pinning, which would add a second source of truth for the pin.
149
+ - A hard refusal from `sync` on version skew, and a nonzero exit when an adapter fails.
150
+ - End-to-end checks in Orca (setup failure, trust prompt), Claude Code `SessionStart` timing against skill loading, and Cursor or Windsurf reading rules in worktrees.