2.0 KiB
2.0 KiB
GitHub Copilot Instructions — @bytelyst Common Platform
For full agent instructions, read
AGENTS.mdat 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_IDfrom@bytelyst/config(loadProductIdentity()) — never hardcode"lysnrai" - Include
productIdfield in every Cosmos DB document - Validate inputs with Zod schemas
- Use
req.log/app.logfor Fastify logging - Use ESM imports (
import ... from "./file.js"with.jsextension) - Follow the module pattern:
types.ts→repository.ts→routes.ts - Propagate
x-request-idheaders in service-to-service calls - Use
peerDependenciesfor heavy deps in packages - Use
workspace:*for inter-package dependencies
Never
console.login production codeanytype in TypeScriptMath.random()for IDs in loops without an index suffix- Hardcoded secrets or API keys
npmcommands (usepnpm)- Edit generated token files directly (edit
bytelyst.tokens.jsoninstead)
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