Supabase MCP Server
by Sentry01
Verified
# Custom Instructions Guide
## What Are Custom Instructions?
Custom instructions are personalized guidelines that you provide to AI assistants to shape how they respond to your requests. They help the AI understand your preferences, needs, and context better, resulting in more relevant and useful responses.
## How to Use Custom Instructions
### Setting Up Custom Instructions
1. **Access the Settings**:
- Navigate to the settings or preferences section of your AI assistant platform
- Look for "Custom Instructions" or "Personalization" options
2. **Create Your Instructions**:
- Write clear, specific instructions about how you want the AI to respond
- Structure your instructions in a logical manner
- Consider breaking them into sections for clarity
3. **Save and Apply**:
- Save your custom instructions
- They will be applied to future conversations with the AI
### Updating Your Instructions
You can update your custom instructions at any time:
1. Return to the settings section
2. Edit your existing instructions
3. Save the changes
## Best Practices for Custom Instructions
### Be Specific and Clear
```
✓ "When explaining code, include comments about why certain decisions were made"
✗ "Explain code better"
```
### Provide Context About Yourself
```
✓ "I'm an experienced developer working primarily with React and Node.js"
✗ "I know programming"
```
### Include Preferences
```
✓ "I prefer concise explanations with bullet points when possible"
✗ "Make your answers good"
```
### Specify Output Format When Needed
```
✓ "When providing code examples, include both the implementation and a usage example"
✗ "Give me code"
```
### Use Sections for Organization
Structure your instructions into sections like:
- About Me (your background and expertise)
- Communication Preferences (how you want information presented)
- Technical Context (tools, languages, frameworks you use)
- Response Format (structure you prefer for responses)
## Custom Instructions Template
```
# About Me
[Your profession/role and experience level]
[Key technologies you work with]
[Your goals or what you're trying to accomplish]
# Communication Preferences
[How detailed you want explanations]
[Preferred formats (bullet points, step-by-step guides, etc.)]
[Language preferences (technical level, tone)]
# Technical Context
[Your development environment]
[Frameworks and libraries you commonly use]
[Coding style preferences]
# Response Format
[How you want information structured]
[Whether you want examples included]
[Any specific format requirements]
```
## GitHub Copilot Custom Instructions in VS Code
GitHub Copilot in VS Code offers powerful customization options to enhance its responses through custom instructions. These instructions provide context about your team's workflow, tools, or project specifics automatically with every chat request.
### Types of Custom Instructions in VS Code
Copilot allows you to specify custom instructions for different purposes:
1. **Code-generation instructions** - Provide context for generating code, such as coding standards, preferred patterns, or architectural guidelines.
2. **Test-generation instructions** - Specify preferences for test generation, like testing frameworks or methodologies.
3. **Code review instructions** - Define criteria for code reviews, such as security practices or performance considerations.
4. **Commit message generation instructions** - Guide Copilot on how to format and structure commit messages.
5. **Pull request title and description generation instructions** - Set guidelines for generating pull request content.
### Setting Up Custom Instructions in VS Code
#### Method 1: Using VS Code Settings
You can configure custom instructions through VS Code settings:
1. Open VS Code Settings (`Ctrl+,` or `Cmd+,` on macOS)
2. Search for "github.copilot.chat"
3. Find the relevant setting for your instruction type (e.g., `github.copilot.chat.codeGeneration.instructions`)
4. Configure instructions using JSON format
Example settings file configuration:
```json
"github.copilot.chat.codeGeneration.instructions": [
{
"text": "Always add a comment: 'Generated by Copilot'."
},
{
"text": "In TypeScript always use underscore for private field names."
},
{
"file": "code-style.md" // import instructions from an external file
}
]
```
#### Method 2: Using a `.github/copilot-instructions.md` File
For team collaboration and version control:
1. Enable the `github.copilot.chat.codeGeneration.useInstructionFiles` setting
2. Create a `.github/copilot-instructions.md` file at your workspace root
3. Add natural language instructions using Markdown format
This approach allows instructions to be shared and version-controlled across the team.
### Reusable Prompt Files (Experimental)
VS Code Copilot also offers experimental support for reusable prompt files that can be shared across projects:
1. Enable prompt files with the `chat.promptFiles` setting
2. Create `.prompt.md` files in the `.github/prompts` directory
3. Reference these prompts in your chat interactions
Prompt files are particularly useful for:
- Code generation templates
- Domain expertise documentation
- Team collaboration on complex patterns
- Onboarding documentation
Example prompt file for React forms:
```markdown
Your goal is to generate a new React form component.
Ask for the form name and fields if not provided.
Requirements for the form:
* Use form design system components
* Use `react-hook-form` for form state management
* Always define TypeScript types for your form data
* Prefer *uncontrolled* components using register
* Use `defaultValues` to prevent unnecessary rerenders
```
### How to Create User Prompt Files
For reusable prompts across multiple workspaces:
1. Use the "Create User Prompt" command from the Command Palette
2. Enter a name for your prompt file
3. Write instructions using Markdown formatting
### Using Custom Instructions Effectively
1. **Keep instructions concise** - Each instruction should be a simple, self-contained statement
2. **Be specific** - Clearly state your preferences and requirements
3. **Don't reference external resources** in the instructions
4. **Share with your team** by storing instructions in version-controlled files
### Settings Reference for Copilot Customization
Key settings for custom instructions:
- `github.copilot.chat.codeGeneration.useInstructionFiles` - Use the `.github/copilot-instructions.md` file
- `github.copilot.chat.codeGeneration.instructions` - Code generation instructions
- `github.copilot.chat.testGeneration.instructions` - Test generation instructions
- `github.copilot.chat.reviewSelection.instructions` - Code review instructions
- `github.copilot.chat.commitMessageGeneration.instructions` - Commit message generation instructions
- `github.copilot.chat.pullRequestDescriptionGeneration.instructions` - PR generation instructions
- `chat.promptFiles` - Configure prompt file locations
## Examples of Effective Custom Instructions
### For a Student Learning Programming
```
About Me: I'm a computer science student in my second year. I'm currently learning Java and basic data structures. I sometimes struggle with algorithm complexity.
Communication Preferences: Please explain concepts using simple analogies. I prefer step-by-step explanations with examples. Use beginner-friendly terminology but introduce proper technical terms.
Technical Context: I use VS Code on Windows and compile using the command line. I'm familiar with basic Java syntax but new to object-oriented programming concepts.
Response Format: When explaining code, first give a high-level overview of what it does, then break down the implementation details. For algorithms, please include time and space complexity analysis.
```
### For a Professional Developer
```
About Me: I'm a senior full-stack developer with 8+ years of experience. I work primarily with TypeScript, React, and Node.js. I'm very familiar with modern web development practices.
Communication Preferences: Be concise and direct. You can use technical jargon freely. I prefer discussions that focus on trade-offs and best practices rather than basic explanations.
Technical Context: My stack includes React, Next.js, Node.js, TypeScript, PostgreSQL, and Docker. I follow functional programming principles where possible and prioritize type safety.
Response Format: For implementation questions, provide idiomatic TypeScript with proper typing. Include error handling when relevant. For architectural discussions, bullet point pros and cons.
```
## Common Mistakes to Avoid
1. **Being Too Vague**: "Be helpful" doesn't give the AI much guidance
2. **Contradictory Instructions**: Asking for both "detailed explanations" and "brief responses"
3. **Unrealistic Expectations**: Asking the AI to always use a specific approach when flexibility might be needed
4. **Neglecting Context**: Not informing the AI about your technical background or tools
5. **Overwhelming Detail**: Providing too many specific instructions that may conflict with each other
## Measuring Effectiveness
To determine if your custom instructions are effective:
1. **Evaluate Responses**: Are the AI's responses more aligned with your needs?
2. **Iterative Improvement**: Refine your instructions based on the responses you receive
3. **A/B Testing**: Try different sets of instructions to see which produces better results
## Conclusion
Custom instructions are a powerful tool to personalize AI interactions. By clearly communicating your context, preferences, and needs, you can significantly improve the relevance and usefulness of AI-generated responses. Take time to craft thoughtful instructions, and don't hesitate to refine them as you learn what works best for your specific situation.