AI-Assisted Development Guide
Team-wide AI prompt templates and guidelines for consistent code generation
AI-Assisted Development Guide
Overview
This guide helps you leverage AI assistants effectively while maintaining our codebase's consistency. By using standardized prompts and following these guidelines, AI-generated code will seamlessly integrate with our existing patterns, making it indistinguishable from human-written code.
Why standardized prompts? AI assistants are powerful but need proper context. Our templates provide the exact context needed to generate code that follows our patterns, uses our conventions, and integrates perfectly with existing code.
Getting Started with AI Assistance
Quick Start Guide
- Choose the right template from our Core Prompt Templates below
- Fill in the placeholders with your specific requirements
- Review and refine the generated code against our standards
- Run validation before committing:
npx tsc --noEmit && npm run lint
Time saver: Using our templates typically reduces development time by 40% while maintaining 100% standard compliance.
Core Prompt Templates
Feature Implementation Template
Use this template when implementing complete features:
Pro tip: The more specific your examples, the better the output. Always reference a similar feature that already exists in your codebase.
Component Generation Template
For creating new UI components:
Hook Generation Template
For custom React hooks:
Test Generation Template
For comprehensive test coverage:
Specific Use Case Templates
API Integration Template
Creating consistent API integrations:
Remember: Always group API functions by domain, not by HTTP method. This keeps related logic together and makes the codebase more navigable.
AI Tool Configuration
GitHub Copilot Settings
Create .github/copilot-instructions.md in your project:
VS Code Settings
Add to .vscode/settings.json:
Code Review with AI
Use AI to help review code for compliance:
AI Review Prompt
Working with AI Effectively
Before Using AI
Preparation is key to good outputs:
- Identify the pattern - Find similar code in your codebase
- Prepare context - Gather relevant files and documentation
- Choose template - Select the appropriate prompt template
- Set constraints - Specify performance/compatibility requirements
Example: Before asking AI to create a new modal component, find an existing modal in your codebase to use as a reference pattern.
During AI Generation
Guide the AI for better results:
- Provide examples - Include similar implemented features
- Be specific - Vague prompts lead to inconsistent code
- Iterate - Refine output to match standards exactly
- Verify imports - AI often gets import paths wrong
Common issue: AI often uses arrow functions for components. Always convert to function declarations as per our standards.
After Generation
Validate and refine the output:
- Run checks -
npx tsc --noEmit && npm run lint - Compare patterns - Ensure consistency with existing code
- Update tests - AI-generated tests often need refinement
- Document decisions - Add comments for non-obvious choices
Quality check: Good AI-generated code should be indistinguishable from human-written code following our standards.
Common AI Mistakes to Fix
Be aware of these frequent AI errors:
Import Issues
Component Structure
State Management
Type Definitions
Metrics and Continuous Improvement
Track these metrics to improve AI assistance:
- Code Review Cycles: Should decrease as prompts improve
- Pattern Violations: Target zero violations in AI-generated code
- Generation Time: Should decrease as you refine templates
- Developer Satisfaction: Survey team on AI tool effectiveness
Success indicator: When AI-generated code passes code review on first submission, your templates are working perfectly!
Sharing Knowledge
Contributing Back
When you discover improvements:
- Update templates - Refine prompts based on experience
- Share patterns - Document new patterns that work well
- Report issues - Note where AI consistently struggles
- Train the team - Share tips in team meetings
Template Evolution
Our templates should evolve with:
- New patterns we adopt
- Lessons learned from AI outputs
- Changes in our architecture
- Feedback from the team
Related Documents
- Feature Implementation Decision Tree - Where code belongs
- TypeScript & React Patterns - Our coding standards
- Code Review Templates - Reviewing AI-generated code
- Common Pitfalls & Solutions - Mistakes to avoid
Project Structure Migration Guide
Step-by-step guide for migrating to the hybrid architecture with domain-based business logic and feature-based UI organization.
Authentication Flow Implementation Guide
Implementing core authentication using TanStack Query, Zustand, Axios interceptors, and Secure Storage.