Zero-dependency codebase intelligence for AI agents and humans.
Static analysis → structured Markdown → readable by any LLM. No graph database, no MCP server, no cloud service. Just .md files committed to your repo.
Every AI coding tool (Claude Code, Cursor, Copilot) needs to understand your codebase. Current solutions require running servers or databases. Fondamenta ArchCode generates structured Markdown files that any LLM can read natively — no special tools needed.
npx fondamenta-archcode analyze
That's it. Your .planning/ directory now contains a complete architectural analysis.
.planning/
├── DEPENDENCY-MAP.md # Architecture overview, impact areas
└── dependencies/
├── pages-atomic.md # Every page: imports, auth, data fetching
├── components-atomic.md # Every component: props, state, hooks, used-by
├── api-routes-atomic.md # Every API route: methods, auth, models
├── lib-atomic.md # Every utility: exports, imports, env vars
├── schema-crossref-atomic.md # DB models, fields, relations, enums
└── component-graph.md # Visual dependency tree
Each file is:
- Human-readable — open in any editor, review in any PR
- AI-readable — any LLM understands Markdown natively
- Grep-friendly — find anything with standard tools
- Git-friendly — meaningful diffs when your code changes
# Analyze current project
npx fondamenta-archcode analyze
# Analyze specific directory
npx fondamenta-archcode analyze ./my-project
# Custom output directory
npx fondamenta-archcode analyze --output .docs
# Initialize config file
npx fondamenta-archcode init### `/dashboard`
- **File:** `app/(dashboard)/dashboard/page.tsx`
- **Type:** Server Component
- **Auth:** auth()
- **Data Fetching:**
- DB: findMany (courses)
- DB: count (flashcards)
- **Components:** `CourseCard`, `StatsWidget`, `RecentActivity`
- **i18n:** `dashboard`### `/api/courses`
- **File:** `app/api/courses/route.ts`
- **Methods:** `GET`, `POST`
- **Auth:** auth()
- **Models:** `course`, `enrollment`
- **Side Effects:** DB: findMany, DB: create### `User`
| Field | Type | Constraints |
| --- | --- | --- |
| `id` | `String` | primary key, @default(cuid()) |
| `email` | `String` | unique |
| `name` | `String` | optional |
| `courses` | `Course` | array |
**Relations:**
- `courses` → `Course` (one-to-many)
- `flashcards` → `Flashcard` (one-to-many)Create fondamenta.config.ts (or run npx fondamenta-archcode init):
import { defineConfig } from 'fondamenta';
export default defineConfig({
output: '.planning',
framework: 'auto', // 'nextjs-app' | 'nextjs-pages' | 'nuxt' | 'sveltekit' | 'remix'
language: 'en',
generators: {
pages: true,
components: true,
apiRoutes: true,
lib: true,
schemaXref: true,
componentGraph: true,
dependencyMap: true,
},
exclude: ['**/node_modules/**', '**/*.test.*'],
schema: {
provider: 'auto', // 'prisma' | 'drizzle' | 'none'
},
});| Framework | Status |
|---|---|
| Next.js App Router | Supported |
| Next.js Pages Router | Supported (basic) |
| Nuxt 3 | Planned |
| SvelteKit | Planned |
| Remix | Planned |
- Discovers files using
fast-glob(respects.gitignore) - Parses TypeScript/TSX using the TypeScript Compiler API (not regex)
- Builds an in-memory graph of imports, exports, components, hooks
- Classifies each file: page, component, API route, lib, hook
- Analyzes Prisma schema for models, fields, and relations
- Generates structured Markdown with consistent formatting
Zero runtime dependencies after analysis — output is plain Markdown.
| Fondamenta ArchCode | GitNexus | Repomix | |
|---|---|---|---|
| Output | Structured .md files | Graph DB (KuzuDB) | Single concatenated file |
| Runtime deps | None | KuzuDB + MCP server | None |
| AI integration | Any tool (reads files) | Claude Code only (MCP) | Any tool |
| Framework-aware | Yes (routes, pages, auth) | AST only | No |
| Schema-aware | Yes (Prisma) | No | No |
| Human-readable | Excellent | Requires queries | Poor (wall of text) |
| Git-friendly | Yes (meaningful diffs) | No (binary DB) | Poor (single file) |
| Incremental | Yes (watch + diff) | Re-index | No |
| Command | Description |
|---|---|
fondamenta analyze [path] |
Full codebase analysis → Markdown files |
fondamenta analyze --incremental |
Only analyze git-changed files |
fondamenta analyze --no-preserve-manual |
Skip manual section preservation |
fondamenta agents [path] |
Run code health agents on the project graph |
fondamenta agents --json |
Output findings as JSON (for CI/tools) |
fondamenta diff [path] |
Show changes since last analysis |
fondamenta watch [path] |
Watch mode — regenerate on file changes |
fondamenta ai-context [path] |
Generate AI context files |
fondamenta init |
Create configuration file |
Run 8 code health agents (3 free, 5 PRO) that analyze your project graph and produce actionable findings.
fondamenta agents # All available agents
fondamenta agents --free # Free agents only
fondamenta agents --agent dead-code # Single agent
fondamenta agents --ci # Exit code 1 if errors found
fondamenta agents --report # Generate AGENTS-REPORT.md
fondamenta agents --list # List all agents with tierFree agents:
| Agent | What it checks |
|---|---|
dead-code |
Orphan components, unused exports, unreferenced lib files |
circular-deps |
Circular import chains (DFS cycle detection) |
architecture-guard |
Oversized files, god components, unprotected mutation routes |
PRO agents (license required):
| Agent | What it checks |
|---|---|
security-scanner |
Auth gaps, env var leaks, insecure patterns |
schema-drift |
Code↔schema model mismatches |
performance-sentinel |
Heavy pages, unnecessary client components, API waterfalls |
convention-enforcer |
Naming, barrel exports, auth pattern consistency |
impact-analyzer |
Fan-in/out hotspots, hub components, bridge files |
fondamenta diff # Show what changed
fondamenta diff --ci # Exit code 1 if outdated (for CI)fondamenta watch # Watch and regenerate on changes
fondamenta watch --debounce 1000 # Custom debounce (ms)fondamenta ai-context --claude # Generate/update CLAUDE.md
fondamenta ai-context --cursor # Generate .cursorrules
fondamenta ai-context --copilot # Generate .github/copilot-instructions.md
fondamenta ai-context --all # All of the aboveFondamenta preserves human-written content across regenerations. Add manual sections using markers:
<!-- MANUAL-START:my-notes -->
Your custom notes here — they survive `fondamenta analyze`
<!-- MANUAL-END:my-notes -->Or use the split-point pattern — everything after ## Manual Notes is preserved:
## /dashboard
(auto-generated content above)
## Manual Notes
Your custom architecture notes here — preserved across regeneration.Disable with --no-preserve-manual.
Only regenerate documentation for files changed since last commit:
fondamenta analyze --incrementalUses git diff to detect changed .ts/.tsx/.vue files and skips unchanged files. Combined with writeIfChanged (always active), only files with actual content changes are written to disk — zero noise in git diffs.
# Regenerate every 6 hours
30 */6 * * * cd /path/to/project && fondamenta analyze > /dev/null 2>&1# .git/hooks/pre-commit
fondamenta analyze
git add .planning/- name: Update architecture docs
run: npx fondamenta-archcode analyze
- name: Commit changes
run: |
git add .planning/
git diff --staged --quiet || git commit -m "docs: update fondamenta analysis"- CLI
analyzecommand - Next.js App Router support
- Prisma schema analysis
- 7 atomic generators + dependency map
-
fondamenta watch(incremental rebuild) -
fondamenta diff(show changes since last analysis) - AI context generation (
.cursorrules,CLAUDE.md, copilot instructions) - Code health agents (8 agents: dead code, circular deps, security, performance, etc.)
- Open Core licensing (3 free + 5 PRO)
- Manual sections preservation (marker-based + split-point)
- Incremental mode (
--incrementalvia git diff) - writeIfChanged (zero-noise git diffs)
- Test suite (120+ tests, CI with GitHub Actions)
- GitHub Action (marketplace)
- Multi-framework support (Nuxt, SvelteKit, Remix)
- Ed25519 license validation (upgrade from HMAC)
Contributions welcome! See CONTRIBUTING.md for guidelines.
MIT