diff --git a/IMPLEMENTATION.md b/IMPLEMENTATION.md index a53c0fc..adf577b 100644 --- a/IMPLEMENTATION.md +++ b/IMPLEMENTATION.md @@ -8,6 +8,35 @@ We are porting vim-sudoku from the old architecture (src_old) to follow the unif --- +## Agent Rules + +These are the key principles and constraints that guide this implementation: + +### React 19 Optimization +- **No `useCallback` or `useMemo`**: React 19's compiler automatically optimizes, making these hooks unnecessary +- Use plain functions instead of wrapped callbacks +- React will handle memoization automatically +- Cleaner, more readable code + +### Code Conventions +- **No comments**: Code should be self-documenting unless explicitly requested +- **Type-first approach**: Define types before implementation +- **Explicit imports**: Always import types with `import type` +- **Return type annotations**: Use `ReturnType` for hook return types + +### Architecture Patterns +- **Hook composition**: Small, focused hooks composed together +- **Ref-based state**: Use refs for non-reactive state, useState for reactive +- **Module organization**: Each hook module has types.ts, implementation, and index.ts +- **Follow vim-maze patterns**: Maintain consistency across games + +### Documentation +- **Update IMPLEMENTATION.md**: After every iteration +- **Clear commit messages**: Describe what, why, and how +- **Track issues and solutions**: Document problems encountered and fixes + +--- + ## Iteration 1: Preparation & Planning **Date**: 2025-01-22