# GitHub Copilot Instructions — @bytelyst Common Platform

> For full agent instructions, read [`AGENTS.md`](../AGENTS.md) at the repo root.

## Project Context

**@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
- 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

## 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)

## Build Verification
```bash
pnpm build && pnpm test && pnpm typecheck
```
