Spook is a custom integration for Home Assistant: repairs, actions, triggers, conditions and helpers on top of what Home Assistant ships.
The integration lives in custom_components/spook/, its tests in tests/.
The website (https://spook.boo) lives in documentation/: Nuxt, Nuxt UI and Nuxt Content.
Spook's frontends live in frontend/: the dashboard bundle (Lit) and the panel (Vue and Nuxt UI). See frontend/README.md.
The integration uses uv. From the repository root:
uv sync: install everything.uv run pytest: run the tests.uv run ruff check .anduv run ruff format .: lint and format.uv run prek run pylint --all-files: pylint.uv run prek run --all-files: every hook in.pre-commit-config.yaml.uv run zizmor .github/workflows/: check the workflows.uv run python script/generate_skill.py: rebuild the agent skill references after adding or changing an action, trigger, condition or repair. A test fails when they are stale.python3 design/icons/icons.py: rebuild thespook:icons after changing them. A test fails when they are stale, or a drawing breaks a rule.icons.py have <name>...says whether a name is taken,icons.py sheet <batch>writes the contact sheet of what a branch drew. Seedesign/icons/README.md.gh actions-lock --no-narrow: lock the actions the workflows use, after changing auses:line. Commit.github/workflows/actions.lockwith the change. Install it withgh extension install github/gh-actions-lock.
The website, from documentation/:
npm ci: install.npm run dev: local site onhttp://localhost:3000.npm run build: the build CI runs.
The frontends, from frontend/:
npm ci: install.npm run lint,npm run typecheck,npm run test: what CI runs, withnpm run buildandnpm run size.npm run build: build both intocustom_components/spook/static/, which git ignores.npm run home-assistant: a Home Assistant in Docker with Spook from this checkout, onhttp://127.0.0.1:18125.
- English is the source. People edit
documentation/content/anddocumentation/locales/en.json, nothing else of the website's text. - Headings on documentation pages are a contract: their anchors are linked from the integration and from other sites. Do not rename an existing heading.
custom_components/spook/translations/en.jsonis the only translation file of the integration edited by hand. Weblate owns the other languages.- Write "Home Assistant" in full.
- A new icon for the
spook:set followsdesign/icons/README.md: in the folder of its family, which is its group in the icon browser on the website, and on a contact sheet of its batch. On a conflict in a generated file of the set, take either side and runpython3 design/icons/icons.pyagain. - A new npm dependency in
frontend/is asked for first. The naming rules infrontend/README.mdare forever once shipped. - Do not edit
.github/workflows/actions.lockby hand. Always rungh actions-lockwith--no-narrow: without it, the branch pins like@<sha> # mainbecome plain branches again. On a merge conflict, take the lockfile frommainand run it again.
The website is machine-translated. Three directories, three rules:
documentation/translations/output/: generated. Never edit a file in it, not even to fix a typo. The next pipeline run overwrites it.documentation/translations/corpus/: hand-edited. The style guides, glossaries and corrections the translator works from. A translation improvement goes here. The exception: files namedglossary.generated.ymlare generated too, leave them alone.documentation/translations/pipeline/: the scripts that turn English plus corpus into output.
A translation is wrong? Fix the English source or the corpus, and let the pipeline regenerate the output.
CI enforces this. A pull request that touches documentation/translations/output/ without a change in documentation/content/, documentation/locales/, documentation/translations/corpus/ or documentation/translations/pipeline/ fails. Run the same check locally:
documentation/translations/pipeline/check-output-untouched.sh origin/mainPeople who spot a translation problem report it with the form: https://github.com/frenck/spook/issues/new?template=translation.yml