Thanks for your interest in contributing to Diff Hound! This document covers the conventions and workflow you need to follow.
git clone https://github.com/runtimebug/diff-hound.git
cd diff-hound
npm install
npm run buildThe fastest way to test changes is local diff mode — no GitHub token needed:
# Review your changes against main
npm run dev -- --local --base main
# Review a patch file
npm run dev -- --patch changes.patchYou'll need an OPENAI_API_KEY in your .env (or another configured provider) for the LLM call.
| Branch | Purpose |
|---|---|
main |
Stable release branch. Never commit directly to main. |
feat/<short-name> |
New features (e.g., feat/anthropic-adapter) |
fix/<short-name> |
Bug fixes (e.g., fix/diff-parser-hunk-offset) |
docs/<short-name> |
Documentation changes |
refactor/<short-name> |
Code refactoring with no behavior change |
chore/<short-name> |
Tooling, CI, dependencies, config |
Always branch off main:
git checkout main
git pull origin main
git checkout -b feat/my-featureWe follow Angular Commit Message Conventions. Every commit message must match this format:
<type>(<scope>): <subject>
[optional body]
[optional footer]
| Type | When to Use |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation only |
style |
Formatting, missing semicolons, etc. (no logic change) |
refactor |
Code change that neither fixes a bug nor adds a feature |
perf |
Performance improvement |
test |
Adding or updating tests |
chore |
Build process, CI, tooling, dependencies |
ci |
CI/CD configuration changes |
revert |
Reverting a previous commit |
The scope is the module affected. Common scopes:
cli— CLI flags and argument parsingconfig— Configuration loading and validationplatforms— Platform adapters (github, local, gitlab)models— LLM model adapters (openai, anthropic, ollama)core— Diff parsing, deduplication, token budgettypes— Shared type definitionsdeps— Dependency updates
feat(models): add Anthropic Claude adapter
fix(platforms): handle renamed files in local diff parser
docs(readme): add local diff mode usage examples
chore(deps): bump openai from 4.10.0 to 4.20.0
refactor(models): extract shared prompt logic into base class
If your change is breaking, add BREAKING CHANGE: in the commit footer:
feat(types)!: replace severity global config with minSeverity
BREAKING CHANGE: The `severity` field in ReviewConfig is now `minSeverity`.
Per-comment severity is assigned by the LLM.
One PR = one logical change. Don't bundle unrelated changes.
All PRs are squash-merged into main. This means your PR becomes a single commit on main, so:
- You don't need to obsess over individual commit messages during development
- The PR title becomes the final commit message — make sure it follows the Angular convention
- The PR description becomes the commit body
Example PR title: feat(platforms): add GitLab platform adapter
Use this template:
## Summary
Brief description of what this PR does and why.
## Changes
- Bullet list of specific changes
## How to Test
Steps to verify the change works:
1. ...
2. ...- Code compiles:
npm run build - Linter passes:
npm run lint - Changes tested locally with
--localmode where applicable - PR title follows Angular commit convention
- No secrets, API keys, or
.envfiles included
- All PRs require at least one approval before merging
- Maintainers may request changes — address feedback in additional commits (they'll be squashed)
- Once approved, a maintainer will squash-merge your PR
- Create
src/platforms/<name>.tsimplementingCodeReviewPlatform - Add the platform name to the
Platformtype insrc/types/index.ts - Add the case to the factory in
src/platforms/index.ts - Add to the valid platforms list in
src/config/index.ts
- Create
src/models/<name>.tsimplementingCodeReviewModel - Add the provider name to the
Providertype insrc/types/index.ts - Add the case to the factory in
src/models/index.ts - Add to the valid providers list in
src/config/index.ts
- TypeScript strict mode is enabled — no
anyunless absolutely necessary - Use
constoverletwhere possible - Error messages should be clear and actionable
- No external dependencies unless they provide significant value — prefer Node.js built-ins
- Follow existing patterns in the codebase (factory methods, adapter interfaces)
By contributing, you agree that your contributions will be licensed under the MIT License.