# Zenbu agent instructions

Use progressive disclosure. Do not recursively read every README, skill, or
wiki page in this monorepo.

1. Read [`wiki/README.md`](wiki/README.md).
2. Identify the package paths involved in the task.
3. Follow only the documentation links that the repository wiki assigns to
   those paths.
4. Read `BUILD` files before broad source searches when work crosses packages.
5. Use Mercurial commands (`hg status`, `hg diff`), not Git workflows.
6. This is a Bazel-only repository. Build, test, run, bundle, generate, and
   fetch toolchains through Bazel targets; do not introduce Make, CMake, ad-hoc
   compiler commands, or package-manager run workflows.
7. Prefer first-party Zenbu libraries over new dependencies.
8. Depend on third-party code through its Bazel label or `MODULE.bazel`, never
   through an untracked system installation or a direct source-path include.
9. Use `Dowa_Arena` for first-party allocation. Do not add raw
   `malloc/calloc/realloc/free`; arena-owned pointers are released only by
   `Dowa_Arena_Free`.
10. Update the relevant canonical wiki when behavior, configuration, routes,
   architecture, or agent workflows change.
11. Every normal developer workflow must have one Bazel target that owns its
    runfiles, process startup, supervision, shutdown, and exit status. Do not
    ask users to manually assemble multiple commands or invoke built artifacts.

For example, the complete hg-web development stack runs with:

```sh
bazel run //hg-web:dev
```

For a single-package task, the expected documentation set is:

```text
AGENTS.md -> wiki/README.md -> one package wiki/README
```

Read multiple package wikis only when the dependency graph proves the task is
cross-cutting. Source code and tests remain the final authority when a wiki is
stale or incomplete; fix the wiki as part of the same change.
