Appearance
Thank you for contributing to Opilot!
Before You Start
- Search existing issues to see if your bug or feature is already tracked.
- For significant changes, open an issue first to discuss the approach.
- Fork the repository and clone your fork.
Branch Naming
All work happens on feature branches:
<type>/<issue-number>-<short-description>Examples:
feat/42-vision-support
fix/87-connection-timeout
docs/50-api-reference
refactor/99-provider-cleanupSupported types: feat, fix, docs, refactor, test, chore, ci.
Development Loop
bash
# 1. Create a branch
git checkout -b feat/42-my-feature
# 2. Install dependencies (first time)
pnpm install
# 3. Start watch mode for fast iteration
task watch
# 4. Open Extension Development Host
# Press F5 in VS Code
# 5. Make your changes
# 6. Run tests
task unit-tests
# 7. Run pre-commit checks before staging
task precommit
# 8. Commit
git add -p
git commit -m "feat: add my feature"Code Style
The project uses oxlint for linting and oxfmt for formatting.
Run both:
bash
task lint-fix # auto-fix lint issues
task check-formatting # verify formattingFormatting is enforced on commit via Husky + lint-staged.
Key conventions:
- TypeScript only —
neveruseany - No hardcoded shell strings for process invocation — always use argument arrays
- Secrets go in VS Code
SecretStorage, never in settings or state - Use
reportError(logger, error, { showToUser })fromerrorHandler.tsfor error handling - Use
DiagnosticsLoggerfromdiagnostics.tsfor all logging (noconsole.log)
Test-Driven Development
Write tests before code. The coverage target is 85% or higher.
bash
task unit-tests # run tests
task unit-test-coverage # run with coverage reportTests live alongside source files as *.test.ts. The VS Code API is mocked via src/test/vscode.mock.ts.
See Testing for full details.
Commit Messages
Follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer: Closes #<issue>]Examples:
feat(completions): add FIM prompt format support
fix(sidebar): normalize Content-Type header before parsing
test(provider): add tool invocation error recovery tests
docs: add inline completions guideTypes: feat, fix, docs, style, refactor, test, chore, ci, perf.
Pull Requests
- Push your branch and open a PR against
main - Fill out the PR template
- Ensure all CI checks pass:
- Type check (
task check-types) - Lint (
task lint) - Unit tests (
task unit-tests) - Extension tests (
task extension-tests)
- Type check (
- Request a review
- Squash merge after approval
What Makes a Good PR
- Focused: one feature or fix per PR
- Tested: new behavior covered by unit tests
- Clean:
task precommitpasses with no warnings - Described: the PR body explains why, not just what
- Small: prefer multiple smaller PRs over one large one
Reporting Bugs
Include:
- OS and VS Code version
- Extension version
- Ollama version (
ollama --version) - Steps to reproduce
- Expected vs. actual behavior
- Relevant output from Opilot output channel (with
ollama.diagnostics.logLevel: "debug")
Feature Requests
Open an issue with the enhancement label. Describe:
- The use case (what you want to do, not just what to build)
- Why existing functionality doesn't cover it
- Any API/implementation ideas you have
