GitHub Copilot Instructions
Enhance your development experience with AI-powered assistance and best practices
GitHub Copilot Instructions are a powerful feature that enhances your development experience by providing context-aware assistance and best practices for specific technologies and frameworks. These instructions are automatically applied when you install templates or extensions, creating a tailored development environment for your project.
Template Instructions
When you create a new project using a template, GitHub Copilot automatically applies a set of predefined instructions specific to that template, helping you follow best practices and maintain consistent patterns.
Extension Instructions
As you add extensions to your project, GitHub Copilot dynamically incorporates additional instructions specific to each extension, providing specialized guidance and best practices.
- Description: Defines the assistant's expertise and focus area
- Guidelines: Specific best practices and implementation patterns
- Anti-patterns: Common mistakes to avoid
- Examples: Practical implementation examples
- Contextual Assistance: Get relevant suggestions based on your stack
- Consistent Development: Maintain uniform patterns across your team
- Learning Support: Learn best practices as you code
- Error Prevention: Avoid common mistakes with proactive guidance
You can customize these instructions by modifying the .github/copilot-instructions.md
file in your project, creating new instruction sets, and extending existing instructions to match your team's preferences.
We welcome contributions to improve our instruction sets. If you have suggestions for new instructions, improvements, better examples, or additional anti-patterns, please submit a pull request to our repository.
Getting Started
To enable GitHub Copilot Instructions in your new project, use the --ai-tool
flag when creating your project:
With GitHub Copilot Instructions
npx create-awesome-node-app my-app --ai-tool copilot
Interactive Mode
npx create-awesome-node-app my-app --interactive
Choose your AI tool preference when prompted
Example Instruction Set
# GitHub Copilot Instructions for React Vite Project
## Core Guidelines
1. **Check Documentation First**
- Always reference the `docs/` folder for technology-specific guides and patterns
- Follow the README.md for setup, testing, and development instructions
- Consult official documentation when uncertain
2. **Code Quality**
- Run `npm run format` to format code automatically
- Run `npm run lint:fix` to fix linting issues
- Keep code clean, typed, and well-structured
- Use TypeScript properly and avoid `any` types
3. **Project Structure**
- Follow the established Feature-Based Architecture
- Check `docs/PROJECT_STRUCTURE.md` for organization patterns
- Keep features self-contained and modular
- Place components in appropriate feature directories
4. **Development Workflow**
- Test changes using the commands in README.md
- Follow the project's established patterns and conventions
- Reference existing code for consistency
- Use Vite's development server and HMR effectively
5. **Best Practices**
- Write clean, readable, and maintainable code
- Use proper error handling and validation
- Follow React and TypeScript best practices
- Implement proper loading and error states
- Optimize for performance with React.memo and useMemo when needed
## When Suggesting Code
1. **Component Creation**
- Check if similar components exist in the codebase
- Look for relevant guides in the `docs/` folder
- Follow the established component patterns
- Use TypeScript interfaces for props
- Include proper error boundaries when appropriate
2. **State Management**
- Reference `docs/` for state management patterns used in the project
- Use React hooks appropriately (useState, useEffect, useContext)
- Follow established patterns for global state if configured
3. **Styling**
- Check `docs/` for styling approach used in the project
- Follow established CSS/styling patterns
- Use consistent naming conventions
- Implement responsive design patterns
4. **Testing**
- Suggest appropriate tests if testing is configured
- Follow testing patterns established in the project
- Reference testing guides in `docs/` folder
5. **Performance**
- Reference `docs/PERFORMANCE.md` for optimization guidelines
- Suggest lazy loading for route components
- Recommend proper bundle splitting techniques
## React Vite Specific
- Leverage Vite's fast development server and build optimizations
- Use ES modules and modern JavaScript features
- Take advantage of Vite's plugin ecosystem
- Follow Vite's file naming conventions for assets
- Use dynamic imports for code splitting