The AI Project Manager that Delivers β A Svelte 5 platform for autonomous AI agent orchestration using the Ralph Wiggum methodology.
CoCo is an AI Project Manager β not just another chatbot, but a complete system that can:
The core innovation is treating AI coding as project management, not prompt engineering. Instead of asking an AI to "build an app," you define a PRD, let CoCo decompose it into features, and watch the autonomous loop execute each one systematically.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CoCo AI v1.4.0 β
β (Main Application Shell) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Auth β Payments β Chat β Library β Admin β Projects β Settings β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββ β
β β lib/pm/ β β lib/components/ β β lib/ai/ β β
β β ββββββββββββββ β β ChatInterface β β providers β β
β β β engine/ β β β FileUpload β β tools β β
β β β stores/ β β β ui/ β β utils β β
β β β components/β β ββββββββββββββββββββ βββββββββββββββββ β
β β β - gantt/ β β β
β β β - workflowβ β β
β β β types.ts β β β
β β ββββββββββββββ β β
β ββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Concept | Description |
|---|---|
| PRD | Product Requirements Document with phases and features |
| Feature | A single unit of work (the task for one loop iteration) |
| RPI Workflow | Research β Plan β Implement β Test β Commit |
| Context Zones | Smart (green), Warning (yellow), Dumb (red) token tracking |
| Ralph Loop | Autonomous execution: pick feature, complete it, commit, repeat |
# Navigate to project
cd /Users/christophermangun/Desktop/svelte-ai-master/Mainv2-coco/CoCoAI-v1.4.0
# Install dependencies
pnpm install
# Start development server
pnpm dev
Server runs at: http://localhost:5174
src/
βββ lib/
β βββ pm/ # π― Project Manager Module
β βββ components/
β β βββ gantt/ # Gantt chart visualization
β β β βββ Gantt.svelte # Main timeline component
β β β βββ hooks.ts # Svelte 5 runes hooks
β β β βββ types.ts # Gantt-specific types
β β β βββ utils.ts # Date/calculation helpers
β β βββ workflow/ # XYFlow orchestration
β β β βββ Workflow.svelte # Node graph component
β β β βββ nodes/ # Custom node types
β β β βββ types.ts # Workflow types
β β β βββ utils.ts # Graph utilities
β β βββ ContextMonitor.svelte # Token usage display
β β βββ LoopControls.svelte # Start/Pause/Stop
β βββ engine/
β β βββ index.ts # Core PM orchestrator
β βββ stores/
β β βββ agents.svelte.ts # Multi-agent state
β β βββ loop.svelte.ts # Loop iteration state
β β βββ project.svelte.ts # Project/PRD state
β βββ tools/
β β βββ index.ts # MCP tool definitions
β βββ types.ts # Complete type system
β βββ mock-data.ts # Test data generator
β βββ index.ts # Public exports
βββ routes/
β βββ projects/
β β βββ +page.svelte # Projects list
β β βββ +page.server.ts # List data loader
β β βββ [id]/
β β βββ +page.svelte # Project detail (4 tabs)
β β βββ +page.server.ts # Detail data loader
β βββ api/pm/
β βββ projects/+server.ts # CRUD endpoints
β βββ loop/+server.ts # Loop control
β βββ chat/+server.ts # AI interaction
β βββ execute/+server.ts # Phase execution
The core methodology borrowed from Anthropic's research on long-running agents:
// Simplified flow in src/lib/pm/engine/index.ts
async executeRPI(feature: PRDFeature): Promise<RPIResult> {
// 1. RESEARCH: Understand the codebase and requirements
const research = await this.research(feature);
// 2. PLAN: Create detailed implementation steps with code snippets
const plan = await this.plan(feature, research.output);
// 3. IMPLEMENT: Execute the plan step by step
const implementation = await this.implement(feature, plan.output);
// 4. TEST: Verify the implementation works
const testResult = await this.test(feature);
// 5. COMMIT: Git commit with descriptive message
if (testResult.success) {
await this.commit(feature, implementation.output);
}
return result;
}
Keeping AI in the "smart zone" is critical for quality output:
| Zone | Token Usage | Color | Action |
|---|---|---|---|
| Smart | 0-40% | π’ Green | Full capability |
| Warning | 40-70% | π‘ Yellow | Consider compaction |
| Dumb | 70%+ | π΄ Red | Force compaction |
interface ContextMetrics {
tokensUsed: number;
tokensAvailable: number;
usagePercent: number;
zone: 'green' | 'yellow' | 'red';
shouldCompact: boolean;
}
The system supports multiple agent types for specialized tasks:
| Role | Purpose |
|---|---|
orchestrator |
Coordinates the overall loop |
researcher |
Analyzes codebase and requirements |
planner |
Creates detailed implementation plans |
coder |
Writes the actual code |
qa_reviewer |
Reviews code for quality |
qa_tester |
Writes and runs tests |
fixer |
Handles errors and bug fixes |
Displays features grouped by phase with status indicators:
Full-featured Work Breakdown Structure visualization:
Node graph showing feature relationships:
Real-time progress log:
<!-- src/lib/pm/components/LoopControls.svelte -->
<div class="flex gap-2">
<Button onclick={() => engine.start(projectId)} disabled={isRunning}>
βΆ Start
</Button>
<Button onclick={() => engine.pause()} disabled={!isRunning}>
βΈ Pause
</Button>
<Button onclick={() => engine.stop()} variant="destructive">
βΉ Stop
</Button>
</div>
Six tables power the PM system (defined for Drizzle ORM):
| Table | Purpose |
|---|---|
pm_projects |
Project metadata (name, status, working directory) |
pm_prds |
Product requirements documents |
pm_features |
Individual features with status tracking |
pm_loops |
Execution sessions with config |
pm_iterations |
Loop history (one per feature attempt) |
pm_progress |
Activity stream entries |
# List all projects
GET /api/pm/projects
# Create new project
POST /api/pm/projects
Content-Type: application/json
{
"name": "My Project",
"description": "Project description",
"workingDirectory": "/path/to/code"
}
# Start the PM loop
POST /api/pm/loop
Content-Type: application/json
{
"projectId": "project-123",
"action": "start",
"config": {
"maxIterations": 100,
"autoCommit": true
}
}
# Pause/Resume/Stop
POST /api/pm/loop
{
"projectId": "project-123",
"action": "pause" | "resume" | "stop"
}
# Execute a specific phase
POST /api/pm/chat
Content-Type: application/json
{
"phase": "research" | "plan" | "implement" | "test",
"featureId": "feature-123",
"context": { ... }
}
// Feature: The unit of work
interface PRDFeature {
id: string;
category: 'functional' | 'ui' | 'api' | 'infrastructure' | 'test' | 'documentation';
description: string;
steps: string[];
passes: boolean; // Did it pass verification?
status: FeatureStatus; // pending | in_progress | testing | done | blocked
priority: 1 | 2 | 3 | 4 | 5;
dependencies: string[];
estimatedHours?: number;
actualHours?: number;
}
// Loop: The execution session
interface PMLoop {
id: string;
projectId: string;
status: 'idle' | 'running' | 'paused' | 'completed' | 'error' | 'stopped';
config: LoopConfig;
currentIteration: number;
iterations: LoopIteration[];
}
// Gantt Task: Timeline visualization
interface GanttTask {
id: string;
name: string;
start: Date;
end: Date;
progress: number;
dependencies?: string[];
featureId?: string;
}
npx tsc --noEmit
# Should return 0 errors
pnpm build
Copy .env.example to .env and configure:
# Database
DATABASE_URL=postgresql://...
# AI Provider
OPENROUTER_API_KEY=...
# Auth (if using)
AUTH_SECRET=...
| Feature | Status |
|---|---|
| TypeScript Compiles | β |
| Dev Server Runs | β |
| Projects List Page | β |
| Project Detail (4 Tabs) | β |
| PRD Tab | β |
| Timeline/Gantt Tab | β |
| Workflow/XYFlow Tab | β |
| Activity Tab | β |
| Loop Controls UI | β |
| Context Monitor | β |
| API Endpoints | β |
| Database Schema | β |
| Mock Data | β |
E2E Test Results: 97% pass rate (32/33 tests)
Run tests with:
pnpm test:e2e # Comprehensive test suite
pnpm test:e2e:http # HTTP-only tests
CoCo integrates concepts from:
MIT License - See LICENSE for details.
CoCo AI β The AI Project Manager that actually ships code.