|
| 1 | +# GitHub Copilot Instructions |
| 2 | + |
| 3 | +This repository uses TypeScript with strict standards. Follow the guidelines below when modifying code. |
| 4 | + |
| 5 | +## Project Commands |
| 6 | + |
| 7 | +Use these commands when building, testing, or validating changes: |
| 8 | + |
| 9 | +* Install dependencies: `yarn --frozen-lockfile --prefer-offline --ignore-scripts` |
| 10 | +* Build: `yarn build` |
| 11 | +* Watch build: `yarn watch` |
| 12 | +* Lint: `yarn lint` |
| 13 | +* Run all tests: `yarn test` |
| 14 | +* Run a single test file: `yarn test src/path/to/file.test.ts` |
| 15 | +* Run all checks: `yarn all` |
| 16 | +* Lint md files: `yarn lint:md` |
| 17 | +* Check links: `yarn check:links` |
| 18 | +* Download tools: `yarn download-tools [--target <target>] [--no-cache]` |
| 19 | +* Validate tools in a VSIX: `yarn validate-tools --target <target> --vsix <file.vsix>` |
| 20 | + |
| 21 | +## Code Standards |
| 22 | + |
| 23 | +* Language: TypeScript (strict mode enabled) |
| 24 | +* Runtime module output: CommonJS (`module: commonjs`) |
| 25 | +* Target: `ES2024` |
| 26 | +* Tooling baseline: Node.js `^22.22.0`, Yarn `^1.22.0` |
| 27 | +* Prefer explicit types and avoid `any` |
| 28 | +* Ensure code passes typechecking with no errors |
| 29 | + |
| 30 | +## Naming Conventions |
| 31 | + |
| 32 | +* Variables and functions: `camelCase` |
| 33 | +* Classes and types: `PascalCase` |
| 34 | +* File names should match exported functionality where applicable |
| 35 | + |
| 36 | +## Architecture & Patterns |
| 37 | + |
| 38 | +* Write testable code using dependency injection |
| 39 | +* Keep functions small and focused |
| 40 | +* Avoid tightly coupled modules |
| 41 | +* Prefer composition over inheritance |
| 42 | + |
| 43 | +## Validation & Error Handling |
| 44 | + |
| 45 | +* Validate external inputs at boundaries (especially workspace/debug configuration inputs) |
| 46 | +* Reuse existing parser/reader patterns in the surrounding module |
| 47 | +* Provide meaningful error and log messages that help troubleshooting |
| 48 | + |
| 49 | +## Imports |
| 50 | + |
| 51 | +* Group imports in this order: |
| 52 | + |
| 53 | + 1. External packages |
| 54 | + 2. Internal modules |
| 55 | +* Avoid unused imports |
| 56 | +* Use consistent import style across the codebase |
| 57 | + |
| 58 | +## Testing |
| 59 | + |
| 60 | +* Test framework: Jest with `ts-jest` |
| 61 | +* Write unit tests for all new logic |
| 62 | +* Keep tests isolated and deterministic |
| 63 | +* Use descriptive test names |
| 64 | +* Prefer testing behavior over implementation details |
| 65 | +* Follow existing test patterns (`jest.mock`, factory helpers under `src/__test__`) |
| 66 | + |
| 67 | +## General Guidelines |
| 68 | + |
| 69 | +* Follow existing patterns in the codebase |
| 70 | +* Maintain consistency with surrounding code |
| 71 | +* Do not introduce new libraries unless necessary |
| 72 | +* Keep changes minimal and focused |
| 73 | +* If a new source file is completely AI-generated, add `// generated with AI` at the top (per contribution guide) |
| 74 | + |
| 75 | +## Notes for Copilot |
| 76 | + |
| 77 | +* Always align with existing project structure and patterns |
| 78 | +* When unsure, prioritize consistency over creativity |
| 79 | +* Ensure all generated code builds, typechecks, and passes tests |
0 commit comments