Thanks for your interest in contributing!
-
Clone the repository:
git clone https://github.com/athal7/opencode-pilot.git cd opencode-pilot -
Install dependencies:
npm install
npm test # Unit tests
npm run test:integration # Integration tests
npm run test:all # All testsTests use the Node.js built-in test runner (node:test) with node:assert.
Tests live in test/unit/ and test/integration/. Each test file follows this pattern:
import { test, describe } from 'node:test';
import assert from 'node:assert';
describe('myModule', () => {
test('does the thing', () => {
assert.strictEqual(actual, expected);
});
});- Use ES modules (
import/export) - Use
async/awaitfor async operations - Log with
[opencode-pilot]prefix - Handle errors gracefully (log, don't crash OpenCode)
- No external dependencies beyond what's in
package.json
plugin/
└── index.js # OpenCode plugin entry point (auto-starts daemon)
service/
├── server.js # HTTP server and polling orchestration
├── poll-service.js # Polling lifecycle management
├── poller.js # MCP tool polling
├── actions.js # Session creation and template expansion
├── readiness.js # Evaluate item readiness (labels, deps, priority)
├── worktree.js # Git worktree management
├── repo-config.js # Repository discovery and config
├── logger.js # Debug logging
├── utils.js # Shared utilities
├── version.js # Package version detection
└── presets/
├── index.js # Preset loader
├── github.yaml # GitHub source presets
└── linear.yaml # Linear source presets
- Create a feature branch:
git checkout -b my-feature - Make your changes
- Run tests:
npm test - Commit with a clear message following conventional commits:
feat(#1): add idle notificationsfix(#3): handle network timeout
- Push and open a pull request
Releases are automated via semantic-release on merge to main. The CI pipeline will:
- Run tests
- Determine the next version from commit messages
- Publish to npm
- Commit version bump (
package.json,package-lock.json) back to the repo - Create a GitHub release
- Update the Homebrew formula