Thank you for your interest in contributing to ContextShare! This document provides guidelines and instructions for contributing to the project.
- Node.js: Version 18+ with npm
- Visual Studio Code: Version 1.90.0 or later
- TypeScript: Version 5.4+
- Git: For version control
-
Fork and Clone
git clone https://github.com/your-username/vscode-contextshare.git cd vscode-contextshare -
Install Dependencies
npm install
-
Build the Extension
npm run build
-
Run Tests
npm test
We follow a Test-Driven Development (TDD) approach and adhere to strict quality gates:
- REPRO (for bugs): Reproduce the issue manually
- RED: Write a failing test first that demonstrates the problem
- GREEN: Implement the minimal code to make the test pass
- REFACTOR: Clean up the implementation while keeping tests green
- Update
package.jsonversion following Semantic Versioning - Keep
vsix/extension.vsixmanifestversion synchronized - Update
CHANGELOG.mdwith user-visible changes - Place new changelog entries at the TOP (newest first)
Before any pull request:
# 1. Clean build (must succeed)
rm -rf dist/
npm run build
# 2. Run all tests (must pass)
npm test
# 3. Check TypeScript compilation
npx tsc --noEmit
# 4. Package extension (Windows only)
pwsh ./build_vsix.ps1- Use strict TypeScript configuration
- Prefer explicit types over
any - Follow existing code style and patterns
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Every bug fix must include a new test that would fail without the fix
- Every new feature must have corresponding test coverage
- Tests should be fast, deterministic, and independent
- Avoid network calls in tests (use mocks when needed)
| Type | Location | Purpose |
|---|---|---|
| Unit Tests | test/*.test.ts |
Fast, isolated logic testing |
| Integration Tests | test/integration/ |
Component interaction testing |
| E2E Tests | test/e2e/ |
Full workflow testing |
We welcome various types of contributions:
- Search existing issues to avoid duplicates
- Reproduce the bug and create a minimal test case
- Write a failing test that demonstrates the issue
- Implement the fix to make the test pass
- Update documentation if behavior changes
- Discuss the feature by opening an issue first
- Design the API and get feedback from maintainers
- Write tests for the expected behavior
- Implement the feature incrementally
- Update documentation and examples
- Improve README and setup guides
- Add code examples and usage patterns
- Update API documentation for new features
- Fix typos and improve clarity
- Increase test coverage for existing code
- Add edge case tests that weren't previously covered
- Improve test reliability and reduce flakiness
- Add performance tests for critical paths
Use descriptive branch names:
feature/add-remote-catalog-supportbugfix/fix-resource-activation-racedocs/improve-setup-guidetest/add-hat-service-coverage
Follow Conventional Commits:
feat: add support for remote catalog URLs
fix: resolve race condition in resource activation
docs: update installation instructions
test: add coverage for MCP server merging
When opening a PR, include:
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix (non-breaking change fixing an issue)
- [ ] New feature (non-breaking change adding functionality)
- [ ] Breaking change (fix or feature causing existing functionality to change)
- [ ] Documentation update
## Testing
- [ ] Added/updated tests for changes
- [ ] All tests pass locally
- [ ] Manual testing completed
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] Version bumped appropriately
- [ ] CHANGELOG.md updated- Automated checks must pass (CI/CD pipeline)
- At least one approval required from maintainers
- Address review feedback promptly
- Squash commits before merging (if requested)
Use our bug report template:
**Bug Description**
Clear description of the bug
**Steps to Reproduce**
1. Go to '...'
2. Click on '...'
3. See error
**Expected Behavior**
What should happen
**Screenshots**
If applicable
**Environment**
- OS: [e.g., Windows 11]
- VS Code Version: [e.g., 1.90.0]
- Extension Version: [e.g., 0.1.33]**Feature Description**
Clear description of the desired feature
**Use Case**
Why is this feature needed?
**Proposed Solution**
How should it work?
**Alternatives Considered**
Other approaches you've thought about- Never commit sensitive information (API keys, passwords, etc.)
- Report security vulnerabilities privately via SECURITY.md
- Follow secure coding practices and validate all inputs
- Use dependency scanning to avoid vulnerable packages
This project follows the Microsoft Open Source 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 existing docs before asking questions
Contributors will be recognized in:
- Release notes for their contributions
- GitHub contributors page
- Special thanks for significant contributions
Thank you for helping make ContextShare better! 🚀