Thank you for your interest in contributing to CommitCompass! This document covers everything you need to get started.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Making Changes
- Testing
- Submitting a Pull Request
- Reporting Bugs
- Suggesting Features
- Style Guide
Be respectful and constructive. We follow the Contributor Covenant — harassment, discrimination, or hostile behavior will not be tolerated.
# Fork the repo on GitHub, then:
git clone https://github.com/<your-username>/commitsense.git
cd commitsense
npm install- Open the project in VS Code.
- Press
F5to launch the Extension Development Host — a new VS Code window opens with CommitCompass loaded. - Open any Git repository in the Extension Development Host to test features.
| Command | Description |
|---|---|
npm run lint |
Run ESLint |
npm run pretest |
Lint + compile checks before tests |
npm test |
Run the test suite |
Use the Run Extension launch config (.vscode/launch.json). Breakpoints set in extension.js will be hit in the Extension Development Host.
commitsense/
├── extension.js # All extension logic — activation, commands, providers
├── package.json # Extension manifest: commands, settings, activation events
├── test/
│ └── extension.test.js # Test suite
├── images/ # Extension icons and assets
├── .vscode/
│ ├── launch.json # Debug configuration
│ └── extensions.json # Recommended VS Code extensions for contributors
└── eslint.config.mjs # Linting rules
The entire extension lives in extension.js. Key areas:
activate()— entry point; registers all commands, providers, and event listeners.- Git data layer — three-tier fallback: VS Code git API → GitLens API → shell
gitcommands. - Copilot Chat participant —
@commitcompasswith/history,/blame, and/suggestslash commands. - LM Tools —
commitcompass_getFileHistoryandcommitcompass_getLineBlamefor agent use. - Providers —
CodeLensProvider, hover provider, inline blame decorator, status bar.
Branch off main using a descriptive name:
feat/add-codelens-option
fix/blame-fallback-null-crash
docs/update-readme-settings
Prefix with feat/, fix/, docs/, refactor/, or test/.
Follow Conventional Commits:
feat: add per-file blame cache to reduce git shell calls
fix: handle undefined repository in getFileHistory
docs: document includeDiff setting behaviour
test: add coverage for three-tier git fallback
Keep the subject line under 72 characters. Add a body when the why is non-obvious.
Tests live in test/extension.test.js and run inside a real VS Code instance via @vscode/test-cli.
npm testWhen adding a feature or fixing a bug, add a corresponding test. The extension relies on the VS Code API and shell git commands — prefer integration-style tests that exercise real code paths over heavy mocking.
- Ensure
npm run lintandnpm testpass locally. - Push your branch and open a PR against
main. - Fill in the PR description:
- What changed and why.
- Steps to manually verify the change.
- Screenshots or recordings for any UI changes.
- Keep PRs focused — one feature or fix per PR.
- A maintainer will review and may request changes before merging.
Open a GitHub Issue and include:
- VS Code version (
Help → About). - CommitCompass version.
- Whether GitLens is installed.
- Steps to reproduce.
- Expected vs. actual behaviour.
- Any relevant output from the Output panel (
View → Output → CommitCompass).
Open a GitHub Issue with the enhancement label. Describe:
- The problem you want to solve.
- Your proposed solution.
- Any alternatives you considered.
For large or architectural changes, open an issue for discussion before writing code.
- Language: JavaScript (ES2022). No TypeScript for now.
- Linting: ESLint rules defined in
eslint.config.mjs. Runnpm run lintbefore committing — the CI will fail if there are lint errors. - Formatting: 4-space indentation, single quotes, semicolons — match the existing code style.
- Comments: Only where the why is non-obvious. Don't narrate what the code clearly does.
- No new runtime dependencies without prior discussion in an issue.