Contributing
Development setup
git clone https://github.com/giolabs/ai-code-reviewer.git
cd ai-code-reviewer
npm installCopy the example env file and add your API key:
cp .env.example .env
# edit .env and add OPENAI_API_KEY=sk-...Run commands directly from source (no build step needed):
npm run dev -- review-file src/cli.ts
npm run dev -- review-diff --stagedBuild
npm run build # tsc → dist/
npm run clean # rm -rf distTests
npm test # vitest run (single pass)
npm run test:watch # vitest watch modeTests live in __test__/, mirroring the structure of src/. See the Design page for architecture context.
Code conventions
All code is in English without exception: class names, method names, variable names, interfaces, file names. The only content in Spanish is user-facing CLI output and the README.
Key TypeScript rules enforced in this project:
- No
anyorunknownas types — model the shape explicitly - No standalone functions at module scope — all logic lives in a class
- No separate positional parameters — all params grouped in a typed interface
- Explicit return types on all class methods
async/awaitover.then()chains
See CLAUDE.md at the repo root for the full TypeScript coding standards.
Adding a provider
Providers are implemented in src/openai.ts (despite the name, it handles all providers). To add a new provider:
- Add the provider name to the
Providerunion type insrc/types.ts - Add a case to the provider switch in
src/openai.ts - Add the API key env var name to
PROVIDER_ENV_VAR_MAP - Add a row to the Providers docs page
- Add test coverage in
__test__/openai.test.ts
Adding a tech stack template
Templates are Markdown files in templates/. To add a new stack:
- Create
templates/<stack>-rules.mdwith review rules for the stack - Add the stack to the
TechStackenum insrc/types.ts - Add detection logic to
src/tech-detect.ts(before the generic fallback) - Add the config value to the
tech:field documentation - Add a section to the Tech Stacks docs page
Submitting a PR
- Fork and clone the repo
- Create a branch:
feat/<short-description>orfix/<short-description> - Make your changes with tests
- Run
npm testandnpm run build— both must pass - Open a PR targeting
develop
The reviewer will run on your PR automatically. Address any critical or major findings before requesting review.
Reporting issues
Open an issue at github.com/giolabs/ai-code-reviewer/issues (opens in a new tab).
Include:
- Exact command or workflow step
- Your
.ai-review.yml(redact API keys) - The full error output (with
DEBUG=1if applicable) - Node.js version (
node --version)