Turbo Flow Agentic Development Environment

repository·main·Indexed 41 days ago

https://github.com/marcuspat/turbo-flow

A complete agentic development environment for the Claude ecosystem. Turbo Flow v4.0 integrates Ruflo v3.5 for orchestration, GitNexus for codebase intelligence, and Beads for cross-session memory. It features a three-tier memory protocol, Git Worktrees for agent isolation, and a specialized CLI for AI coordination including commands like cf, cf-swarm, and cf-hive.

Tokens
24.2K
Snippets
61
Records
81
Agent score
50%

What's inside Turbo Flow

  1. Performance Features of Claude-Flow and Agentic-Flow

    main

    Turbo Flow provides significant performance optimizations across its core components:

    Claude-Flow (v2.5.0)

    • Session Forking: Enables 10-20x faster generation for parallel agents.
    • Hook Matchers: Provides 2-3x faster execution for selective hooks.
    • In-Process MCP: Achieves 50-100x faster tool calls.
    • Combined Acceleration: Potential total gains of 100-600x.

    Agentic-Flow

    • Model Selection: Minimal overhead (<100ms).
    • Local ONNX: High-speed local inference (6-300 tokens/sec).
    • Cloud APIs: Low latency for first token (1-3s).
    • Optimization: Automatic intelligent routing.
  2. What is included in the Turbo Flow stack?

    main

    Turbo Flow v4.0 is an agentic development environment that automates the installation of a complex stack in 10 steps. The core components include:

    • Orchestration: Ruflo v3.5 (replaces claude-flow), providing 60+ agents and 215+ MCP tools.
    • Intelligence: GitNexus for codebase knowledge graphs and blast-radius detection.
    • Memory: Beads (@beads/bd) for cross-session project memory using git-native JSONL.
    • Isolation: Git Worktrees per agent with dedicated PG Vector schema namespacing.
    • Plugins: 6 critical plugins including Agentic QE, Code Intelligence, Test Intelligence, Perf Optimizer, Teammate Plugin, and Gastown Bridge.
    • UI/UX: Statusline Pro v4.0 and the uipro-cli design system skill.
    • Spec-driven Dev: OpenSpec integration.
  3. Understand the Turbo Flow Memory Hierarchy

    main

    Turbo Flow utilizes a three-tier memory protocol to manage context across sessions and agents. This hierarchy is defined in the generated CLAUDE.md file:

    1. Beads: Git-native JSONL project memory (issues, decisions, blockers).
    2. Native Tasks: Session-specific memory stored in ~/.claude/.
    3. AgentDB: Long-term orchestration memory powered by RuVector WASM.
  4. Understand the Turbo Flow v4.0 Architecture

    main

    Turbo Flow v4.0 is an agentic development environment organized into several functional layers:

    • Interface Layer: Supports Claude Code CLI, Open WebUI (4 instances), and Statusline Pro v4.0.
    • Orchestration Layer (Ruflo v3.5): The core engine managing 60+ agents, 215+ MCP tools, AgentDB v3, RuVector WASM, and 3-level model routing.
    • Plugin Layer: Includes specialized tools like Agentic QE, Code Intelligence, Test Intelligence, Perf Optimizer, Teammate Plugin, and Gastown Bridge.
    • Codebase Intelligence (GitNexus): A knowledge graph that indexes dependencies, call chains, and execution flows, providing impact radius detection via MCP.
    • Memory Layer (Three Levels):
      • Beads: Project/Git native JSONL memory for issues and decisions.
      • Native Tasks: Session-based memory (~/.claude/).
      • AgentDB: Persistent memory using RuVector WASM acceleration.
    • Isolation Layer: Uses Git Worktrees per agent with automatic PG Vector schema namespacing.
    • Infrastructure: Optimized for DevPod, Codespaces, and Rackspace Spot.
  5. Resolve storage mounting errors (FailedMount)

    main

    When pods are stuck in ContainerCreating with FailedMount events, check the following:

    1. Pod Events: Run kubectl describe pod <pod-name> -n <namespace> and look at the Events section.
    2. Volume Attachment Conflicts: If a volume is stuck attached to an old node, force delete the old pod: kubectl delete pod <old-pod> -n <namespace> --force --grace-period=0.
    3. PVC Status: Verify the PersistentVolumeClaim exists and is bound using kubectl get pvc -n <namespace>.
    4. Storage Class: Ensure you are using valid Rackspace storage classes like rackspace-standard or rackspace-ssd via kubectl get storageclass.
    5. Manual Detach: If the volume is still attached in the Rackspace Cloud Block Storage panel, manually detach it there.
    # Inspect pod events for mounting errors
    kubectl describe pod <nombre-pod> -n <namespace> | grep -A 20 Events
    
    # Force delete a pod to release a volume
    kubectl delete pod <nombre-pod-antiguo> -n <namespace> --force --grace-period=0
    
    # Check PVCs
    kubectl get pvc -n <namespace>
  6. Perform mass operations on Pods and Deployments

    main

    Use these commands for bulk actions within a namespace or across the cluster.

    Mass Pod Deletion (Caution): Deletes all pods in Unknown or Error states across all namespaces using jq to parse the status.

    kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded -o json | \
      jq -r '.items[] | "\(.metadata.namespace) \(.metadata.name)"' | \
      while read ns pod; do kubectl delete pod $pod -n $ns --force --grace-period=0; done

    Deployment Management:

    # Restart all deployments in a namespace
    kubectl rollout restart deployment -n <namespace>
    
    # Scale all deployments to 0 (stop all workloads)
    kubectl get deployments -n <namespace> -o name | xargs -I {} kubectl scale {} --replicas=0 -n <namespace>
    
    # Scale all deployments back to 1
    kubectl get deployments -n <namespace> -o name | xargs -I {} kubectl scale {} --replicas=1 -n <namespace>
    kubectl get deployments -n <namespace> -o name | xargs -I {} kubectl scale {} --replicas=0 -n <namespace>
  7. Quick Start Guide for Turbo Flow

    main

    Follow these steps to clone, install, and run your first task in approximately 5 minutes.

    1. Clone and Install: Clone the repository, navigate to the devpods directory, and run the appropriate boot script for your OS.
    2. Connect to Workspace: Attach to the existing tmux session named workspace.
    3. Activate Aliases: Source your .bashrc to enable new command aliases.
    4. Start MCP Servers: Initialize the Model Context Protocol (MCP) servers.
    5. Execute Task: Use cf-swarm to run an agentic task.

    Note: Always work within a tmux session to ensure all new aliases (such as dsp, cf-swarm, cfs, etc.) are active and available.

    # 1. Clone and install
    git clone https://github.com/marcuspat/turbo-flow-claude.git
    cd turbo-flow-claude/devpods
    ./boot_linux.sh  # or ./boot_macosx.sh
    
    # 2. Connect to tmux
    tmux attach -t workspace
    
    # 3. Activate aliases
    source ~/.bashrc
    
    # 4. Start MCP servers
    af-mcp-start
    
    # 5. Run first task
    cf-swarm "Build a simple REST API"
  8. Setup Turbo Flow in GitHub Codespaces

    main

    To set up Turbo Flow in a GitHub Codespace, create a boot script, paste the provided setup logic, and execute it. This process clones the repository, extracts the devpods directory to your project root, makes scripts executable, and runs the codespace_setup.sh script.

    Steps:

    1. Create and open a boot script:
      touch boot.sh && chmod +x boot.sh && vi boot.sh
    2. Paste the setup script (see code block below) into boot.sh.
    3. Run the script: ./boot.sh.

    Setup Script Content:

    #!/bin/bash
    # Clone the repository
    echo "Cloning repository..."
    git clone https://github.com/marcuspat/turbo-flow-claude.git
    
    # Check if clone was successful
    if [ $? -ne 0 ]; then
        echo "Error: Failed to clone repository"
        exit 1
    fi
    
    # Navigate into the cloned directory
    cd turbo-flow-claude
    
    # Move devpods directory to parent directory
    echo "Moving devpods directory..."
    mv devpods ..
    
    # Go back to parent directory
    cd ..
    
    # Remove the cloned repository
    echo "Removing turbo-flow-claude directory..."
    rm -rf turbo-flow-claude
    
    # Make all shell scripts in devpods executable
    echo "Making scripts executable..."
    chmod +x ./devpods/*.sh
    
    # Run the setup script
    echo "Running codespace_setup.sh..."
    ./devpods/codespace_setup.sh
    
    echo "Script completed!"
    touch boot.sh && chmod +x boot.sh && vi boot.sh
  9. Troubleshoot and manage node issues

    main

    When nodes show as NotReady or have issues:

    1. Inspect: Use kubectl describe node <node-name> to find the cause (e.g., resource exhaustion).
    2. Cordon/Drain: If a node is problematic, use kubectl cordon to stop new pods from scheduling and kubectl drain to safely evict existing pods.
    3. Recovery: If the node is unresponsive, restart it via the Rackspace Control Panel. After fixing, use kubectl uncordon to allow scheduling again.
    # Check node status
    kubectl get nodes
    kubectl describe node <node-name>
    
    # Cordon and drain problem node
    kubectl cordon <node-name>
    kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data --force
    
    # Uncordon after fix
    kubectl uncordon <node-name>
  10. Prevent and fix random pod deaths

    main

    Pods may die or enter Unknown status due to node pressure or infrastructure hiccups. To mitigate this, implement resource limits, Pod Disruption Budgets (PDB), and pod anti-affinity to spread pods across different nodes.

    # 1. Set proper resource limits on a deployment
    kubectl set resources deployment <deployment-name> \
      --limits=cpu=2,memory=4Gi \
      --requests=cpu=1,memory=2Gi \
      -n <namespace>
    
    # 2. Add pod disruption budgets
    kubectl create pdb <pdb-name> \
      --selector=app=<your-app> \
      --min-available=1 \
      -n <namespace>

    3. Add pod anti-affinity to your deployment spec to spread across nodes

    spec:
      template:
        spec:
          affinity:
            podAntiAffinity:
              preferredDuringSchedulingIgnoredDuringExecution:
              - weight: 100
                podAffinityTerm:
                  labelSelector:
                    matchExpressions:
                    - key: app
                      operator: In
                      values:
                      - <your-app>
                  topologyKey: kubernetes.io/hostname
  11. Launch Turbo Flow environment

    main

    You can launch the Turbo Flow environment using three different methods:

    Use DevPod to spin up a pre-configured environment with VS Code as your IDE:

    devpod up https://github.com/marcuspat/turbo-flow --ide vscode

    2. GitHub Codespaces

    Push your code to GitHub and open it in a Codespace; the environment will execute automatically.

    3. Manual Installation

    Clone the repository and run the setup script manually:

    git clone https://github.com/marcuspat/turbo-flow -b main
    cd turbo-flow
    chmod +x devpods/setup.sh
    ./devpods/setup.sh
    source ~/.bashrc
    turbo-status
    devpod up https://github.com/marcuspat/turbo-flow --ide vscode
  12. Configure Turbo Flow for Google Cloud Shell

    main

    To set up Turbo Flow in Google Cloud Shell, use the rapid configuration method by creating and running a boot script. This script clones the repository, moves the devpods directory to the parent folder, and executes the codespace_setup.sh script.

    Installation Steps

    1. Create a boot script in your Google Cloud Shell:
      touch boot.sh && chmod +x boot.sh && vi boot.sh
    2. Paste the configuration script (see code below) into boot.sh.
    3. Run the script: bash boot.sh.
    4. Wait ~5-10 minutes for completion.
    5. Connect to the preconfigured Tmux workspace: tmux attach -t workspace.
    #!/bin/bash
    # Clonar el repositorio
    echo "Clonando repositorio..."
    git clone https://github.com/marcuspat/turbo-flow-claude.git
    
    # Verificar si la clonación fue exitosa
    if [ $? -ne 0 ]; then
        echo "Error: Falló al clonar repositorio"
        exit 1
    fi
    
    # Navegar al directorio clonado
    cd turbo-flow-claude
    
    # Mover directorio devpods al directorio padre
    echo "Moviendo directorio devpods..."
    mv devpods ..
    
    # Regresar al directorio padre
    cd ..
    
    # Eliminar el repositorio clonado
    echo "Eliminando directorio turbo-flow-claude..."
    rm -rf turbo-flow-claude
    
    # Hacer ejecutables todos los scripts shell en devpods
    echo "Haciendo scripts ejecutables..."
    chmod +x ./devpods/*.sh
    
    # Ejecutar el script de configuración
    echo "Ejecutando codespace_setup.sh..."
    ./devpods/codespace_setup.sh
    
    echo "¡Script completado!"