Home / Docs / Developer docs / Contributing
Contributing
Changes here are small, ticketed and test-first, and they never weaken a safety rule. This page summarises AGENTS.md, which applies to people and to AI coding agents alike and is the authority if the two differ.
Developer docs. You want to read, run, deploy or change the code. Not what you came for? Find the right docs.
Before you start
- Read
AGENTS.mdand the specs index. The PRD wins on scope, copy and safety; the SRS wins on implementation. - Work from a GitHub issue. Its Scope, Requirements, Tests and Done-when sections are the brief, and the issues it depends on must be closed.
- Do not add a feature, endpoint, dependency or table the PRD or SRS does not list. If something is unclear, leave a
TODO(question)and ask.
Workflow
- Branch from the base branch as
t-xx-short-name. - Write or update the tests first, watch them fail, then implement.
- Keep the diff small: one ticket per branch and pull request.
- Run
npm testandnpm run typecheck. Let GitHub Actions run the browser suites and builds (Testing). - Open a pull request titled
T-xx: ...whose description saysCloses #<number>. - Append what changed and the test evidence to
LOG.md, and tick the ticket infor-agents/build-plan.md. - Name the requirement in commit messages, for example
FR-17: emit lines on the drift-free clock.
Rules that never bend
- No code sends text to Twitch chat except the fixed announcement behind
ANNOUNCE_ENABLED. - Every generated link ends in
.invalid; slurs are only the placeholdersslurxandslury. - Overlay sockets receive redacted payloads only.
- Tokens never leave the Worker and never appear in logs or responses.
- Never call Twitch's AutoMod settings update endpoint.
- No blocked term reaches Twitch without the streamer's approval, and every push can be undone.
- Secrets come only from
wrangler secret putandapp/.dev.vars. Never commit either. packages/corestays pure: no I/O, noDate.now(), noMath.random(). Use the seededRng.- TypeScript is strict with
noUncheckedIndexedAccess; noany; validate every boundary with zod. - Durable Object changes are atomic with
transactionSync(), use one alarm multiplexed through thescheduletable, and use the Hibernation API.
Design and copy changes
- Screen copy matches the PRD section 9.6 copy deck; strings live in
app/src/copy.ts. - Colours come from tokens. Run the gates in Design system before pushing.
site/is the static website andapp/is the Worker. Never add app routes or API calls tosite/.
Docs changes
- The Markdown specs in
docs/for-agents/are the source; the PDFs indocs/for-humans/are never edited by hand. - Keep pages factual: every statement should come from the code, a spec or a workflow file. Where something is not confirmed, say so.
- Check relative links before you push, and keep Mermaid diagrams valid.
Commits and attribution
Commits are authored by the human builders. Do not add co-author trailers or generated-by lines to commits, pull requests or documentation.