Barazo lexicon schemas and TypeScript types barazo.forum
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: replace CLAUDE.md with AGENTS.md

AGENTS.md is the cross-vendor standard for AI coding agent instructions.
Auto-generated from barazo-workspace/agents-md/ source files.

+70 -1
-1
.gitignore
··· 1 1 # Claude Code 2 - CLAUDE.md 3 2 .claude/ 4 3 5 4 # Logs
+70
AGENTS.md
··· 1 + # Barazo Lexicons -- Schema Definitions 2 + 3 + <!-- Auto-generated from barazo-workspace. To propose changes, edit the source: 4 + https://github.com/barazo-forum/barazo-workspace/tree/main/agents-md --> 5 + 6 + MIT | Part of [github.com/barazo-forum](https://github.com/barazo-forum) 7 + 8 + Lexicon schemas for the Barazo forum platform. Defines all `forum.barazo.*` record types and generates TypeScript types consumed by barazo-api and barazo-web. 9 + 10 + ## Namespace 11 + 12 + `forum.barazo.*` 13 + 14 + ## What This Repo Does 15 + 16 + - Defines AT Protocol lexicon schemas (JSON files) for all forum record types 17 + - Generates TypeScript types from lexicon schemas 18 + - Published as an npm package consumed by barazo-api and barazo-web 19 + - Schemas are the contract between users' PDSs, the AppView, and any frontend 20 + 21 + ## Core Record Types (MVP) 22 + 23 + - `forum.barazo.topic.post` -- main thread posts 24 + - `forum.barazo.topic.reply` -- replies to threads 25 + - `forum.barazo.interaction.reaction` -- reactions (configurable per forum) 26 + 27 + Categories are AppView-only (admin-managed, stored in PostgreSQL), not PDS records. 28 + 29 + ## Lexicon-Specific Standards 30 + 31 + - Schema-first -- lexicon JSON files are the source of truth; TypeScript types are generated, never hand-written 32 + - Backwards compatibility -- once published, fields can be added but never removed or changed 33 + - Follow AT Protocol lexicon conventions (see [AT Protocol Lexicon spec](https://atproto.com/specs/lexicon)) 34 + - Strict TypeScript -- `strict: true`, no `any`, no `@ts-ignore` 35 + 36 + --- 37 + 38 + ## Project-Wide Standards 39 + 40 + ### About Barazo 41 + 42 + Federated forum built on the [AT Protocol](https://atproto.com/). Portable identity, user-owned data, cross-community reputation. 43 + 44 + - **Organization:** [github.com/barazo-forum](https://github.com/barazo-forum) 45 + - **License:** AGPL-3.0 (backend) / MIT (frontend, lexicons, deploy, website) 46 + - **Contributing:** See [CONTRIBUTING.md](https://github.com/barazo-forum/.github/blob/main/CONTRIBUTING.md) 47 + 48 + ### Coding Standards 49 + 50 + 1. **Test-Driven Development** -- write tests before implementation (Vitest). 51 + 2. **Strict TypeScript** -- `strict: true`, no `any`, no `@ts-ignore`. 52 + 3. **Conventional commits** -- `type(scope): description`. 53 + 4. **CI must pass** -- lint, typecheck, tests, security scan on every PR. 54 + 5. **Input validation** -- Zod schemas on all API inputs and firehose records. 55 + 6. **Output sanitization** -- DOMPurify on all user-generated content. 56 + 7. **No raw SQL** -- Drizzle ORM with parameterized queries only. 57 + 8. **Structured logging** -- Pino logger, never `console.log`. 58 + 9. **Accessibility** -- WCAG 2.2 AA, semantic HTML, keyboard navigable. 59 + 60 + ### Git Workflow 61 + 62 + All changes go through Pull Requests -- never commit directly to `main`. Branch naming: `type/short-description` (e.g., `feat/add-reactions`, `fix/xss-sanitization`). 63 + 64 + ### AT Protocol Context 65 + 66 + - Users own their data (stored on their Personal Data Server) 67 + - The AppView (barazo-api) indexes data from the AT Protocol firehose 68 + - Lexicons (`forum.barazo.*`) define the data schema contract 69 + - Identity is portable via DIDs -- no vendor lock-in 70 + - All record types are validated against lexicon schemas