Add GitHub Copilot Agent Skills for .NET IoT repository#2473
Add GitHub Copilot Agent Skills for .NET IoT repository#2473
Conversation
…e abstraction Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
- Add MD041 exception to .markdownlint.json for YAML frontmatter - Fix MD031: Add blank lines around fenced code blocks - Fix MD032: Add blank lines around lists - Fix MD022: Add blank lines around headings - Fix MD040: Specify language for code blocks - Fix MD036: Remove emphasis used as heading Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
|
|
||
| - Developer requests adding a new device binding for a sensor, display, motor, or other hardware component | ||
| - Creating a new driver under `src/devices/<DeviceName>` | ||
| - Need to ensure the device follows .NET IoT conventions and patterns |
There was a problem hiding this comment.
There was a problem hiding this comment.
Updated all skill files to use full GitHub URLs instead of relative paths. This makes the references more portable and clear. Changed in commit 28e767b.
Files updated:
- add-device-binding/SKILL.md
- debug-build-issues/SKILL.md
- fix-api-conventions/SKILL.md
- hardware-abstraction-check/SKILL.md
- update-device-documentation/SKILL.md
There was a problem hiding this comment.
@copilot I didn't mean to change relative links to absolute but rather to link this specific "Device Convention" reference. relative paths are better
There was a problem hiding this comment.
Reverted to relative paths in all References sections. The Device Conventions and other internal documentation links now use relative paths for better in-repository navigation. Changed in commit 0723618.
| ├── <DeviceName>.csproj | ||
| ├── <DeviceName>.cs (main class) | ||
| ├── samples/ | ||
| │ ├── <DeviceName>.samples.csproj |
There was a problem hiding this comment.
@copilot <DeviceName>.Samples.csproj (capital S in samples)
There was a problem hiding this comment.
Corrected to <DeviceName>.Samples.csproj with capital S to match the most common naming convention in the repository (66 out of 129 sample projects use this format). Changed in commit bebccf0.
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
| ### 2. Constructor & Dependencies | ||
|
|
||
| - Accept hardware transports from the caller: `I2cDevice`, `SpiDevice`, `GpioController`, pin numbers, bus addresses | ||
| - Provide sensible defaults (e.g., common I²C addresses like 0x48) |
There was a problem hiding this comment.
| - Provide sensible defaults (e.g., common I²C addresses like 0x48) | |
| - Provide sensible defaults (e.g., common I2C addresses like 0x48) |
There was a problem hiding this comment.
Changed "I²C" to "I2C" for consistency. Updated in commit c321596.
|
|
||
| - Accept hardware transports from the caller: `I2cDevice`, `SpiDevice`, `GpioController`, pin numbers, bus addresses | ||
| - Provide sensible defaults (e.g., common I²C addresses like 0x48) | ||
| - **Never hardcode board-specific details** |
There was a problem hiding this comment.
Clarified with examples: "Never hardcode board-specific details (e.g., GPIO pin numbers, bus IDs, or hardware paths like /dev/i2c-1)". Device bindings should accept these as parameters instead of hardcoding them, ensuring cross-platform compatibility. Updated in commit c321596.
|
|
||
| - XML documentation comments on all public APIs | ||
| - **Include units** in comments (°C, Pa, %RH, lux, etc.) | ||
| - Document parameter ownership (does caller own the transport?) |
There was a problem hiding this comment.
@copilot clarify: there should always be a way for device to not own the transport
There was a problem hiding this comment.
Clarified that devices MUST provide a way for caller to retain ownership of transports via shouldDispose parameter (default true). Updated both the Resource Management section and Documentation Requirements to emphasize this pattern. Changed in commit c321596.
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
| - XML documentation comments on all public APIs | ||
| - **Include units** in comments (°C, Pa, %RH, lux, etc.) | ||
| - Document parameter ownership (does caller own the transport?) | ||
| - README.md with: |
There was a problem hiding this comment.
- title will be visible in the device listing and therefore it should be short and meaningful and follow existing conventions
- second subheader should always be link to documentation/reference
read several READMEs in this repo and try to figure out and document conventions here
There was a problem hiding this comment.
Documented README conventions based on analysis of existing device bindings (BMP180, HMC5883L, Bmxx80, LM75, ADS1115, Ahtxx):
Title format: # DeviceName - Brief functional description (short, meaningful, appears in listings)
Documentation section: Must be ## Documentation as second heading, with first item always linking to official datasheet
Required sections: ## Usage with code examples
Updated in commit c1ffacf.
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
| # Check for hardware abstraction violations | ||
| grep -r "Environment.OSVersion\|DllImport\|P/Invoke" . |
There was a problem hiding this comment.
@copilot this seem like some bogus step, no one has any clue what this means
There was a problem hiding this comment.
Removed the confusing grep command. Hardware abstraction checking is already covered by the dedicated hardware-abstraction-check skill, so this redundant validation step in the build section was unnecessary and unclear. The Build Validation section now focuses only on building the device and samples. Changed in commit 07b3cb4.
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
Create AI Skills Based on Copilot Instructions
.github/skills/directorySummary
Successfully created 5 comprehensive AI skills for the .NET IoT repository totaling 1,777 lines of guidance:
Skills Created
Each skill follows the GitHub Copilot Agent Skills standard format with YAML frontmatter and structured markdown content. All references to in-repository documentation use relative paths for better navigation, and follow repository naming conventions including README title format and documentation section structure.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Microsoft Reviewers: Open in CodeFlow