Skip to content

Latest commit

ย 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  ProjectBrain

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

Bun VS Code TypeScript SQLite License

English โ€ข ะ ัƒััะบะธะน โ€ข ็ฎ€ไฝ“ไธญๆ–‡ โ€ข ๆ—ฅๆœฌ่ชž โ€ข Portuguรชs โ€ข Espaรฑol โ€ข ํ•œ๊ตญ์–ด โ€ข Deutsch โ€ข Franรงais โ€ข ะฃะบั€ะฐั—ะฝััŒะบะฐ


๐ŸŒŸ Why ProjectBrain?

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.

$$\text{Static Analysis (AST/Graph)} \longrightarrow \text{Templates} \longrightarrow \text{Local LLM (Ollama/HF)} \longrightarrow \text{Cloud LLM (Optional)}$$


โšก Key Highlights

  • ๐Ÿ” 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.md context packets with explicit DO NOT DUPLICATE guardrails 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.

๐Ÿ›๏ธ Monorepo Architecture

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

๐Ÿš€ Quick Start

Prerequisites

1. Clone & Install

git clone https://github.com/oneheka/Project-Brain-AI.git
cd Project-Brain-AI
bun install

2. Typecheck & Build

# Run typecheck across all workspace packages
bun run typecheck

# Compile VS Code extension
bun run compile:vscode

3. Launch in VS Code

Open the project in VS Code, navigate to the Run & Debug panel (F5), and select "Launch Extension" to spin up an Extension Development Host.


๐Ÿ”’ Strict Security Guardrails

  • Zero Leaks: Secrets, private keys (.pem), connection strings, and .env files are strictly ignored by .gitignore.
  • Safe Configuration: Use .env.example as 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.

๐Ÿ“„ License

Distributed under the MIT License. Developed with โค๏ธ by oneheka.

About

๐Ÿง  Local-first VS Code extension for codebase intelligence, AST guardrails, and deterministic AI context engineering. Protects against vibe-coding degradation with zero cloud dependency.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages