### SplitMind Development Environment Setup Source: https://github.com/webdevtodayjason/splitmind/blob/main/README.md Instructions to set up the SplitMind development environment, including cloning the repository, installing dependencies, starting the backend development server, and initiating the frontend hot-reload development server. ```bash # 1. Fork and clone git clone https://github.com/yourusername/splitmind.git cd splitmind # 2. Install dependencies python setup.py # 3. Start development server python launch-dashboard.py --dev # 4. Frontend development cd dashboard/frontend npm run dev # Hot reload development ``` -------------------------------- ### Example TodoWrite Task List Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/claude-template.md An illustrative example demonstrating how to structure tasks when using the TodoWrite tool, outlining typical development steps from project setup to committing changes. This helps in organizing and tracking progress effectively. ```text Use TodoWrite to create todos: - Set up project structure - Install dependencies - Create main components - Add styling - Test functionality - Commit changes ``` -------------------------------- ### Integration Task Example for Homepage Components Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/conflict-prevention-guide.md An example of a dedicated integration task designed to consolidate components, ensure consistent styling, and resolve any conflicts after individual feature tasks are completed. ```plaintext Task 12: Homepage Integration Dependencies: [hero_section, feature_cards, contact_section] Description: - Integrate all homepage components into app/page.tsx - Ensure consistent spacing and styling - Add smooth scroll navigation - Resolve any conflicts between sections ``` -------------------------------- ### Start SplitMind Backend Server Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/test-onboarding.md Command to navigate to the backend directory and start the Python dashboard server. This is a prerequisite for testing the frontend components and interacting with the backend APIs. ```bash cd /Users/jasonbrashear/code/cctg python launch-dashboard.py ``` -------------------------------- ### Initial Setup and Launch of SplitMind Dashboard Source: https://github.com/webdevtodayjason/splitmind/blob/main/README.md Provides the complete sequence of commands to clone the SplitMind repository, perform the initial Python setup, and then launch the web-based command center dashboard. This prepares the development environment and makes the UI accessible for further configuration and project management. ```bash git clone https://github.com/webdevtodayjason/splitmind.git cd splitmind python setup.py ``` ```bash python launch-dashboard.py ``` -------------------------------- ### Launch SplitMind with A2AMCP Infrastructure Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-USAGE-GUIDE.md This bash script automates the setup process for SplitMind with A2AMCP. It initiates the A2AMCP server infrastructure using Docker containers, configures the Claude CLI for seamless MCP communication, and launches the SplitMind dashboard, providing real-time coordination status. ```bash ./launch-with-a2amcp.sh ``` -------------------------------- ### Develop Worktree Initialization System for Git Worktrees Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/AGENT_COORDINATION_PLAN.md Implements a Python class `WorktreeInitializer` to manage the setup of git worktrees for individual tasks. It handles creating worktrees from the correct base branch, copying necessary initialization files from completed dependencies, and running setup commands like `pnpm install` based on task type and dependencies. ```python class WorktreeInitializer: """ Handles proper worktree setup based on task dependencies """ def initialize_worktree(self, task, project_path): worktree_path = project_path / "worktrees" / task.branch # Create worktree from the latest merged state base_branch = self.get_base_branch(task) subprocess.run([ "git", "worktree", "add", str(worktree_path), "-b", task.branch, base_branch # Start from latest relevant merge ]) # Copy initialization files from completed dependencies for dep_id in task.initialization_deps: self.copy_initialization_files(dep_id, worktree_path) # Run setup commands self.run_setup_commands(task, worktree_path) def get_base_branch(self, task): """ Determine the best starting point for this task """ if task.initialization_deps: # Start from the latest dependency merge return f"merge-{task.initialization_deps[-1]}" return "main" def run_setup_commands(self, task, worktree_path): """ Run necessary setup based on task type """ os.chdir(worktree_path) # Install dependencies if package.json exists if (worktree_path / "package.json").exists(): subprocess.run(["pnpm", "install"]) # Type-specific setup if "framework" in task.dependencies: # Ensure Next.js is properly initialized subprocess.run(["pnpm", "next", "telemetry", "disable"]) ``` -------------------------------- ### Verify MCP Server Configuration in Claude Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-USAGE-GUIDE.md Example JSON configuration for the Claude CLI, showing how the SplitMind MCP server should be defined for agent coordination. ```json { "mcpServers": { "splitmind-coordination": { "command": "docker", "args": ["exec", "-i", "splitmind-mcp-server", "python", "/app/mcp_server_redis.py"] } } } ``` -------------------------------- ### Component Composition Pattern Examples Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/conflict-prevention-guide.md Illustrates both problematic and effective component composition patterns. The 'Bad' example shows direct modification of shared files leading to conflicts, while the 'Good' example demonstrates a registry-based approach for conflict-free integration. ```typescript // Bad: Modifying existing page // app/page.tsx export default function Home() { return (
// Agent 2 adds this line - CONFLICT!
) } // Good: Component registry pattern // lib/page-sections.ts export const pageSections = { home: [] // Each agent adds their section here } // app/page.tsx (set up once) import { pageSections } from '@/lib/page-sections' export default function Home() { return (
{pageSections.home.map((Section, i) => (
))}
) } ``` -------------------------------- ### MCP Commands for Onboarding Modal Examples Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/test-onboarding.md A collection of `claude mcp` commands used as examples within the Onboarding Modal. These commands demonstrate how to add different types of Message Control Protocols (MCPs) including Dart with a token, Context7 with SSE transport, Playwright, BrowserMCP, and copying from Claude Desktop. ```bash # Dart (with token) claude mcp add-json dart '{"command":"npx","args":["-y","dart-mcp-server"],"env":{"DART_TOKEN":"dsa_9aa6........."}}' # Context7 claude mcp add --transport sse context7 https://mcp.context7.com/sse # Playwright claude mcp add-json playwright '{"command":"npx","args":["@playwright/mcp"]}' # BrowserMCP claude mcp add-json browsermcp '{"command":"npx","args":["@browsermcp/mcp@latest"]}' # Copy from Claude Desktop claude mcp add-from-claude-desktop ``` -------------------------------- ### Backend API Endpoints for MCP Management Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/test-onboarding.md API endpoints implemented for managing Claude CLI and MCPs. These endpoints allow checking CLI installation status, listing installed MCPs, and optionally installing MCP tools. ```APIDOC /api/mcp/check-cli: Method: GET Description: Check Claude CLI installation status. Responses: 200: Status of Claude CLI installation. /api/mcp/list: Method: GET Description: List installed Message Control Protocols (MCPs). Responses: 200: List of installed MCPs. /api/mcp/install: Method: POST Description: Install MCP tools (optional). Parameters: tool_name: string (Name of the MCP tool to install) Responses: 200: Installation status. ``` -------------------------------- ### Troubleshooting A2AMCP Availability Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-USAGE-GUIDE.md Commands to check if the A2AMCP Docker container is running, manually start it, and verify its health status. ```bash docker ps cd A2AMCP && ./quickstart.sh curl http://localhost:5000/health ``` -------------------------------- ### Install A2AMCP SDK Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-INTEGRATION-PLAN.md This command installs the A2AMCP SDK using pip, a Python package installer. It's the first step in setting up the necessary libraries for A2AMCP integration. ```bash pip install a2amcp-sdk ``` -------------------------------- ### Bad Task Description Example Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/conflict-prevention-guide.md An example of a poorly defined task description that is too broad and lacks specific instructions, making it prone to conflicts when multiple agents are involved. ```plaintext Task: Create homepage Description: Build the homepage with hero section, features, and contact form ``` -------------------------------- ### Implement Agent Communication Patterns Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-USAGE-GUIDE.md Python examples for different agent communication patterns: broadcasting messages, querying agents for information, and registering event handlers for specific events like file locking. ```python broadcast_message(project_id, session, "announcement", "Starting refactor") response = query_agent(project_id, from, to, "api", "What's the User schema?") register_event_handler("file_locked", handle_file_lock) ``` -------------------------------- ### Good Task Description Example for Multi-Agent Development Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/conflict-prevention-guide.md An example of a well-defined task description that specifies file ownership, exclusion rules, and integration points, designed to prevent conflicts in multi-agent development workflows. ```plaintext Task: Homepage Hero Section ONLY Description: - Create components/home/HeroSection.tsx - DO NOT modify app/page.tsx (Task 8 will integrate) - DO NOT modify layout.tsx - DO NOT add to package.json - Export component for later integration ``` -------------------------------- ### Python Script to Launch SplitMind Dashboard Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/GUI_PLAN.md This Python script automates the launch of the SplitMind Command Center. It performs dependency checks for required packages like `fastapi`, `uvicorn`, and `websockets`, starts the FastAPI server on a specified port, and can optionally open the dashboard in a web browser. It also supports a development mode for auto-reloading. ```python #!/usr/bin/env python3 """ SplitMind Dashboard Launcher Launch the command center with a single command from project root """ import uvicorn import webbrowser import argparse import os import sys from pathlib import Path def check_dependencies(): """Check if required packages are installed""" required = ['fastapi', 'uvicorn', 'websockets'] missing = [] for package in required: try: __import__(package) except ImportError: missing.append(package) if missing: print(f"Missing dependencies: {', '.join(missing)}") print("Install with: pip install fastapi uvicorn websockets") sys.exit(1) def main(): parser = argparse.ArgumentParser(description='Launch SplitMind Command Center') parser.add_argument('--port', type=int, default=8000, help='Port to run on') parser.add_argument('--no-browser', action='store_true', help='Don\'t open browser') parser.add_argument('--dev', action='store_true', help='Run in development mode') args = parser.parse_args() check_dependencies() # Ensure we\'re in the right directory os.chdir(Path(__file__).parent) print(f"πŸš€ Launching SplitMind Command Center on port {args.port}...") if not args.no_browser: webbrowser.open(f'http://localhost:{args.port}') uvicorn.run( "dashboard.backend.api:app", host="0.0.0.0", port=args.port, reload=args.dev ) if __name__ == "__main__": main() ``` -------------------------------- ### Example Task: Homepage Hero Section Component Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/enhanced-task-master-prompt.md Illustrates a specific task for creating a homepage hero section component, detailing its responsibilities, files to create, files to read, and files it must not modify, along with its dependencies. ```YAML task_5: title: "Homepage Hero Section Component" description: | - Create components/home/hero/HeroSection.tsx - Create components/home/hero/index.ts - Use existing UI components from components/ui/ - Export HeroSection for integration owns_files: [] creates_files: - "components/home/hero/HeroSection.tsx" - "components/home/hero/index.ts" reads_files: - "components/ui/button.tsx" - "lib/utils.ts" forbidden_files: - "app/page.tsx" - "app/layout.tsx" - "package.json" dependencies: ["task_3_ui_library"] ``` -------------------------------- ### Example Integration Task: Homepage Assembly Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/enhanced-task-master-prompt.md Demonstrates an integration task responsible for assembling multiple homepage components into the main application page, specifying its file ownership and dependencies on other feature tasks. ```YAML task_13: title: "Homepage Integration" description: | - Import all homepage components - Assemble in app/page.tsx - Ensure proper spacing - Add section transitions owns_files: - "app/page.tsx" creates_files: [] reads_files: - "components/home/hero/index.ts" - "components/home/features/index.ts" - "components/home/testimonials/index.ts" forbidden_files: [] dependencies: - "task_5_hero" - "task_6_features" - "task_7_testimonials" ``` -------------------------------- ### API Call to Start Orchestrator for a Project Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/TEST_PLAN.md Initiates the orchestrator for a specific project by sending a POST request to the `/api/orchestrator/start` endpoint. This command begins the task management and agent coordination process for the given project, allowing agents to start processing tasks. ```APIDOC curl -X POST http://localhost:8000/api/orchestrator/start \ -H "Content-Type: application/json" \ -d '{"project_id": "hello-splitmind"}' ``` -------------------------------- ### Accept Claude CLI Permissions Source: https://github.com/webdevtodayjason/splitmind/blob/main/TODO.md This command is a one-time setup requirement to accept necessary permissions for the Claude CLI. It allows the orchestrator to properly spawn agents. Without this step, all agent operations will fail. ```Shell claude --dangerously-skip-permissions "test" ``` -------------------------------- ### Python Configuration for Explicit File Ownership Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/conflict-prevention-guide.md Demonstrates how to define explicit file ownership, creation, read permissions, and 'never modify' rules within a Python task configuration, ensuring clear boundaries for AI agents. ```python task_config = { "homepage_hero": { "owns": ["components/home/HeroSection.tsx", "components/home/HeroSection.css"], "creates": ["components/home/HeroSection.tsx", "components/home/HeroSection.css"], "reads": ["lib/utils.ts", "components/ui/button.tsx"], "never_modify": ["app/page.tsx", "app/layout.tsx", "package.json"] } } ``` -------------------------------- ### Check Claude CLI Configuration Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-USAGE-GUIDE.md Command to display the current Claude CLI configuration file, which is essential for verifying MCP server settings. ```bash cat ~/.config/claude-code/config.json ``` -------------------------------- ### Set Priority-Based File Access Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-USAGE-GUIDE.md Python code snippet showing how to assign different access priorities to specific files within a task, influencing agent access order. ```python task.file_priority = { "src/critical.ts": 10, # High priority "src/normal.ts": 5 # Normal priority } ``` -------------------------------- ### Markdown Architecture Rules for Multi-Agent Projects Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/conflict-prevention-guide.md Defines a set of architectural and file modification rules to be included in a CLAUDE.md file, guiding AI agents on component structure, state management, styling, and file ownership to prevent conflicts. ```markdown ## Architecture Rules ### Component Structure - Each major section gets its own folder in components/ - Never modify another task's component folder - Export all components through index.ts ### State Management - Use React Context for global state - Each feature manages its own local state - Never add global state without coordination ### Styling Rules - Use Tailwind classes only - No inline styles - No new CSS files without approval - Reuse existing design tokens ### File Modification Rules - NEVER modify package.json after Task 1 - NEVER modify layout.tsx after Task 2 - NEVER modify global styles after Task 2 - Create new files in your assigned folders only ``` -------------------------------- ### Configure Custom Conflict Strategies Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-USAGE-GUIDE.md Python code snippet demonstrating how to set a custom conflict resolution strategy and timeout for tasks within SplitMind. ```python task.conflict_strategy = "negotiate" # or "wait", "abort", "queue" task.conflict_timeout = 120 # seconds ``` -------------------------------- ### YAML Configuration for Conflict-Free Web Project Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/conflict-prevention-guide.md This YAML configuration defines a project structure for a web development project, organizing tasks into 'waves' (Foundation, Features, Integration). Each task specifies file ownership ('owns'), creation ('creates'), files to avoid touching ('never_touch'), or integration points ('integrates') to minimize merge conflicts among developers. ```yaml Wave 1 - Foundation: task_1: title: "Project Setup" owns: ["package.json", "*.config.*", ".npmrc", ".nvmrc"] task_2: title: "Layout System" owns: ["app/layout.tsx", "app/globals.css", "components/layout/"] task_3: title: "UI Component Library" owns: ["components/ui/", "lib/utils.ts"] Wave 2 - Features: task_4: title: "Homepage Hero" creates: ["components/home/hero/"] never_touch: ["app/page.tsx"] task_5: title: "Homepage Features" creates: ["components/home/features/"] never_touch: ["app/page.tsx"] Wave 3 - Integration: task_10: title: "Homepage Assembly" owns: ["app/page.tsx"] integrates: ["components/home/*/" ``` -------------------------------- ### A2AMCP Agent Communication Protocol Reference Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-USAGE-GUIDE.md This section outlines the mandatory A2AMCP communication tools and functions agents must use for coordination. It defines the API for agent registration, managing todo lists, coordinating file changes, sharing interfaces, and direct agent-to-agent communication, ensuring consistent interaction within the multi-agent system. ```APIDOC MANDATORY: You MUST use the MCP communication tools. 1. Register yourself: register_agent("project-id", "session-name", "task-id", "branch", "description") 2. Create todo list: add_todo("project-id", "session-name", "Research approach", 1) update_todo("project-id", "session-name", "todo-1", "completed") 3. Coordinate files: announce_file_change("project-id", "session-name", "src/api.ts", "modify", "Adding endpoint") release_file_lock("project-id", "session-name", "src/api.ts") 4. Share interfaces: register_interface("project-id", "session-name", "User", "interface User {...}") query_interface("project-id", "User") 5. Communicate: query_agent("project-id", "from", "to", "type", "question") broadcast_message("project-id", "session", "type", "message") ``` -------------------------------- ### View A2AMCP Server and Redis Logs Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-USAGE-GUIDE.md These commands provide real-time access to the operational logs of the A2AMCP server and its associated Redis instance. Monitoring these logs is crucial for debugging, troubleshooting, and understanding the background processes and communication within the multi-agent coordination protocol. ```bash docker-compose -f A2AMCP/docker-compose.yml logs -f mcp-server docker-compose -f A2AMCP/docker-compose.yml logs -f redis ``` -------------------------------- ### Automated A2AMCP Coordination Integration Test with Python Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-TEST-PLAN.md This Python asynchronous function `test_coordination` performs an end-to-end integration test for the A2AMCP system. It uses `httpx` to interact with a local API, creating a project, generating a plan with AI, starting an orchestrator, and then continuously monitoring coordination statistics to verify multi-agent collaboration. ```python import asyncio import httpx import time from datetime import datetime async def test_coordination(): """Run automated A2AMCP coordination tests""" async with httpx.AsyncClient() as client: # Create test project project_data = { "id": f"test-auto-{int(time.time())}", "name": "Automated A2AMCP Test", "path": f"/tmp/test-auto-{int(time.time())}", "project_scope": "Test coordination", "initial_prompt": "Create user management system" } # Create project response = await client.post( "http://localhost:8000/api/projects", json=project_data ) project = response.json() # Generate tasks with AI await client.post( f"http://localhost:8000/api/projects/{project['id']}/generate_plan", json={"prompt": project['initial_prompt']} ) # Start orchestrator await client.post( f"http://localhost:8000/api/orchestrator/start/{project['id']}" ) # Monitor coordination for _ in range(60): # Monitor for 10 minutes stats = await client.get( f"http://localhost:8000/api/orchestrator/coordination_stats/{project['id']}" ) print(f"[{datetime.now()}] Coordination stats: {stats.json()}") await asyncio.sleep(10) if __name__ == "__main__": asyncio.run(test_coordination()) ``` -------------------------------- ### Bash Command to Monitor Project Test Execution Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/TEST_PLAN.md Executes the `monitor-test.py` script using the Python interpreter. This command starts the continuous monitoring process, which checks the project's status and agent activity, logging events and generating a final report once all tasks are completed. ```bash python monitor-test.py ``` -------------------------------- ### Clear Redis File Locks Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-USAGE-GUIDE.md Command to connect to the SplitMind Redis container and clear all project-specific file locks. Use with caution as this can disrupt ongoing operations. ```bash docker exec -it splitmind-redis redis-cli > DEL project:myproject:locks ``` -------------------------------- ### Monitor A2AMCP Data in Redis Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-USAGE-GUIDE.md These commands allow direct inspection of A2AMCP's internal state stored within the Redis database. Users can connect to the Redis instance and query for project details, active agents, todo lists, and file locks to gain insights into the real-time coordination status and data flow. ```bash docker exec -it splitmind-redis redis-cli ``` ```redis-cli KEYS project:* HGETALL project:myproject:agents LRANGE project:myproject:todos:task-001 0 -1 HGETALL project:myproject:locks ``` -------------------------------- ### Launch SplitMind Dashboard Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/GUI_PLAN.md Instructions for launching the SplitMind Command Center dashboard from the project root using a Python script, including an option to specify a custom port for the application. ```bash # Single command to launch from project root python launch-dashboard.py # Or with custom port python launch-dashboard.py --port 8080 ``` -------------------------------- ### Launch SplitMind with A2AMCP and Verify Services Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-TEST-PLAN.md Commands to ensure Docker is running, clone the A2AMCP repository, launch SplitMind with A2AMCP integration, and verify that the SplitMind services are active. ```bash # 1. Ensure Docker is running docker --version # 2. Clone A2AMCP if not already present git clone https://github.com/webdevtodayjason/A2AMCP.git # 3. Launch SplitMind with A2AMCP ./launch-with-a2amcp.sh # 4. Verify services are running docker ps --filter name=splitmind ``` -------------------------------- ### SplitMind Project Directory Structure Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/GUI_PLAN.md An overview of the SplitMind project's file and directory organization, detailing the location of the main entry point, dashboard files (frontend/backend), scripts, and assets for clear project navigation. ```plaintext splitmind/ # Project root β”œβ”€β”€ launch-dashboard.py # Main entry point (in root for easy access) β”œβ”€β”€ dashboard/ # All dashboard files β”‚ β”œβ”€β”€ frontend/ β”‚ β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”‚ β”œβ”€β”€ components/ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ TaskBoard.tsx β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ AgentMonitor.tsx β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ OrchestratorControl.tsx β”‚ β”‚ β”‚ β”‚ └── CommandCenter.tsx β”‚ β”‚ β”‚ β”œβ”€β”€ hooks/ β”‚ β”‚ β”‚ β”œβ”€β”€ services/ β”‚ β”‚ β”‚ └── styles/ β”‚ β”‚ β”œβ”€β”€ dist/ # Built frontend files β”‚ β”‚ └── public/ β”‚ β”‚ └── splitmind-logo-200x190.png β”‚ └── backend/ β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ api.py # FastAPI main app β”‚ β”œβ”€β”€ orchestrator.py # Orchestrator integration β”‚ β”œβ”€β”€ task_manager.py # Task CRUD operations β”‚ └── agent_monitor.py # Agent monitoring β”œβ”€β”€ scripts/ # Existing scripts β”‚ β”œβ”€β”€ format-tasks.py β”‚ └── auto-merge.py β”œβ”€β”€ .claude/ # Claude commands β”œβ”€β”€ assets/ # Project assets β”œβ”€β”€ worktrees/ # Git worktrees └── tasks.md # Task definitions ``` -------------------------------- ### Bash Script to Set Up SplitMind Test Project Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/TEST_PLAN.md A shell script designed to initialize the 'hello-splitmind' project. It creates the project directory, sets up a Git repository with an initial commit, and establishes the .splitmind directory essential for agent operations. ```bash #!/bin/bash # setup-test-project.sh PROJECT_NAME="hello-splitmind" PROJECT_PATH="/Users/jasonbrashear/code/$PROJECT_NAME" # Create project directory mkdir -p "$PROJECT_PATH" cd "$PROJECT_PATH" # Initialize git git init git checkout -b main echo "# Hello SplitMind Test Project" > README.md git add README.md git commit -m "Initial commit" # Create .splitmind directory mkdir -p .splitmind echo "βœ… Test project created at $PROJECT_PATH" ``` -------------------------------- ### Python Function for A2AMCP Prompt Generation Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-INTEGRATION-PLAN.md This Python function `generate_a2amcp_prompt` constructs a detailed prompt for agents, incorporating mandatory A2AMCP coordination instructions. It dynamically includes task-specific details and outlines various coordination actions like registering agents, managing TODOs, coordinating file access, sharing interfaces, and general communication. ```python def generate_a2amcp_prompt(self, task, project_id): session_name = f"task-{task.task_id}" base_prompt = task.prompt or task.description a2amcp_instructions = f""" MANDATORY A2AMCP COORDINATION: 1. FIRST ACTION - Register yourself: register_agent("{project_id}", "{session_name}", "{task.task_id}", "{task.branch}", "{task.title}") 2. CREATE TODO LIST: Break down your task and share progress: - add_todo("{project_id}", "{session_name}", "task description", priority) - update_todo("{project_id}", "{session_name}", "todo_id", "in_progress") 3. COORDINATE FILE ACCESS: Before modifying ANY file: - announce_file_change("{project_id}", "{session_name}", "filepath", "change_type", "description") After completion: - release_file_lock("{project_id}", "{session_name}", "filepath") 4. SHARE INTERFACES: When creating types/interfaces: - register_interface("{project_id}", "{session_name}", "InterfaceName", "definition") 5. COMMUNICATE: - Check who's active: list_active_agents("{project_id}") - Query other agents: query_agent("{project_id}", "{session_name}", "target", "type", "question") - Send heartbeat every 30 seconds: heartbeat("{project_id}", "{session_name}") Your task: {base_prompt} """ return a2amcp_instructions ``` -------------------------------- ### Frontend Service Integration with API and WebSocket Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/GUI_PLAN.md This snippet illustrates how the frontend application connects to the backend API using a dynamically determined base URL and establishes a WebSocket connection for receiving real-time updates. ```typescript // Single API base URL const API_URL = window.location.origin; // WebSocket connection const ws = new WebSocket(`ws://${window.location.host}/ws/updates`); ``` -------------------------------- ### Hello SplitMind Project Directory Structure Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/TEST_PLAN.md Illustrates the intended file and directory layout for the 'Hello SplitMind' test project, providing a clear organizational blueprint for agent-driven development tasks. ```text hello-splitmind/ β”œβ”€β”€ index.html β”œβ”€β”€ styles.css β”œβ”€β”€ script.js β”œβ”€β”€ components/ β”œβ”€β”€ data/ └── tests/ ``` -------------------------------- ### iTerm Integration for Tmux Session Launch Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/GUI_PLAN.md This Python function demonstrates how to programmatically launch iTerm and attach to a specified tmux session using AppleScript, enabling one-click access to agent sessions. ```python # Launch iTerm to tmux session def launch_iterm_session(session_name): applescript = f''' tell application "iTerm" create window with default profile tell current session of current window write text "tmux attach -t {session_name}" end tell end tell ''' subprocess.run(['osascript', '-e', applescript]) ``` -------------------------------- ### JSON Configuration for MCP Servers Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-INTEGRATION-PLAN.md This JSON snippet defines the configuration for 'mcpServers', specifically for 'splitmind-coordination'. It specifies the command and arguments to execute the MCP server via Docker, along with an empty environment object. ```json { "mcpServers": { "splitmind-coordination": { "command": "docker", "args": ["exec", "-i", "splitmind-mcp-server", "python", "/app/mcp_server_redis.py"], "env": {} } } } ``` -------------------------------- ### Markdown Template for Task Descriptions Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/task-assignment-template.md Provides a structured markdown template for defining individual tasks, specifying files that are exclusively owned, files that require coordinated changes, new files to be created, and dependencies on other tasks. This helps in clear communication and avoids conflicts. ```markdown ## Task: [Task Name] ### Owned Files (DO NOT let other agents modify): - src/components/[component-name]/ - src/app/[page-name]/page.tsx ### Shared Files (coordinate changes): - package.json (only add new dependencies) - src/lib/utils.ts (only add new utilities) ### Creates New: - src/components/[component-name]/index.tsx - src/components/[component-name]/styles.css ### Dependencies: - Wait for: Task 1 (Project Setup) - Blocks: Task 8 (Integration) ``` -------------------------------- ### Troubleshoot Agent Registration Issues Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-TEST-PLAN.md Commands to diagnose why agents might not be registering, including checking Docker containers, Claude configuration, and the MCP server status. ```bash 1. Check Docker containers: `docker ps` 2. Verify Claude config: `cat ~/.config/claude-code/config.json` 3. Test MCP server: `docker exec -it splitmind-mcp-server python -m mcp_server_redis` ``` -------------------------------- ### Custom Component Styling with Tailwind and shadcn/ui Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/GUI_PLAN.md This snippet demonstrates how custom Tailwind CSS classes and shadcn/ui components are combined to achieve specific visual effects like neon glow, gradient backgrounds, and enhanced hover states, contributing to the 'Command Center Feel'. ```tsx // Custom Button variant // Glowing Card {/* Agent status */} ``` -------------------------------- ### API Call to Register a Project with the Dashboard Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/TEST_PLAN.md Uses `curl` to send a POST request to the `/api/projects` endpoint, registering a new project with its ID, name, path, description, and maximum agent capacity. This makes the project visible and manageable by the system. ```APIDOC curl -X POST http://localhost:8000/api/projects \ -H "Content-Type: application/json" \ -d '{ "id": "hello-splitmind", "name": "Hello SplitMind Test", "path": "/Users/jasonbrashear/code/hello-splitmind", "description": "Quick test project for agent coordination", "max_agents": 5 }' ``` -------------------------------- ### A2AMCP Orchestrator Integration Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-INTEGRATION-PLAN.md This Python class demonstrates how the SplitMind Orchestrator integrates with A2AMCP. It initializes an A2AMCP client, generates A2AMCP-aware prompts for spawning agents, and monitors agent coordination through the A2AMCP project interface. ```python from a2amcp import A2AMCPClient, Project class A2AMCPOrchestrator(OrchestratorManager): def __init__(self, ws_manager): super().__init__(ws_manager) self.a2amcp = A2AMCPClient(server_url="localhost:5000") async def spawn_agent(self, task, project_id): # Generate A2AMCP-aware prompt prompt = self.generate_a2amcp_prompt(task, project_id) # Standard agent spawning session_name = await super().spawn_agent(task, project_id, prompt) # Monitor via A2AMCP project = Project(self.a2amcp, project_id) await self.monitor_agent_coordination(project, session_name) ``` -------------------------------- ### Create A2AMCP Test Project via API Script Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-TEST-PLAN.md A bash script to create a new test project for A2AMCP coordination features using a `curl` command to interact with the project API, including setting up a unique project ID and initial prompt. ```bash cat > create-test-project.sh << 'EOF' #!/bin/bash PROJECT_ID="test-coordination-$(date +%s)" # Create project via API curl -X POST http://localhost:8000/api/projects \ -H "Content-Type: application/json" \ -d '{ "id": "'$PROJECT_ID'", "name": "A2AMCP Test Project", "path": "/tmp/'$PROJECT_ID'", "project_scope": "Test A2AMCP coordination features", "initial_prompt": "Build a simple web API with user management" }' echo "Created project: $PROJECT_ID" EOF chmod +x create-test-project.sh ``` -------------------------------- ### Bash Script to Create a Test Project Directory Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/TEST_PLAN.md Executes a shell script to set up the necessary directory structure for a new test project. This is a prerequisite step before adding the project to the dashboard or running any tests. ```bash ./setup-test-project.sh ``` -------------------------------- ### SplitMind Project Directory Structure Source: https://github.com/webdevtodayjason/splitmind/blob/main/README.md Overview of the SplitMind project's file and directory organization, showing the main components like the dashboard, agent coordination (A2AMCP), and user project areas. ```text splitmind/ # Main installation β”œβ”€β”€ πŸ“„ README.md # This documentation β”œβ”€β”€ πŸš€ launch-dashboard.py # One-click launcher β”œβ”€β”€ βš™οΈ setup.py # Installation script β”œβ”€β”€ πŸ“Š dashboard/ # Web interface β”‚ β”œβ”€β”€ πŸ”§ backend/ # FastAPI server β”‚ β”‚ β”œβ”€β”€ api.py # REST endpoints β”‚ β”‚ β”œβ”€β”€ orchestrator.py # Agent management β”‚ β”‚ β”œβ”€β”€ coordination_monitor.py # A2AMCP monitoring β”‚ β”‚ β”œβ”€β”€ models.py # Data structures β”‚ β”‚ └── websocket_manager.py # Real-time updates β”‚ └── 🎨 frontend/ # React dashboard β”‚ β”œβ”€β”€ components/ # UI components β”‚ β”œβ”€β”€ services/ # API clients β”‚ └── hooks/ # Custom React hooks β”œβ”€β”€ πŸ€– A2AMCP/ # Agent coordination β”‚ β”œβ”€β”€ mcp-server-redis.py # Coordination server β”‚ └── sdk/ # Python SDK └── πŸ“Š projects/ # User projects └── your-project/ # Individual project β”œβ”€β”€ .splitmind/ # Project metadata β”œβ”€β”€ worktrees/ # Git worktrees └── .git/ # Git repository ``` -------------------------------- ### YAML Configuration for Enhanced Task Definitions Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/AGENT_COORDINATION_PLAN.md This YAML snippet defines enhanced task configurations, including properties like `id`, `title`, `priority`, `merge_order`, `dependencies`, `initialization_deps`, `exclusive_files`, `shared_files`, and `setup_commands`. It illustrates how different tasks (e.g., 'framework', 'styling', 'ui-components') are structured with their specific requirements and file associations. ```yaml # tasks.yaml - Enhanced task definitions tasks: - id: framework title: "Next.js 14 Framework Setup" priority: 10 merge_order: 1 dependencies: [] initialization_deps: [] exclusive_files: - "next.config.ts" - "tsconfig.json" - "src/app/" shared_files: - "package.json" - "README.md" setup_commands: - "pnpm create next-app . --typescript --tailwind --app" - id: styling title: "TailwindCSS Configuration" priority: 9 merge_order: 2 dependencies: [] initialization_deps: ["framework"] # Needs Next.js structure exclusive_files: - "tailwind.config.ts" - "src/styles/" shared_files: - "package.json" - id: ui-components title: "ShadCN/UI Setup" priority: 8 merge_order: 3 dependencies: ["framework", "styling"] initialization_deps: ["framework", "styling"] exclusive_files: - "src/components/" - "components.json" shared_files: - "package.json" ``` -------------------------------- ### Multi-Agent Development Workflow Source: https://github.com/webdevtodayjason/splitmind/blob/main/README.md Outlines the end-to-end development process in Splitmind, from project creation and AI planning to task generation, parallel agent execution, real-time monitoring, and final coordination/merge. ```Diagram Project Creation β†’ AI Planning β†’ Task Generation β†’ Agent Spawning β”‚ β”‚ β”‚ β”‚ β–Ό β–Ό β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Settings β”‚ β”‚ AI Task β”‚ β”‚ Wave β”‚ β”‚ Parallel β”‚ β”‚ & Overview β”‚ β”‚ Master β”‚ β”‚ Based β”‚ β”‚ Execution β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ Tasks β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Real-time β”‚ β”‚Coordination β”‚ β”‚ Monitoring β”‚ β”‚ & Merge β”‚ β”‚ & Control β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` -------------------------------- ### Monitor Splitmind Coordination in Real-time Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-TEST-PLAN.md A bash script to continuously monitor active agents, file locks, and recent messages in the Splitmind Redis instance, providing real-time insights into project coordination. ```bash # Create monitoring script cat > monitor-coordination.sh << 'EOF' #!/bin/bash while true; do clear echo "=== ACTIVE AGENTS ===" docker exec -it splitmind-redis redis-cli HGETALL project:$1:agents echo -e "\n=== FILE LOCKS ===" docker exec -it splitmind-redis redis-cli HGETALL project:$1:locks echo -e "\n=== RECENT MESSAGES ===" docker exec -it splitmind-redis redis-cli LRANGE project:$1:messages -10 -1 sleep 2 done EOF chmod +x monitor-coordination.sh ./monitor-coordination.sh test-coordination ``` -------------------------------- ### Verify Shared Interfaces in Redis Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-TEST-PLAN.md Commands to list all shared interfaces and retrieve the definition of a specific interface (e.g., 'User') from Redis, confirming successful interface sharing among agents. ```bash # List shared interfaces docker exec -it splitmind-redis redis-cli HKEYS project:test-coordination:interfaces # Get interface definition docker exec -it splitmind-redis redis-cli HGET project:test-coordination:interfaces User ``` -------------------------------- ### Verify Agent Registration and Todos in Redis Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-TEST-PLAN.md Commands to check if agents are successfully registered in Redis and to inspect the todo list for a specific task within the 'test-coordination' project. ```bash # Check registered agents docker exec -it splitmind-redis redis-cli HGETALL project:test-coordination:agents # Check agent todos docker exec -it splitmind-redis redis-cli LRANGE project:test-coordination:todos:task-001 0 -1 ``` -------------------------------- ### Follow A2AMCP Server and Redis Logs Source: https://github.com/webdevtodayjason/splitmind/blob/main/A2AMCP-TEST-PLAN.md Commands to follow the real-time logs of the A2AMCP Message Coordination Protocol (MCP) server and the Redis instance, useful for debugging and monitoring system operations. ```bash # Follow MCP server logs docker-compose -f A2AMCP/docker-compose.yml logs -f mcp-server # Follow Redis logs docker-compose -f A2AMCP/docker-compose.yml logs -f redis ``` -------------------------------- ### Backend API Endpoints Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/GUI_PLAN.md This section details the REST API endpoints implemented in the FastAPI backend for managing tasks, agents, orchestrator controls, and configuration. It also includes the WebSocket endpoint for real-time updates. ```APIDOC GET /api/tasks - List all tasks POST /api/tasks - Create task PUT /api/tasks/{id} - Update task DELETE /api/tasks/{id} - Delete task GET /api/agents - List running agents POST /api/orchestrator/start - Start orchestrator POST /api/orchestrator/stop - Stop orchestrator GET /api/config - Get configuration PUT /api/config - Update configuration WS /ws/updates - Real-time updates ``` -------------------------------- ### SplitMind Command Center UI Layout Concept Source: https://github.com/webdevtodayjason/splitmind/blob/main/docs/GUI_PLAN.md A conceptual ASCII art diagram illustrating the main layout of the SplitMind Command Center dashboard, showing the arrangement of Orchestrator Control, Task Board, and Agent Monitor sections for visual clarity. ```plaintext β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ [Logo] SplitMind Command Center [Dark Mode]β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Orchestratorβ”‚ β”‚ Task Board β”‚ β”‚ β”‚ β”‚ Control β”‚ β”‚ [Add Task] [Refresh] β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ β”‚ [β–Ά Launch] β”‚ β”‚ β”‚TODO β”‚CLAIMβ”‚WORK β”‚DONE β”‚ β”‚ β”‚ β”‚ β”‚ [β–  Stop] β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚Task1β”‚Task2β”‚Task3β”‚Task4β”‚ β”‚ β”‚ β”‚ β”‚ Max Agents: β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ [5] β”‚ β”‚ β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Agent Monitor β”‚ β”‚ β”‚ β”‚ Agent 1: auth-feature [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘] 75% [iTerm]β”‚ β”‚ β”‚ β”‚ Agent 2: api-endpoints [β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘] 45% [iTerm]β”‚ β”‚ β”‚ β”‚ Agent 3: ui-components [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘] 90% [iTerm]β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ β”‚ β”‚ Live Metrics Graph β”‚ β”‚ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` -------------------------------- ### SplitMind Complete System Reset Source: https://github.com/webdevtodayjason/splitmind/blob/main/README.md A comprehensive script to stop all SplitMind processes, clear configuration and Redis data, rebuild the frontend, and restart the entire system for a clean state. ```bash # 1. Stop all processes tmux kill-server docker-compose -f A2AMCP/docker-compose.yml down # 2. Clear configuration rm -f config.json projects.json # 3. Reset Redis data docker-compose -f A2AMCP/docker-compose.yml down -v # 4. Rebuild frontend cd dashboard/frontend rm -rf node_modules dist npm install npm run build cd ../.. # 5. Restart everything docker-compose -f A2AMCP/docker-compose.yml up -d python launch-dashboard.py ```