Architecture Overview
FundAdmin AI is structured as three independent tiers that can be used together or separately.

Three-Tier Architecture
T1 — Skills + CLI (MIT)
skills/ 62 Claude Code sub-skills
agents/ 5 LPA review agents
fund/ /fund orchestrator
mcp-vault-server/ MCP server + REST API
T2 — Obsidian Vault Template (MIT)
fund-admin-vault/ FileClasses, dashboards, kanban boards
T3 — Commercial Webapp
apps/web Next.js 16 dashboard (port 3000)
apps/worker Background worker (no dedicated port)
apps/ws WebSocket sidecar (port 3002)
packages/shared Drizzle schema + shared typesSkill Routing (T1)
fund/SKILL.md is the orchestrator. It receives /fund <command> and routes to one of 62 sub-skills in skills/fund-*/SKILL.md. Each sub-skill is a standalone markdown file that instructs Claude how to perform a specific task.
5-Agent LPA Review Pipeline
/fund review-lpa launches five parallel agents via the Anthropic SDK directly (apps/web/src/lib/review-pipeline.ts). The CLI path no longer depends on the claude CLI binary.

| Agent | Role | Weight |
|---|---|---|
agents/fund-terms.md | Term extraction & categorisation | 20% |
agents/fund-risks.md | Risk scoring (1–10 per provision) | 25% |
agents/fund-compliance.md | Regulatory compliance checks | 20% |
agents/fund-obligations.md | Obligations & timeline mapping | 15% |
agents/fund-recommendations.md | Negotiation recommendations | 20% |
The PDF is sent once with cache_control: ephemeral so all five agent calls share the cached prefix, significantly reducing API cost.
Port Assignments
| Service | Port |
|---|---|
| Next.js webapp | 3000 |
| MCP vault server REST API | 3001 (configurable via MCP_VAULT_API_PORT) |
| WebSocket sidecar | 3002 |
Data Flow

Obsidian Inbox (~/FundAdmin-AI-Vault/Inbox/)
↓ mcp-vault-server/watcher.js classifies PDFs
↓ apps/worker/src/inbox-watcher.ts (30s tick)
↓ /api/review/trigger
↓ apps/web/src/lib/review-pipeline.ts (Anthropic SDK)
↓ vault_write_review → Obsidian vault (.md + .json sidecar)
↓ Post-review hooks (wire, capital, compliance, investor, obligation, performance, reconcile, skill-chains)Key Source Files
| File | Purpose |
|---|---|
apps/web/src/lib/review-pipeline.ts | Anthropic SDK LPA review pipeline |
apps/web/src/lib/reviews.ts | Read review markdown from vault |
apps/web/src/lib/vault.ts | Obsidian vault access |
apps/worker/src/inbox-watcher.ts | 30s tick inbox scanner |
mcp-vault-server/index.js | MCP server + REST API (port 3001) |
mcp-vault-server/vault.js | Filesystem operations |
mcp-vault-server/watcher.js | File change watcher + classifier |
packages/shared/src/schema.ts | Drizzle database schema |