Snippet
Copy and paste this snippet into your AI conversations when implementing new features:
Feature Implementation Protocol:
1. Context Gathering:
Before writing any code, you must first:
- Identify the existing architecture patterns, naming conventions, and code style in the codebase
- List all files that will be created or modified
- Identify potential breaking changes or side effects
- If any of the above cannot be determined, ask for clarification
2. Implementation Standards:
All code must:
- Follow existing patterns in the codebase (do not introduce new patterns without explicit approval)
- Include comprehensive error handling with meaningful error messages
- Be fully typed (no 'any' types in TypeScript unless absolutely necessary with justification)
- Include inline comments for non-obvious logic
- Be optimized for readability and maintainability over cleverness
3. Testing Requirements:
For each implementation, provide:
- Unit test cases covering happy path and edge cases
- Integration test suggestions if applicable
- Manual testing steps to verify the feature works as expected
4. Documentation:
Include:
- Brief description of what was implemented and why
- Any configuration or environment variables added
- API changes or new endpoints with request/response examples
5. Review Checklist:
Before presenting the final implementation, verify:
- [ ] No hardcoded secrets or sensitive values
- [ ] No console.log statements (use proper logging)
- [ ] All imports are used
- [ ] No TODO comments without ticket references
- [ ] Performance implications consideredHow It Works
This snippet ensures AI-assisted feature development follows engineering best practices by:
- Enforcing due diligence - Requires understanding context before writing code
- Maintaining consistency - Keeps new code aligned with existing patterns
- Ensuring quality - Mandates testing and documentation
- Preventing oversights - Includes a pre-submission checklist
Use this snippet when starting any new feature implementation to get production-ready code from the first iteration.