docs
Documentation maintenance guide. Use when making code changes that affect APIs, features, patterns, or architecture to keep documentation in sync.
SKILL.md.claude/skills/docs/SKILL.md
GitHubDocumentation Maintenance
When making code changes, check whether related documentation needs updating.
tereo is one service (packages/tereo) plus libraries, so most docs are either
repo-wide or per area of that service — auth, files, webhooks, audit, registry, telemetry.
What to Update When
Backend Route Changes (add/modify/remove endpoints)
- OpenAPI path file for the area:
packages/tereo/openapi/paths/{auth,files,webhooks,audit}/{resource}.yaml - OpenAPI schemas:
packages/tereo/openapi/components/{area}/schemas.yaml - Reference the new path in the one root,
packages/tereo/openapi/openapi.yaml - Area doc:
packages/tereo/docs/{area}.md(if it lists endpoints or the behavior changes) - SDK: a request in
packages/tereo-sdk/src/requests/{area}/and a method on its client insrc/clients/, if app services should call it; thenpackages/tereo-sdk/docs/{area}.md
Then npm run openapi:build in packages/tereo (see the openapi skill).
Database Schema Changes (Prisma models)
- Area doc:
packages/tereo/docs/{area}.md(the Database / Database Schema / object-model sections, where present) - Root
CLAUDE.mdMigrations convention, if the change needs a new kind of raw SQL (partitioning, partial or opclass indexes, CHECK constraints)
Declarations (permissions, system roles, buckets, event types)
All of these live in packages/tereo/src/definitions/ and are registered on every start.
- Permission or system role: the endpoint's Required permissions in the OpenAPI spec, and the
Permissions section of
packages/tereo/docs/{area}.md - Event type: a webhook definition in the OpenAPI spec (
openapi/paths/{area}/+ the rootwebhooks:), andpackages/tereo/docs/webhooks.mdif delivery changes - Declaration rules (namespaces, access, retirement) and the provisioning documents (
provisioning.md):packages/tereo/docs/registry.md
Webhook / Audit Changes
- Webhooks:
packages/tereo/docs/webhooks.md(event emission flow, delivery, signing) - Audit:
packages/tereo/docs/audit.md(entry shape, idempotency, retention) - Outbox behavior: the
outboxskill (.claude/skills/outbox/SKILL.md) and the Outbox section ofpackages/tereo-sdk/README.md
Auth / Setup Changes
- Auth area doc:
packages/tereo/docs/auth.md - First boot, keys or setup token: root
README.md(Run it) and rootCLAUDE.md(Local development → Keys)
SDK Changes (@tereo-io/sdk)
-
packages/tereo-sdk/README.md— usage, provisioning types, outbox, the layout table - Per-area notes:
packages/tereo-sdk/docs/{auth,files,webhooks,audit}.md - Root
CLAUDE.mdWhere this is heading if the SDK's shape changes
Environment, Telemetry, Process Roles
- New or changed env var:
packages/tereo/src/env.tsis the schema; alsopackages/tereo/.env.exampleand the Environment Variables section of the area doc - Telemetry:
packages/tereo/docs/telemetry.md -
ROLE, entry points, background jobs: rootCLAUDE.mdlayout table; Background Jobs inpackages/tereo/docs/webhooks.mdfor delivery workers
Architecture / Roadmap Changes
- Root
CLAUDE.md— project overview, layout table, key conventions, what not to do - Root
README.md— packages table, Run it, Develop, Current state (what works / what's not done) - Local stack:
docker-compose.yml,docker/and the commands in rootREADME.md/CLAUDE.md
Code Style / Tooling Changes
-
docs/code-style.md(Prettier, import order, ESLint, comments)
Documentation Locations
| Type | Location | Purpose |
|---|---|---|
| Root CLAUDE.md | CLAUDE.md |
Claude Code guidance: layout, key conventions, local development, what not to do |
| Root README.md | README.md |
Overview, packages, run/develop, current state, roadmap links |
| Code style | docs/code-style.md |
Formatting, TypeScript, naming, errors, import order |
| Area docs | packages/tereo/docs/*.md |
auth, files, webhooks, audit, registry, telemetry |
| OpenAPI spec | packages/tereo/openapi/ |
API contract, one spec for every area (paths/{area}/) |
| SDK docs | packages/tereo-sdk/README.md, docs/*.md |
How app services use core |
| Skills | .claude/skills/*/SKILL.md |
Task guides for Claude Code (outbox, openapi, docs, …) |
There is no packages/tereo/CLAUDE.md or README.md — the root files cover the service.
Guidelines
- Only update docs that are actually affected by the change — don't update everything
- Keep CLAUDE.md files focused on implementation-level guidance (what Claude needs to know)
- Keep README.md files focused on human readers (setup, usage)
- Keep area docs focused on how that area behaves; cross-cutting decisions go in root
CLAUDE.md - The OpenAPI spec is the contract for endpoints — update it with the route, not afterwards
- When a doc section no longer matches the code, correct it to match the code rather than copying its pattern