Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
216 commits
Select commit Hold shift + click to select a range
1419766
Merge pull request #1 from nehraa/copilot/improve-project-features
nehraa Mar 14, 2026
d7b2847
Initial plan
Copilot Mar 14, 2026
6be13ee
Initial plan
Copilot Mar 14, 2026
96469e8
Initial plan
Copilot Mar 14, 2026
eab2935
Initial plan
Copilot Mar 14, 2026
ced68ee
feat: implement Time-Travel Branching for Blueprint Graphs
Copilot Mar 14, 2026
c416e0b
feat: Ghost Nodes — Predictive Architecture Suggestions in Visual Age…
Copilot Mar 14, 2026
d098945
feat: heatmap observability dashboard with live polling and trace vis…
Copilot Mar 14, 2026
ecdc89e
feat: add MCP client integration for node superpowers
Copilot Mar 14, 2026
d1b47fd
refactor: move MCP schemas before blueprintNodeSchema to remove z.lazy()
Copilot Mar 14, 2026
b1d79e4
test: add workbench test for branch panel UI, fix HTML entities
Copilot Mar 14, 2026
3a899d1
Potential fix for pull request finding
nehraa Mar 14, 2026
34fc507
Potential fix for pull request finding
nehraa Mar 14, 2026
ef788c7
Potential fix for pull request finding
nehraa Mar 14, 2026
14cf0b7
Potential fix for pull request finding
nehraa Mar 14, 2026
63c13f7
Potential fix for pull request finding
nehraa Mar 14, 2026
59d8f92
Merge pull request #14 from nehraa/copilot/add-heatmap-observability-…
nehraa Mar 14, 2026
8fe6d42
Potential fix for pull request finding
nehraa Mar 14, 2026
9282f33
Potential fix for pull request finding
nehraa Mar 14, 2026
a469174
Potential fix for pull request finding
nehraa Mar 14, 2026
cc04ce2
Potential fix for pull request finding
nehraa Mar 14, 2026
546a170
Potential fix for pull request finding
nehraa Mar 14, 2026
b0a3f6b
Potential fix for pull request finding
nehraa Mar 14, 2026
e6ddc6b
Potential fix for pull request finding
nehraa Mar 14, 2026
1934938
Potential fix for pull request finding
nehraa Mar 14, 2026
8cd1943
Potential fix for pull request finding
nehraa Mar 14, 2026
af8ce51
Potential fix for pull request finding
nehraa Mar 14, 2026
817fe2b
Potential fix for pull request finding
nehraa Mar 14, 2026
6a05251
Potential fix for pull request finding
nehraa Mar 14, 2026
511b4df
Potential fix for pull request finding
nehraa Mar 14, 2026
c7045f4
Potential fix for pull request finding
nehraa Mar 14, 2026
abc25e3
Potential fix for pull request finding
nehraa Mar 14, 2026
49846d8
Potential fix for pull request finding
nehraa Mar 14, 2026
b680d3b
Potential fix for pull request finding
nehraa Mar 14, 2026
9599c8f
Potential fix for pull request finding
nehraa Mar 14, 2026
abf3fd6
Potential fix for pull request finding
nehraa Mar 14, 2026
3b53391
Merge main into integrate-mcp-client-servers
nehraa Mar 14, 2026
1d1cf9b
Merge main into add-time-travel-branching
nehraa Mar 14, 2026
e47573d
Merge main into add-ghost-nodes-suggestions
nehraa Mar 14, 2026
3c209de
Merge pull request #13 from nehraa/copilot/integrate-mcp-client-servers
nehraa Mar 14, 2026
5ea2fc3
Merge latest main into add-time-travel-branching
nehraa Mar 14, 2026
fbbcb2f
Merge latest main into add-ghost-nodes-suggestions
nehraa Mar 14, 2026
8ca5a1a
Merge pull request #11 from nehraa/copilot/add-time-travel-branching
nehraa Mar 14, 2026
4609ee8
Merge latest main into add-ghost-nodes-suggestions
nehraa Mar 14, 2026
97e6492
Merge pull request #12 from nehraa/copilot/add-ghost-nodes-suggestions
nehraa Mar 14, 2026
3f2bfbb
Harden AI blueprint JSON parsing
nehraa Mar 14, 2026
fec5326
Redesign policy canvas graph view
nehraa Mar 14, 2026
0168067
Initial plan
Copilot Mar 14, 2026
4e0a769
feat: add VCR time-travel debugging with scrub bar replay
Copilot Mar 14, 2026
87de8fb
fix: use clearer step-forward icon in VCR transport controls
Copilot Mar 14, 2026
d3f82c7
Potential fix for pull request finding
nehraa Mar 14, 2026
decb911
Potential fix for pull request finding
nehraa Mar 14, 2026
53464cb
Potential fix for pull request finding
nehraa Mar 14, 2026
c023be2
Potential fix for pull request finding
nehraa Mar 14, 2026
915916f
Potential fix for pull request finding
nehraa Mar 14, 2026
dc83233
Potential fix for pull request finding
nehraa Mar 14, 2026
1722c4b
Merge pull request #15 from nehraa/copilot/nehraa-add-scrub-bar-ui
nehraa Mar 14, 2026
5a1ccf7
Initial plan
Copilot Mar 14, 2026
99b5bdf
feat: add Digital Twin real-time production mirroring
Copilot Mar 14, 2026
c06cb12
Potential fix for pull request finding
nehraa Mar 14, 2026
bf8c872
Potential fix for pull request finding
nehraa Mar 14, 2026
78e2256
Potential fix for pull request finding
nehraa Mar 14, 2026
ad75470
Potential fix for pull request finding
nehraa Mar 14, 2026
eee5ab4
Potential fix for pull request finding
nehraa Mar 14, 2026
ae492bc
Potential fix for pull request finding
nehraa Mar 14, 2026
4a42912
Potential fix for pull request finding
nehraa Mar 14, 2026
8b9656a
Potential fix for pull request finding
nehraa Mar 14, 2026
0bec23f
Merge pull request #16 from nehraa/copilot/digital-twin-real-time-mir…
nehraa Mar 14, 2026
e75762b
Initial plan
Copilot Mar 14, 2026
0682d73
Initial plan
Copilot Mar 14, 2026
58c1fff
Add Neural Auto-Refactoring: drift detection, healing API, shake anim…
Copilot Mar 14, 2026
7397e51
feat: Architectural Genetic Algorithms — multi-agent evolution of wor…
Copilot Mar 14, 2026
62d77e6
refactor: address code review feedback on genetic algorithms
Copilot Mar 14, 2026
5960d3f
Potential fix for pull request finding
nehraa Mar 15, 2026
efc1612
Potential fix for pull request finding
nehraa Mar 15, 2026
a9a1eed
Potential fix for pull request finding
nehraa Mar 15, 2026
c83af3c
Potential fix for pull request finding
nehraa Mar 15, 2026
440554c
Potential fix for pull request finding
nehraa Mar 15, 2026
d75c7d2
Potential fix for pull request finding
nehraa Mar 15, 2026
0f79e3d
Potential fix for pull request finding
nehraa Mar 15, 2026
a6da400
Potential fix for pull request finding
nehraa Mar 15, 2026
77cee7f
Potential fix for pull request finding
nehraa Mar 15, 2026
269645f
Potential fix for pull request finding
nehraa Mar 15, 2026
01883ad
Merge pull request #17 from nehraa/copilot/nehraa-architectural-genet…
nehraa Mar 15, 2026
edec6ad
Address review feedback: fix broken-edge nodeId, dedup key, shake ani…
Copilot Mar 15, 2026
62e0b34
Merge main into pr-18
nehraa Mar 15, 2026
022c626
Merge pull request #18 from nehraa/copilot/nehraa-neural-auto-refacto…
nehraa Mar 15, 2026
f098df8
refactor: split persistence layer into domain-specific stores
nehraa Mar 27, 2026
5af42c8
feat: enhance blueprint schema for execution tracking and artifacts
nehraa Mar 27, 2026
dec0497
feat: core infrastructure for runtime workspaces and test execution
nehraa Mar 27, 2026
7cd4fc5
feat: core execution engine overhaul with steps, artifacts, and test …
nehraa Mar 27, 2026
6a6e7a6
feat: api route updates for core blueprint execution and management
nehraa Mar 27, 2026
96447d7
feat: enhance api routes for observability, digital twin, and code as…
nehraa Mar 27, 2026
5ab5de9
feat: workbench UI enhancements and new showcase components
nehraa Mar 27, 2026
833b594
feat: library enhancements for codegen, digital twin, and graph refac…
nehraa Mar 27, 2026
3063b85
docs: project-wide documentation and configuration updates
nehraa Mar 27, 2026
3862cde
fix: update approval API route with latest persistence logic
nehraa Mar 27, 2026
0a30e22
🎨 Palette: Add ARIA labels to VCR playback buttons
google-labs-jules[bot] Mar 27, 2026
2968746
Merge pull request #20 from nehraa/palette-ux-vcr-a11y-17691744943390…
nehraa Mar 27, 2026
ec940bf
fix: address PR review comments for security, correctness, and perfor…
Claude Mar 27, 2026
c46f01b
Merge pull request #19 from nehraa/feat/blueprint-workbench-evolution
nehraa Mar 27, 2026
ddf34a4
feat: Integrate CodeRag for intelligent code retrieval
nehraa Apr 2, 2026
ab37d76
Fix CodeRag export indexing paths
nehraa Apr 2, 2026
10fbd89
Cat aniimations
nehraa Apr 2, 2026
ece89cc
feat: add file tabs and file tree explorer
nehraa Apr 2, 2026
f6146b4
chore: add claude-code and serena to gitignore
nehraa Apr 2, 2026
2dec8a9
feat: Add secure file I/O API routes for Monaco integration
nehraa Apr 3, 2026
eedbf0d
chore: initial plan tracking
Copilot Apr 3, 2026
e7dec70
fix: address all security review comments on file I/O API routes
Copilot Apr 3, 2026
6e04a21
fix: address all PR review comments - security, a11y, perf, tests, wi…
Copilot Apr 3, 2026
0dc4868
Merge pull request #22 from nehraa/feat/file-io-api-routes
nehraa Apr 3, 2026
2b98cd8
merge: resolve conflicts in files/get route
nehraa Apr 3, 2026
947d7ef
added integration plan
nehraa Apr 3, 2026
132b13d
Add production readiness analysis for 15 GitHub repos
nehraa Apr 3, 2026
2c796b0
Add all 15 GitHub repository clones with production readiness analysis
nehraa Apr 3, 2026
5b3fd1b
feat: P1-P3 IDE mode foundation, repo-scoped APIs, Monaco setup
nehraa Apr 3, 2026
9d3fb79
feat: P4 graph-to-editor navigation
nehraa Apr 3, 2026
e797f45
feat: P5 editor intelligence - repo-aware TypeScript
nehraa Apr 3, 2026
5e89422
feat: P6 workbench IDE mode integration
nehraa Apr 3, 2026
6bb6136
feat: P7 full CodeFlow feature parity in IDE mode
nehraa Apr 3, 2026
0d4ceb3
feat: P8 startup scripts + Playwright E2E tests
nehraa Apr 3, 2026
1c72d93
feat: Complete CodeFlow IDE Mode Implementation
nehraa Apr 4, 2026
831c8fd
Revert "Add production readiness analysis for 15 GitHub repos"
nehraa Apr 4, 2026
423b279
Add CodeQL analysis workflow
nehraa Apr 4, 2026
b2f71a7
Merge pull request #23 from nehraa/remove-analysis-commits
nehraa Apr 4, 2026
f704a79
fix(opencode): add specific API key patterns for all 11 providers
nehraa Apr 4, 2026
647432a
fix(opencode): mark provider as manually selected when user changes d…
nehraa Apr 4, 2026
56f1542
test(opencode): add comprehensive detection tests for all providers
nehraa Apr 4, 2026
8c97099
fix(opencode): remove duplicate closing brace in provider dropdown
nehraa Apr 4, 2026
a685ae5
feat(opencode): add model fetcher for API key validation and model di…
nehraa Apr 4, 2026
9ad3b83
feat(opencode): add API key validation UI component
nehraa Apr 4, 2026
12c9161
feat(opencode): integrate API key validator into settings component
nehraa Apr 4, 2026
c551f00
feat(opencode): export modelFetcher from module index
nehraa Apr 4, 2026
c44e827
test(opencode): add comprehensive tests for model fetcher
nehraa Apr 4, 2026
2197b1c
Merge pull request #24 from nehraa/remove-analysis-commits
nehraa Apr 4, 2026
a6d032b
chore(codeflow-core): add tree-sitter language grammar dependencies
nehraa Apr 6, 2026
c980ade
feat(codeflow-core): add tree-sitter loader and language queries
nehraa Apr 6, 2026
fb6f184
feat(codeflow-core): add analyzeRepo orchestrator with tree-sitter AS…
nehraa Apr 6, 2026
2863363
fix(codeflow-core): resolve all TypeScript compile errors in tree-sit…
nehraa Apr 6, 2026
cccc4a0
test(codeflow-core): add sample repo fixtures for all 6 languages
nehraa Apr 6, 2026
fde60c5
feat(codeflow-core): all 10 tests pass for multi-language analyzeRepo
nehraa Apr 6, 2026
ba9aad5
fix(codeflow-core): prevent duplicate extraction of class methods
nehraa Apr 6, 2026
964c6e8
fix(codeflow-core): match import paths to module nodes across extensions
nehraa Apr 6, 2026
59a51ed
chore(codeflow-core): rebuild dist with latest fixes
nehraa Apr 6, 2026
3126fda
test: verify pre-commit hook fires
nehraa Apr 6, 2026
8cbdcaa
chore: remove test hook verification file
nehraa Apr 6, 2026
85db892
fix(codeflow-core): address all PR review comments
Claude Apr 6, 2026
ecd27b4
fix(codeflow-core): address additional PR review findings
Claude Apr 6, 2026
bbf3538
Merge pull request #25 from nehraa/remove-analysis-commits
nehraa Apr 7, 2026
5beb6cb
updated the verison
nehraa Apr 7, 2026
8da01c6
chore: bump version to 1.0.0 and fix ghost-nodes test env leak
nehraa Apr 7, 2026
5104ffb
chore: add .qwen to gitignore, add source spans and call sites to ana…
nehraa Apr 7, 2026
0fb4545
probabrly last commit for this monorepo
nehraa Apr 21, 2026
e8a92e9
docs: add FEATURES.md with complete feature list
nehraa Apr 21, 2026
d8423c5
docs: add PACKAGE_DECOMPOSITION with full package plan
nehraa Apr 21, 2026
8037042
feat(codeflow-mcp): extract MCP package with test_tool and JSON-RPC s…
nehraa Apr 21, 2026
8978511
feat(codeflow-mcp): extract MCP package with test_tool and JSON-RPC s…
nehraa Apr 21, 2026
cad9b0c
feat(codeflow-mcp): add stdio and SSE transports for maximum MCP comp…
nehraa Apr 21, 2026
7b57d5a
test: add invoke/index.test.ts for MCP server protocol coverage
nehraa Apr 21, 2026
2434813
test: add tools/index.test.ts and cli.test.ts, reach 40 tests total
nehraa Apr 21, 2026
dba6ba5
test(codeflow-store): add comprehensive tests for all store modules
nehraa Apr 21, 2026
a050846
docs: fix PACKAGE_DECOMPOSITION.md per review feedback
Copilot Apr 22, 2026
adc8b13
fix: address PR review feedback for codeflow-mcp and codeflow-store
Copilot Apr 22, 2026
7993759
Changes before error encountered
Copilot Apr 22, 2026
919f400
Merge pull request #26 from nehraa/feature/codeflow-store-decomposition
nehraa Apr 22, 2026
eba1d41
Merge branch 'main' into feature/codeflow-mcp-decomposition
nehraa Apr 22, 2026
14838cc
Merge pull request #27 from nehraa/feature/codeflow-mcp-decomposition
nehraa Apr 22, 2026
860372f
feat(codeflow-core): add reasoning journal schemas
nehraa Apr 22, 2026
d65bcef
test(codeflow-store): add reasoning + changes test fixtures
nehraa Apr 22, 2026
890d0f1
chore: bump codeflow-core to v0.2.0 for reasoning journal feature
nehraa Apr 22, 2026
e813ed6
chore: bump codeflow-core to v1.1.0
nehraa Apr 22, 2026
68026ac
chore: set codeflow-core to v0.2.0
nehraa Apr 22, 2026
f9a814f
feat(codeflow-store): wire local codeflow-core and fix critical data …
nehraa Apr 22, 2026
15eeac9
feat: publish codeflow-core@1.1.1 with Phase 1 schema
nehraa Apr 22, 2026
52a93a0
fix: make Phase 1 fields optional for backward compat
nehraa Apr 22, 2026
9d8eedb
chore: bump codeflow-store to 0.2.4
nehraa Apr 22, 2026
a0b2129
fix(schema): add approver, runId to approvalRecord; taskId to traceSpan
nehraa Apr 22, 2026
6ac4c94
fix(store): 17 validation and API bugs across session, run, branch, a…
nehraa Apr 22, 2026
31bfc04
chore: bump codeflow-core to 1.1.5, codeflow-store to 1.0.3
nehraa Apr 22, 2026
7598d25
revert(codeflow-store): restore to v1.0.7 from npm
nehraa Apr 23, 2026
ca31fb9
fix(store): isolate test stores per module to prevent race conditions
nehraa Apr 23, 2026
7472915
release: bump version to 1.0.8
nehraa Apr 23, 2026
25c352c
docs: add codeflow-versioning 0.1.0 implementation plan
nehraa Apr 23, 2026
84df1c6
feat(versioning): scaffold package skeleton v0.1.0
nehraa Apr 23, 2026
978cfaa
feat(versioning): implement createBranch and diffBranches
nehraa Apr 23, 2026
a93c77b
feat(versioning): add src/store/index.ts re-export from codeflow-store
nehraa Apr 23, 2026
76c5e92
feat(versioning): add reasoning checkpoint snapshots
nehraa Apr 23, 2026
ec1576d
feat(versioning): add invoke.ts and diff.ts API layer
nehraa Apr 23, 2026
58a2911
feat(versioning): create barrel src/index.ts
nehraa Apr 23, 2026
a080026
feat(versioning): wire Next.js routes to import from package
nehraa Apr 23, 2026
b851ba8
feat(versioning): add CodeRAG integration (index.ts, agent.ts, search…
nehraa Apr 23, 2026
2ed7dd5
feat(versioning): add MCP tool definitions for version control
nehraa Apr 23, 2026
e5029bd
feat(versioning): add observability and risk sub-module exports
nehraa Apr 23, 2026
67b2e13
feat(versioning): wire observability, risk, session to branch creation
nehraa Apr 23, 2026
d98ae38
feat(versioning): add CodeRAG-powered observability and risk search
nehraa Apr 23, 2026
95ebfb4
feat(versioning): add observability and risk MCP tools
nehraa Apr 23, 2026
70b3c59
chore(versioning): bump version to 0.3.0
nehraa Apr 23, 2026
1d7572b
chore: add .worktrees to gitignore
nehraa Apr 24, 2026
6b0b668
feat(prd): add codeflow-prd package v0.1.0
nehraa Apr 24, 2026
77e8879
feat(agent): add core type definitions
nehraa Apr 28, 2026
8cd7ba4
feat(agent): add task queue, agent spawner, and result aggregator
nehraa Apr 28, 2026
760e8f1
fix(agent): fix markCompleted typing, add retries, add missing tests
nehraa Apr 28, 2026
ee7f142
fix(agent): use template literals in getSkillPrompt for proper interp…
nehraa Apr 28, 2026
28ac21a
feat(agent): integrate opencode CLI as backend for standalone operation
nehraa Apr 28, 2026
4e8cfb6
feat(agent): add blueprint ingestion and reasoning trace saving
nehraa Apr 28, 2026
4d46958
feat(agent): add AI orchestration layer with NVIDIA Llama blueprint g…
nehraa Apr 28, 2026
72e2669
feat(agent): add BlueprintNode language field for multi-lang support
nehraa May 8, 2026
9e4aa1e
feat(agent): add scaffold-generator and scaffold-utils — move codegen…
nehraa May 8, 2026
10f3d9e
refactor(codeflow-agent): remove duplicate types/blueprint.ts
nehraa May 8, 2026
1f713b5
feat: add execution-context, blueprint, refactor-suggester, test-gene…
nehraa May 26, 2026
375cdb8
chore: add prd change entry and update website components
nehraa May 26, 2026
f6759cc
chore: package restructuring and clean up
nehraa Jun 3, 2026
21be3e4
feat: import CodeRag and Codeflow_master source into monorepo
nehraa Jun 3, 2026
a896899
chore: clean up — keep only packages/, docs/, README, pnpm-workspace,…
nehraa Jun 3, 2026
67fd98e
fix(codeflow): CORS configured with `Access-Control-Allow-Origin: *` …
nehraa Jun 3, 2026
0efd3be
fix(codeflow): `.env` is NOT in `.gitignore` (only `.env.local`/`.env…
nehraa Jun 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .env.example

This file was deleted.

26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
node_modules
.next
out
dist
build
coverage
artifacts
*.tgz
.DS_Store
.codeflow-store
.codeflow-store-test
.codeflow-sandboxes
.test-store
*.log
*.tsbuildinfo
.env
.env.*
.env.local
.env.*.local
.env*.local
!.env.example
# CodeRag index files
.coderag-*
.coderag/

# Claude Code working directories
claude-code/
.claude/

# Serena tooling
.serena/

# Qwen Code working directories
.qwen/
.qwen*
.worktrees
23 changes: 0 additions & 23 deletions BACKLOG.md

This file was deleted.

275 changes: 181 additions & 94 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,131 +1,218 @@
# CodeFlow

CodeFlow is a blueprint-first coding workbench. It ingests a PRD and/or a local JavaScript or TypeScript repo, builds an architecture graph, lets you inspect and edit node contracts in a visual map, applies runtime trace overlays, and exports markdown docs plus generated code stubs and a JSON Canvas file that can be opened in Obsidian-compatible tools.

## What is implemented

- **AI blueprint generation** - Generate architecture blueprints from natural language prompts using NVIDIA API (Llama 3.1 405B)
- PRD ingestion with deterministic extraction of screens, APIs, classes, functions, modules, and workflows
- JavaScript/TypeScript repo analysis with `ts-morph` for modules, imports, classes, methods, functions, API routes, page screens, inheritance, and discovered call edges
- React Flow workbench for graph visualization and node inspection/editing
- Workbench graph editing for adding/removing nodes and edges without rebuilding from the PRD
- Execution planning with dependency batches and per-node task ownership paths
- Local persistence under `.codeflow-store/` for sessions, runs, approvals, and checkpoints
- Risk-aware export flow with approval gating in `essential` mode and checkpoint creation before overwriting exports
- Local sandboxed `yolo` export runs with diff manifests before syncing to the target directory
- Conflict/drift analysis against a live TypeScript repo snapshot
- Observability ingestion and retrieval APIs for spans/logs with graph overlay
- Trace overlay support from pasted JSON spans
- Disk export for:
- `blueprint.json`
- markdown docs per node
- `system.canvas`
- generated TypeScript and TSX stubs
- `ownership.json`
- `obsidian-index.md`

## Run it
Code-as-graph platform for AI-driven software development. You write a product requirements document in markdown. The parser lifts it into a typed `BlueprintGraph` of functions, classes, APIs, and UI screens. The other packages reason over that graph: analyze it for smells, execute it in a sandbox, snapshot it as a versioned branch, simulate user flows through it, evolve it with a genetic algorithm, render it on a React Flow canvas. CodeRag indexes the underlying source repository so the platform can answer questions about the actual code.

Fourteen packages, one Next.js IDE, one MCP server, one CLI.

## Why It Exists

Software work happens in two layers: the requirements ("the user can reset their password") and the code (`POST /auth/reset`). Most tooling forces you to maintain both as separate artifacts that drift apart. CodeFlow collapses the gap. The PRD is the source of truth. The graph is a derived, typed representation you can analyze, version, simulate, and execute. The code you write for each node is an implementation detail, not the primary artifact.

This changes what tools you can build. Once the structure is a graph you can run cycle detection, find god nodes, simulate traffic, evolve architectures, diff branches by their structural fingerprint rather than line-by-line, and answer "where is auth handled?" with retrieval over a semantic index.

## The Packages

Every package lives in `packages/` and publishes to npm under the `@abhinav2203` scope. The `codeflow-master` package is the Next.js IDE that ties them together. Per-package deep dives live in [`docs/`](./docs).

| Package | What It Does |
|---|---|
| [`codeflow-core`](./docs/codeflow-core.md) | Zod schemas, multi-language tree-sitter analyzer, conflict detection, artifact export. The graph data model. |
| [`codeflow-prd`](./docs/codeflow-prd.md) | Markdown PRD parser. Infers nodes and edges from headings, inline tags, HTTP patterns, and workflow lines. |
| [`codeflow-analysis`](./docs/codeflow-analysis.md) | Cycle detection (Tarjan SCC), smell detection (god nodes, hubs, tight coupling), structural metrics, drift healing, repo conflicts. |
| [`codeflow-execution`](./docs/codeflow-execution.md) | Run plans via topological batching, isolated TS workspaces, VCR recordings of trace spans, Mermaid export, sandbox diffs. |
| [`codeflow-versioning`](./docs/codeflow-versioning.md) | Branch creation, structural diff, reasoning snapshots, CodeRag-backed search and explain. |
| [`codeflow-store`](./docs/codeflow-store.md) | Local session storage, project-scoped state, checkpoints, approvals, observability, risk reports. |
| [`codeflow-mcp`](./docs/codeflow-mcp.md) | JSON-RPC MCP server and client for blueprint operations. Stdio and HTTP transports. |
| [`codeflow-canvas`](./docs/codeflow-canvas.md) | React Flow graph canvas, Monaco code editors, IDE layout components, blueprint store hook. |
| [`codeflow-dtwin`](./docs/codeflow-dtwin.md) | Digital twin simulation. Groups spans into user flows, computes active nodes, synthesizes simulated spans. |
| [`codeflow-evolution`](./docs/codeflow-evolution.md) | Genetic algorithm for architecture evolution. Monolith and microservices variants, tournament selection, four-dimension fitness. |
| [`codeflow-agent`](./docs/codeflow-agent.md) | Orchestrates subagent-driven development. Spawns Claude Code agents per task with skill, MCP, and plugin registries. |
| [`codeflow-master`](./docs/codeflow-master.md) | The unified Next.js IDE. Integrates the 12 packages above into a single canvas-centric environment. |
| [`CodeRag`](./docs/coderag.md) | Standalone repo RAG engine. Tree-sitter indexing, LanceDB storage, MCP tools for query, lookup, explain, impact. |
| `codeflow-prd-test-npm` | Placeholder package, no runtime code. Reserved for downstream test consumers. |

## Architecture

```
PRDs in markdown
|
v
[codeflow-prd] parsePrd() ──> BlueprintGraph (spec)
| |
| v
| [codeflow-core] analyzer, schema, conflicts
| |
| v
| [codeflow-execution] runBlueprint() in sandbox
| |
| v
| [codeflow-store] checkpoints, runs, approvals
| |
+───── [codeflow-analysis] ◄──────┘ detect cycles, smells, metrics
|
+───── [codeflow-versioning] ──> branches, structural diff, CodeRag search
|
+───── [codeflow-dtwin] ──> simulate user flows, active nodes
|
+───── [codeflow-evolution] ──> genetic variants, fitness benchmark
|
v
[codeflow-canvas] React Flow + Monaco ──> [codeflow-master] Next.js IDE
|
v
[codeflow-mcp] JSON-RPC server ◄─── [codeflow-agent] subagent dispatch
|
v
[CodeRag] LanceDB index of the actual source repo
```

The data flow is acyclic. The graph is the spine. Every other package either reads the graph, writes to it, or produces artifacts derived from it.

## The BlueprintGraph

The central type. A `BlueprintGraph` has:

- `nodes`: `BlueprintNode[]` where each node carries a `kind` (`function | module | api | class | ui-screen`), a `status` (`spec_only | implemented | verified | connected`), a `contract` with methods, fields, and I/O, and a `specDraft` placeholder for code generation.
- `edges`: `BlueprintEdge[]` with eight kinds including `calls`, `reads-state`, `writes-state`, `depends-on`, `renders`.
- `workflows`: named sequences of node references, the user-visible flows.
- `sourceRefs`: provenance pointing back to the PRD section, repo file span, or branch that produced each node.

Every package operates on this shape. Analysis diffs two graphs. Versioning hashes nodes and edges into stable `nodeKey`/`edgeKey` fingerprints. Evolution mutates the graph with crossover and mutation operators. Execution walks it in topological batches.

## Quick Start

Run the IDE:

```bash
npm install
npm run dev
git clone https://github.com/nehraa/CodeFlow.git
cd CodeFlow
pnpm install
cd packages/Codeflow_master
pnpm dev
```

Then open `http://localhost:3000`.
The IDE opens at `http://localhost:3000` with the canvas, file tree, and Monaco editor in a single workbench.

## Test and verify
If you only need a single package, install inside it:

```bash
cd packages/codeflow-prd
npm install
npm test
npm run check
npm run build
```

Run `npm run check` separately from `npm run build`; they both touch Next type generation and should not be launched in parallel.
Install CodeRag into a target repo:

## How to use
```bash
cd your-project
npm install @abhinav2203/coderag
npx coderag init
npx coderag query "where is auth handled?"
npx coderag serve-mcp
```

### AI Blueprint Generation (Recommended)
CodeRag installs a `post-commit` hook that reindexes after each commit. It supports TypeScript, JavaScript, Go, Python, C, C++, and Rust. Embeddings run locally with ONNX (`Xenova/gte-small`, 384-dim) or remotely with Gemini.

1. Enter a project name.
2. Select **AI Prompt (NVIDIA)** mode.
3. Enter your NVIDIA API key (saved to localStorage) or set `NVIDIA_API_KEY` environment variable.
4. Describe your project in natural language (e.g., "A task management app with React frontend and Node.js backend..." or "A Rails monolith with Sidekiq jobs and a React admin panel...").
5. Choose `essential` or `yolo` mode.
6. Click `Build blueprint`.
Use the MCP server from Claude Code or Cursor by adding to your MCP config:

AI prompt mode is stack-agnostic. Today the legacy repo analyzer reads JavaScript/TypeScript repos, and exported starter stubs are still generated as TS/TSX files.
```json
{
"mcpServers": {
"codeflow": {
"command": "npx",
"args": ["-y", "@abhinav2203/codeflow-mcp"]
}
}
}
```

### Legacy PRD/Repo Mode
## Writing a PRD

1. Enter a project name.
2. Select **PRD / Repo (legacy)** mode.
3. Optionally enter an absolute path to a local JavaScript or TypeScript repo.
4. Paste PRD markdown.
5. Choose `essential` or `yolo` mode.
6. Click `Build blueprint`.
PRDs are markdown. The parser recognizes:

### After Building
- Headings become `module` nodes. Subheadings become `function`/`class`/`api`/`ui-screen` based on keywords.
- Inline tags like `api: POST /users/:id` and `function validateEmail(email: string): boolean` become typed nodes with inferred contracts.
- HTTP method patterns (`GET /path`, `POST /path`) become `api` nodes.
- Signature lines (`name(params): returnType`) become method specs.
- Workflow lines (`a -> b -> c`) become `calls` edges with `confidence: 0.7`.

7. Click nodes in the graph to inspect and edit their summary and notes.
8. Paste trace spans JSON if you want to overlay runtime status.
9. Click `Run plan` to execute the current task plan and persist execution ownership metadata.
10. Click `Load observability` to reload stored spans/logs for the project and overlay them on the graph.
11. Click `Analyze drift` to compare the current blueprint to the repo snapshot.
12. Click `Export artifacts` to write docs, canvas, ownership metadata, and code stubs to disk.
13. If `essential` mode flags the export as risky, approve the pending export and rerun it from the UI.
A minimal PRD:

## Trace JSON format
```markdown
# Auth Service

```json
[
{
"spanId": "span-1",
"traceId": "trace-1",
"name": "TaskService.saveTask",
"status": "error",
"durationMs": 12,
"runtime": "node"
}
]
## API
api: POST /auth/login
body: { email: string, password: string }
returns: { token: string, user: User }

## Function
function validateEmail(email: string): boolean
returns: email matches RFC 5322

## UI
screen: LoginPage
form: [email, password]
submit: POST /auth/login
```

You can also set `blueprintNodeId` directly for exact matching.
The parser turns this into a graph with three nodes and one edge.

## Per-Package Documentation

Every package has a deep dive in [`docs/`](./docs). Each one covers purpose, public API, internal architecture, key types, and extension points.

- [docs/codeflow-core.md](./docs/codeflow-core.md)
- [docs/codeflow-prd.md](./docs/codeflow-prd.md)
- [docs/codeflow-analysis.md](./docs/codeflow-analysis.md)
- [docs/codeflow-execution.md](./docs/codeflow-execution.md)
- [docs/codeflow-versioning.md](./docs/codeflow-versioning.md)
- [docs/codeflow-store.md](./docs/codeflow-store.md)
- [docs/codeflow-mcp.md](./docs/codeflow-mcp.md)
- [docs/codeflow-canvas.md](./docs/codeflow-canvas.md)
- [docs/codeflow-dtwin.md](./docs/codeflow-dtwin.md)
- [docs/codeflow-evolution.md](./docs/codeflow-evolution.md)
- [docs/codeflow-agent.md](./docs/codeflow-agent.md)
- [docs/codeflow-master.md](./docs/codeflow-master.md)
- [docs/coderag.md](./docs/coderag.md)

## Output layout
## Development

By default exports go to:
The repository is a pnpm workspace (`pnpm-workspace.yaml` at the root). All packages live under `packages/`. There is no root `package.json`; the root only holds the workspace manifest, this README, the documentation in `docs/`, and the `.gitignore`.

```text
artifacts/<project-name>/
To install everything at once:

```bash
pnpm install
```

With these files:
To work on a single package, drop into it and use its scripts directly. Most packages expose:

```text
blueprint.json
docs/
stubs/
system.canvas
ownership.json
obsidian-index.md
```bash
npm run check # tsc --noEmit
npm run test # vitest run
npm run build # tsc emit + dist
```

Local state is stored in:
Build order matters because of inter-package dependencies. The graph:

```text
.codeflow-store/
```
codeflow-core
├── codeflow-store
│ ├── codeflow-prd
│ ├── codeflow-analysis
│ ├── codeflow-versioning
│ └── codeflow-agent
├── codeflow-mcp
├── codeflow-execution
│ └── codeflow-dtwin
├── codeflow-canvas
├── codeflow-evolution
└── codeflow-master (consumes all of the above + CodeRag)
```

This includes latest sessions, run records, approval records, and checkpoints for overwritten export directories.
Build `codeflow-core` first. Then everything that depends only on it. Then transitive dependents.

## API routes
## License

- `POST /api/blueprint`
- `POST /api/generate-blueprint`
- `POST /api/executions/run`
- `POST /api/export`
- `POST /api/approvals/approve`
- `POST /api/observability/ingest`
- `GET /api/observability/latest`
- `POST /api/conflicts`
Apache-2.0. See each package's `LICENSE` file.
Loading