Thanks for your interest in contributing to @jamaalbuilds/ai-toolkit.
git clone https://github.com/danilobatson/ai-toolkit.git
cd ai-toolkit
yarn installRequirements: Node.js >= 20, Yarn 1.x
yarn test # run all tests
yarn build # compile TypeScript
yarn lint # biome check
yarn typecheck # tsc --noEmit
yarn verify # all of the above in sequence
yarn semantic-checks # run semantic verification- Adapter pattern — wrap all third-party libraries behind toolkit interfaces
- No
anyin public API — useunknown+ type guards - No raw
throw new Error()— useToolkitErrorwith context - No hardcoded provider URLs — use
config.getProviderUrl() - No
process.exit()in library code - Pin exact dependency versions — no
^ranges
- JSDoc with
@exampleblock - Input validation (Zod schema or type guard)
- Error handling (catch and wrap in
ToolkitError)
Tests use a tiered framework:
- CRASH — doesn't throw on valid input
- BEHAVIOR — correct output on happy path
- DATA QUALITY — output types and values correct
- ENVIRONMENT — invalid/missing/null inputs handled
- PATTERN — matches conventions across modules
- CONTRACT — API contract honored
- PROVIDER FALLBACK — graceful degradation
- CLEANUP — resources released properly
Additional rules:
toThrow()must use regex, never exact string matchvi.useFakeTimers()must be paired withtry/finally- Zero external API calls in tests — use mock providers
- Implementation and tests always in the same commit
packages/toolkit/src/[module]/
index.ts # public exports
[feature].ts # implementation
types.ts # type definitions
adapters/[provider].ts # provider adapters
__tests__/[feature].test.ts # tests
Use Conventional Commits:
feat(module): add new feature
fix(module): fix specific bug
chore(deps): update dependency
docs(module): update documentation
test(module): add missing tests
One concern per commit. Tests ship with their implementation.
- Create a feature branch from
main - Implement with tests (same commit)
- Ensure all checks pass:
yarn test && yarn typecheck && yarn lint - Open a PR using the provided template
- Fill out the checklist completely
If you're using Claude Code to contribute, the following skills are available:
| Skill | Purpose |
|---|---|
/preflight |
Run at session start — checks repo state |
/writer |
Implement a module or feature end-to-end |
/discovery |
Deep exploration before building |
/spike |
Research a library before committing |
/semantic-checks |
Run pattern-based verification |
/report |
Generate session report |
/session-state |
Update session state for continuity |
Always run /preflight first. Always run /report last.