Thanks for your interest in contributing! This guide will help you get started.
git clone https://github.com/codebase-pilot/codebase-pilot.git
cd codebase-pilot
npm install
npm run buildsrc/
bin/ # CLI entry point
cli/ # 7 commands: init, scan, fix, health, eject, pack, tokens
scanner/ # Project detection (delegates to registry)
registry/ # Data-driven language/framework/ORM/test detection
agents/ # Agent generator (scan → agents.json)
generators/ # File generators (CLAUDE.md, .claudeignore, etc.)
packer/ # Codebase packing engine (collector, formatters, token counter)
security/ # Secret detection (152 patterns, 15 categories)
compress/ # Code compression (Tier A regex, Tier B tree-sitter)
types.ts # All interfaces
utils.ts # Cross-platform utilities
index.ts # Public API
tests/
security/ # Secret detection tests
packer/ # Pack engine tests
compress/ # Compression tests
npm test # Run all tests
npm run test:watch # Watch mode
npm run typecheck # TypeScript type checking
npm run build # Build with tsupAdd an entry to src/registry/languages.ts:
{
name: 'MyLang',
extensions: ['.ml'],
tier: 2, // 1=full ecosystem, 2=pkg+test, 3=extension only
skipDirs: ['build'],
entryPoints: ['src/main.ml'],
packageFiles: ['manifest.toml'],
}Add a detector to src/registry/frameworks.ts:
{
name: 'MyFramework',
language: 'MyLang',
category: 'backend',
detect: (root) => fileContains(join(root, 'manifest.toml'), 'myframework'),
}Same pattern for test runners (src/registry/testing.ts) and ORMs (src/registry/databases.ts).
Edit src/security/patterns.ts and add to the appropriate category:
// In src/security/patterns.ts, add to the appropriate category:
{ name: 'MyService API Key', category: 'cloud', regex: /myservice_[A-Za-z0-9]{32,}/ },Then add a test case in tests/security/ to verify the pattern matches real-world examples and does not produce false positives.
- ESM modules only (
import, neverrequire) - Node built-in imports use
node:prefix - Functions over classes
- Use
toPosix()fromsrc/utils.tsfor config paths - Use
path.join()for filesystem operations
- Fork the repository
- Create a feature branch (
git checkout -b feat/my-feature) - Write tests for new functionality
- Ensure all tests pass (
npm test) - Ensure TypeScript compiles (
npm run typecheck) - Submit a pull request
- Zero cloud — no API calls, no accounts, no telemetry
- Zero lock-in — eject must always work
- Cross-platform — Linux, macOS, Windows
- Data-driven — add languages/frameworks via registry, not code changes