WIP: A simple cli for daily tangled use cases and AI integration. This is for my personal use right now, but happy if others get mileage from it! :)

Add coding guidelines to README

Add mandatory coding guidelines section to prevent common mistakes:
- ALL validation functions must go in src/utils/validation.ts
- ALL code requires comprehensive test coverage
- Include examples and PR checklist

This ensures consistency and prevents validation functions from
being scattered across the codebase.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

markbennett.ca 77eb7b28 c9146363

verified
+61
+61
README.md
··· 239 239 └── package.json # Package configuration 240 240 ``` 241 241 242 + ### Coding Guidelines 243 + 244 + **IMPORTANT: These guidelines must be followed for all code contributions.** 245 + 246 + #### Validation Functions Location 247 + 248 + **ALL validation logic belongs in `src/utils/validation.ts`** 249 + 250 + - Use Zod schemas for all input validation 251 + - Boolean validation helpers (e.g., `isValidHandle()`, `isValidTangledDid()`) go in `validation.ts` 252 + - Never define validation functions in other files - import from `validation.ts` 253 + - Validation functions should return `true/false` or use Zod's `safeParse()` pattern 254 + 255 + Example: 256 + ```typescript 257 + // ✅ CORRECT: validation.ts 258 + export function isValidHandle(handle: string): boolean { 259 + return handleSchema.safeParse(handle).success; 260 + } 261 + 262 + // ❌ WRONG: Don't define validators in other files 263 + // git.ts should import isValidHandle, not define it 264 + ``` 265 + 266 + #### Test Coverage Requirements 267 + 268 + **ALL code must have comprehensive test coverage** 269 + 270 + - Every new feature requires tests in the corresponding `tests/` directory 271 + - Commands must have test files (e.g., `src/commands/foo.ts` → `tests/commands/foo.test.ts`) 272 + - Utilities must have test files (e.g., `src/utils/bar.ts` → `tests/utils/bar.test.ts`) 273 + - Tests should cover: 274 + - Success cases (happy path) 275 + - Error cases (validation failures, network errors, etc.) 276 + - Edge cases (empty input, boundary values, etc.) 277 + - Aim for high test coverage - tests are not optional 278 + 279 + Example test structure: 280 + ```typescript 281 + describe('MyFeature', () => { 282 + describe('successfulOperation', () => { 283 + it('should handle valid input', async () => { /* ... */ }); 284 + it('should handle edge case', async () => { /* ... */ }); 285 + }); 286 + 287 + describe('errorHandling', () => { 288 + it('should reject invalid input', async () => { /* ... */ }); 289 + it('should handle network errors', async () => { /* ... */ }); 290 + }); 291 + }); 292 + ``` 293 + 294 + #### Pull Request Checklist 295 + 296 + Before submitting code, verify: 297 + - [ ] All validation functions are in `validation.ts` 298 + - [ ] Comprehensive tests are written and passing 299 + - [ ] TypeScript compilation passes (`npm run typecheck`) 300 + - [ ] Linting passes (`npm run lint`) 301 + - [ ] All tests pass (`npm test`) 302 + 242 303 ### Technology Stack 243 304 244 305 - **TypeScript 5.7.2** - Latest stable with strict mode enabled