Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ Your contributions help make adapter development better for the entire ioBroker
```
Title: 🤖 Setup ioBroker GitHub Copilot Instructions

GitHub Copilot: Please help me set up GitHub Copilot instructions for my ioBroker adapter repository using the template from:
GitHub Copilot: Please help me set up GitHub Copilot instructions for my ioBroker adapter repository using the centralized automation template from:
templates/initial-setup-automation.md
```
2. **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
2. **Let GitHub Copilot handle everything** using our **centralized automation system**:
- ✅ Validates existing setup and detects repository status
- 📥 Downloads and customizes latest template using metadata.json
- 🎯 Adds adapter-specific content with intelligent customization
- ⚙️ Sets up weekly monitoring with centralized GitHub Action
- 🛡️ Preserves any existing customizations automatically
- 🚫 **Avoids manual scripts** (replaces approaches like validation scripts in package.json)

### For Quick Updates Only
1. **Create a quick update issue** with this simple content:
Expand Down Expand Up @@ -176,18 +177,20 @@ For advanced users who want more control over the template management process:

### Manual Version Check

If you want to manually check your template status:
For repository diagnostics or manual validation:

```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
```

This script will:
- Compare your local template version with the latest available
- Compare your local template version with the latest available from metadata.json
- Provide update guidance if your template is outdated
- Show you what's changed in newer versions

**Note**: The centralized automation system eliminates the need for manual scripts in your repository (avoiding patterns like validation scripts in package.json).

### Repository Maintenance

For repository maintainers who want to contribute or customize the template system:
Expand Down
161 changes: 161 additions & 0 deletions config/automation-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# Centralized Initial Setup Configuration for ioBroker Copilot Instructions
# Version: 0.5.0
# This file contains the configuration and prompts for automated setup

automation:
repository_detection:
indicators:
- "package.json contains iobroker"
- "io-package.json exists"
- "main.js or lib/ directory exists"
- "admin/ directory exists"
validation:
required_files:
- "package.json"
- "io-package.json"
- "README.md"
optional_files:
- "main.js"
- "lib/"
- "admin/"

copilot_status_check:
detection_methods:
- "Check .github/copilot-instructions.md existence"
- "Validate version information in copilot instructions"
- "Test Copilot responsiveness in repository"
status_levels:
- "not_initialized" # No copilot-instructions.md
- "needs_update" # Version mismatch
- "up_to_date" # Current version matches

template_integration:
source_references:
template_url: "https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/template.md"
metadata_url: "https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/config/metadata.json"
repository_url: "https://github.com/DrozmotiX/ioBroker-Copilot-Instructions"

version_storage:
location: ".github/copilot-instructions.md"
format: "**Version:** X.Y.Z"
note: "Store in copilot instructions file, NOT package.json"

customization_sections:
preserve_tags: ["[CUSTOMIZE]"]
custom_content_types:
- "Adapter-specific API patterns"
- "Unique error codes and handling"
- "Custom device discovery patterns"
- "Authentication flows specific to service"
- "Testing scenarios beyond standard patterns"

github_action_setup:
workflow_file: ".github/workflows/check-copilot-template.yml"
template_source: "templates/centralized-version-check-action.yml"
features:
- "Weekly automated version checking"
- "Dynamic version detection from metadata.json"
- "Copilot-driven issue creation"
- "Custom section preservation"
- "Duplicate issue prevention"

prompts:
initial_setup:
analysis_prompt: |
Please analyze this repository and check:

1. **Repository Type Confirmation**:
- Confirm this is an ioBroker adapter repository
- Identify the adapter name and type
- Check existing structure and dependencies

2. **Copilot Status Assessment**:
- Verify if GitHub Copilot is active in this repository
- Check if .github/copilot-instructions.md exists
- Analyze any existing Copilot configuration

3. **Setup Requirements**:
- Determine what needs to be configured
- Identify adapter-specific patterns to customize
- Plan the integration strategy

template_setup_prompt: |
Create a complete .github/copilot-instructions.md file:

1. **Download and process template**:
- Fetch: https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/template.md
- Remove template comment block (<!-- TEMPLATE FILE --> section)
- Get version from: https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/config/metadata.json

2. **Version and source setup**:
- Set version from metadata.json (store in copilot instructions, NOT package.json)
- Add template source reference
- Include metadata reference for future updates

3. **Adapter-specific customization**:
- Customize all [CUSTOMIZE] sections for this specific adapter
- Add unique API patterns, error codes, authentication flows
- Include adapter-specific testing scenarios
- Remove any duplicate content that exists in standard template

workflow_setup_prompt: |
Create .github/workflows/check-copilot-template.yml:

1. **Use centralized template**:
- Copy from: https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/templates/centralized-version-check-action.yml
- This provides dynamic version checking using metadata.json
- Includes Copilot-driven automation (no manual scripts)

2. **Weekly monitoring features**:
- Automatic version checking every Sunday
- Smart issue creation with duplicate prevention
- Custom section preservation during updates
- Manual trigger capability

update_process:
merge_prompt: |
Update .github/copilot-instructions.md by merging latest template:

TEMPLATE SOURCES:
- Template: https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/template.md
- Version from: https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/config/metadata.json

PRESERVATION REQUIREMENTS:
1. Keep ALL [CUSTOMIZE] sections exactly as they are
2. Preserve adapter-specific context not in standard template
3. Maintain custom error handling, API patterns, authentication
4. Keep unique testing scenarios and configuration instructions
5. REMOVE duplicate content from [CUSTOMIZE] that exists in standard template
6. Store version in copilot instructions, NOT package.json

UPDATE REQUIREMENTS:
1. Integrate latest best practices from new template
2. Update version number from metadata.json
3. Refresh template source references
4. Add missing standard sections
5. Clean up [CUSTOMIZE] sections to avoid duplication

validation:
success_criteria:
setup:
- ".github/copilot-instructions.md created"
- "Version stored in copilot instructions (not package.json)"
- "Template source reference included"
- "[CUSTOMIZE] sections populated with adapter-specific content"
- "Weekly monitoring workflow created"
- "Enhanced Copilot suggestions working"

update:
- "All [CUSTOMIZE] sections preserved"
- "Version updated from metadata.json"
- "Custom content intact"
- "New best practices integrated"
- "No duplicate content between [CUSTOMIZE] and standard sections"
- "Template source references updated"

testing_steps:
- "Test enhanced Copilot suggestions (try typing 'this.setState(' in .js file)"
- "Verify template version matches metadata.json"
- "Confirm custom sections contain only unique content"
- "Check GitHub Action workflow syntax"
- "Validate issue template functionality"
21 changes: 15 additions & 6 deletions config/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@
"labels": [
"template-update",
"automation"
]
],
"configuration_file": "config/automation-setup.yml",
"centralized_action": "templates/centralized-version-check-action.yml"
},
"components": {
"github_actions": {
"weekly_version_check": {
"file": "templates/weekly-version-check-action.yml",
"version": "0.2.1",
"description": "GitHub Action for automated template version monitoring"
"centralized-version-check": {
"file": "templates/centralized-version-check-action.yml",
"version": "0.5.0",
"description": "Centralized GitHub Action with dynamic version checking from metadata.json"
},
"github_action_snippet": {
"file": "snippets/github-action-version-check.yml",
Expand All @@ -38,7 +40,7 @@
"templates": {
"initial_setup_automation": {
"file": "templates/initial-setup-automation.md",
"version": "0.3.0",
"version": "0.4.0",
"description": "Automated setup template with GitHub Copilot integration"
},
"copy_paste_template": {
Expand All @@ -63,6 +65,13 @@
"version": "0.1.0",
"description": "Version management script usage examples"
}
},
"config": {
"automation_setup": {
"file": "config/automation-setup.yml",
"version": "0.5.0",
"description": "Centralized configuration for automated setup processes"
}
}
},
"version_policy": {
Expand Down
Loading