Local-first repository context for AI tools — no hallucinations.
Hybrid search (BM25 + vector), code analysis, and GitHub integration through MCP. Powered by Antfly for search and embeddings. Everything runs on your machine. No data leaves.
- pnpm for everything. Never npm or yarn.
- Node.js >= 22 (LTS).
packages/
core/ # Scanner (ts-morph, tree-sitter for Python/Go/Rust), vector storage (Antfly), services
cli/ # Commander.js CLI — dev index, dev search, dev refs, dev map, dev mcp install
mcp-server/ # MCP server with 5 built-in adapters
subagents/ # Coordinator, explorer, planner, PR agents
integrations/ # Claude Code, VS Code, Cursor
logger/ # @prosdevlab/kero — centralized logging
types/ # Shared TypeScript types
dev-agent/ # Root package (CLI entry point)
Turborepo handles this, but know the chain:
@prosdevlab/kero(no deps)@prosdevlab/dev-agent-core(depends on logger)@prosdevlab/dev-agent-cli(depends on core)@prosdevlab/dev-agent-subagents(depends on core)@prosdevlab/dev-agent-mcp(depends on core, subagents)@prosdevlab/dev-agent-integrations(depends on multiple)
Critical: pnpm build before pnpm typecheck — TypeScript needs .d.ts files.
pnpm install # Install deps
pnpm build # Build all packages
pnpm test # Run tests from root (NOT turbo test)
pnpm typecheck # Type check (AFTER build)
pnpm lint # Biome lint
pnpm format # Biome format
pnpm dev # Watch mode
pnpm clean # Clean build outputs
pnpm changeset # Document changes for release
dev setup # One-time: start Antfly search backend- Biome for linting and formatting. No ESLint.
- Conventional commits enforced by Commitlint + Husky.
- Workspace protocol for internal deps:
"@prosdevlab/dev-agent-core": "workspace:*" - Tests run from root only:
pnpm test— centralized Vitest config. - Logger: Use
@prosdevlab/kero— neverconsole.login packages. - Local-first: No data sent externally. Embeddings via Antfly/Termite (local ONNX).
- Code review before PR. Always run the
code-revieweragent (which launches security-reviewer, logic-reviewer, and quality-reviewer in parallel) on the branch diff before creating a pull request. Address any CRITICAL or WARNING findings before merging. - Plan before building. For non-trivial features, write a plan in
.claude/da-plans/and run theplan-revieweragent before implementation. - Changesets target published packages only. Only
@prosdevlab/dev-agentand@prosdevlab/keroare published to npm. All other packages are private and bundled into dev-agent via tsup. Never add private packages to changesets. - Changesets include doc site updates. When adding a changeset, also:
- Add a release entry to
website/content/updates/index.mdx - Update
website/content/latest-version.tsto match the new version
- Add a release entry to
code-reviewer — orchestrates 3 reviewers in parallel before PRs
security-reviewer — command injection, secrets, MCP security, supply chain
logic-reviewer — correctness, race conditions, cross-package data flow
quality-reviewer — tests, conventions, readability (caps at 5 suggestions)
quick-scout — fast "where is X?" codebase explorer (haiku)
bug-investigator — systematic root cause analysis + fix + regression test
pr-composer — validation suite + PR description composer
plan-reviewer — two-pass plan review (engineer + SDET)
research-planner — investigation planning before implementation
Agents dogfood the dev-agent MCP tools. ★ = high impact, ● = useful.
┌───────────────────┬────────────┬──────────┬─────────┬──────────────┐
│ Agent │ dev_search │ dev_refs │ dev_map │ dev_patterns │
├───────────────────┼────────────┼──────────┼─────────┼──────────────┤
│ bug-investigator │ ★ │ ★ │ ● │ │
│ quick-scout │ ★ │ ★ │ ● │ │
│ research-planner │ ★ │ ● │ ★ │ ★ │
│ logic-reviewer │ ● │ ★ │ │ ● │
│ security-reviewer │ ★ │ ★ │ │ ★ │
│ quality-reviewer │ ● │ │ │ ★ │
│ plan-reviewer │ │ ★ │ ★ │ ● │
│ pr-composer │ │ │ ● │ │
│ code-reviewer* │ │ │ │ │
└───────────────────┴────────────┴──────────┴─────────┴──────────────┘
* code-reviewer is an orchestrator — it delegates to security/logic/quality reviewers.
Phase-based planning docs written before implementation. Organized by package track.
- Small phases (1-2 commits): single
.mdfile - Large phases (3+ commits): folder with
overview.md+ numbered parts - Max 400 lines per part, 500 for overview
- Each plan: context, architecture, decisions, risks, test strategy, verification
See .claude/da-plans/README.md for status and format details.
Before you Grep or Read, ask: can an MCP tool answer this without reading files?
MCP tools return pre-ranked snippets. Every Grep → Read cycle burns ~3,000-5,000 tokens of context window on irrelevant matches. MCP tools return only what you need.
| Instead of | Use | Tokens saved |
|---|---|---|
| Grep "auth" → read 10 files | dev_search "authentication" |
~5,000 |
| Grep function name → read callers | dev_refs "functionName" |
~3,000 |
| ls + glob + read READMEs | dev_map |
~2,000 |
| Read multiple files to compare patterns | dev_patterns filePath |
~3,000 |
Only use Grep for exact string matches where you know the literal text. Only Read files when you need the full implementation.
| Tool | Purpose |
|---|---|
dev_search |
Hybrid code search — BM25 + vector + RRF (use FIRST for conceptual queries) |
dev_refs |
Find callers/callees of functions. dependsOn traces the dependency chain between files. |
dev_map |
Codebase structure with PageRank hot paths and connected subsystems |
dev_patterns |
File pattern analysis (similar code, error handling, types). Takes filePath, not query. |
dev_status |
Repository indexing status + Antfly stats + health checks (section="health") |
Graph caching: dev index builds a dependency graph (dependency-graph.json) saved alongside the index.
dev_map and dev_refs load the cached graph instead of fetching all docs — scales to 50k+ docs.
File watcher incrementally updates the graph on save.
- Create in
packages/mcp-server/src/adapters/built-in/ - Extend
ToolAdapter, implementgetToolDefinition()+execute() - Add tests in
__tests__/ - Register in
bin/dev-agent-mcp.ts - Export from
built-in/index.ts
See
WORKFLOW.mdfor branch naming, commit format, PR process, and testing standards.
# Common workflows
pnpm install && pnpm build && pnpm test # Full setup
dev setup # One-time: start Antfly
dev index # Index repository
dev mcp install # Install for Claude Code
dev mcp install --cursor # Install for Cursor
# CLI tools (no MCP server needed)
dev search "authentication" # Semantic code search
dev refs "functionName" # Find callers/callees
dev refs "fn" --depends-on "src/db.ts" # Trace dependency chain
dev map # Codebase structure overview
dev map --focus packages/core --depth 3 # Focused maptype(scope): description
feat(mcp): add health check adapter
fix(core): resolve vector search timeout
docs: update CLAUDE.md
chore: update dependencies
Types: feat, fix, docs, style, refactor, perf, test, chore, ci