diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..25ca37f57 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,34 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# All files +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +# Markdown files +[*.md] +trim_trailing_whitespace = false +max_line_length = off + +# JSON files +[*.json] +indent_size = 2 + +# JavaScript files +[*.js] +indent_size = 2 + +# Shell scripts +[*.sh] +end_of_line = lf + +# Windows scripts +[*.{cmd,bat}] +end_of_line = crlf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..d85c21c6c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,28 @@ +# Set default behavior to automatically normalize line endings. +* text=auto eol=lf + +# Explicitly declare text files to be normalized and converted to native line endings on checkout. +*.md text eol=lf +*.txt text eol=lf +*.js text eol=lf +*.json text eol=lf +*.yml text eol=lf +*.yaml text eol=lf +*.html text eol=lf +*.css text eol=lf +*.scss text eol=lf +*.ts text eol=lf +*.sh text eol=lf + +# Windows-specific files that should retain CRLF line endings +*.bat text eol=crlf +*.cmd text eol=crlf + +# Binary files that should not be modified +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.zip binary +*.pdf binary diff --git a/.github/workflows/check-line-endings.yml b/.github/workflows/check-line-endings.yml new file mode 100644 index 000000000..e37a3b99e --- /dev/null +++ b/.github/workflows/check-line-endings.yml @@ -0,0 +1,29 @@ +name: Check Line Endings + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + check-line-endings: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Check for CRLF line endings in markdown files + run: | + ! grep -l $'\r' $(find . -name "*.md") + if [ $? -eq 0 ]; then + echo "✅ No CRLF line endings found in markdown files" + exit 0 + else + echo "❌ CRLF line endings found in markdown files" + echo "Files with CRLF line endings:" + grep -l $'\r' $(find . -name "*.md") + exit 1 + fi diff --git a/.gitignore b/.gitignore index f0c24295e..4047669cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules *.orig +[Cc]opilot-[Pp]rocessing.md diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..d2b41d40b --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "editorconfig.editorconfig", + "davidanson.vscode-markdownlint" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 32465d8c4..bf65aac8b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,26 @@ { - "chat.modeFilesLocations": { - "chatmodes": true - }, - "chat.promptFilesLocations": { - "prompts": true - }, - "chat.instructionsFilesLocations": { - "instructions": true - } -} \ No newline at end of file + "chat.modeFilesLocations": { + "chatmodes": true + }, + "chat.promptFilesLocations": { + "prompts": true + }, + "chat.instructionsFilesLocations": { + "instructions": true + }, + "files.eol": "\n", + "files.insertFinalNewline": true, + "files.trimTrailingWhitespace": true, + "[markdown]": { + "files.trimTrailingWhitespace": false, + "editor.formatOnSave": true + }, + "editor.rulers": [ + 100 + ], + "files.associations": { + "*.chatmode.md": "markdown", + "*.instructions.md": "markdown", + "*.prompt.md": "markdown" + } +} diff --git a/README.md b/README.md index 1c8cbf0c4..f9aa799af 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,8 @@ Ready-to-use prompt templates for specific development scenarios and tasks, defi - [Product Manager Assistant: Feature Identification and Specification](prompts/gen-specs-as-issues.prompt.md) - This workflow guides you through a systematic approach to identify missing features, prioritize them, and create detailed specifications for implementation. - [Javascript Typescript Jest](prompts/javascript-typescript-jest.prompt.md) - Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns. - [Multi Stage Dockerfile](prompts/multi-stage-dockerfile.prompt.md) - Create optimized multi-stage Dockerfiles for any language or framework -- [My Issues](prompts/my-issues.prompt.md) -- [My Pull Requests](prompts/my-pull-requests.prompt.md) +- [My Issues](prompts/my-issues.prompt.md) - List my issues in the current repository +- [My Pull Requests](prompts/my-pull-requests.prompt.md) - List my pull requests in the current repository > 💡 **Usage**: Use `/prompt-name` in VS Code chat, run `Chat: Run Prompt` command, or hit the run button while you have a prompt open. @@ -79,6 +79,16 @@ Custom chat modes define specific behaviors and tools for GitHub Copilot Chat, e - [Custom Chat Modes](https://code.visualstudio.com/docs/copilot/chat/chat-modes) - Advanced chat configuration - [VS Code Settings](https://code.visualstudio.com/docs/getstarted/settings) - General VS Code configuration guide +## 🛠️ Development Configuration + +This repository uses various configuration files to ensure consistent code style and avoid issues with line endings: + +- [`.editorconfig`](.editorconfig) - Defines coding styles across different editors and IDEs +- [`.gitattributes`](.gitattributes) - Ensures consistent line endings in text files +- [`.vscode/settings.json`](.vscode/settings.json) - VS Code-specific settings for this repository +- [`.vscode/extensions.json`](.vscode/extensions.json) - Recommended VS Code extensions + +> 💡 **Note**: All markdown files in this repository use LF line endings (Unix-style) to avoid mixed line endings issues. The repository is configured to automatically handle line endings conversion. ## 📄 License @@ -90,8 +100,8 @@ Please note that this project is released with a [Contributor Code of Conduct](C ## ™️ Trademarks -This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft -trademarks or logos is subject to and must follow +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft +trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. \ No newline at end of file diff --git a/SUPPORT.md b/SUPPORT.md index 72edc54cd..a7dd53c32 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -1,15 +1,15 @@ -# Support - -## How to file issues and get help - -This project uses GitHub issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue. - -For help or questions about using this project, please raise an issue on GitHub. - -Please include one of the following statements file: - -- **Awesome Copilot Prompts** is under active development and maintained by GitHub and Microsoft staff **AND THE COMMUNITY**. We will do our best to respond to support, feature requests, and community questions in a timely manner. -- -## GitHub Support Policy - -Support for this project is limited to the resources listed above. +# Support + +## How to file issues and get help + +This project uses GitHub issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue. + +For help or questions about using this project, please raise an issue on GitHub. + +Please include one of the following statements file: + +- **Awesome Copilot Prompts** is under active development and maintained by GitHub and Microsoft staff **AND THE COMMUNITY**. We will do our best to respond to support, feature requests, and community questions in a timely manner. +- +## GitHub Support Policy + +Support for this project is limited to the resources listed above. diff --git a/prompts/my-issues.prompt.md b/prompts/my-issues.prompt.md index 113c77fb5..119772026 100644 --- a/prompts/my-issues.prompt.md +++ b/prompts/my-issues.prompt.md @@ -1,9 +1,9 @@ ---- -mode: 'agent' -tools: ['githubRepo', 'github', 'get_issue', 'get_issue_comments', 'get_me', 'list_issues'] -description: 'List my issues in the current repository' ---- - -Search the current repo (using #githubRepo for the repo info) and list any issues you find (using #list_issues) that are assigned to me. - -Suggest issues that I might want to focus on based on their age, the amount of comments, and their status (open/closed). +--- +mode: 'agent' +tools: ['githubRepo', 'github', 'get_issue', 'get_issue_comments', 'get_me', 'list_issues'] +description: 'List my issues in the current repository' +--- + +Search the current repo (using #githubRepo for the repo info) and list any issues you find (using #list_issues) that are assigned to me. + +Suggest issues that I might want to focus on based on their age, the amount of comments, and their status (open/closed). diff --git a/prompts/my-pull-requests.prompt.md b/prompts/my-pull-requests.prompt.md index 25b8d7553..128a60f75 100644 --- a/prompts/my-pull-requests.prompt.md +++ b/prompts/my-pull-requests.prompt.md @@ -1,15 +1,15 @@ ---- -mode: 'agent' -tools: ['githubRepo', 'github', 'get_me', 'get_pull_request', 'get_pull_request_comments', 'get_pull_request_diff', 'get_pull_request_files', 'get_pull_request_reviews', 'get_pull_request_status', 'list_pull_requests', 'request_copilot_review'] -description: 'List my pull requests in the current repository' ---- - -Search the current repo (using #githubRepo for the repo info) and list any pull requests you find (using #list_pull_requests) that are assigned to me. - -Describe the purpose and details of each pull request. - -If a PR is waiting for someone to review, highlight that in the response. - -If there were any check failures on the PR, describe them and suggest possible fixes. - -If there was no review done by Copilot, offer to request one using #request_copilot_review. +--- +mode: 'agent' +tools: ['githubRepo', 'github', 'get_me', 'get_pull_request', 'get_pull_request_comments', 'get_pull_request_diff', 'get_pull_request_files', 'get_pull_request_reviews', 'get_pull_request_status', 'list_pull_requests', 'request_copilot_review'] +description: 'List my pull requests in the current repository' +--- + +Search the current repo (using #githubRepo for the repo info) and list any pull requests you find (using #list_pull_requests) that are assigned to me. + +Describe the purpose and details of each pull request. + +If a PR is waiting for someone to review, highlight that in the response. + +If there were any check failures on the PR, describe them and suggest possible fixes. + +If there was no review done by Copilot, offer to request one using #request_copilot_review. diff --git a/scripts/fix-line-endings.sh b/scripts/fix-line-endings.sh new file mode 100755 index 000000000..de57f6673 --- /dev/null +++ b/scripts/fix-line-endings.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Script to fix line endings in all markdown files + +echo "Normalizing line endings in markdown files..." + +# Find all markdown files and convert CRLF to LF +find . -name "*.md" -type f -exec sed -i 's/\r$//' {} \; + +echo "Done! All markdown files now have LF line endings." diff --git a/update-readme.js b/update-readme.js index 144d87363..a9d5c4252 100755 --- a/update-readme.js +++ b/update-readme.js @@ -49,6 +49,16 @@ Custom chat modes define specific behaviors and tools for GitHub Copilot Chat, e - [Custom Chat Modes](https://code.visualstudio.com/docs/copilot/chat/chat-modes) - Advanced chat configuration - [VS Code Settings](https://code.visualstudio.com/docs/getstarted/settings) - General VS Code configuration guide +## 🛠️ Development Configuration + +This repository uses various configuration files to ensure consistent code style and avoid issues with line endings: + +- [\`.editorconfig\`](.editorconfig) - Defines coding styles across different editors and IDEs +- [\`.gitattributes\`](.gitattributes) - Ensures consistent line endings in text files +- [\`.vscode/settings.json\`](.vscode/settings.json) - VS Code-specific settings for this repository +- [\`.vscode/extensions.json\`](.vscode/extensions.json) - Recommended VS Code extensions + +> 💡 **Note**: All markdown files in this repository use LF line endings (Unix-style) to avoid mixed line endings issues. The repository is configured to automatically handle line endings conversion. ## 📄 License @@ -60,8 +70,8 @@ Please note that this project is released with a [Contributor Code of Conduct](C ## ™️ Trademarks -This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft -trademarks or logos is subject to and must follow +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft +trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.`, @@ -353,78 +363,6 @@ function generateChatModesSection(chatmodesDir) { } return `${TEMPLATES.chatmodesSection}\n\n${chatmodesContent}\n${TEMPLATES.chatmodesUsage}`; - - if (chatmodesSection) { - let chatmodesListContent = "\n\n"; - - // Always regenerate the entire list to ensure descriptions are included - for (const file of chatmodeFiles.sort()) { - const filePath = path.join(chatmodesDir, file); - const title = extractTitle(filePath); - const link = encodeURI(`chatmodes/${file}`); - - // Check if there's a description in the frontmatter - const customDescription = extractDescription(filePath); - - if (customDescription && customDescription !== "null") { - // Use the description from frontmatter - chatmodesListContent += `- [${title}](${link}) - ${customDescription}\n`; - } else { - // Just add a link without description - chatmodesListContent += `- [${title}](${link})\n`; - } - } - - // Replace the current chat modes section with the updated one - const newChatmodesSection = - "## 🧩 Custom Chat Modes\n\nCustom chat modes define specific behaviors and tools for GitHub Copilot Chat, enabling enhanced context-aware assistance for particular tasks or workflows." + - chatmodesListContent + - "\n> 💡 **Usage**: Create new chat modes using the command `Chat: Configure Chat Modes...`, then switch your chat mode in the Chat input from _Agent_ or _Ask_ to your own mode."; - - return currentReadme.replace(chatmodesSection[0], newChatmodesSection); - } else { - // Chat modes section doesn't exist yet but we have chat mode files - console.log( - "Creating new chat modes section with all available chat modes." - ); - - const chatmodesListContent = chatmodeFiles - .sort() - .map((file) => { - const filePath = path.join(chatmodesDir, file); - const title = extractTitle(filePath); - const link = `chatmodes/${file}`; - const customDescription = extractDescription(filePath); - - if (customDescription) { - return `- [${title}](${link}) - ${customDescription}`; - } else { - return `- [${title}](${link})`; - } - }) - .join("\n"); - - const newChatmodesSection = - "## 🧩 Custom Chat Modes\n\n" + - "Custom chat modes define specific behaviors and tools for GitHub Copilot Chat, enabling enhanced context-aware assistance for particular tasks or workflows.\n\n" + - chatmodesListContent + - "\n\n> 💡 **Usage**: Create new chat modes using the command `Chat: Configure Chat Modes...`, then switch your chat mode in the Chat input from _Agent_ or _Ask_ to your own mode.\n"; - - // Insert before Additional Resources section - const additionalResourcesPos = currentReadme.indexOf( - "## 📚 Additional Resources" - ); - if (additionalResourcesPos !== -1) { - return ( - currentReadme.slice(0, additionalResourcesPos) + - newChatmodesSection + - "\n" + - currentReadme.slice(additionalResourcesPos) - ); - } - - return currentReadme; - } } /**