Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 21, 2025

This PR adds a comprehensive .github/copilot-instructions.md file that provides GitHub Copilot coding agents with detailed instructions on how to work effectively in the node-switchbot codebase.

Key Features

Validated Commands and Timing: Every command has been tested from a clean environment with actual timing measurements:

  • npm install: ~5-25 seconds (varies by cache)
  • npm run build: ~5 seconds (TypeScript compilation)
  • npm run test: ~1 second (12 tests)
  • npm run lint: ~3 seconds (ESLint validation)

Platform-Specific Requirements: Clear documentation of constraints:

  • BLE functionality requires Linux-based OS only (Raspbian, Ubuntu, etc.)
  • Windows and macOS are NOT supported for BLE operations
  • Node.js versions: ^20, ^22, or ^24 required
  • ES Modules: Project uses "type": "module"

Development Workflow: Step-by-step instructions for common tasks:

  • Bootstrap and setup procedures
  • Build, test, and lint validation cycles
  • Adding new device support
  • Working with both BLE and OpenAPI interfaces

Manual Validation Scenarios: Specific tests to run after making changes:

// Basic functionality validation
const { SwitchBotBLE, SwitchBotOpenAPI } = require('./dist/index.js');
const ble = new SwitchBotBLE(); // Should not throw
const api = new SwitchBotOpenAPI('test', 'test'); // Should not throw

Timeout Warnings: Explicit "NEVER CANCEL" warnings with timeout recommendations for all build operations to prevent premature cancellation of long-running commands.

Project Structure Documentation

The instructions include comprehensive information about:

  • Source code organization (src/switchbot-ble.ts, src/switchbot-openapi.ts, device classes)
  • Configuration files (TypeScript, ESLint, package.json)
  • Build output structure (dist/ directory)
  • Documentation generation (TypeDoc)

Validation Completed

All instructions have been thoroughly validated by:

  • Following step-by-step procedures from a clean environment
  • Testing basic functionality scenarios
  • Verifying ES module imports work correctly
  • Confirming full development workflow chain
  • Measuring actual timing for all operations

The instructions follow the required imperative tone ("Run [this command]", "Do not do [this]") and provide exhaustive guidance for GitHub Copilot agents to work effectively in this TypeScript Node.js library for controlling SwitchBot devices via Bluetooth Low Energy and OpenAPI.

Fixes #299.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor Author

Copilot AI commented Aug 21, 2025

@donavanbecker 👋 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.

@donavanbecker donavanbecker changed the title [WIP] 1 [WIP] ✨ Set up Copilot instructions Aug 21, 2025
Copilot AI and others added 2 commits August 21, 2025 05:13
Co-authored-by: donavanbecker <9875439+donavanbecker@users.noreply.github.com>
Co-authored-by: donavanbecker <9875439+donavanbecker@users.noreply.github.com>
Copilot AI changed the title [WIP] ✨ Set up Copilot instructions Add comprehensive GitHub Copilot instructions for node-switchbot repository Aug 21, 2025
Copilot AI requested a review from donavanbecker August 21, 2025 05:18
Copilot finished work on behalf of donavanbecker August 21, 2025 05:18
@donavanbecker donavanbecker marked this pull request as ready for review August 21, 2025 05:26
@coveralls
Copy link

coveralls commented Aug 21, 2025

Pull Request Test Coverage Report for Build 17117833096

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 8 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 14.315%

Files with Coverage Reduction New Missed Lines %
src/device.ts 8 15.4%
Totals Coverage Status
Change from base Build 16524572898: -0.3%
Covered Lines: 404
Relevant Lines: 2903

💛 - Coveralls

@donavanbecker donavanbecker merged commit d64cb32 into latest Aug 21, 2025
10 checks passed
@donavanbecker donavanbecker deleted the copilot/fix-299 branch August 21, 2025 05:27
donavanbecker added a commit that referenced this pull request Sep 18, 2025
…sitory (#300)

This PR adds a comprehensive `.github/copilot-instructions.md` file that
provides GitHub Copilot coding agents with detailed instructions on how
to work effectively in the node-switchbot codebase.

**Validated Commands and Timing**: Every command has been tested from a
clean environment with actual timing measurements:
- `npm install`: ~5-25 seconds (varies by cache)
- `npm run build`: ~5 seconds (TypeScript compilation)
- `npm run test`: ~1 second (12 tests)
- `npm run lint`: ~3 seconds (ESLint validation)

**Platform-Specific Requirements**: Clear documentation of constraints:
- BLE functionality requires Linux-based OS only (Raspbian, Ubuntu,
etc.)
- Windows and macOS are NOT supported for BLE operations
- Node.js versions: ^20, ^22, or ^24 required
- ES Modules: Project uses `"type": "module"`

**Development Workflow**: Step-by-step instructions for common tasks:
- Bootstrap and setup procedures
- Build, test, and lint validation cycles
- Adding new device support
- Working with both BLE and OpenAPI interfaces

**Manual Validation Scenarios**: Specific tests to run after making
changes:
```javascript
// Basic functionality validation
const { SwitchBotBLE, SwitchBotOpenAPI } = require('./dist/index.js');
const ble = new SwitchBotBLE(); // Should not throw
const api = new SwitchBotOpenAPI('test', 'test'); // Should not throw
```

**Timeout Warnings**: Explicit "NEVER CANCEL" warnings with timeout
recommendations for all build operations to prevent premature
cancellation of long-running commands.

The instructions include comprehensive information about:
- Source code organization (`src/switchbot-ble.ts`,
`src/switchbot-openapi.ts`, device classes)
- Configuration files (TypeScript, ESLint, package.json)
- Build output structure (`dist/` directory)
- Documentation generation (TypeDoc)

All instructions have been thoroughly validated by:
- Following step-by-step procedures from a clean environment
- Testing basic functionality scenarios
- Verifying ES module imports work correctly
- Confirming full development workflow chain
- Measuring actual timing for all operations

The instructions follow the required imperative tone ("Run [this
command]", "Do not do [this]") and provide exhaustive guidance for
GitHub Copilot agents to work effectively in this TypeScript Node.js
library for controlling SwitchBot devices via Bluetooth Low Energy and
OpenAPI.

Fixes #299.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Update Workflow

Co-Authored-By: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-Authored-By: donavanbecker <9875439+donavanbecker@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Set up Copilot instructions

3 participants