Skip to content

Add GitHub Copilot Agent Skills for .NET IoT repository#2473

Open
Copilot wants to merge 9 commits intomainfrom
copilot/create-ai-skills-based-on-copilot
Open

Add GitHub Copilot Agent Skills for .NET IoT repository#2473
Copilot wants to merge 9 commits intomainfrom
copilot/create-ai-skills-based-on-copilot

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

Create AI Skills Based on Copilot Instructions

  • Explore repository structure and understand copilot instructions
  • Research GitHub Copilot Agent Skills format and structure
  • Create .github/skills/ directory
  • Create skill for adding new device bindings (226 lines)
  • Create skill for debugging build issues (288 lines)
  • Create skill for fixing device binding API issues (392 lines)
  • Create skill for updating documentation (411 lines)
  • Create skill for handling hardware abstraction compliance (460 lines)
  • Create README for skills directory (138 lines)
  • Fix markdown linting errors (all files pass validation)
  • Use relative paths for in-repository documentation references
  • Fix sample project naming convention to match repository standard (.Samples.csproj)
  • Clarify constructor guidelines and transport ownership patterns
  • Document README conventions (title format, Documentation section, required sections)
  • Remove unclear validation steps (hardware abstraction checking covered by dedicated skill)
  • Test and validate all skills

Summary

Successfully created 5 comprehensive AI skills for the .NET IoT repository totaling 1,777 lines of guidance:

Skills Created

  1. add-device-binding - Complete guide for adding new IoT device bindings with proper API patterns, resource management, and documentation
  2. debug-build-issues - Comprehensive troubleshooting for Azure DevOps feeds, SDK errors, timeouts, and CI/CD failures
  3. fix-api-conventions - Detailed API design patterns including UnitsNet usage, error handling, and visibility guidelines
  4. update-device-documentation - Documentation templates and guidelines for README files, XML comments, and wiring diagrams
  5. hardware-abstraction-check - Cross-platform validation ensuring proper use of System.Device.* abstractions

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

Create AI skills based on copilot instructions and past issues assigned to copilot


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Microsoft Reviewers: Open in CodeFlow

Copilot AI and others added 2 commits February 5, 2026 16:48
…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>
Copilot AI changed the title [WIP] Create AI skills based on Copilot instructions and past issues Add GitHub Copilot Agent Skills for .NET IoT repository Feb 5, 2026
Copilot AI requested a review from krwq February 5, 2026 16:57
@joperezr joperezr marked this pull request as ready for review February 19, 2026 16:50

- 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot I didn't mean to change relative links to absolute but rather to link this specific "Device Convention" reference. relative paths are better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot <DeviceName>.Samples.csproj (capital S in samples)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copilot finished work on behalf of krwq March 19, 2026 16:49
### 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Provide sensible defaults (e.g., common I²C addresses like 0x48)
- Provide sensible defaults (e.g., common I2C addresses like 0x48)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot what does this mean

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot clarify: there should always be a way for device to not own the transport

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copilot AI requested a review from krwq March 19, 2026 16:52
Copilot finished work on behalf of krwq March 19, 2026 16:52
- 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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

  • 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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Comment on lines +166 to +167
# Check for hardware abstraction violations
grep -r "Environment.OSVersion\|DllImport\|P/Invoke" .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot this seem like some bogus step, no one has any clue what this means

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copilot finished work on behalf of krwq March 19, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants