Codebase Intelligence, Architecture Guardrails & AI Context Engineering for VS Code.
Understand the codebase before the AI changes it โข Zero-Cloud by Default โข AST & Graph First
English โข ะ ัััะบะธะน โข ็ฎไฝไธญๆ โข ๆฅๆฌ่ช โข Portuguรชs โข Espaรฑol โข ํ๊ตญ์ด โข Deutsch โข Franรงais โข ะฃะบัะฐัะฝััะบะฐ
In modern AI-assisted development ("vibe coding"), LLM agents quickly generate code, but also introduce hidden architecture rot, duplicate utilities, broken type references, and hallucinated context.
ProjectBrain transforms chaotic AI-generated codebases into a structured, verifiable workspace. It is not another autonomous code generator โ it is your codebase's Observer, Analyzer, Guard, and Context Builder.
- ๐ Dead Code & Zombie Symbol Hunter: Recursively analyzes call trees and incoming reference graphs to identify dead files, unused exports, zombie functions, and orphaned API routes.
- ๐ฅ Semantic & Structural Duplicate Detection: 4-tier comparison (Exact AST โ Control Flow Graph โ Normalized Syntax โ Local Vector/LLM Reasoning) prevents AI agents from reinventing existing functions.
- ๐บ๏ธ Full Architecture Flow Discovery: Automatically traces end-to-end pathways:
$$\text{Route} \longrightarrow \text{Handler} \longrightarrow \text{Service} \longrightarrow \text{Repository} \longrightarrow \text{Model} \longrightarrow \text{Database Table}$$ - ๐ฏ AI Context Engineering & Task Boundaries: Generates pinpoint
.projectbrain/projectbrain-prompt.mdcontext packets with explicitDO NOT DUPLICATEguardrails and resets stale context between task sessions. - ๐ก๏ธ AI Change Review & Snapshots: Compares codebase snapshots before and after AI agent execution, catching new type errors, convention breaches, and leaked secrets.
- ๐ Zero-Cloud Privacy by Default: All indexation and graph databases run locally in embedded SQLite (
.projectbrain/). Zero telemetry, zero unauthorized external network calls.
ProjectBrain is engineered with a modular, decoupled architecture powered by Bun Workspaces:
projectbrain/
โโโ apps/
โ โโโ vscode/ # @projectbrain/vscode (VS Code Extension VSIX)
โ โโโ cli/ # @projectbrain/cli (Standalone CLI โ Planned)
โ
โโโ packages/
โ โโโ shared/ # Domain models, AST & Graph interfaces, DTOs
โ โโโ parser/ # Multi-language AST parser registry (TS, JS, SCSS, JSON, YAML)
โ โโโ indexer/ # High-speed workspace crawler & symbol indexer
โ โโโ graph/ # Bidirectional dependency & architecture flow graph
โ โโโ analyzer/ # Dead code engine, duplicate detector, compiler health
โ โโโ rules/ # Declarative YAML project convention rule engine
โ โโโ templates/ # Weighted heuristic composition & template matcher
โ โโโ security/ # Secret scanner, credentials detector & git guardrails
โ โโโ git/ # Repository history, diff & branch analyzer
โ โโโ ai/ # AI Router, Relevance scoring, Prompt builder
โ โโโ core/ # Central orchestrator & local SQLite storage manager
โ
โโโ template-pack/ # Built-in framework & architectural heuristic templates
git clone https://github.com/oneheka/Project-Brain-AI.git
cd Project-Brain-AI
bun install# Run typecheck across all workspace packages
bun run typecheck
# Compile VS Code extension
bun run compile:vscodeOpen the project in VS Code, navigate to the Run & Debug panel (F5), and select "Launch Extension" to spin up an Extension Development Host.
- Zero Leaks: Secrets, private keys (
.pem), connection strings, and.envfiles are strictly ignored by.gitignore. - Safe Configuration: Use
.env.exampleas a reference when configuring optional local LLM providers (e.g. Ollama). - Git Guardrails: The security scanner inspects staged changes and commit history to ensure no sensitive credentials are ever committed.
Distributed under the MIT License. Developed with โค๏ธ by oneheka.