# .clinerules — Cline / Roo Code Rules for @bytelyst Common Platform # Read AGENTS.md for the complete onboarding guide. ## Project: Shared packages + microservices for ByteLyst ecosystem Architecture: pnpm monorepo with @bytelyst/* packages + @lysnrai/* Fastify services ## Mandatory Rules 1. Every Cosmos document MUST include a `productId` field 2. Every endpoint MUST validate input with Zod schemas 3. Every service MUST propagate `x-request-id` headers 4. Use `PRODUCT_ID` from `@bytelyst/config` — never hardcode `"lysnrai"` 5. Services re-export `@bytelyst/*` in `src/lib/` files 6. Use `req.log` / `app.log` — never `console.log` 7. ESM only: `"type": "module"`, `.js` extensions in imports 8. Package manager: `pnpm` — never `npm` 9. Commits: `type(scope): description` 10. After changes, verify: `pnpm build && pnpm test` ## Key File Locations - Packages: `packages/` (@bytelyst/errors, cosmos, config, auth, api-client, react-auth, design-tokens) - Services: `services/` (platform-service, billing-service, growth-service, tracker-service) - Base config: `tsconfig.base.json` - Full guide: `AGENTS.md`