-
Notifications
You must be signed in to change notification settings - Fork 2
Implement automated template update system with GitHub Copilot integration #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| # Automated Template Updates with GitHub Copilot | ||
|
|
||
| This guide provides fully automated methods to validate and update your ioBroker Copilot instructions template using GitHub Copilot, ensuring all custom sections are preserved. | ||
DutchmanNL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## 🚀 Quick Start (Copy-Paste Method) | ||
|
|
||
| **Prerequisites**: Ensure GitHub Copilot is active in your repository first. If you haven't set up GitHub Copilot yet, create an issue in your repository with the title "🤖 Setup GitHub Copilot" and content "GitHub Copilot: Please help me set up GitHub Copilot for this repository and create initial .github/copilot-instructions.md file." | ||
|
|
||
| The fastest way to update your template: | ||
|
|
||
| ### Step 1: Create an Issue in Your Repository | ||
|
|
||
| 1. Go to your ioBroker adapter repository on GitHub | ||
| 2. Click "Issues" → "New Issue" | ||
| 3. Use title: **🤖 Update ioBroker Copilot Instructions Template** | ||
| 4. Copy and paste this content: | ||
|
|
||
| ```markdown | ||
| **GitHub Copilot**: Please help me update my ioBroker Copilot instructions template to the latest version while preserving all custom sections. | ||
|
|
||
| ## Task | ||
| Update `.github/copilot-instructions.md` using this prompt: | ||
|
|
||
| ``` | ||
| "Merge the ioBroker template from https://github.com/DrozmotiX/ioBroker-Copilot-Instructions/blob/main/template.md with my existing .github/copilot-instructions.md. | ||
|
|
||
| REQUIREMENTS: | ||
| 1. Preserve ALL [CUSTOMIZE] sections exactly as they are | ||
DutchmanNL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 2. Keep all project-specific context and custom instructions | ||
| 3. Add latest ioBroker best practices from the new template | ||
| 4. Update version to match latest template version | ||
| 5. Maintain Template Source reference | ||
|
|
||
| Show me the changes before applying them." | ||
| ``` | ||
|
|
||
| ## Validation | ||
| After update, confirm: | ||
| - [ ] All [CUSTOMIZE] sections preserved | ||
DutchmanNL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - [ ] Version updated to latest | ||
| - [ ] Custom content intact | ||
| - [ ] Template structure complete | ||
|
|
||
| **Reference**: https://github.com/DrozmotiX/ioBroker-Copilot-Instructions | ||
| ``` | ||
|
|
||
| ### Step 2: Let GitHub Copilot Handle the Update | ||
|
|
||
| GitHub Copilot will automatically: | ||
| - Analyze your current template | ||
| - Fetch the latest template version | ||
| - Merge while preserving ALL `[CUSTOMIZE]` sections | ||
| - Provide a summary of changes | ||
| - Generate the updated file | ||
|
|
||
| ### Step 3: Review and Apply Changes | ||
|
|
||
| Review the proposed changes to ensure: | ||
| - All your custom sections are intact | ||
| - Version is updated correctly | ||
| - New best practices are included | ||
| - No project-specific context is lost | ||
|
|
||
| ## 🔄 Version Check Before Update | ||
|
|
||
| Check if your template needs updating: | ||
|
|
||
| ```bash | ||
| curl -s https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/scripts/check-template-version.sh | bash | ||
| ``` | ||
|
|
||
| ## 🛠️ Advanced Automated Method | ||
|
|
||
| For repositories with existing automation workflows, use the full template: | ||
|
|
||
| ### Template File Location | ||
| Copy from: [`templates/automated-template-update.md`](../templates/automated-template-update.md) | ||
|
|
||
| This provides: | ||
| - Detailed step-by-step automation | ||
| - Comprehensive validation checks | ||
| - Progress tracking with checkboxes | ||
| - Complete reference information | ||
|
|
||
| ## 🔍 Custom Section Management | ||
|
|
||
| Your custom sections are automatically preserved when using the automation prompts. These include: | ||
|
|
||
| ### Automatically Preserved Content | ||
| - All sections marked with `[CUSTOMIZE]` | ||
| - Project-specific adapter context not covered by template | ||
| - Custom service integrations and authentication patterns | ||
| - Unique error handling specific to your adapter's requirements | ||
| - Adapter-specific testing scenarios beyond standard patterns | ||
|
|
||
| ### Example Custom Section | ||
| ```markdown | ||
| ## [CUSTOMIZE] Project-Specific Instructions | ||
|
|
||
| ### My Adapter Specific Patterns | ||
| - Custom authentication flow for [YourService] API | ||
| - Adapter-specific device discovery patterns | ||
| - Unique error codes and recovery procedures specific to your service | ||
|
|
||
| **Note:** This section is preserved during template updates and should contain only content not already covered in the standard template | ||
| ``` | ||
|
|
||
| ## ✅ Validation Steps | ||
|
|
||
| After any automated update, verify: | ||
|
|
||
| 1. **Version Check**: Compare version number with latest available | ||
| 2. **Custom Content**: Confirm all `[CUSTOMIZE]` sections are intact | ||
| 3. **Project Context**: Verify adapter-specific instructions remain | ||
| 4. **Template Structure**: Ensure all standard sections are present | ||
| 5. **Functionality**: Test that Copilot provides enhanced suggestions | ||
|
|
||
| ## 🚨 Troubleshooting | ||
|
|
||
| ### If Custom Sections Are Lost | ||
| Use this recovery prompt: | ||
| ``` | ||
| "Restore my custom sections from the previous version of .github/copilot-instructions.md. I need all [CUSTOMIZE] sections and project-specific context to be added back to the current template while keeping the new version and best practices." | ||
| ``` | ||
|
|
||
| ### If Template Structure Is Incomplete | ||
| ``` | ||
| "Please verify my .github/copilot-instructions.md has all required sections from the ioBroker template at https://github.com/DrozmotiX/ioBroker-Copilot-Instructions/blob/main/template.md and add any missing sections while preserving my custom content." | ||
| ``` | ||
|
|
||
| ## 📋 Success Criteria | ||
|
|
||
| A successful automated update includes: | ||
| - ✅ Latest template version number | ||
| - ✅ All `[CUSTOMIZE]` sections preserved exactly | ||
| - ✅ Project-specific context maintained | ||
| - ✅ New best practices integrated | ||
| - ✅ Template source reference updated | ||
| - ✅ Valid markdown structure | ||
| - ✅ No loss of custom functionality | ||
|
|
||
| --- | ||
|
|
||
| **Benefits of Automated Updates:** | ||
| - 🕒 **Time Saving**: No manual comparison or merging | ||
| - 🛡️ **Safe**: Custom content is automatically preserved | ||
| - 🎯 **Accurate**: Uses exact merge prompts tested for reliability | ||
| - 🔄 **Consistent**: Same process works across all repositories | ||
| - 🤖 **Smart**: Leverages GitHub Copilot's understanding of your codebase | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Issue Templates | ||
|
|
||
| This directory contains templates that can be used to create automated GitHub issues for template validation and updates. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.