This guide walks you through setting up GitHub Copilot for ioBroker adapter development, focusing on repository-level Copilot integration and automated template merging.
- Repository Copilot Setup (Essential)
- Template Integration
- Advanced: IDE Setup
- Validation and Testing
- Organization-Specific Setup
For existing ioBroker adapter repositories - This section covers setting up GitHub Copilot at the repository level, which is essential for all users.
- Subscribe to GitHub Copilot
- Visit GitHub Copilot and subscribe to GitHub Copilot Individual or Business
- Ensure your subscription is active and includes your target repository
-
Navigate to your existing ioBroker adapter repository
cd your-existing-iobroker-adapter -
Ensure you have GitHub Copilot instructions file
# Create .github directory if it doesn't exist mkdir -p .github # Check if you already have Copilot instructions ls -la .github/copilot-instructions.md
-
Initial template setup If you don't have a copilot-instructions.md file yet:
Option A: Use automated setup (Recommended)
- First ensure GitHub Copilot is active: Create an issue with title "🤖 Setup GitHub Copilot" and content "GitHub Copilot: Please help me set up GitHub Copilot for this repository."
- After Copilot responds and is working, create another issue using the copy-paste template
- GitHub Copilot will create the complete template for you
Option B: Manual template download
# Download the template curl -o .github/copilot-instructions.md https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/template.md # Remove template comment block sed -i '/^<!--$/,/^-->$/d' .github/copilot-instructions.md
Important: After initial setup, always add your project-specific content in
[CUSTOMIZE]sections:## [CUSTOMIZE] Project-Specific Instructions ### My Adapter Specific Patterns - Custom authentication flow for [YourService] API - Adapter-specific device discovery patterns - Unique error codes specific to your service **Note:** This section is preserved during template updates and should contain only content not already covered in the standard template
-
For existing configurations If your existing config needs updates, use the automated update process instead of replacing the file
🤖 Fully Automated Updates - Use GitHub Copilot to handle template updates automatically while preserving all custom sections.
Best for: Regular updates and team collaboration
-
Create an automated update issue
- Go to your repository's Issues
- Create new issue with title: "🤖 Update ioBroker Copilot Instructions Template"
- Use content from
templates/copy-paste-template.md - GitHub Copilot will automatically handle the merge
-
Benefits of issue-based automation
- Creates audit trail of template updates
- Allows team review before applying changes
- Preserves all
[CUSTOMIZE]sections automatically - Tracks version history in issues
Best for: Quick updates during development
-
Prompt GitHub Copilot for smart merging In your editor, use 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. Preserve all [CUSTOMIZE] sections and project-specific context while adding the latest ioBroker best practices. Update the version to the latest available." -
For comprehensive automation: Use the full template from
templates/automated-template-update.md
-
Ensure version tracking in your repository Your
.github/copilot-instructions.mdshould include:**Version:** [current-version] **Template Source:** https://github.com/DrozmotiX/ioBroker-Copilot-Instructions **Custom Sections:** [Preserve during updates]
-
Identify your custom sections
- Mark any project-specific instructions with
[CUSTOMIZE]tags - These will be preserved during template updates
- Mark any project-specific instructions with
Use GitHub Copilot to intelligently merge templates - This preserves your custom content and maintains version control.
-
Prompt GitHub Copilot for smart merging In your editor, use 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. Preserve all [CUSTOMIZE] sections and project-specific context while adding the latest ioBroker best practices. Update the version to the latest available." -
Verify version tracking Ensure your updated file includes:
- Current template version (latest available)
- Template source reference
- Your custom sections intact
- Project-specific context preserved
-
Commit with version control
git add .github/copilot-instructions.md git commit -m "Update Copilot instructions to latest template version, preserve custom sections"
Keep customizations safe - Always use the custom section approach:
-
Structure your custom content
## [CUSTOMIZE] Project-Specific Instructions ### My Adapter Specific Patterns - Custom patterns for your adapter - Project-specific error handling - Unique API integrations **Note:** This section is preserved during template updates
-
Version validation Use the version check script to ensure you're up-to-date:
curl -s https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/scripts/check-template-version.sh | bash
Optional IDE integration - For developers who want to use Copilot directly in their development environment.
-
Install GitHub Copilot Extension
- VS Code: Install the GitHub Copilot extension
- JetBrains IDEs: Install GitHub Copilot from the plugin marketplace
- Vim/Neovim: Use the copilot.vim plugin
- Other editors: Check GitHub Copilot documentation for your editor
-
Authenticate GitHub Copilot in IDE
- Open your editor and sign in to GitHub Copilot when prompted
- Verify authentication by typing code in any file - you should see Copilot suggestions
-
Test IDE Integration
// Create a file test-copilot.js and start typing this comment: // Function to add two numbers // Copilot should suggest a function implementation when you press Enter
| Problem | Solution |
|---|---|
| No suggestions appear | Check authentication and subscription status |
| Extension not working | Reinstall Copilot extension and restart editor |
| Authentication issues | Sign out and sign back in to GitHub Copilot |
After completing the template integration, verify everything is working correctly:
# Test that Copilot instructions are properly integrated
# 1. Check your .github/copilot-instructions.md file exists
ls -la .github/copilot-instructions.md
# 2. Verify version information is present
grep "Version:" .github/copilot-instructions.md
grep "Template Source:" .github/copilot-instructions.md
# 3. Check for custom sections
grep "\[CUSTOMIZE\]" .github/copilot-instructions.mdTest that Copilot provides ioBroker-specific suggestions:
-
Open any .js or .ts file in your adapter
-
Start typing ioBroker-related code:
- Example:
// Create new ioBroker adapter instance - Example:
this.setState( - Example:
// Handle device connection
- Example:
-
Verify enhanced suggestions:
- Copilot should provide ioBroker-specific patterns
- Error handling should follow ioBroker best practices
- Test suggestions should include
@iobroker/testingframework usage
After successful integration, you should observe:
- Context-aware suggestions specific to ioBroker development patterns
- Error handling that follows ioBroker best practices
- Test suggestions that include
@iobroker/testingframework usage - README updates that follow ioBroker documentation standards
- Dependency management suggestions aligned with ioBroker ecosystem
Click to expand organization setup instructions (only relevant if your repository is part of a GitHub organization)
If your repository is part of an organization:
-
Check Organization Settings
- Go to your GitHub organization settings
- Navigate to "Copilot" in the left sidebar
- Ensure your repository is included in the allowed repositories
-
Verify Team Access
- Ensure your team has Copilot access enabled
- Check that repository access policies allow Copilot usage
| Problem | Solution |
|---|---|
| Organization access denied | Contact organization admin to enable Copilot access |
| Repository not in allowed list | Add repository to organization's Copilot allowed repositories |
| Team access issues | Verify team has Copilot license allocation |
| Policy restrictions | Review organization Copilot policies and permissions |
- Centralized Configuration: Consider creating organization-level Copilot instruction templates
- Access Management: Use teams to manage Copilot access across repositories
- Policy Compliance: Ensure Copilot usage complies with organization security policies
- Training: Provide team training on Copilot best practices for ioBroker development
Next Steps: Return to the main README to explore what's included in the template and see examples of how it enhances ioBroker development.