Contributing
Development Setup
Section titled “Development Setup”git clone https://github.com/danielbodnar/auto-sre-agents.gitcd auto-sre-agentsbun installbunx wrangler@latest typesBranch Naming
Section titled “Branch Naming”Use conventional branch names:
feat/description— new featuresfix/description— bug fixeschore/description— tooling, config, refactoringdocs/description— documentation changes
Commit Messages
Section titled “Commit Messages”Follow Conventional Commits:
feat: add circuit breaker to FixAgentfix: handle empty stack traces in fingerprintingdocs: update API reference for retry endpointchore: upgrade wrangler to 4.70test: add integration tests for CodeTriageTesting
Section titled “Testing”Run the full test suite before submitting changes:
bun testTests are organized by layer:
| Directory | What |
|---|---|
tests/types/ | Schema validation |
tests/lib/ | Library unit tests |
tests/agents/ | Agent unit tests |
tests/integration/ | Cross-agent integration tests |
Linting
Section titled “Linting”bunx oxlint --fix .Project Conventions
Section titled “Project Conventions”- TypeScript 5.9+ strict mode — no
any, no implicit returns - Zod for all validation — every external input is validated
- ESM only —
import/export, neverrequire() - Functional style — prefer functions and composition over classes
- Arrow functions — always use arrow function syntax
- ULID for IDs — lexicographically sortable, globally unique
Architecture Rules
Section titled “Architecture Rules”- Never execute untrusted code in the Worker process — always use Sandbox
- Never embed secrets in source — use
wrangler secret put - Agent-local SQLite for hot state, D1 for system of record
- Zod validation at queue boundaries — both producer and consumer
- All LLM text is sanitized —
sanitizeForLlm()strips secrets before sending
Adding a New Agent
Section titled “Adding a New Agent”- Create
src/agents/my-agent.tsextendingSentinelAgent - Add HTTP endpoints via
onRequest() - Add the Durable Object binding to
wrangler.jsonc - Add to
new_sqlite_classesin the migration tag - Export the class from
src/index.ts - Add queue consumer handler in
src/queues/consumers.tsif needed - Add tests in
tests/agents/ - Document in
docs/src/content/docs/agents/