Thank you for considering contributing to dev-agent! This document outlines the process for contributing and the standards we follow.
- Testability First - If it's hard to test, refactor it
- Modularity - Small, focused, reusable modules
- 100% Coverage on Utilities - Pure functions should be fully tested
- Atomic Commits - Each commit should build and test independently
- Fork and clone the repository
- Install dependencies:
pnpm install - Create a branch:
git checkout -b feature/my-feature - Make your changes
- Test your changes:
pnpm test - Ensure code quality:
pnpm lint && pnpm typecheck
We follow Conventional Commits for commit messages. This is enforced using commitlint.
Format: type(scope): subject
Types:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Changes that don't affect code meaning (formatting, etc.)refactor: Code changes that neither fix bugs nor add featuresperf: Performance improvementstest: Adding or fixing testschore: Changes to build process or auxiliary tools
Example:
feat(core): add new API method for authentication
- Update the README.md if needed with details of changes to the interface.
- Add a changeset to document your changes:
pnpm changeset - Create a pull request to the
mainbranch. - The PR will be reviewed and merged if it meets our standards.
- Create a new directory in the
packagesfolder. - Create a
package.json,tsconfig.json, and source files. - Add the package to relevant workspace configurations.
- Update path mappings in the root
tsconfig.json.
📖 Read First: TESTABILITY.md
Our comprehensive testability guide covers:
- When and how to extract utilities
- Organization patterns
- Coverage targets
- Real-world examples
-
Extract Pure Functions to
utils/modules- ✅ DO:
utils/formatting.tswithformatDocument(doc: Document) - ❌ DON'T: Private methods in 500-line classes
- ✅ DO:
-
Aim for 100% on Utilities
- Pure functions are easy to test
- No mocks needed
- Foundation for everything else
-
No Non-Null Assertions (
!)- Use guard clauses or optional chaining
- Makes code safer and more testable
-
Organize by Domain
- ✅
utils/strings.ts,utils/dates.ts,utils/validation.ts - ❌
utils.ts(500 lines of everything)
- ✅
| Code Type | Target | Example |
|---|---|---|
| Pure Utilities | 100% | formatDocument(), calculateCoverage() |
| Integration | >80% | RepositoryIndexer, ExplorerAgent |
| CLI/UI | >60% | Command handlers, spinners |
# Run tests with coverage
pnpm vitest run --coverage
# Check specific package
pnpm vitest run packages/core/src/indexer --coverage- Write tests for all new features and bug fixes
- Run existing tests to ensure your changes don't break existing functionality
- See TESTABILITY.md for detailed guidelines
We use Biome for linting and formatting:
- Run
pnpm lintto check code quality. - Run
pnpm formatto format the code.
All code must pass linting and typechecking before being merged.
We use Changesets to manage versions and generate changelogs.
After making changes:
- Run
pnpm changeset - Follow the prompts to describe your changes
- Commit the generated changeset file
If you have any questions, please open an issue or discussion in the repository.