learning_ai_common_plat/.github/copilot-instructions.md
saravanakumardb1 d39c447c52 docs: add .cursorrules and .github/copilot-instructions.md
Completes the AI agent config set for the common platform repo:
- .cursorrules — Cursor inline completions + chat rules
- .github/copilot-instructions.md — GitHub Copilot code generation patterns

Both reference AGENTS.md for full instructions and are tailored
to the @bytelyst/* packages + @lysnrai/* services structure.
2026-02-12 12:55:32 -08:00

46 lines
1.8 KiB
Markdown

# GitHub Copilot Instructions — @bytelyst Common Platform
> For full agent instructions, read [`AGENTS.md`](../../AGENTS.md) at the repo root.
## Project Context
Shared `@bytelyst/*` packages and `@lysnrai/*` microservices for the ByteLyst ecosystem. Product-agnostic — consumed by LysnrAI and MindLyst.
## 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
### Never
- `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)
### 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`