chore(docs): regenerate AI agent config files
This commit is contained in:
parent
664bc93b86
commit
a7d8a58348
@ -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
|
||||
|
||||
31
.clinerules
31
.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`
|
||||
|
||||
89
.cursorrules
89
.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)
|
||||
|
||||
59
.github/copilot-instructions.md
vendored
59
.github/copilot-instructions.md
vendored
@ -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
|
||||
```
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user