Thanks for your interest in contributing!
-
Clone the repository:
git clone https://github.com/athal7/opencode-devcontainers.git cd opencode-devcontainers -
Install dependencies:
npm install
-
Install the devcontainer CLI (required for devcontainer operations):
npm install -g @devcontainers/cli
-
Set up the plugin for local testing:
# Link plugin to OpenCode plugins directory mkdir -p ~/.config/opencode/plugins ln -sf "$(pwd)/plugin" ~/.config/opencode/plugins/opencode-devcontainers # Add to opencode.json # "plugin": ["/path/to/opencode-devcontainers/plugin"]
Run the full test suite:
npm testRun tests in watch mode:
npm run test:watchopencode-devcontainers/
├── plugin/
│ ├── index.js # Plugin entry point (tools + bash interception)
│ ├── helpers.js # Utility functions
│ ├── command/
│ │ ├── devcontainer.md # /devcontainer command definition
│ │ ├── worktree.md # /worktree command definition
│ │ └── workspaces.md # /workspaces command definition
│ └── core/ # Core modules
│ ├── index.js # Public API exports
│ ├── clones.js # Clone management
│ ├── config.js # Override config generation
│ ├── devcontainer.js # Devcontainer CLI operations
│ ├── git.js # Git operations (clone, worktree, etc.)
│ ├── jobs.js # Background job tracking
│ ├── paths.js # Path constants and migration
│ ├── ports.js # Port allocation
│ ├── worktree.js # Worktree workspace management
│ └── workspaces.js # Unified workspace listing/cleanup
├── skill/
│ └── ocdc/
│ └── SKILL.md # Agent skill documentation
└── test/
└── unit/ # Unit tests
Tests use Node.js built-in test runner. Example:
import { describe, test, beforeEach, afterEach } from 'node:test'
import assert from 'node:assert'
describe('myFeature', () => {
beforeEach(() => {
// Setup
})
afterEach(() => {
// Cleanup
})
test('does something', () => {
assert.strictEqual(actual, expected)
})
})- Use ES modules (
import/export) - Use async/await for async operations
- Handle errors explicitly
- Add JSDoc comments for public functions
- Create a feature branch:
git checkout -b my-feature - Make your changes
- Run tests:
npm test - Commit with conventional commit message:
feat:for new featuresfix:for bug fixesdocs:for documentationrefactor:for refactoringtest:for testschore:for maintenance
- Push and open a pull request
Releases are automated via semantic-release:
- Merge PR to main
- CI analyzes commit messages and determines version bump
- Publishes to npm automatically
- Creates GitHub release
No manual version bumping needed - just use conventional commits!