Thank you for your interest in contributing to opencode-test! This document provides guidelines for contributing to the project.
- Node.js >= 16.0.0
- npm >= 7.0.0
- Git
-
Clone the repository:
git clone https://github.com/anthropics/opencode-test.git cd opencode-test -
Install dependencies:
npm install
-
Run tests:
npm test npm run test:coverage -
Run linting:
npm run lint npm run lint:fix
-
Test CLI locally:
npm pack npm install -g ./opencode-test-*.tgz opencode-test --version
- ESLint: Code must pass ESLint checks
- Jest: All tests must pass with >= 80% coverage
- Code Style: Follow existing code patterns and conventions
- Unit Tests: All new functions must have unit tests
- Integration Tests: CLI commands must have integration tests
- Coverage: Maintain >= 80% test coverage
- Cross-Platform: Tests must pass on macOS and Linux
The following checks run automatically before each commit:
- ESLint validation
- Jest test suite
- Coverage threshold validation
We follow Semantic Versioning (SemVer):
- PATCH (1.0.1): Bug fixes and minor improvements
- MINOR (1.1.0): New features that are backward compatible
- MAJOR (2.0.0): Breaking changes
# Patch release (bug fixes)
npm run release:patch
# Minor release (new features)
npm run release:minor
# Major release (breaking changes)
npm run release:major-
Create a tag: Push a tag in format
v1.2.3git tag v1.2.3 git push origin v1.2.3
-
GitHub Actions: Automatically runs:
- Full test suite across Node.js versions 16, 18, 20
- Cross-platform testing (Ubuntu, Windows, macOS)
- Security audit
- CLI functionality verification
- NPM package publishing
- GitHub release creation
-
Manual Verification: After release:
npm install -g opencode-test@latest opencode-test --version opencode-test --help
-
Run all checks locally:
npm run ci
-
Update tests: Add/update tests for any new functionality
-
Update documentation: Update README.md and command files as needed
-
Check dependencies: Ensure no unnecessary dependencies are added
- Descriptive title: Clearly describe what the PR does
- Detailed description: Explain the changes and why they're needed
- Tests included: All new code must be tested
- Documentation updated: Update docs for user-facing changes
- Breaking changes: Clearly mark any breaking changes
- Fork and branch: Create a feature branch from
master - Make changes: Implement your changes with tests
- Test thoroughly: Run the full test suite
- Submit PR: Create a pull request to
masterbranch - Code review: Address feedback from maintainers
- Merge: PR will be merged after approval and CI passes
On every push and PR:
- Multi-platform testing: Ubuntu, macOS
- Multi-version testing: Node.js 16.x, 18.x, 20.x
- Code quality checks: Linting, testing, coverage
- Security audit: npm audit for vulnerabilities
- CLI testing: Verify CLI installation and basic functionality
On tagged releases:
- Pre-publish validation: Full test suite and linting
- NPM publishing: Automatic publication to npm registry
- GitHub releases: Automatic release notes generation
- Documentation updates: Auto-generated changelog
Dependabot integration:
- Weekly dependency updates: Automated PR creation
- Security updates: Immediate PRs for security vulnerabilities
- Auto-merge: Patch and minor updates auto-merged after tests pass
Please include:
- Node.js version:
node --version - npm version:
npm --version - Operating system: macOS/Linux
- opencode-test version:
opencode-test --version - Error message: Full error output
- Steps to reproduce: Clear reproduction steps
- Expected behavior: What should happen
- Actual behavior: What actually happens
Please include:
- Use case: Why is this feature needed?
- Proposed solution: How should it work?
- Alternatives considered: Other approaches you've considered
- Additional context: Any other relevant information
This project follows the Contributor Covenant Code of Conduct. Please be respectful and professional in all interactions.
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and general discussion
- Documentation: Check README.md and command documentation first
By contributing to opencode-test, you agree that your contributions will be licensed under the MIT License.