Evoku Copilot Assistant
AI programming assistant for developing Evoku (Evolved Sudoku), an online multiplayer real-time Sudoku game with evolutionary powerups themed around Yin/Yang balance and the Five Elements.
Project Context
Evoku is a unique twist on classic Sudoku featuring:
Real-time 1v1 multiplayer matches with ELO-based matchmakingEastern mystical aesthetic (Yin/Yang and Five Elements theme)Evolutionary powerup system with offensive (Yang) and defensive (Yin) abilitiesThree-phase game loop with elemental amplification mechanicsPowerup progression earned by completing rows, columns, boxes, and Golden ObjectivesInstructions
When assisting with Evoku development, follow these guidelines:
1. Project Understanding
Familiarize yourself with the monorepo structure: `src/client` (Angular), `src/server` (Node.js/Express), `src/shared` (common code)Review relevant documentation in `/docs` directory before making changesUnderstand the core gameplay loop: matchmaking → puzzle generation → three-phase gameplay → powerup progression → victory conditionsRespect the Eastern theme and Yin/Yang/Five Elements concepts in all design decisions2. Coding Standards
**Type Safety**: Never use `any` type; avoid `as unknown as` except for mocked component casting**DRY Principle**: No repeated logic, code, templates, constants, or CSS styles**Style Consistency**: Reference existing code and `eslint.config.js`; enforce 100-char line limit**Access Modifiers**: Use `private` and `protected` appropriately**Pure Functions**: Prefer pure functions or static methods; stateful methods can be impure**No Single-Line Conditionals**: Always expand if/switch statements with braces (except arrow functions)**Types Organization**: Store types in separate `/types` directories (not with implementation)3. Framework-Specific Rules
**Angular (Client)**:
Store templates and styles in separate `.html` and `.scss` files (use `templateUrl` and `styleUrl`)Use updated Angular directives over deprecated syntaxMulti-line CSS rules only (no single-line rules in `.scss` files)Avoid inline CSS except for temporary test/demo files**Node.js (Server)**:
Use Express for REST API and `ws` library for WebSocket connectionsAccess secrets via `process.env` from `.env` fileFollow custom binary protocol in `/shared/networking/` for packets4. Testing Requirements (90-95% Coverage Goal)
**Unit Tests** (`.spec.ts`):
Store next to the file being testedUse Jasmine/Karma for client, Jest for server/sharedDon't re-test inherited/composed functionalityMute console output when testing error scenariosUse string indexing for private/protected access: `obj['privateProp']`**Integration Tests** (`.integration.spec.ts`):
Store in `/src/[client|server|shared]/tests`Cover composite systems with multiple components**Test Execution**:
`npm run test` - All tests`npm run test-ci` - With coverage reports`npm run test:client` / `npm run test:server` - Specific environments5. Quality Checks (Run After Major Changes)
1. **Type Checking**: `npm run comp`
2. **Linting**: `npm run lint` (auto-fix with `npx eslint . --fix`)
3. **Testing**: Run appropriate test command above
4. **Pre-commit Hook**: Husky runs all checks before commit (must pass)
6. GitHub Issues Workflow
Create feature branches (master is protected)When creating PRs: - Assign labels and milestone from base issue
- Move issue to "In Progress" or "In Review" on project board
- Mark PR as ready for review when done
- Use closing keywords with line breaks: `Closes:\n - #59`
Complete assigned tasks without unrelated changesConsult developer for suggestions outside task scope7. Documentation Style
**JSDoc**:
Use for complex functions/classes/methodsSingle-line: `/** ... */` for simple explanationsUse `@param`, `@returns`, `@throws` only for long/complex functions**Markdown** (`/docs`):
Split lines at commas, periods, or logical breaksUse headers instead of bold formatting for bullet pointsProvide relevant examples from existing use casesInclude relative links to related documentationAvoid overly detailed implementation notes8. Architecture Patterns
**Interaction Flow**: Client input → pending state → server validation → reject or broadcast update**Composition over Inheritance**: Use for unrelated functionalities**Singletons**: Export instantiated object as default, also export class**Hashable Objects**: Prefer `Map`/`Set` over arrays for performance9. Important Constraints
No backwards compatibility required during refactorsFocus on realistic test scenarios, not physically impossible edge casesNotify developer if Copilot Instructions become outdatedDeveloper has final say on all project decisions10. When to Ask Questions
Task instructions conflict with these guidelinesBetter approach exists but is unrelated to current taskOutdated information found in instructions or documentationClarification needed on Eastern theme implementationUncertainty about which documentation to referenceExample Tasks
Implement new powerup with Yin/Yang classification and elemental typingAdd server validation for Golden Objective completionCreate integration test for three-phase progression systemRefactor WebSocket packet handling for new game eventUpdate UI components to match Figma design specificationsAdd unit tests for ELO matchmaking algorithm