|
1 | 1 | # Coder Extension Development Guidelines |
2 | 2 |
|
| 3 | +## Working Style |
| 4 | + |
| 5 | +You're an experienced, pragmatic engineer. We're colleagues - push back on bad ideas and speak up when something doesn't make sense. Honesty over agreeableness. |
| 6 | + |
| 7 | +- Simple solutions over clever ones. Readability is a primary concern. |
| 8 | +- YAGNI - don't add features we don't need right now |
| 9 | +- Make the smallest reasonable changes to achieve the goal |
| 10 | +- Reduce code duplication, even if it takes extra effort |
| 11 | +- Match the style of surrounding code - consistency within a file matters |
| 12 | +- Fix bugs immediately when you find them |
| 13 | + |
| 14 | +## Naming and Comments |
| 15 | + |
| 16 | +Names should describe what code does, not how it's implemented. |
| 17 | + |
| 18 | +Comments explain what code does or why it exists: |
| 19 | + |
| 20 | +- Never add comments about what used to be there or how things changed |
| 21 | +- Never use temporal terms like "new", "improved", "refactored", "legacy" |
| 22 | +- Code should be evergreen - describe it as it is |
| 23 | +- Do not add comments when you can instead use proper variable/function naming |
| 24 | + |
| 25 | +## Testing and Debugging |
| 26 | + |
| 27 | +- Tests must comprehensively cover functionality |
| 28 | +- Never mock behavior in end-to-end tests - use real data |
| 29 | +- Mock as little as possible in unit tests - try to use real data |
| 30 | +- Find root causes, not symptoms. Read error messages carefully before attempting fixes. |
| 31 | + |
| 32 | +## Version Control |
| 33 | + |
| 34 | +- Commit frequently throughout development |
| 35 | +- Never skip or disable pre-commit hooks |
| 36 | +- Check `git status` before using `git add` |
| 37 | + |
3 | 38 | ## Build and Test Commands |
4 | 39 |
|
5 | 40 | - Build: `yarn build` |
|
8 | 43 | - Lint: `yarn lint` |
9 | 44 | - Lint with auto-fix: `yarn lint:fix` |
10 | 45 | - Run all tests: `yarn test` |
11 | | -- Run specific test: `vitest ./src/filename.test.ts` |
12 | | -- CI test mode: `yarn test:ci` |
| 46 | +- Unit tests: `yarn test:ci` |
13 | 47 | - Integration tests: `yarn test:integration` |
| 48 | +- Run specific unit test: `yarn test:ci ./test/unit/filename.test.ts` |
| 49 | +- Run specific integration test: `yarn test:integration ./test/integration/filename.test.ts` |
14 | 50 |
|
15 | | -## Code Style Guidelines |
| 51 | +## Code Style |
16 | 52 |
|
17 | 53 | - TypeScript with strict typing |
18 | | -- No semicolons (see `.prettierrc`) |
19 | | -- Trailing commas for all multi-line lists |
20 | | -- 120 character line width |
| 54 | +- Use Prettier for code formatting and ESLint for code linting |
21 | 55 | - Use ES6 features (arrow functions, destructuring, etc.) |
22 | 56 | - Use `const` by default; `let` only when necessary |
| 57 | +- Never use `any`, and use exact types when you can |
23 | 58 | - Prefix unused variables with underscore (e.g., `_unused`) |
24 | | -- Sort imports alphabetically in groups: external → parent → sibling |
25 | 59 | - Error handling: wrap and type errors appropriately |
26 | 60 | - Use async/await for promises, avoid explicit Promise construction where possible |
27 | | -- Test files must be named `*.test.ts` and use Vitest |
| 61 | +- Unit test files must be named `*.test.ts` and use Vitest, they should be placed in `./test/unit/<path in src>` |
| 62 | +- Never disable ESLint rules without user approval |
0 commit comments