Skip to content
122 changes: 65 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,88 +29,96 @@ Your contributions help make adapter development better for the entire ioBroker

## πŸ“‹ Quick Start

> **New to GitHub Copilot?** Start with the [detailed setup guide](docs/setup.md) to get GitHub Copilot working in your repository first.
> **New to GitHub Copilot?** Start with the [detailed setup guide](docs/setup.md) for complete setup instructions.

**For experienced Copilot users:**
**πŸš€ Fully Automated Setup** (Recommended for all users):

1. **πŸš€ Automated Updates** (Recommended): Ensure GitHub Copilot is active in your repository first, then create an issue with the [automated update template](templates/copy-paste-template.md) to let GitHub Copilot handle everything
2. **🎯 Manual Integration**: Use GitHub Copilot to intelligently merge the template with your existing setup
3. **πŸ› οΈ Customize**: Review and modify sections marked with `[CUSTOMIZE]` for your specific adapter
4. **βœ… Verify**: Test that Copilot provides enhanced ioBroker-specific suggestions
### For New Repositories or Comprehensive Setup
1. **Ensure GitHub Copilot is working** in your repository (create a test issue if unsure)
2. **Create an automated setup issue** using the [Initial Setup Automation Template](templates/initial-setup-automation.md)
3. **Let GitHub Copilot handle everything**:
- βœ… Validates existing setup
- πŸ“₯ Downloads and customizes latest template
- 🎯 Adds adapter-specific content
- βš™οΈ Sets up weekly monitoring
- πŸ›‘οΈ Preserves any existing customizations

**Quick automation**: First ensure GitHub Copilot is set up in your repository, then copy-paste from [this template](templates/copy-paste-template.md) into a new issue.
### For Quick Updates Only
1. **Use the** [Copy-Paste Template](templates/copy-paste-template.md) for existing setups
2. **GitHub Copilot will merge** the latest template while preserving your customizations

**Zero Manual Steps Required** - No curl commands, file editing, or manual configuration needed!

![Version](https://img.shields.io/github/package-json/v/DrozmotiX/ioBroker-Copilot-Instructions?label=Current%20Version) | **Template:** [`template.md`](template.md) | ![Last Updated](https://img.shields.io/github/last-commit/DrozmotiX/ioBroker-Copilot-Instructions?label=Last%20Updated)

## πŸ“š Documentation

### πŸ› οΈ For Developers
- **[Setup Guide](docs/setup.md)** - Complete GitHub Copilot setup and template integration
- **[Automated Updates Guide](docs/automated-updates.md)** - Automated template updates with GitHub Copilot
- **[Setup Guide](docs/setup.md)** - Automated GitHub Copilot setup and template integration
- **[Automated Templates](templates/README.md)** - Complete guide to all automation templates
- **[Testing Guide](docs/testing.md)** - Validate your template integration and Copilot functionality

### πŸ”§ For Repository Maintainers
- **[Maintenance Guide](docs/maintenance.md)** - Version management, testing infrastructure, and release processes
- **[Technical Testing](TESTING.md)** - Detailed testing infrastructure documentation (54+ automated tests)

## πŸ”„ Template Versioning & Updates
## πŸ”„ Automated Template Management

### ⚑ Zero Manual Steps Required

All template operations are now fully automated:

### Quick Version Check
- **βœ… Setup**: Automated via [Initial Setup Template](templates/initial-setup-automation.md)
- **πŸ”„ Updates**: Automated via GitHub Actions with issue creation
- **πŸ›‘οΈ Customizations**: Always preserved during updates
- **πŸ“… Monitoring**: Weekly checks with automatic notifications

Check if your template is up-to-date:
### Quick Version Check (Optional)

If you want to manually check your template status:

```bash
# Download and run the version check script
curl -s https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/scripts/check-template-version.sh | bash
```

### Automated Template Updates

πŸ€– **Use GitHub Copilot to automatically update your template** - This is now the recommended approach that preserves all your custom sections:

#### Quick Update (Copy-Paste Method)
1. **Create an issue in your repository** with title: "πŸ€– Update ioBroker Copilot Instructions Template"
2. **Copy-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
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
- [ ] Version updated to latest
- [ ] Custom content intact
- [ ] Template structure complete
```
3. **Let GitHub Copilot handle the merge** automatically while preserving your customizations
4. **Review and apply** the proposed changes

πŸ“š **For detailed automation instructions**: See [Automated Updates Guide](docs/automated-updates.md)

#### Alternative Templates
- **Full automation**: Use [`templates/automated-template-update.md`](templates/automated-template-update.md) for comprehensive workflow
- **Quick copy-paste**: Use [`templates/copy-paste-template.md`](templates/copy-paste-template.md) for simple updates

### Version Information

- **Latest Version:** v0.4.0
### Automated Continuous Monitoring

The [Initial Setup Template](templates/initial-setup-automation.md) automatically configures:
- πŸ“… Weekly version checking via GitHub Actions
- 🎯 Automatic issue creation when updates are available
- πŸ›‘οΈ Safe updates that preserve all custom content
- 🚫 Prevention of duplicate update issues

## πŸ’‘ Key Features

### ⚑ **Full Automation**
- **Zero Manual Configuration**: All setup handled by GitHub Copilot
- **Smart Detection**: Automatically detects existing setups and customizations
- **Safe Updates**: Custom content always preserved during template updates

### πŸ›‘οΈ **Customization Protection**
- **[CUSTOMIZE] Sections**: Marked areas that are automatically preserved
- **Adapter-Specific Content**: Automatically added based on your repository context
- **Version Tracking**: Automatic version management and source references

### πŸ“… **Continuous Monitoring**
- **Weekly Checks**: GitHub Actions monitor for template updates
- **Automatic Issues**: Update notifications created automatically
- **No Maintenance**: Set once, works forever

### 🎯 **Enhanced Development**
- **ioBroker-Specific Suggestions**: Context-aware code completion
- **Best Practices**: Integrated patterns from experienced developers
- **Testing Integration**: Smart suggestions for `@iobroker/testing` framework

## πŸ“Š Version Information

- **Current Template Version:** ![Version](https://img.shields.io/github/package-json/v/DrozmotiX/ioBroker-Copilot-Instructions?label=v)
- **Template Location:** [`template.md`](template.md)
- **Last Updated:** September 2025
- **Last Updated:** ![Last Updated](https://img.shields.io/github/last-commit/DrozmotiX/ioBroker-Copilot-Instructions?label=)

You can validate your local template version by checking the version header in your `.github/copilot-instructions.md` file:
Your template version is automatically tracked in your `.github/copilot-instructions.md` file:

```markdown
**Version:** 0.4.0
Expand Down
150 changes: 61 additions & 89 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,25 @@ This guide walks you through setting up GitHub Copilot for ioBroker adapter deve
ls -la .github/copilot-instructions.md
```

3. **Initial template setup**
If you don't have a copilot-instructions.md file yet:
3. **Automated Initial Setup** (Recommended)

**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](../templates/copy-paste-template.md)
- GitHub Copilot will create the complete template for you
**πŸ€– Fully Automated Process**: Use our comprehensive setup template that handles everything automatically:

**Option B: Manual template download**
```bash
# 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
```
1. **Create Setup Issue**: Go to your repository's Issues and create a new issue
2. **Use Automated Template**: Copy the content from [Initial Setup Automation Template](../templates/initial-setup-automation.md)
3. **Let GitHub Copilot Handle Everything**: The template will:
- βœ… Validate if Copilot is already working in your repository
- πŸ” Check if copilot-instructions.md already exists
- πŸ“₯ Download and customize the latest template automatically
- 🎯 Add adapter-specific customizations to [CUSTOMIZE] sections
- βš™οΈ Set up weekly monitoring via GitHub Actions
- πŸ›‘οΈ Preserve any existing custom content during updates

**Benefits of Automated Setup**:
- πŸ• **No Manual Steps**: Everything is handled by GitHub Copilot
- πŸ”„ **Future-Proof**: Automatic weekly version checking
- πŸ›‘οΈ **Safe Updates**: Custom content is always preserved
- 🎯 **Adapter-Specific**: Automatically tailored to your specific adapter

**Important**: After initial setup, always add your project-specific content in `[CUSTOMIZE]` sections:
```markdown
Expand All @@ -65,102 +69,70 @@ This guide walks you through setting up GitHub Copilot for ioBroker adapter deve
```

4. **For existing configurations**
If your existing config needs updates, use the automated update process instead of replacing the file

## Template Integration

**πŸ€– Fully Automated Updates** - Use GitHub Copilot to handle template updates automatically while preserving all custom sections.
If your existing config needs updates, the same [Initial Setup Automation Template](../templates/initial-setup-automation.md) handles this automatically. It will:
- πŸ” Detect existing copilot-instructions.md
- πŸ”„ Merge the latest template while preserving ALL [CUSTOMIZE] sections
- βœ… Update version numbers and references
- πŸ›‘οΈ Ensure no custom content is lost

### Option A: Automated Issue-Based Updates (Recommended)
5. **Ongoing Maintenance**
The automated setup also configures weekly monitoring via GitHub Actions that will:
- πŸ“… Check for template updates every Sunday
- 🎯 Create issues automatically when updates are available
- πŸ”„ Handle version management without manual intervention
- πŸ›‘οΈ Always preserve your custom configurations during updates

**Best for**: Regular updates and team collaboration
## Automated Template Integration

1. **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`](../templates/copy-paste-template.md)
- GitHub Copilot will automatically handle the merge
**πŸ€– Fully Automated Process** - All template operations are now handled via GitHub Copilot automation with zero manual steps required.

2. **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
### Primary Method: Issue-Based Automation (Recommended)

### Option B: Direct Editor Integration

**Best for**: Quick updates during development

1. **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."
```
**Best for**: Both initial setup and ongoing maintenance

2. **For comprehensive automation**: Use the full template from [`templates/automated-template-update.md`](../templates/automated-template-update.md)
1. **For Initial Setup or Updates**
- Use the [Initial Setup Automation Template](../templates/initial-setup-automation.md)
- Creates comprehensive setup with validation and monitoring
- Handles both new installations and updates automatically
- Preserves all custom content during updates

### Step 1: Prepare for Template Integration
2. **For Quick Updates Only**
- Use the [Copy-Paste Template](../templates/copy-paste-template.md) for existing setups
- Focuses specifically on template merging
- Ideal when you just need to update an existing template

1. **Ensure version tracking in your repository**
Your `.github/copilot-instructions.md` should include:
```markdown
**Version:** [current-version]
**Template Source:** https://github.com/DrozmotiX/ioBroker-Copilot-Instructions
**Custom Sections:** [Preserve during updates]
```
### Automated Benefits

2. **Identify your custom sections**
- Mark any project-specific instructions with `[CUSTOMIZE]` tags
- These will be preserved during template updates
βœ… **Zero Manual Steps**: No curl commands, sed operations, or file manipulation
πŸ›‘οΈ **Safe Updates**: All [CUSTOMIZE] sections automatically preserved
πŸ“… **Continuous Monitoring**: Weekly checks via GitHub Actions
🎯 **Adapter-Specific**: Automatically customized for your specific adapter
πŸ”„ **Future-Proof**: Automatically handles new template versions
πŸ“‹ **Audit Trail**: All changes tracked through GitHub issues

### Step 2: Automated Template Merging
### Alternative: Direct Editor Integration

**Use GitHub Copilot to intelligently merge templates** - This preserves your custom content and maintains version control.
**For Advanced Users**: If you prefer working directly in your editor instead of using issues:

1. **Prompt GitHub Copilot for smart merging**
In your editor, use this prompt:
1. **Use the comprehensive automation template**
Copy the full template from [`templates/automated-template-update.md`](../templates/automated-template-update.md)

2. **Or use this quick prompt in your editor**:
```
"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."
```

2. **Verify version tracking**
Ensure your updated file includes:
- Current template version (latest available)
- Template source reference
- Your custom sections intact
- Project-specific context preserved
### Weekly Monitoring Setup

3. **Commit with version control**
```bash
git add .github/copilot-instructions.md
git commit -m "Update Copilot instructions to latest template version, preserve custom sections"
```

### Step 3: Custom Section Management

**Keep customizations safe** - Always use the custom section approach:
The [Initial Setup Automation Template](../templates/initial-setup-automation.md) automatically creates a GitHub Action that:
- πŸ“… Runs weekly to check for template updates
- 🎯 Creates issues when updates are available
- πŸ›‘οΈ Never overwrites existing custom content
- πŸ” Prevents duplicate issues from being created

1. **Structure your custom content**
```markdown
## [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
```

2. **Version validation**
Use the version check script to ensure you're up-to-date:
```bash
curl -s https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/scripts/check-template-version.sh | bash
```
**Manual GitHub Action Setup**: If you want to add monitoring to an existing setup without using the full automation template, copy [`templates/weekly-version-check-action.yml`](../templates/weekly-version-check-action.yml) to `.github/workflows/check-copilot-template.yml` in your repository.

## Advanced: IDE Setup

Expand Down
Loading