Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 11, 2025

This PR adds a comprehensive .github/copilot-instructions.md file that provides detailed guidance for GitHub Copilot and developers working with the DeviceKit codebase.

Key Features Added

Platform Requirements & Limitations

  • Clear documentation that DeviceKit requires macOS with Xcode (cannot build on Linux)
  • Specific warnings about ProcessInfo API incompatibilities on non-Apple platforms

Critical Code Generation Rules

  • Explicit warnings about never editing Device.generated.swift directly
  • Mandatory use of the official gyb command: ./Utils/gyb --line-directive '' -o ./Source/Device.generated.swift ./Source/Device.swift.gyb
  • Required pre-commit code generation step to ensure generated files are up-to-date

Complete Development Workflow

  • Step-by-step bootstrap instructions for fresh repository clones
  • Code generation process using the official gyb executable to create Device.generated.swift
  • Multiple build system support (Swift Package Manager, Xcode, CocoaPods)
  • Comprehensive test execution guidelines

Validation & Testing Scenarios

  • Device detection library-specific validation approaches
  • Multi-platform simulator testing instructions
  • Playground setup and usage guidance
  • Enhanced pre-commit validation steps (code generation, SwiftLint, tests)

Time Expectations & Performance

  • Detailed timeout recommendations with "NEVER CANCEL" warnings
  • Realistic time estimates for builds (2-5 minutes) and tests (1-3 minutes)
  • Specific guidance for CI pipeline expectations

Troubleshooting & Common Issues

  • Platform-specific error solutions
  • Ruby gem installation troubleshooting
  • Xcode scheme and simulator setup guidance
  • Code generation validation steps with correct command syntax

Developer Workflow Patterns

  • Adding new device support process with proper code generation workflow
  • Testing changes across multiple platforms
  • Essential pre-commit validation checklist including mandatory code generation

The instructions follow an imperative tone as requested and include validation status indicating which commands were verified on Linux vs. those requiring macOS/Xcode. This ensures developers and Copilot have accurate, actionable guidance for working effectively with the DeviceKit codebase.

Fixes #453.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Contributor Author

Copilot AI commented Sep 11, 2025

@Zandor300 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@github-actions
Copy link

1 Error
🚫 This PR has no changes at all, this is likely an issue during development.
2 Warnings
⚠️ PR is classed as Work in Progress
⚠️ Plist changed, don't forget to localize your plist values

Generated by 🚫 Danger

@Zandor300
Copy link
Member

@copilot

Some instructions for you to add to the repository for you to use in the future:

File Source/Device.generated.swift may never be edited directly. We always apply changes to Source/Device.swift.gyb and then run the following command to generate the Device.generated.swift file:

./Utils/gyb --line-directive '' -o ./Source/Device.generated.swift ./Source/Device.swift.gyb

So everytime you commit, you should run that right before to update the Device.generated.swift file with your gyb changes.

…flows

Co-authored-by: Zandor300 <6069593+Zandor300@users.noreply.github.com>
Copilot AI changed the title [WIP] ✨ Set up Copilot instructions Add comprehensive GitHub Copilot instructions for DeviceKit development workflow Sep 11, 2025
Copilot AI requested a review from Zandor300 September 11, 2025 22:16
Copilot finished work on behalf of Zandor300 September 11, 2025 22:16
@Zandor300 Zandor300 marked this pull request as ready for review September 11, 2025 22:18
@Zandor300 Zandor300 merged commit 55ad16f into master Sep 11, 2025
1 check passed
Copy link
Contributor Author

Copilot AI commented Sep 11, 2025

@copilot

Some instructions for you to add to the repository for you to use in the future:
...

Updated the copilot instructions to use the correct gyb command and added critical rules about never editing Device.generated.swift directly. The instructions now emphasize using ./Utils/gyb --line-directive '' -o ./Source/Device.generated.swift ./Source/Device.swift.gyb and running this command before every commit. All command references throughout the file have been updated accordingly. (7c98b15)

Copilot finished work on behalf of Zandor300 September 11, 2025 22:23
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.

✨ Set up Copilot instructions

2 participants