From a7d8a58348f9f8245b256edbe93bb7ee5b8ede03 Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Thu, 5 Mar 2026 14:37:31 -0800 Subject: [PATCH] chore(docs): regenerate AI agent config files --- .aider.conf.yml | 4 -- .clinerules | 31 ++++++------ .cursorrules | 89 +++++++++------------------------ .github/copilot-instructions.md | 59 ++++++++++------------ .windsurfrules | 31 +++++------- 5 files changed, 77 insertions(+), 137 deletions(-) diff --git a/.aider.conf.yml b/.aider.conf.yml index e3a4906c..6eed2dae 100644 --- a/.aider.conf.yml +++ b/.aider.conf.yml @@ -1,19 +1,15 @@ # .aider.conf.yml — Aider Configuration for @bytelyst Common Platform # Helps Aider understand the project structure and conventions. -# Tell Aider to read these files for context read: - AGENTS.md - README.md -# Convention file conventions: AGENTS.md -# Lint commands lint-cmd: - 'pnpm build 2>&1 | tail -10' - 'pnpm test 2>&1 | tail -10' - 'pnpm typecheck 2>&1 | tail -10' -# Auto-commit settings auto-commits: false diff --git a/.clinerules b/.clinerules index ef76fe16..9c8edba2 100644 --- a/.clinerules +++ b/.clinerules @@ -1,23 +1,24 @@ # .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 +## Project: @bytelyst Common Platform — Shared packages + microservices for the ByteLyst ecosystem +Architecture: TypeScript, ESM, pnpm workspace, Fastify 5, Vitest, Azure Cosmos DB ## 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` +- Package manager: pnpm — NEVER use npm +- ESM everywhere: "type": "module", .js extensions in imports +- Fastify module pattern: types.ts → repository.ts → routes.ts +- Use req.log / app.log — never console.log +- Every Cosmos document MUST include a productId field +- peerDependencies for heavy deps; workspace:* for inter-package deps +- Services re-export @bytelyst/* in src/lib/ for clean internal imports +- Commits: `type(scope): description` +- After changes, verify: `pnpm build && pnpm test && pnpm typecheck` ## Key File Locations -- Packages: `packages/` (@bytelyst/errors, cosmos, config, auth, api-client, fastify-core, react-auth, logger, testing, blob, extraction, monitoring, design-tokens) -- Services: `services/` (platform-service :4003, extraction-service :4005) -- Base config: `tsconfig.base.json` +- packages/ — @bytelyst/* shared libraries (errors, cosmos, config, auth, api-client, fastify-core, react-auth, logger, testing, blob, extraction, monitoring, design-tokens) +- services/platform-service/ — consolidated platform service (port 4003) +- services/extraction-service/ — text extraction + Python sidecar (port 4005) +- dashboards/admin-web/ — admin console (port 3001) +- dashboards/tracker-web/ — issue tracker (port 3003) - Full guide: `AGENTS.md` diff --git a/.cursorrules b/.cursorrules index 0cedaf1c..08218d18 100644 --- a/.cursorrules +++ b/.cursorrules @@ -1,75 +1,32 @@ -# Cursor Rules — @bytelyst Common Platform +# @bytelyst Common Platform — Cursor Rules +# Read AGENTS.md for full context. -# For full agent instructions, read AGENTS.md at the repo root. +Project: @bytelyst Common Platform — Shared packages + microservices for the ByteLyst ecosystem +Product ID: (product-agnostic) +Stack: TypeScript, ESM, pnpm workspace, Fastify 5, Vitest, Azure Cosmos DB -## Project -- Repo: learning_ai_common_plat — shared packages + microservices -- Library scope: @bytelyst/* (packages/) -- Service scope: @lysnrai/* (services/) -- Consumers: LysnrAI (voice dictation), MindLyst (multimodal memory) -- Product-agnostic: every Cosmos document MUST include a productId field +## Architecture +- packages/ — @bytelyst/* shared libraries (errors, cosmos, config, auth, api-client, fastify-core, react-auth, logger, testing, blob, extraction, monitoring, design-tokens) +- services/platform-service/ — consolidated platform service (port 4003) +- services/extraction-service/ — text extraction + Python sidecar (port 4005) +- dashboards/admin-web/ — admin console (port 3001) +- dashboards/tracker-web/ — issue tracker (port 3003) + +## Rules - Package manager: pnpm — NEVER use npm - -## Monorepo Structure -- packages/errors/ → Typed HTTP errors (400–429) -- packages/cosmos/ → Azure Cosmos DB client singleton -- packages/config/ → Zod env loader + product identity + AKV resolver -- packages/auth/ → JWT, middleware, password hashing -- packages/api-client/ → Fetch wrapper with auth injection -- packages/fastify-core/ → createServiceApp() + startService() -- packages/react-auth/ → React auth context factory -- packages/logger/ → Structured logging (pino) -- packages/testing/ → Test mocks, Fastify inject helpers -- packages/blob/ → Azure Blob Storage client + SAS -- packages/extraction/ → createExtractionClient(), shared types -- packages/monitoring/ → Health-check utilities -- packages/design-tokens/ → Cross-platform tokens (JSON → CSS/TS/Kotlin/Swift) -- services/platform-service/ → Consolidated: auth, audit, flags, blob, subscriptions, stripe, usage, plans, licenses, invitations, referrals, promos, items, comments, votes, public (port 4003) -- services/extraction-service/ → Text extraction + Python sidecar (port 4005) -- services/monitoring/ → Loki + Grafana, health-check - -## TypeScript Rules -- ESM everywhere ("type": "module") -- Target: ES2022, moduleResolution: NodeNext -- All packages/services extend ../../tsconfig.base.json -- Fastify 5 with Zod validation for all inputs -- Module pattern: types.ts → repository.ts → routes.ts -- Auth: JWT via jose — platform-service issues, all others validate -- Database: Azure Cosmos DB via @azure/cosmos -- Tests: Vitest (passWithNoTests at root) -- NEVER use console.log — use req.log or app.log in Fastify -- NEVER use any type — use Zod inference or explicit types - -## Package Rules -- Export from src/index.ts → dist/index.js -- Use exports field in package.json (not just main) -- Heavy deps in peerDependencies, not dependencies -- Workspace deps: "@bytelyst/errors": "workspace:*" - -## Service Rules +- ESM everywhere: "type": "module", .js extensions in imports +- Fastify module pattern: types.ts → repository.ts → routes.ts +- Use req.log / app.log — never console.log +- Every Cosmos document MUST include a productId field +- peerDependencies for heavy deps; workspace:* for inter-package deps - Services re-export @bytelyst/* in src/lib/ for clean internal imports -- Services use self-contained Zod config schemas in src/lib/config.ts -- Health: GET /health → { status: "ok", service, requestId } -- Propagate x-request-id headers across all services - -## Conventions -- Commit messages: type(scope): description (feat, fix, docs, refactor, test, chore) -- Fix source code, not tests (unless the test itself is wrong) +- Commits: feat(scope): description / fix(scope): description - Never delete existing comments/documentation unless asked - Never add emojis unless asked -- Never hardcode secrets or API keys -- Never modify generated token files directly — edit bytelyst.tokens.json +- Never hardcode secrets, colors, or API URLs -## Key Commands -- pnpm build → build all packages + services -- pnpm test → run all tests (234+) -- pnpm typecheck → type-check everything -- pnpm --filter @lysnrai/platform-service dev → run one service -- pnpm --filter @bytelyst/design-tokens generate → regen tokens +## Build Verification +- pnpm build && pnpm test && pnpm typecheck ## Key Documents -- AGENTS.md — Full AI agent instructions -- README.md — Quick start + consuming packages -- docs/ECOSYSTEM_ARCHITECTURE.md — Full architecture -- docs/ROADMAP.md — Phased extraction plan -- .env.example — Required environment variables +- AGENTS.md — Full AI agent instructions (read this first) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 3cff7532..6a8bb474 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -4,44 +4,37 @@ ## Project Context -Shared `@bytelyst/*` packages and `@lysnrai/*` microservices for the ByteLyst ecosystem. Product-agnostic — consumed by LysnrAI and MindLyst. +**@bytelyst Common Platform** — Shared packages + microservices for the ByteLyst ecosystem. +Stack: TypeScript, ESM, pnpm workspace, Fastify 5, Vitest, Azure Cosmos DB ## Code Generation Rules ### Always - -- Import `PRODUCT_ID` from `@bytelyst/config` (`loadProductIdentity()`) — never hardcode `"lysnrai"` -- Include `productId` field in every Cosmos DB document -- Validate inputs with Zod schemas -- Use `req.log` / `app.log` for Fastify logging -- Use ESM imports (`import ... from "./file.js"` with `.js` extension) -- Follow the module pattern: `types.ts` → `repository.ts` → `routes.ts` -- Propagate `x-request-id` headers in service-to-service calls -- Use `peerDependencies` for heavy deps in packages -- Use `workspace:*` for inter-package dependencies +- Package manager: pnpm — NEVER use npm +- ESM everywhere: "type": "module", .js extensions in imports +- Fastify module pattern: types.ts → repository.ts → routes.ts +- Use req.log / app.log — never console.log +- Every Cosmos document MUST include a productId field +- peerDependencies for heavy deps; workspace:* for inter-package deps +- Services re-export @bytelyst/* in src/lib/ for clean internal imports +- Include `productId: "(product-agnostic)"` in every Cosmos DB document +- Use `type(scope): description` commit message format +- Fix source code, not tests (unless the test itself is wrong) ### Never +- `console.log` or `print()` in production code +- Hardcoded secrets, API keys, colors, or URLs +- Delete existing comments or documentation unless explicitly asked +- Add emojis unless asked -- `console.log` in production code -- `any` type in TypeScript -- `Math.random()` for IDs in loops without an index suffix -- Hardcoded secrets or API keys -- `npm` commands (use `pnpm`) -- Edit generated token files directly (edit `bytelyst.tokens.json` instead) +## Key Paths +- packages/ — @bytelyst/* shared libraries (errors, cosmos, config, auth, api-client, fastify-core, react-auth, logger, testing, blob, extraction, monitoring, design-tokens) +- services/platform-service/ — consolidated platform service (port 4003) +- services/extraction-service/ — text extraction + Python sidecar (port 4005) +- dashboards/admin-web/ — admin console (port 3001) +- dashboards/tracker-web/ — issue tracker (port 3003) -### Suggestions Context - -When suggesting code in these directories, follow these patterns: - -| Directory | Framework | Key Pattern | -| ------------------------- | ------------------ | --------------------------------------------------------- | -| `packages/*/src/` | TypeScript library | Export from `index.ts`, `peerDependencies` for heavy deps | -| `services/*/src/modules/` | Fastify 5 + Zod | `types.ts` → `repository.ts` → `routes.ts` | -| `services/*/src/lib/` | Re-exports | Re-export from `@bytelyst/*` packages | -| `packages/design-tokens/` | Token generator | Edit `bytelyst.tokens.json`, run `generate.ts` | - -### Commit Messages - -Format: `type(scope): description` - -Types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore` +## Build Verification +```bash +pnpm build && pnpm test && pnpm typecheck +``` diff --git a/.windsurfrules b/.windsurfrules index 75bc7d55..f06beb9d 100644 --- a/.windsurfrules +++ b/.windsurfrules @@ -1,32 +1,25 @@ -# Common Platform — Windsurf / Codeium Rules +# @bytelyst Common Platform — Windsurf / Codeium Rules # Read AGENTS.md for full context. These are the critical rules. -Project: @bytelyst/* shared packages + @lysnrai/* microservices +Project: @bytelyst Common Platform — Shared packages + microservices for the ByteLyst ecosystem Stack: TypeScript, ESM, pnpm workspace, Fastify 5, Vitest, Azure Cosmos DB ## Architecture Rules -- @bytelyst/* = shared packages (packages/), @lysnrai/* = product services (services/) -- Product-agnostic: every Cosmos document MUST include productId field -- Services re-export @bytelyst/* in src/lib/ files for clean internal imports -- Services use self-contained Zod config schemas (not from shared packages) -- Package manager: pnpm — NEVER use npm - -## Key Paths -- Packages: packages/ (@bytelyst/errors, cosmos, config, auth, api-client, fastify-core, react-auth, logger, testing, blob, extraction, monitoring, design-tokens) -- Services: services/ (platform-service 4003, extraction-service 4005) -- Base TS config: tsconfig.base.json (ES2022, NodeNext, strict) -- Workspace: pnpm-workspace.yaml +- packages/ — @bytelyst/* shared libraries (errors, cosmos, config, auth, api-client, fastify-core, react-auth, logger, testing, blob, extraction, monitoring, design-tokens) +- services/platform-service/ — consolidated platform service (port 4003) +- services/extraction-service/ — text extraction + Python sidecar (port 4005) +- dashboards/admin-web/ — admin console (port 3001) +- dashboards/tracker-web/ — issue tracker (port 3003) ## Conventions -- ESM everywhere ("type": "module", .js extensions in imports) +- Package manager: pnpm — NEVER use npm +- ESM everywhere: "type": "module", .js extensions in imports - Fastify module pattern: types.ts → repository.ts → routes.ts -- Heavy deps in peerDependencies, workspace deps as "workspace:*" - Use req.log / app.log — never console.log +- Every Cosmos document MUST include a productId field +- peerDependencies for heavy deps; workspace:* for inter-package deps +- Services re-export @bytelyst/* in src/lib/ for clean internal imports - Commits: feat(scope): description / fix(scope): description -## Consumers -- Dashboards in ../learning_voice_ai_agent/ consume packages via file: refs -- Prerequisite: pnpm build before consumer npm install - ## Build Verification - pnpm build && pnpm test && pnpm typecheck