Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
61 changes: 61 additions & 0 deletions .claude/commands/todo_guide
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Claude Code Todo System Guide

## How Todos Actually Work

The todo system in Claude Code stores todo lists as JSON files with UUID names in:
```
/home/gotime2022/.claude/todos/
```

Each session gets a unique UUID, for example:
- `/home/gotime2022/.claude/todos/a64ca605-74cc-4915-afa3-19ac8c315b41.json`

## The Problem

1. Each new Claude Code session creates a NEW todo file
2. Previous session todos are saved but not loaded
3. This creates the illusion that todos don't persist

## The Solution

To access todos from previous sessions:

1. List recent todo files:
```bash
ls -t /home/gotime2022/.claude/todos/*.json | head -10
```

2. Read a specific todo file:
```
Read(/home/gotime2022/.claude/todos/[UUID].json)
```

3. Find non-empty todo files:
```bash
for f in $(ls -t /home/gotime2022/.claude/todos/*.json | head -20); do
size=$(wc -c < "$f")
if [ $size -gt 10 ]; then
echo "File: $f (size: $size)"
cat "$f" | head -5
fi
done
```

## Permissions Required

Add these to `.claude/settings.json`:
```json
"Read(/home/gotime2022/.claude/todos/*.json)",
"TodoRead()",
"TodoWrite(*)"
```

## Current Session Todo Commands

- `TodoRead()` - Read current session's todos
- `TodoWrite(todos)` - Update current session's todos
- `/todo` - Display todos in interactive mode

## The Real Issue

The todo system works but lacks session continuity. Each session is isolated, which breaks the workflow when you need to continue work from a previous session.
File renamed without changes.
File renamed without changes.
91 changes: 56 additions & 35 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,46 +1,67 @@
# DevLoopAI Environment Variables
# MCP Server Environment Variables
# Copy this file to .env and fill in your actual values
# NEVER commit the .env file to version control

# API Keys - REQUIRED
ANTHROPIC_API_KEY=your_anthropic_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
GEMINI_API_KEY=your_gemini_api_key_here
# GitHub MCP Server
GITHUB_TOKEN=your_github_personal_access_token

# Supabase Configuration - REQUIRED
SUPABASE_URL=your_supabase_project_url
SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# OpenAI Tools MCP Server
OPENAI_API_KEY=your_openai_api_key

# GitHub Configuration - OPTIONAL
GITHUB_TOKEN=your_github_personal_access_token
GITHUB_ORG=your_github_organization
# Anthropic Comprehensive MCP Server
ANTHROPIC_API_KEY=your_anthropic_api_key

# Slack Configuration - OPTIONAL
SLACK_BOT_TOKEN=your_slack_bot_token
SLACK_APP_TOKEN=your_slack_app_token
# Supabase MCP Server
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=your_supabase_service_key
SUPABASE_ACCESS_TOKEN=your_supabase_access_token

# Vercel v0 MCP Server (for AI component generation)
V0_API_KEY=your_v0_api_key

# Redis Configuration - OPTIONAL
REDIS_URL=redis://localhost:6379
# Vercel Deploy MCP Server (for deployments)
VERCEL_TOKEN=your_vercel_deploy_token

# Gemini MCP Server
GEMINI_API_KEY=your_gemini_api_key

# Slack MCP Server
SLACK_BOT_TOKEN=your_slack_bot_token
SLACK_USER_TOKEN=your_slack_user_token

# Application Configuration
NODE_ENV=development
NEXT_PUBLIC_API_URL=http://localhost:8080
API_PORT=8080
FRONTEND_PORT=3001
# Redis MCP Server
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=optional_redis_password

# Security
JWT_SECRET=generate_a_strong_random_string_here
SESSION_SECRET=generate_another_strong_random_string_here
# Context7 MCP Server
CONTEXT7_API_KEY=your_context7_api_key

# Feature Flags
ENABLE_MCP_SERVERS=true
ENABLE_PARALLEL_EXECUTION=true
ENABLE_AUTO_SAVE=true
# Browserbase MCP Server
BROWSERBASE_API_KEY=your_browserbase_api_key
BROWSERBASE_PROJECT_ID=your_browserbase_project_id

# Logging
LOG_LEVEL=info
LOG_FORMAT=json
# Hostinger MCP Server
HOSTINGER_API_KEY=your_hostinger_api_key

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/devloop
# MCP Server Ports (defaults shown)
BRAVE_SEARCH_MCP_PORT=8003
FILESYSTEM_MCP_PORT=8006
MEMORY_MCP_PORT=8007
VERCEL_V0_MCP_PORT=8010
GITHUB_MCP_PORT=8011
OPENAI_TOOLS_MCP_PORT=8012
SUPABASE_MCP_PORT=8013
GEMINI_MCP_PORT=8014
ANTHROPIC_MCP_PORT=8015
SEQUENTIAL_THINKING_MCP_PORT=8016
SLACK_MCP_PORT=8017
REDIS_MCP_PORT=8018
CONTEXT7_MCP_PORT=8019
DOCKER_MCP_PORT=8020
EVERYTHING_MCP_PORT=8021
FETCH_MCP_PORT=8022
BROWSERBASE_MCP_PORT=8023
HOSTINGER_MCP_PORT=8024
VERCEL_DEPLOY_MCP_PORT=8025
ROUTING_MCP_PORT=8026
EOF < /dev/null
84 changes: 84 additions & 0 deletions V0_SERVER_IMPROVEMENTS_SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# V0 Server Major Improvements Summary

## Branch: feat/v0-server-major-improvements

### Overview
This branch contains significant improvements to the Vercel v0 MCP server to address code extraction issues and add new functionality for better file management and feature generation.

## Key Improvements Made

### 1. Fixed Code Extraction Issues
- **Problem**: The v0 server was saving entire AI responses including markdown artifacts and explanatory text
- **Solution**: Updated `_parse_generated_code` method with improved regex patterns to:
- Properly extract code from markdown code blocks
- Handle file markers like ` ```tsx file="path/to/file.ext" ` `
- Remove language identifiers and closing backticks
- Support multiple files in a single response

### 2. Enhanced Multi-File Support
- **Problem**: Generated files were all placed in the same directory regardless of specified paths
- **Solution**: Updated `create_component_files` method to:
- Use the `path` field from file_info dict when provided
- Create proper directory structures based on file paths
- Handle paths that start with `/` or `./` correctly

### 3. Added write_to_file Parameter
- **Enhancement**: Added `write_to_file` parameter to `generate_component` tool
- **Benefits**:
- Allows direct file creation during component generation
- Reduces the need for separate file creation steps
- Includes `target_directory` parameter for flexible file placement

### 4. Implemented v0_update_file Function
- **New Tool**: `v0_update_file` - Updates existing files in-place using v0
- **Features**:
- Reads existing file content
- Improves it based on provided requirements
- Writes the improved code back to the file
- Maintains file structure and API compatibility

### 5. Enhanced improve_component Function
- **Improvements**:
- Added `write_to_file` parameter to directly update files
- Added `file_path` parameter for specifying which file to update
- Better error handling for file write operations

### 6. Added v0_create_feature Function
- **New Tool**: `v0_create_feature` - Creates complete features with multiple components
- **Capabilities**:
- Generates multiple related components for a feature
- Creates optional API endpoints
- Ensures components work together with consistent interfaces
- Handles file creation for all generated components

## Code Quality Improvements

### Error Handling
- Added try/catch blocks around file operations
- Proper error messages when file creation fails
- Partial success reporting when some files are created

### Logging
- Added detailed logging for debugging code extraction
- Log file creation operations with sizes
- Log raw v0 responses for troubleshooting

### File Management
- Consistent UTF-8 encoding with Unix line endings
- Proper path handling for cross-platform compatibility
- Directory creation with parents=True for nested structures

## Testing Recommendations

1. Test multi-file generation with v0
2. Verify file paths are created correctly
3. Test the v0_update_file function on existing components
4. Test v0_create_feature with multiple components
5. Verify markdown artifacts are properly removed

## Next Steps

1. Copy all fixes to devloop3 repository
2. Test with real-world component generation scenarios
3. Add more sophisticated error recovery mechanisms
4. Consider adding component preview functionality
Loading
Loading