@@ -16,6 +16,18 @@ This is a TypeScript project using modern best practices with ES modules, pnpm p
1616
1717## Code Standards
1818
19+ ### Design Principles
20+
21+ - Follow ** SOLID** design patterns:
22+ - ** S** ingle Responsibility Principle: Each class/module should have one reason to change
23+ - ** O** pen/Closed Principle: Open for extension, closed for modification
24+ - ** L** iskov Substitution Principle: Subtypes must be substitutable for their base types
25+ - ** I** nterface Segregation Principle: Don't force clients to depend on interfaces they don't use
26+ - ** D** ependency Inversion Principle: Depend on abstractions, not concretions
27+ - Favor composition over inheritance
28+ - Keep functions and methods small and focused
29+ - Use dependency injection for better testability
30+
1931### TypeScript
2032
2133- Always use ES modules (` import ` /` export ` )
@@ -28,7 +40,8 @@ This is a TypeScript project using modern best practices with ES modules, pnpm p
2840### File Organization
2941
3042- Source files in ` src/ `
31- - Test files alongside source with ` .test.ts ` extension
43+ - Test files in ` __tests__/ ` folder with ` .test.ts ` extension (or ` .spec.ts ` )
44+ - Organize test files to mirror the structure of source files
3245- One export per file when possible
3346- Barrel exports in ` index.ts ` files
3447
@@ -60,11 +73,16 @@ This is a TypeScript project using modern best practices with ES modules, pnpm p
6073
6174### Before Committing
6275
63- 1 . Run ` pnpm run typecheck ` to verify types
64- 2 . Run ` pnpm run lint ` to check for linting errors
65- 3 . Run ` pnpm run format:check ` to verify formatting
66- 4 . Run ` pnpm run test ` to ensure tests pass
67- 5 . Or use ` pnpm run ci ` to run all checks
76+ 1 . ** Always check linting and formatting first:**
77+ - Run ` pnpm run lint ` to check for linting errors
78+ - Run ` pnpm run format:check ` to verify formatting
79+ - Or fix automatically with ` pnpm run lint:fix ` and ` pnpm run format `
80+ 2 . ** Then ensure all CI checks pass:**
81+ - Run ` pnpm run typecheck ` to verify types
82+ - Run ` pnpm run test ` to ensure tests pass
83+ 3 . ** Or use ` pnpm run ci ` to run all checks at once** (recommended)
84+ - This runs: typecheck → lint → format: check → build → test
85+ - ** All changes must pass ` pnpm run ci ` before committing**
6886
6987### Scripts
7088
@@ -105,6 +123,10 @@ This is a TypeScript project using modern best practices with ES modules, pnpm p
105123- Add JSDoc comments for public APIs
106124- Keep README.md up to date
107125- Document complex algorithms inline
126+ - ** When adding new features, create documentation in the ` docs/ ` folder**
127+ - Follow the existing pattern (e.g., ` csv-writer.md ` , ` json-writer.md ` )
128+ - Include usage examples and API reference
129+ - Update the README to link to new documentation
108130- Update this file when project conventions change
109131
110132## CI/CD
@@ -113,13 +135,19 @@ This is a TypeScript project using modern best practices with ES modules, pnpm p
113135- CI runs on Node.js 18.x, 20.x, and 22.x
114136- Must pass: typecheck, lint, format check, build, and tests
115137- Coverage reports uploaded for Node.js 22.x
138+ - ** Copilot code review automatically runs on all pull requests**
139+ - Review feedback should be addressed before merging
140+ - Copilot may suggest improvements for code quality, security, and best practices
116141
117142## Contributing
118143
119144When adding new features:
120145
1211461 . Create a feature branch
122- 2 . Write tests first (TDD)
123- 3 . Implement the feature
124- 4 . Ensure all CI checks pass locally
125- 5 . Create a pull request with clear description
147+ 2 . Write tests first (TDD) in the ` __tests__/ ` folder
148+ 3 . Implement the feature following SOLID principles
149+ 4 . Create documentation in the ` docs/ ` folder
150+ 5 . Ensure linting and formatting pass (` pnpm run lint ` , ` pnpm run format:check ` )
151+ 6 . ** Ensure all CI checks pass locally (` pnpm run ci ` )**
152+ 7 . Create a pull request with clear description
153+ 8 . Address any Copilot review feedback
0 commit comments