--- name: preview description: Show a website of this repository locally - pick the site from .project/specs/website.json, start its dev server with the controller, check the served page and open the controller's address in the host's browser tool. Use when the user wants to see a site, a page or a change locally. allowed-tools: - 'Bash(python3 -B "${CLAUDE_SKILL_DIR}/scripts/control.py" *)' - 'Bash(test -f "${CLAUDE_SKILL_DIR}/scripts/control.py")' --- # preview (Website plugin) Shows one site from `sites//` locally. Only the controller `scripts/control.py` starts, reuses or stops a dev server; this skill never installs dependencies. > **Script location (binding).** The script is `scripts/control.py` next to the **actually loaded** `SKILL.md`. Run it with the **website project** as working directory (or `--root`). Site configuration (`.project/`, `sites/`) always comes from that project; templates and the shared schema stay inside the plugin and are never written to. > > - **Claude:** the host replaces `${CLAUDE_SKILL_DIR}` with the folder of this `SKILL.md`; the commands below use it in double quotes. The `allowed-tools` pre-approvals above are Claude-specific and exactly the two call patterns of this text; they are a convenience, not a requirement. > - **Codex:** use the path of the loaded `SKILL.md` that the host gave you and form the absolute script path `/scripts/control.py`. Do **not** run `${CLAUDE_SKILL_DIR}` as a shell variable; do not rely on a Claude placeholder or on `allowed-tools`. > - **No path, no run:** if the path of the loaded `SKILL.md` is not available, stop and say so. Do not search caches or plugin folders, do not guess a replacement path, never copy scripts into the website project. > - **Form of the call:** `python3 -B` with the script path as **one** quoted argument (the path may contain spaces), no `PYTHONPATH`. Before the first call check that the script exists (`test -f "