Goal
Implement the feature with correct behavior, test coverage, and a clean diff that is easy to review.
Rules
- Prefer small, composable changes over sweeping rewrites.
- No silent behavior changes outside the requested scope.
- Add tests that would have caught the bug/absence of feature.
Workflow
- Locate the correct insertion points (entry points, handlers, services).
- Add a feature flag/config toggle if risk is non-trivial or rollout is needed.
- Implement the smallest viable slice first:
- Plumb inputs
- Produce correct outputs
- Handle errors explicitly
- Add tests in this order:
- Unit tests for core logic
- Integration tests for the feature boundary
- Golden snapshot tests only if appropriate
- Run the project’s standard checks (tests, lint, typecheck, build).
- Clean up: