Merge branch 'github:main' into jpa-to-cosmos-db
This commit is contained in:
commit
55bfedd440
@ -9,12 +9,16 @@ Thank you for your interest in contributing to the Awesome GitHub Copilot reposi
|
|||||||
Instructions help customize GitHub Copilot's behavior for specific technologies, coding practices, or domains.
|
Instructions help customize GitHub Copilot's behavior for specific technologies, coding practices, or domains.
|
||||||
|
|
||||||
1. **Create your instruction file**: Add a new `.md` file in the `instructions/` directory
|
1. **Create your instruction file**: Add a new `.md` file in the `instructions/` directory
|
||||||
2. **Follow the naming convention**: Use descriptive, lowercase filenames with hyphens (e.g., `python-django.md`)
|
2. **Follow the naming convention**: Use descriptive, lowercase filenames with hyphens (e.g., `python-django.instructions.md`)
|
||||||
3. **Structure your content**: Start with a clear heading and organize your instructions logically
|
3. **Structure your content**: Start with a clear heading and organize your instructions logically
|
||||||
4. **Test your instructions**: Make sure your instructions work well with GitHub Copilot
|
4. **Test your instructions**: Make sure your instructions work well with GitHub Copilot
|
||||||
|
|
||||||
#### Example instruction format:
|
#### Example instruction format:
|
||||||
```markdown
|
```markdown
|
||||||
|
---
|
||||||
|
description: 'Instructions for customizing GitHub Copilot behavior for specific technologies and practices'
|
||||||
|
---
|
||||||
|
|
||||||
# Your Technology/Framework Name
|
# Your Technology/Framework Name
|
||||||
|
|
||||||
## Instructions
|
## Instructions
|
||||||
@ -40,9 +44,9 @@ Prompts are ready-to-use templates for specific development scenarios and tasks.
|
|||||||
#### Example prompt format:
|
#### Example prompt format:
|
||||||
```markdown
|
```markdown
|
||||||
---
|
---
|
||||||
mode: "agent"
|
mode: 'agent'
|
||||||
tools: ["codebase", "terminalCommand"]
|
tools: ['codebase', 'terminalCommand']
|
||||||
description: "Brief description of what this prompt does"
|
description: 'Brief description of what this prompt does'
|
||||||
---
|
---
|
||||||
|
|
||||||
# Prompt Title
|
# Prompt Title
|
||||||
@ -55,6 +59,47 @@ Your goal is to...
|
|||||||
- Include examples where helpful
|
- Include examples where helpful
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Adding Chat Modes
|
||||||
|
|
||||||
|
Chat modes are specialized configurations that transform GitHub Copilot Chat into domain-specific assistants or personas for particular development scenarios.
|
||||||
|
|
||||||
|
1. **Create your chat mode file**: Add a new `.chatmode.md` file in the `chatmodes/` directory
|
||||||
|
2. **Follow the naming convention**: Use descriptive, lowercase filenames with hyphens and the `.chatmode.md` extension (e.g., `react-performance-expert.chatmode.md`)
|
||||||
|
3. **Include frontmatter**: Add metadata at the top of your file with required fields
|
||||||
|
4. **Define the persona**: Create a clear identity and expertise area for the chat mode
|
||||||
|
5. **Test your chat mode**: Ensure the chat mode provides helpful, accurate responses in its domain
|
||||||
|
|
||||||
|
#### Example chat mode format:
|
||||||
|
```markdown
|
||||||
|
---
|
||||||
|
description: 'Brief description of the chat mode and its purpose'
|
||||||
|
model: 'gpt-5'
|
||||||
|
tools: ['codebase', 'terminalCommand']
|
||||||
|
---
|
||||||
|
|
||||||
|
# Chat Mode Title
|
||||||
|
|
||||||
|
You are an expert [domain/role] with deep knowledge in [specific areas].
|
||||||
|
|
||||||
|
## Your Expertise
|
||||||
|
|
||||||
|
- [Specific skill 1]
|
||||||
|
- [Specific skill 2]
|
||||||
|
- [Specific skill 3]
|
||||||
|
|
||||||
|
## Your Approach
|
||||||
|
|
||||||
|
- [How you help users]
|
||||||
|
- [Your communication style]
|
||||||
|
- [What you prioritize]
|
||||||
|
|
||||||
|
## Guidelines
|
||||||
|
|
||||||
|
- [Specific instructions for responses]
|
||||||
|
- [Constraints or limitations]
|
||||||
|
- [Best practices to follow]
|
||||||
|
```
|
||||||
|
|
||||||
## Submitting Your Contribution
|
## Submitting Your Contribution
|
||||||
|
|
||||||
1. **Fork this repository**
|
1. **Fork this repository**
|
||||||
@ -68,6 +113,29 @@ Your goal is to...
|
|||||||
- A brief description of what your instruction/prompt does
|
- A brief description of what your instruction/prompt does
|
||||||
- Any relevant context or usage notes
|
- Any relevant context or usage notes
|
||||||
|
|
||||||
|
## What We Accept
|
||||||
|
|
||||||
|
We welcome contributions covering any technology, framework, or development practice that helps developers work more effectively with GitHub Copilot. This includes:
|
||||||
|
|
||||||
|
- Programming languages and frameworks
|
||||||
|
- Development methodologies and best practices
|
||||||
|
- Architecture patterns and design principles
|
||||||
|
- Testing strategies and quality assurance
|
||||||
|
- DevOps and deployment practices
|
||||||
|
- Accessibility and inclusive design
|
||||||
|
- Performance optimization techniques
|
||||||
|
|
||||||
|
## What We Don't Accept
|
||||||
|
|
||||||
|
To maintain a safe, responsible, and constructive community, we will **not accept** contributions that:
|
||||||
|
|
||||||
|
- **Violate Responsible AI Principles**: Content that attempts to circumvent Microsoft/GitHub's Responsible AI guidelines or promotes harmful AI usage
|
||||||
|
- **Compromise Security**: Instructions designed to bypass security policies, exploit vulnerabilities, or weaken system security
|
||||||
|
- **Enable Malicious Activities**: Content intended to harm other systems, users, or organizations
|
||||||
|
- **Exploit Weaknesses**: Instructions that take advantage of vulnerabilities in other platforms or services
|
||||||
|
- **Promote Harmful Content**: Guidance that could lead to the creation of harmful, discriminatory, or inappropriate content
|
||||||
|
- **Circumvent Platform Policies**: Attempts to work around GitHub, Microsoft, or other platform terms of service
|
||||||
|
|
||||||
## Quality Guidelines
|
## Quality Guidelines
|
||||||
|
|
||||||
- **Be specific**: Generic instructions are less helpful than specific, actionable guidance
|
- **Be specific**: Generic instructions are less helpful than specific, actionable guidance
|
||||||
@ -75,6 +143,7 @@ Your goal is to...
|
|||||||
- **Follow conventions**: Use consistent formatting and naming
|
- **Follow conventions**: Use consistent formatting and naming
|
||||||
- **Keep it focused**: Each file should address a specific technology, framework, or use case
|
- **Keep it focused**: Each file should address a specific technology, framework, or use case
|
||||||
- **Write clearly**: Use simple, direct language
|
- **Write clearly**: Use simple, direct language
|
||||||
|
- **Promote best practices**: Encourage secure, maintainable, and ethical development practices
|
||||||
|
|
||||||
## Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
applyTo: '*'
|
applyTo: '**/Dockerfile,**/Dockerfile.*,**/*.dockerfile,**/docker-compose*.yml,**/docker-compose*.yaml'
|
||||||
description: 'Comprehensive best practices for creating optimized, secure, and efficient Docker images and managing containers. Covers multi-stage builds, image layer optimization, security scanning, and runtime best practices.'
|
description: 'Comprehensive best practices for creating optimized, secure, and efficient Docker images and managing containers. Covers multi-stage builds, image layer optimization, security scanning, and runtime best practices.'
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ Your goal is to help me write effective unit tests with JUnit 5, covering both s
|
|||||||
|
|
||||||
## Test Structure
|
## Test Structure
|
||||||
|
|
||||||
- Test classes should have a `Test` suffix, e.g., `CalculatorTests` for a `Calculator` class.
|
- Test classes should have a `Test` suffix, e.g., `CalculatorTest` for a `Calculator` class.
|
||||||
- Use `@Test` for test methods.
|
- Use `@Test` for test methods.
|
||||||
- Follow the Arrange-Act-Assert (AAA) pattern.
|
- Follow the Arrange-Act-Assert (AAA) pattern.
|
||||||
- Name tests using a descriptive convention, like `methodName_should_expectedBehavior_when_scenario`.
|
- Name tests using a descriptive convention, like `methodName_should_expectedBehavior_when_scenario`.
|
||||||
|
|||||||
@ -7,22 +7,27 @@ const path = require("path");
|
|||||||
const TEMPLATES = {
|
const TEMPLATES = {
|
||||||
header: `# 🤖 Awesome GitHub Copilot Customizations
|
header: `# 🤖 Awesome GitHub Copilot Customizations
|
||||||
|
|
||||||
Enhance your GitHub Copilot experience with community-contributed instructions, prompts, and configurations. Get consistent AI assistance that follows your team's coding standards and project requirements.
|
Enhance your GitHub Copilot experience with community-contributed [instructions](#-custom-instructions), [prompts](#-reusable-prompts), and [chat modes](#-custom-chat-modes). Get consistent AI assistance that follows your team's coding standards and project requirements.
|
||||||
|
|
||||||
## 🎯 GitHub Copilot Customization Features
|
<details>
|
||||||
|
<summary><strong>🎯 GitHub Copilot Customization Features</strong></summary>
|
||||||
|
|
||||||
GitHub Copilot provides three main ways to customize AI responses and tailor assistance to your specific workflows, team guidelines, and project requirements:
|
GitHub Copilot provides three main ways to customize AI responses and tailor assistance to your specific workflows, team guidelines, and project requirements:
|
||||||
|
|
||||||
| **📋 [Custom Instructions](#-custom-instructions)** | **🎯 [Reusable Prompts](#-reusable-prompts)** | **🧩 [Custom Chat Modes](#-custom-chat-modes)** |
|
| **🧩 [Custom Chat Modes](#-custom-chat-modes)** | **🎯 [Reusable Prompts](#-reusable-prompts)** | **📋 [Custom Instructions](#-custom-instructions)** |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| Define common guidelines for tasks like code generation, reviews, and commit messages. Describe *how* tasks should be performed<br><br>**Benefits:**<br>• Automatic inclusion in every chat request<br>• Repository-wide consistency<br>• Multiple implementation options | Create reusable, standalone prompts for specific tasks. Describe *what* should be done with optional task-specific guidelines<br><br>**Benefits:**<br>• Eliminate repetitive prompt writing<br>• Shareable across teams<br>• Support for variables and dependencies | Define chat behavior, available tools, and codebase interaction patterns within specific boundaries for each request<br><br>**Benefits:**<br>• Context-aware assistance<br>• Tool configuration<br>• Role-specific workflows |
|
| Define chat behavior, available tools, and codebase interaction patterns within specific boundaries for each request<br><br>**Benefits:**<br>• Context-aware assistance<br>• Tool configuration<br>• Role-specific workflows | Create reusable, standalone prompts for specific tasks. Describe *what* should be done with optional task-specific guidelines<br><br>**Benefits:**<br>• Eliminate repetitive prompt writing<br>• Shareable across teams<br>• Support for variables and dependencies | Define common guidelines for tasks like code generation, reviews, and commit messages. Describe *how* tasks should be performed<br><br>**Benefits:**<br>• Automatic inclusion in every chat request<br>• Repository-wide consistency<br>• Multiple implementation options |
|
||||||
|
|
||||||
> **💡 Pro Tip:** Custom instructions only affect Copilot Chat (not inline code completions). You can combine all three customization types - use custom instructions for general guidelines, prompt files for specific tasks, and chat modes to control the interaction context.
|
> **💡 Pro Tip:** Custom instructions only affect Copilot Chat (not inline code completions). You can combine all three customization types - use custom instructions for general guidelines, prompt files for specific tasks, and chat modes to control the interaction context.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
## 📝 Contributing
|
<details>
|
||||||
|
<summary><strong>📝 Contributing</strong></summary>
|
||||||
|
|
||||||
We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details on how to submit new instructions and prompts.`,
|
We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details on how to submit new instructions and prompts.
|
||||||
|
|
||||||
|
</details>`,
|
||||||
|
|
||||||
instructionsSection: `## 📋 Custom Instructions
|
instructionsSection: `## 📋 Custom Instructions
|
||||||
|
|
||||||
@ -273,7 +278,7 @@ const vscodeInsidersBaseUrl = "https://insiders.vscode.dev/redirect?url=";
|
|||||||
function makeBadges(link, type) {
|
function makeBadges(link, type) {
|
||||||
return `[](${vscodeBaseUrl}${encodeURIComponent(
|
return `[](${vscodeBaseUrl}${encodeURIComponent(
|
||||||
`vscode:chat-${type}/install?url=${repoBaseUrl}/${link})`
|
`vscode:chat-${type}/install?url=${repoBaseUrl}/${link})`
|
||||||
)} [](${vscodeInsidersBaseUrl}${encodeURIComponent(
|
)}<br />[](${vscodeInsidersBaseUrl}${encodeURIComponent(
|
||||||
`vscode-insiders:chat-${type}/install?url=${repoBaseUrl}/${link})`
|
`vscode-insiders:chat-${type}/install?url=${repoBaseUrl}/${link})`
|
||||||
)}`;
|
)}`;
|
||||||
}
|
}
|
||||||
@ -282,6 +287,11 @@ function makeBadges(link, type) {
|
|||||||
* Generate the instructions section with a table of all instructions
|
* Generate the instructions section with a table of all instructions
|
||||||
*/
|
*/
|
||||||
function generateInstructionsSection(instructionsDir) {
|
function generateInstructionsSection(instructionsDir) {
|
||||||
|
// Check if directory exists
|
||||||
|
if (!fs.existsSync(instructionsDir)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
// Get all instruction files
|
// Get all instruction files
|
||||||
const instructionFiles = fs
|
const instructionFiles = fs
|
||||||
.readdirSync(instructionsDir)
|
.readdirSync(instructionsDir)
|
||||||
@ -290,9 +300,14 @@ function generateInstructionsSection(instructionsDir) {
|
|||||||
|
|
||||||
console.log(`Found ${instructionFiles.length} instruction files`);
|
console.log(`Found ${instructionFiles.length} instruction files`);
|
||||||
|
|
||||||
|
// Return empty string if no files found
|
||||||
|
if (instructionFiles.length === 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
// Create table header
|
// Create table header
|
||||||
let instructionsContent =
|
let instructionsContent =
|
||||||
"| Title | Description | Install |\n| ----- | ----------- | ------- |\n";
|
"| Title | Description |\n| ----- | ----------- |\n";
|
||||||
|
|
||||||
// Generate table rows for each instruction file
|
// Generate table rows for each instruction file
|
||||||
for (const file of instructionFiles) {
|
for (const file of instructionFiles) {
|
||||||
@ -308,21 +323,26 @@ function generateInstructionsSection(instructionsDir) {
|
|||||||
|
|
||||||
if (customDescription && customDescription !== "null") {
|
if (customDescription && customDescription !== "null") {
|
||||||
// Use the description from frontmatter
|
// Use the description from frontmatter
|
||||||
instructionsContent += `| [${title}](${link}) | ${customDescription} | ${badges} |\n`;
|
instructionsContent += `| [${title}](${link})<br />${badges} | ${customDescription} |\n`;
|
||||||
} else {
|
} else {
|
||||||
// Fallback to the default approach - use last word of title for description, removing trailing 's' if present
|
// Fallback to the default approach - use last word of title for description, removing trailing 's' if present
|
||||||
const topic = title.split(" ").pop().replace(/s$/, "");
|
const topic = title.split(" ").pop().replace(/s$/, "");
|
||||||
instructionsContent += `| [${title}](${link}) | ${topic} specific coding standards and best practices | ${badges} |\n`;
|
instructionsContent += `| [${title}](${link})<br />${badges} | ${topic} specific coding standards and best practices |\n`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${TEMPLATES.instructionsSection}\n\n${instructionsContent}\n${TEMPLATES.instructionsUsage}`;
|
return `${TEMPLATES.instructionsSection}\n${TEMPLATES.instructionsUsage}\n\n${instructionsContent}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the prompts section with a table of all prompts
|
* Generate the prompts section with a table of all prompts
|
||||||
*/
|
*/
|
||||||
function generatePromptsSection(promptsDir) {
|
function generatePromptsSection(promptsDir) {
|
||||||
|
// Check if directory exists
|
||||||
|
if (!fs.existsSync(promptsDir)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
// Get all prompt files
|
// Get all prompt files
|
||||||
const promptFiles = fs
|
const promptFiles = fs
|
||||||
.readdirSync(promptsDir)
|
.readdirSync(promptsDir)
|
||||||
@ -331,9 +351,14 @@ function generatePromptsSection(promptsDir) {
|
|||||||
|
|
||||||
console.log(`Found ${promptFiles.length} prompt files`);
|
console.log(`Found ${promptFiles.length} prompt files`);
|
||||||
|
|
||||||
|
// Return empty string if no files found
|
||||||
|
if (promptFiles.length === 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
// Create table header
|
// Create table header
|
||||||
let promptsContent =
|
let promptsContent =
|
||||||
"| Title | Description | Install |\n| ----- | ----------- | ------- |\n";
|
"| Title | Description |\n| ----- | ----------- |\n";
|
||||||
|
|
||||||
// Generate table rows for each prompt file
|
// Generate table rows for each prompt file
|
||||||
for (const file of promptFiles) {
|
for (const file of promptFiles) {
|
||||||
@ -348,13 +373,13 @@ function generatePromptsSection(promptsDir) {
|
|||||||
const badges = makeBadges(link, "prompt");
|
const badges = makeBadges(link, "prompt");
|
||||||
|
|
||||||
if (customDescription && customDescription !== "null") {
|
if (customDescription && customDescription !== "null") {
|
||||||
promptsContent += `| [${title}](${link}) | ${customDescription} | ${badges} |\n`;
|
promptsContent += `| [${title}](${link})<br />${badges} | ${customDescription} |\n`;
|
||||||
} else {
|
} else {
|
||||||
promptsContent += `| [${title}](${link}) | | ${badges} |\n`;
|
promptsContent += `| [${title}](${link})<br />${badges} | | |\n`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${TEMPLATES.promptsSection}\n\n${promptsContent}\n${TEMPLATES.promptsUsage}`;
|
return `${TEMPLATES.promptsSection}\n${TEMPLATES.promptsUsage}\n\n${promptsContent}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -382,7 +407,7 @@ function generateChatModesSection(chatmodesDir) {
|
|||||||
|
|
||||||
// Create table header
|
// Create table header
|
||||||
let chatmodesContent =
|
let chatmodesContent =
|
||||||
"| Title | Description | Install |\n| ----- | ----------- | ------- |\n";
|
"| Title | Description |\n| ----- | ----------- |\n";
|
||||||
|
|
||||||
// Generate table rows for each chat mode file
|
// Generate table rows for each chat mode file
|
||||||
for (const file of chatmodeFiles) {
|
for (const file of chatmodeFiles) {
|
||||||
@ -397,13 +422,13 @@ function generateChatModesSection(chatmodesDir) {
|
|||||||
const badges = makeBadges(link, "mode");
|
const badges = makeBadges(link, "mode");
|
||||||
|
|
||||||
if (customDescription && customDescription !== "null") {
|
if (customDescription && customDescription !== "null") {
|
||||||
chatmodesContent += `| [${title}](${link}) | ${customDescription} | ${badges} |\n`;
|
chatmodesContent += `| [${title}](${link})<br />${badges} | ${customDescription} |\n`;
|
||||||
} else {
|
} else {
|
||||||
chatmodesContent += `| [${title}](${link}) | | ${badges} |\n`;
|
chatmodesContent += `| [${title}](${link})<br />${badges} | | |\n`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${TEMPLATES.chatmodesSection}\n\n${chatmodesContent}\n${TEMPLATES.chatmodesUsage}`;
|
return `${TEMPLATES.chatmodesSection}\n${TEMPLATES.chatmodesUsage}\n\n${chatmodesContent}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -420,17 +445,16 @@ function generateReadme() {
|
|||||||
const chatmodesSection = generateChatModesSection(chatmodesDir);
|
const chatmodesSection = generateChatModesSection(chatmodesDir);
|
||||||
|
|
||||||
// Build the complete README content with template sections
|
// Build the complete README content with template sections
|
||||||
let readmeContent = [TEMPLATES.header, instructionsSection, promptsSection];
|
const sections = [TEMPLATES.header];
|
||||||
|
|
||||||
// Only include chat modes section if we have any chat modes
|
// Only include sections that have content
|
||||||
if (chatmodesSection) {
|
if (instructionsSection.trim()) sections.push(instructionsSection);
|
||||||
readmeContent.push(chatmodesSection);
|
if (promptsSection.trim()) sections.push(promptsSection);
|
||||||
}
|
if (chatmodesSection.trim()) sections.push(chatmodesSection);
|
||||||
|
|
||||||
// Add footer
|
sections.push(TEMPLATES.footer);
|
||||||
readmeContent.push(TEMPLATES.footer);
|
|
||||||
|
|
||||||
return readmeContent.join("\n\n");
|
return sections.join("\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Main execution
|
// Main execution
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user