git clone https://github.com/kalpeshgamit/codebase-pilot
cd codebase-pilot
npm install --legacy-peer-deps# Run CLI in dev mode
npx tsx src/bin/codebase-pilot.ts init --dir /path/to/project
# Type check
npm run typecheck
# Run tests
npm test
# Build
npm run build- Zero cloud dependencies — everything runs locally
- Zero lock-in — eject must always work
- Language-agnostic — detection via file patterns, not hardcoded
- Monorepo-aware — all scanners check workspace packages
- Merge, don't overwrite — respect existing Claude Code config
- TypeScript strict mode
- ESM modules (type: "module")
- No
require()— useimporteverywhere - Node built-in imports use
node:prefix (node:fs,node:path) - Functions over classes where possible
- Early returns over nested conditionals
src/
bin/ # CLI entry point
cli/ # 7 commands: init, scan, fix, health, eject, pack, tokens
scanner/ # Project detection engine
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
index.ts # Public API
tests/
security/ # Secret detection tests
packer/ # Pack engine tests
compress/ # Compression tests
Edit src/scanner/framework.ts:
// Add to DETECTORS array (order matters — more specific first)
{ name: 'YourFramework', detect: (r) => hasDepIn(r, 'your-package') },Edit src/scanner/language.ts:
// Add to LANGUAGE_MAP
'.ext': 'LanguageName',Edit src/scanner/database.ts:
// Add to DETECTORS array
{
orm: 'YourORM',
type: 'auto',
detect: (r) => hasNodeDep(r, 'your-orm-package') ? 'auto' : null,
},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.
Follow conventional commits:
feat: add FastAPI framework detection
fix: monorepo scanner missing nested packages
docs: add contributing guide
test: add vitest tests for language detector