chore(docs): regenerate AI agent config files

This commit is contained in:
saravanakumardb1 2026-03-05 14:37:31 -08:00
parent 664bc93b86
commit a7d8a58348
5 changed files with 77 additions and 137 deletions

View File

@ -1,19 +1,15 @@
# .aider.conf.yml — Aider Configuration for @bytelyst Common Platform # .aider.conf.yml — Aider Configuration for @bytelyst Common Platform
# Helps Aider understand the project structure and conventions. # Helps Aider understand the project structure and conventions.
# Tell Aider to read these files for context
read: read:
- AGENTS.md - AGENTS.md
- README.md - README.md
# Convention file
conventions: AGENTS.md conventions: AGENTS.md
# Lint commands
lint-cmd: lint-cmd:
- 'pnpm build 2>&1 | tail -10' - 'pnpm build 2>&1 | tail -10'
- 'pnpm test 2>&1 | tail -10' - 'pnpm test 2>&1 | tail -10'
- 'pnpm typecheck 2>&1 | tail -10' - 'pnpm typecheck 2>&1 | tail -10'
# Auto-commit settings
auto-commits: false auto-commits: false

View File

@ -1,23 +1,24 @@
# .clinerules — Cline / Roo Code Rules for @bytelyst Common Platform # .clinerules — Cline / Roo Code Rules for @bytelyst Common Platform
# Read AGENTS.md for the complete onboarding guide. # Read AGENTS.md for the complete onboarding guide.
## Project: Shared packages + microservices for ByteLyst ecosystem ## Project: @bytelyst Common Platform — Shared packages + microservices for the ByteLyst ecosystem
Architecture: pnpm monorepo with @bytelyst/* packages + @lysnrai/* Fastify services Architecture: TypeScript, ESM, pnpm workspace, Fastify 5, Vitest, Azure Cosmos DB
## Mandatory Rules ## Mandatory Rules
1. Every Cosmos document MUST include a `productId` field - Package manager: pnpm — NEVER use npm
2. Every endpoint MUST validate input with Zod schemas - ESM everywhere: "type": "module", .js extensions in imports
3. Every service MUST propagate `x-request-id` headers - Fastify module pattern: types.ts → repository.ts → routes.ts
4. Use `PRODUCT_ID` from `@bytelyst/config` — never hardcode `"lysnrai"` - Use req.log / app.log — never console.log
5. Services re-export `@bytelyst/*` in `src/lib/` files - Every Cosmos document MUST include a productId field
6. Use `req.log` / `app.log` — never `console.log` - peerDependencies for heavy deps; workspace:* for inter-package deps
7. ESM only: `"type": "module"`, `.js` extensions in imports - Services re-export @bytelyst/* in src/lib/ for clean internal imports
8. Package manager: `pnpm` — never `npm` - Commits: `type(scope): description`
9. Commits: `type(scope): description` - After changes, verify: `pnpm build && pnpm test && pnpm typecheck`
10. After changes, verify: `pnpm build && pnpm test`
## Key File Locations ## Key File Locations
- Packages: `packages/` (@bytelyst/errors, cosmos, config, auth, api-client, fastify-core, react-auth, logger, testing, blob, extraction, monitoring, design-tokens) - packages/ — @bytelyst/* shared libraries (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) - services/platform-service/ — consolidated platform service (port 4003)
- Base config: `tsconfig.base.json` - 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` - Full guide: `AGENTS.md`

View File

@ -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 ## Architecture
- Repo: learning_ai_common_plat — shared packages + microservices - packages/ — @bytelyst/* shared libraries (errors, cosmos, config, auth, api-client, fastify-core, react-auth, logger, testing, blob, extraction, monitoring, design-tokens)
- Library scope: @bytelyst/* (packages/) - services/platform-service/ — consolidated platform service (port 4003)
- Service scope: @lysnrai/* (services/) - services/extraction-service/ — text extraction + Python sidecar (port 4005)
- Consumers: LysnrAI (voice dictation), MindLyst (multimodal memory) - dashboards/admin-web/ — admin console (port 3001)
- Product-agnostic: every Cosmos document MUST include a productId field - dashboards/tracker-web/ — issue tracker (port 3003)
## Rules
- Package manager: pnpm — NEVER use npm - Package manager: pnpm — NEVER use npm
- ESM everywhere: "type": "module", .js extensions in imports
## Monorepo Structure - Fastify module pattern: types.ts → repository.ts → routes.ts
- packages/errors/ → Typed HTTP errors (400429) - Use req.log / app.log — never console.log
- packages/cosmos/ → Azure Cosmos DB client singleton - Every Cosmos document MUST include a productId field
- packages/config/ → Zod env loader + product identity + AKV resolver - peerDependencies for heavy deps; workspace:* for inter-package deps
- 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
- Services re-export @bytelyst/* in src/lib/ for clean internal imports - Services re-export @bytelyst/* in src/lib/ for clean internal imports
- Services use self-contained Zod config schemas in src/lib/config.ts - Commits: feat(scope): description / fix(scope): description
- 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)
- Never delete existing comments/documentation unless asked - Never delete existing comments/documentation unless asked
- Never add emojis unless asked - Never add emojis unless asked
- Never hardcode secrets or API keys - Never hardcode secrets, colors, or API URLs
- Never modify generated token files directly — edit bytelyst.tokens.json
## Key Commands ## Build Verification
- pnpm build → build all packages + services - pnpm build && pnpm test && pnpm typecheck
- 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
## Key Documents ## Key Documents
- AGENTS.md — Full AI agent instructions - AGENTS.md — Full AI agent instructions (read this first)
- README.md — Quick start + consuming packages
- docs/ECOSYSTEM_ARCHITECTURE.md — Full architecture
- docs/ROADMAP.md — Phased extraction plan
- .env.example — Required environment variables

View File

@ -4,44 +4,37 @@
## Project Context ## 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 ## Code Generation Rules
### Always ### Always
- Package manager: pnpm — NEVER use npm
- Import `PRODUCT_ID` from `@bytelyst/config` (`loadProductIdentity()`) — never hardcode `"lysnrai"` - ESM everywhere: "type": "module", .js extensions in imports
- Include `productId` field in every Cosmos DB document - Fastify module pattern: types.ts → repository.ts → routes.ts
- Validate inputs with Zod schemas - Use req.log / app.log — never console.log
- Use `req.log` / `app.log` for Fastify logging - Every Cosmos document MUST include a productId field
- Use ESM imports (`import ... from "./file.js"` with `.js` extension) - peerDependencies for heavy deps; workspace:* for inter-package deps
- Follow the module pattern: `types.ts``repository.ts``routes.ts` - Services re-export @bytelyst/* in src/lib/ for clean internal imports
- Propagate `x-request-id` headers in service-to-service calls - Include `productId: "(product-agnostic)"` in every Cosmos DB document
- Use `peerDependencies` for heavy deps in packages - Use `type(scope): description` commit message format
- Use `workspace:*` for inter-package dependencies - Fix source code, not tests (unless the test itself is wrong)
### Never ### 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 ## Key Paths
- `any` type in TypeScript - packages/ — @bytelyst/* shared libraries (errors, cosmos, config, auth, api-client, fastify-core, react-auth, logger, testing, blob, extraction, monitoring, design-tokens)
- `Math.random()` for IDs in loops without an index suffix - services/platform-service/ — consolidated platform service (port 4003)
- Hardcoded secrets or API keys - services/extraction-service/ — text extraction + Python sidecar (port 4005)
- `npm` commands (use `pnpm`) - dashboards/admin-web/ — admin console (port 3001)
- Edit generated token files directly (edit `bytelyst.tokens.json` instead) - dashboards/tracker-web/ — issue tracker (port 3003)
### Suggestions Context ## Build Verification
```bash
When suggesting code in these directories, follow these patterns: pnpm build && pnpm test && pnpm typecheck
```
| 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`

View File

@ -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. # 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 Stack: TypeScript, ESM, pnpm workspace, Fastify 5, Vitest, Azure Cosmos DB
## Architecture Rules ## Architecture Rules
- @bytelyst/* = shared packages (packages/), @lysnrai/* = product services (services/) - packages/ — @bytelyst/* shared libraries (errors, cosmos, config, auth, api-client, fastify-core, react-auth, logger, testing, blob, extraction, monitoring, design-tokens)
- Product-agnostic: every Cosmos document MUST include productId field - services/platform-service/ — consolidated platform service (port 4003)
- Services re-export @bytelyst/* in src/lib/ files for clean internal imports - services/extraction-service/ — text extraction + Python sidecar (port 4005)
- Services use self-contained Zod config schemas (not from shared packages) - dashboards/admin-web/ — admin console (port 3001)
- Package manager: pnpm — NEVER use npm - dashboards/tracker-web/ — issue tracker (port 3003)
## 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
## Conventions ## 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 - 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 - 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 - 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 ## Build Verification
- pnpm build && pnpm test && pnpm typecheck - pnpm build && pnpm test && pnpm typecheck