Convert GitHub Copilot instructions for FlowCanvas into Claude Code skill format. Handles AI-powered diagram generation with Excalidraw, MCP integration, and real-time collaboration features.
An AI-powered diagram generation tool that creates professional diagrams with real logos and icons, not just generic rectangles.
FlowCanvas converts natural language prompts into professional diagrams using Excalidraw and Model Context Protocol (MCP). The core innovation is library-aware AI that can search and place actual SVG icons from 100+ Excalidraw libraries.
**CRITICAL: Always use pnpm, never npm or yarn**
1. Dev server runs at `http://localhost:3000`
2. Check if server is running before starting new instance
3. Never create multiple dev servers
4. Use relative paths or explicit `http://localhost:3000` in development
**Implementation Flow:**
1. Index Excalidraw libraries → Clone repo, parse JSON, store in PostgreSQL + Meilisearch
2. Expose via MCP Server → Resources, Tools, Prompts
3. Inject available icons into AI system prompts
**MCP Architecture:**
```
Frontend (Next.js)
↓
MCP Client
↓
MCP Server (Node.js)
├─ Resources: library://catalog
├─ Tools: search_libraries(), generate_diagram()
└─ Prompts: system_diagram_generator
↓
LLM (GPT-4/Claude/Ollama)
↓
Excalidraw JSON with real logos
```
**Mode 1: Anonymous (Local-Only)**
**Mode 2: Authenticated (Cloud Sync)**
When anonymous users sign up:
1. Detect localStorage diagram
2. Create diagram record in Supabase
3. Migrate content to cloud
4. Clear localStorage
5. Show success confirmation
| Feature | Anonymous | Authenticated Free | Pro ($9/mo) |
|---------|-----------|-------------------|-------------|
| Diagrams | 1 (local) | 10 diagrams | Unlimited |
| Storage | 5MB localStorage | 100MB cloud | 10GB cloud |
| AI Generations | 5/day | 20/month | 500/month |
| Multi-device | No | Yes | Yes |
| Folders | No | Yes | Yes |
| Version History | No | 7 days | 90 days |
| Collaboration | No | No | Yes |
**Weeks 1-2: Anonymous Mode**
1. Set up Next.js 14 + TypeScript project
2. Integrate Excalidraw React component
3. Implement localStorage auto-save (2-second debounce)
4. Add export functionality (PNG/SVG)
5. No authentication required
**Weeks 3-4: Library System**
1. Clone and index Excalidraw libraries repository
2. Parse library JSON files
3. Build search API (semantic + keyword matching)
4. Create searchable library panel UI
5. Implement drag-and-drop icon placement
**Weeks 5-6: MCP Server Setup**
1. Install `@modelcontextprotocol/sdk`
2. Configure stdio transport
3. Implement MCP Resources (catalog endpoint)
4. Create MCP Tools (search_libraries, generate_diagram)
5. Integrate OpenAI, Claude, and Ollama providers
**Weeks 7-8: AI Generation**
1. Engineer library-aware prompts
2. Develop smart positioning algorithm
3. Create AI dialog UI with progress indicators
4. Test with different LLM providers
**Week 9: Eraser.io-Style Features**
1. Implement split view (Canvas + Markdown editor)
2. Add bidirectional linking between notes and diagram elements
3. Support MDX format
**Week 10: Template System**
1. Create template categories (System Architecture, Data Flow, Network)
2. Build guided wizard for template selection
3. Enable tech stack selection
4. Generate diagrams from templates
**Week 11: Local LLM Integration**
1. Integrate Ollama
2. Support Llama 3.2 and DeepSeek-Coder
3. Enable fully offline operation
4. Zero API costs mode
**Week 12: Organization Features**
1. Implement folders and tags
2. Add search functionality
3. Create version history system
4. Build diagram management dashboard
**Week 13: Real-time Collaboration**
1. WebSocket setup
2. Cursor tracking
3. Presence indicators
4. Conflict resolution
**Week 14: Performance Optimization**
1. Lazy load libraries
2. Implement caching strategies
3. Optimize bundle size
4. Add loading states
**Week 15: Educational Features**
1. Create interactive tutorials
2. Add example diagrams
3. Build template gallery
4. Documentation
**Week 16: Testing**
1. Unit tests for core functions
2. Integration tests for API
3. E2E tests for user flows
4. Performance testing
**Status: Working**
**Usage:**
1. Click "Live collaboration..." button
2. Click "Start session"
3. Copy generated link
4. Open link in another tab/window
5. Draw in one tab → See updates in real-time!
**Key Files:**
**Limitations:**
**Features:**
**Setup Requirements:**
1. Create Supabase project
2. Configure environment variables
3. Enable Realtime in Supabase dashboard
4. Switch manager in `ExcalidrawWrapper.tsx`
```
src/
├── components/ # React components
├── lib/
│ ├── collaboration/ # Collaboration managers
│ ├── mcp/ # MCP server code
│ └── supabase.ts # Supabase client
├── app/ # Next.js app directory
└── types/ # TypeScript type definitions
```
Always wrap in try-catch blocks:
```typescript
try {
localStorage.setItem('key', JSON.stringify(data));
} catch (error) {
console.error('Storage failed:', error);
// Fallback logic
}
```
Implement proper error boundaries and user feedback:
```typescript
const { data, error } = await supabase
.from('diagrams')
.insert(diagram);
if (error) {
toast.error('Failed to save diagram');
console.error(error);
return null;
}
```
Handle connection failures gracefully and provide fallback options.
1. **Row Level Security (RLS)**: Enable on all Supabase tables
2. **API Keys**: Never commit to version control
3. **Input Validation**: Sanitize all user inputs
4. **XSS Protection**: Escape user-generated content
5. **Rate Limiting**: Implement for AI generation endpoints
1. Using npm/yarn instead of pnpm
2. Starting duplicate dev servers
3. Committing wrong lock files
4. Skipping localStorage error handling
5. Not implementing proper RLS policies
6. Ignoring auto-save debouncing
7. Hard-coding API keys
8. Missing migration flows for anonymous users
**MVP Success Metrics:**
**Production Success Metrics:**
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/flowcanvas-ai-diagram-tool/raw