Agent Skill
2/7/2026

drizzle-expert

Drizzle ORM expert for schema design, migrations, query optimization, relations modeling, and database operations. Use PROACTIVELY for Drizzle schema issues, migration problems, query performance, relation design, or database connection issues.

W
whodaniel
2GitHub Stars
1Views
npx skills add whodaniel/fuse

SKILL.md

Namedrizzle-expert
DescriptionDrizzle ORM expert for schema design, migrations, query optimization, relations modeling, and database operations. Use PROACTIVELY for Drizzle schema issues, migration problems, query performance, relation design, or database connection issues.

The New Fuse

A multi-agent AI orchestration platform that enables AI agents to communicate, collaborate, and execute workflows across browsers, IDEs, desktop apps, and cloud services.

Live: thenewfuse.com

Quick Start

Prerequisites

  • Node.js 20+
  • pnpm 10.19.0+ (npm install -g pnpm)
  • Docker (for PostgreSQL + Redis)

Setup

git clone https://github.com/whodaniel/fuse.git
cd fuse
pnpm install
pnpm run docker:start    # PostgreSQL (5433) + Redis (6380)
pnpm run dev              # All services

Operator Commands (TNF CLI)

./tnf onboard
./tnf doctor
./tnf jules supervisor-status
./tnf skills bank sync
./tnf scripts list

Additional operations docs:

  • docs/JULES_AUTONOMOUS_LOOP.md
  • docs/SKILL_BANK_OPERATIONS.md
  • packages/tnf-cli/README.md

Access Points

ServiceURL
Frontendhttp://localhost:3000
API Serverhttp://localhost:3001
API Gatewayhttp://localhost:3005
Drizzle Studiopnpm run db:studio

Architecture

Browser/Chrome Ext ──> Relay Server (WS:3000) <──> Redis (6380) <──> Relay
VSCode Extension  ──/                                                  │
                                                              API Server (3001)
Frontend (3000) ──> API Gateway (3005) ──> API Server (3001) ──> Drizzle ──> PostgreSQL (5433)
                                       ──> Backend (3004)

API Server <── TNF MCP Module <── Claude / other MCP clients
           <── A2A Protocol   <── Cross-agent messages

OpenClaw Mesh (cloud) <──> Anthropic Claude Pro (OAuth)
PicoClaw Fleet (cloud) <── Lightweight edge agents

Core Services

ServicePortTechPurpose
Frontend3000React + ViteSPA: dashboard, workflow builder, agent management, chat, admin
API Server3001NestJSMain backend: agents, chat, LLM routing, MCP, workflows, GraphQL, Web3
API Gateway3005NestJSSingle ingress proxy, auth, API versioning
Backend3004NestJSSecondary service: AG-UI protocol, job queues, Prometheus metrics
Relay Server3000 (WS)Node.jsWebSocket hub connecting all agents across tabs/processes
PostgreSQL5433DockerPrimary database via Drizzle ORM
Redis6380DockerPub/sub, caching, job queues

Message Flow

  1. Frontend -> API Gateway (3005) -> API Server (3001) — REST/GraphQL
  2. Agent -> Relay Server (WS) -> Redis Pub/Sub -> Other Agents — Agent mesh
  3. Chrome Extension -> Relay Server (WS) — Browser AI automation relay
  4. VSCode Extension -> Relay Server -> API — IDE integration
  5. Any Agent -> MCP Server (embedded in API) — Tool invocation via Model Context Protocol
  6. A2A Messages: TNFEnvelope format (Zod-validated), carried over WebSocket or Redis

Apps

Core Services

  • apps/api/ — Main NestJS backend: agent CRUD, LLM providers (Anthropic/OpenAI/Google), MCP server, A2A protocol, GraphQL, Web3Auth, Swagger docs
  • apps/frontend/ — React SPA with ReactFlow workflow builder, Monaco editor, Three.js visualizations, premium UI components, Firebase auth
  • apps/api-gateway/ — NestJS gateway: request proxy, JWT auth, API versioning
  • apps/backend/ — Secondary NestJS service: AG-UI protocol, Bull job queues, Prometheus metrics
  • apps/relay-server/ — WebSocket relay hub for inter-agent messaging, MCP integration, React UI

Client Extensions

  • apps/chrome-extension/ — Injects into Claude/Gemini/ChatGPT/Perplexity tabs, captures AI responses, relays via WebSocket (V7 active)
  • apps/vscode-extension/ — Full VS Code extension (v9.1.0): multi-LLM chat, A2A, AG-UI, MCP client, agent registry, collective orchestrator
  • apps/electron-desktop/ — Electron desktop app with Chakra UI + Socket.io

AI Infrastructure

  • apps/picoclaw-overseer/ — Go-based ultra-lightweight AI agent (<10MB RAM), three Railway instances (tester/subject/perplexity)
  • apps/mcp-servers/ — MCP tool servers: network management, DevOps bridge, Claude/Gemini integration
  • apps/cloud-sandbox/ — Playwright browser automation sandbox with Socket.io

Other

Shared Packages

Foundation

PackagePurpose
@the-new-fuse/typesShared TypeScript types/interfaces for agents, auth, API, workflows, chat
@the-new-fuse/utilsUtility functions
@the-new-fuse/infrastructureNestJS providers: Redis, caching, shared services

Database

PackagePurpose
@the-new-fuse/databaseDrizzle ORM with PostgreSQL. ~15 schema tables (users, agents, workflows, chat, billing, wallets, marketplace, workspace, audit-logs, etc.)

Communication & Protocols

PackagePurpose
@the-new-fuse/relay-coreWebSocket relay, Redis pub/sub, TNF Envelope protocol, protocol translators (A2A, OpenAI, Anthropic, LangChain, CrewAI), JWT auth, Master Agent Registry, heartbeat monitoring
@the-new-fuse/mcp-coreFull MCP client/server/broker implementation
@the-new-fuse/a2a-coreAgent-to-Agent protocol v0.3.0 (Linux Foundation spec)
@the-new-fuse/ag-ui-coreAG-UI protocol (Microsoft's agent-UI spec)
@the-new-fuse/ap2-protocolAP2 protocol integration (HTTP-based, Zod)

Agent & Workflow Layer

PackagePurpose
@the-new-fuse/agentCore agent abstractions, NestJS providers, Redis-backed state
@the-new-fuse/coreLargest shared package: auth, AI adapters (Anthropic, Google), analysis, chat, workflow, vectordb (ChromaDB), webhooks, Supabase client
@the-new-fuse/workflow-engineUnifiedWorkflowEngine (EventEmitter-based): builder, executor, validator, repository
@the-new-fuse/core-vector-dbVector database service (Qdrant + ChromaDB) with gRPC + MCP interfaces

Integrations

PackagePurpose
@the-new-fuse/claude-skillsClaude Skills format: parser, loader, executor
@the-new-fuse/gemini-browser-skillChrome's built-in Gemini AI automation
@the-new-fuse/jules-integrationGoogle Jules coding agent integration (GitHub Issues, Redis queuing)
@the-new-fuse/jules-skillClaude skill wrapper for Jules delegation
@the-new-fuse/n8n-workflowsCommunity n8n workflow fetching, parsing, categorization

UI & Developer Tools

PackagePurpose
@the-new-fuse/ui-consolidatedShared UI component library (tsup)
@the-new-fuse/tnf-cliCLI binary (tnf-agent) for terminal agent messaging via Redis
@the-new-fuse/securityEncryption, security middleware, rate limiting, audit logging
@the-new-fuse/build-optimizationAdaptive build system: detects RAM, adjusts concurrency/strategy
@the-new-fuse/port-managementPort assignment management across the monorepo

Key Patterns

TNF Envelope Protocol

The canonical inter-agent message format, defined in packages/relay-core/src/protocol/tnf-envelope.ts and validated with Zod:

  • Message types: command, event, task, state-sync, query, response
  • Agent identity: id, role, platform, capabilities
  • Context: workflowId, stepId, sessionId, channelId, parentMessageId
  • Transport: WebSocket relay or Redis pub/sub

MCP Integration (4 modes)

  1. TNF as MCP Server — API exposes agents/workflows/chat as MCP tools via TNFMCPModule
  2. TNF as MCP Clientpackages/mcp-core/ provides full client. VSCode extension uses MCPService
  3. Network MCP Serverapps/mcp-servers/tnf-network-mcp/ exposes network management as tools
  4. Relay MCP Transport — MCP as one of the relay's transport mechanisms

Protocol Translation

The relay-core implements adapters for multiple agent communication standards:

  • A2A v0.3.0 (Linux Foundation)
  • AG-UI (Microsoft)
  • OpenAI function calling format
  • Anthropic XML tool format
  • LangChain / CrewAI formats

The ProtocolTranslator converts between any of these, enabling cross-framework agent collaboration.

Auth Stack

  • Firebase — Browser-side auth UI (Google sign-in, etc.)
  • JWT — API issues its own access/refresh tokens (@nestjs/jwt + bcrypt)
  • Web3Auth — Crypto wallet authentication
  • Relay JWT — Separate JWT auth for agents connecting to relay

OpenClaw Mesh

Federated gateway network using the openclaw npm package with Claude Pro OAuth:

  • Local: ws://127.0.0.1:18789
  • Cloud Primary: openclaw-cloud-production-934c.up.railway.app
  • Cloud Secondary: openclaw-primary-production.up.railway.app
  • Cloud Sandbox: openclaw-sandbox-cloud-production.up.railway.app
  • Model: anthropic/claude-opus-4-6

Premium UI Components

Located at apps/frontend/src/components/ui/premium/:

  • GlassCard — Replaces Card/CardContent/CardHeader/CardTitle
  • PremiumButton — Variants: primary, secondary, outline, ghost, danger, gradient
  • PremiumInput, PremiumSelect, PremiumTextarea, ToggleSwitch, StatsCard, ActionCard, IconButton

Import all from @/components/ui/premium.

Database

ORM: Drizzle ORM with PostgreSQL

Schema files in packages/database/src/drizzle/schema/:

SchemaPurpose
users.tsUsers, auth sessions, login attempts
agents.tsAgents, metadata, NFTs, registrations
workflows.tsWorkflows, steps, executions
chat.tsChat sessions, messages
tasks.tsTasks with priority/status
billing.tsBilling/subscription data
wallets.tsSmart account wallets, transactions
marketplace.tsNFT agent marketplace listings
workspace.tsWorkspace multi-tenancy
audit-logs.tsSecurity audit trail
pnpm run db:generate     # Generate schema from changes
pnpm run db:migrate      # Run migrations
pnpm run db:push         # Push schema directly (dev)
pnpm run db:studio       # Open Drizzle Studio GUI

The .agent/ Directory

AI agent operating instructions for any AI working in this codebase:

.agent/
├── SYSTEM_PROMPT.md          # Global identity prompt
├── CODEBASE_INTELLIGENCE.md  # Auto-indexing system docs
├── RESOURCE_REGISTRY.md      # Typed catalog of all TNF resources
├── ROLE_DEFINITIONS.md       # Agent role specs
├── agents/                   # 16 specialized agent personas
├── skills/                   # 15+ skill modules
├── workflows/                # Slash-command procedures
├── context/                  # System knowledge docs
└── session-logs/             # Past session histories

Project Structure

The-New-Fuse/
├── apps/
│   ├── api/                    # Main NestJS API server (port 3001)
│   ├── api-gateway/            # NestJS gateway (port 3005)
│   ├── backend/                # Secondary NestJS service (port 3004)
│   ├── frontend/               # React + Vite SPA (port 3000)
│   ├── relay-server/           # WebSocket relay hub
│   ├── chrome-extension/       # Browser AI automation (V7)
│   ├── vscode-extension/       # VS Code extension (v9.1.0)
│   ├── electron-desktop/       # Electron desktop app
│   ├── picoclaw-overseer/      # Go-based lightweight AI agent
│   ├── mcp-servers/            # MCP tool servers
│   ├── cloud-sandbox/          # Playwright browser sandbox
│   ├── visualization-hub/      # D3.js agent network viz
│   ├── ai-arcade/              # Agent marketplace
│   └── skideancer-ide/         # Theia cloud IDE (excluded from workspace)
├── packages/
│   ├── types/                  # Shared TypeScript types
│   ├── database/               # Drizzle ORM + PostgreSQL schemas
│   ├── relay-core/             # WebSocket relay, protocols, TNF Envelope
│   ├── mcp-core/               # MCP client/server/broker
│   ├── a2a-core/               # Agent-to-Agent protocol
│   ├── ag-ui-core/             # AG-UI protocol
│   ├── core/                   # AI adapters, auth, vectordb, webhooks
│   ├── agent/                  # Agent abstractions
│   ├── workflow-engine/        # Workflow executor
│   ├── security/               # Encryption, middleware, audit
│   ├── ui-consolidated/        # Shared UI components
│   ├── tnf-cli/                # Terminal agent CLI
│   ├── build-optimization/     # Adaptive build system
│   └── ...                     # 25+ more packages
├── .agent/                     # AI agent instructions & personas
├── docs/                       # Documentation (1,200+ files)
├── turbo.json                  # Turbo pipeline config
├── pnpm-workspace.yaml         # Workspace definition
├── docker-compose.dev-simple.yml  # Dev infrastructure (PG + Redis)
├── railway.toml                # Railway deployment (15+ services)
└── Dockerfile.railway          # Multi-stage Railway build

Development Commands

# Infrastructure
pnpm run docker:start       # Start PostgreSQL + Redis
pnpm run docker:stop        # Stop Docker services
pnpm run docker:status      # Check service status
pnpm run docker:logs        # View logs
pnpm run docker:test        # Test connectivity

# Development
pnpm run dev                # Start all services
pnpm run dev:no-ide         # Core services only (fastest)
pnpm run dev:frontend       # Frontend only
pnpm run dev:backend        # Backend only

# Building
pnpm run build              # Build all (via Turbo)
pnpm run type-check         # TypeScript checking

# Quality
pnpm run lint               # Lint all code
pnpm run format             # Format code
pnpm run test               # Run all tests

# Database
pnpm run db:generate        # Generate Drizzle schema
pnpm run db:migrate         # Run migrations
pnpm run db:push            # Push schema (dev)
pnpm run db:studio          # Drizzle Studio GUI

# Agent Management
pnpm run claude:agents:sync      # Sync .claude agents
pnpm run claude:agents:register  # Register agents in DB
pnpm run claude:agents:search    # Search agent ecosystem
pnpm run claude:agents:status    # Agent system status

# Workspace Operations
pnpm --filter @the-new-fuse/[package] add [dep]    # Add dependency
pnpm --filter @the-new-fuse/[package] run [cmd]    # Run command in package
pnpm -r run [cmd]                                   # Run in all packages

# Cleaning
pnpm run clean              # Clean build artifacts
pnpm run clean:full         # Full clean + remove node_modules

Deployment

Deployed on Railway with 15+ services defined in railway.toml.

# Deploy all via Railway CLI
railway up --service TheNewFuse --environment production

# Or deploy individual services
railway up --service api-gateway --environment production

Key Railway services: TheNewFuse (frontend), api-gateway, api, backend, openclaw-cloud, openclaw-primary, openclaw-sandbox-cloud, picoclaw-tester, picoclaw-subject, picoclaw-perplexity, core-vector-db, tnf-cloud-sandbox

Technology Stack

LayerTechnologies
FrontendReact 19, Vite 7, TypeScript, ReactFlow, Monaco Editor, Three.js, TanStack Query, Redux Toolkit, Firebase SDK
BackendNestJS, TypeScript, Drizzle ORM, GraphQL (Apollo), Bull (job queues), Swagger
DatabasePostgreSQL 14, Redis 6
ProtocolsMCP, A2A v0.3.0, AG-UI, TNF Envelope, WebSocket
AI ProvidersAnthropic, OpenAI, Google (Gemini)
DesktopElectron, Tauri
Buildpnpm, Turborepo, Docker, tsup
DeploymentRailway, Nixpacks, GitHub Actions
Edge AIPicoClaw (Go), OpenClaw (Claude Pro OAuth)

Documentation

By Topic

TopicPrimary Doc
Architecturedocs/architecture/ARCHITECTURE_STANDARDS.md
Agent Developmentdocs/agents/COMPLETE-AGENT-GUIDE.md
Agent Communicationdocs/AGENT_COMMUNICATION_PROTOCOL.md
API Usagedocs/API_USAGE_GUIDE.md
GraphQLapps/api/src/graphql/README.md
MCP Integrationapps/backend/src/modules/mcp/README.md
Deploymentdocs/deployment/DEPLOYMENT_GUIDE.md
Railwaydocs/deployment/RAILWAY_DEPLOYMENT_GUIDE.md
Securitydocs/security/SECURITY_BEST_PRACTICES.md
Testingdocs/testing/TESTING_SETUP_COMPLETE.md
Design Systemdocs/PREMIUM_THEME_MANIFEST.md
Chrome Extensionapps/chrome-extension/README.md
VS Code Extensionapps/vscode-extension/README.md
Workflowsdocs/workflows/WORKFLOW_QUICKSTART.md

Package Manager

This project uses pnpm exclusively. Do not use npm or yarn.

License

[Add license information here]

Support

Skills Info
Original Name:drizzle-expertAuthor:whodaniel