Stoneforge Agent Orchestration Platform

repository·master·Indexed 41 days ago

https://github.com/stoneforge-ai/stoneforge

A multi-agent orchestration platform for coordinating AI coding agents, featuring a web dashboard and runtime. It provides task dispatching, git worktree isolation, and persistent state management. The platform includes @stoneforge/core for hierarchical IDs and domain types, @stoneforge/quarry for event-sourced element management and full-text search, and a comprehensive design system with CSS and Tailwind v4 integration.

Tokens
206.2K
Snippets
584
Records
916
Agent score
51%

What's inside Stoneforge

  1. What is Stoneforge?

    master

    Stoneforge is a web dashboard and runtime designed for orchestrating multiple AI coding agents in parallel. It is built for developers who need to coordinate a team of agents (e.g., a Planner, Coders, and Reviewers) to avoid common multi-agent issues like merge conflicts, wasted work, and lost context.

    Stoneforge consists of two primary layers:

    • Smithy (@stoneforge/smithy): The orchestrator. It handles agent spawning, task dispatching, session management, worktree isolation, and merge reviews. This is the main package you install.
    • Quarry (@stoneforge/quarry): The underlying data SDK. It provides event-sourced task management, synchronization, and storage. It is used internally by Smithy but is available for custom integrations.
  2. What is Stoneforge?

    master

    Stoneforge is an open-source AI orchestration platform designed for multi-agent coding workflows. It is built to solve the "coordination tax" associated with managing multiple AI agents simultaneously.

    Instead of manually managing multiple terminal sessions, context windows, and potential file conflicts between different agents, Stoneforge provides infrastructure for:

    • Shared Records: Maintaining a unified context and history across agents.
    • Isolated Workbenches: Preventing agents from modifying the same files simultaneously in incompatible ways.
    • Coordination Mechanisms: Automatically dispatching, merging, and recovering agents to ensure productive collaboration without constant human oversight.
  3. Compare Open Source AI Coding Agents

    master

    As of March 2026, several notable open-source AI coding agents exist, each serving different developer needs. Use this summary to choose an agent based on your workflow:

    • OpenCode: A Go-based terminal agent supporting 75+ models. Features 'Build' (full access) and 'Plan' (read-only) modes. Best for model flexibility and local model privacy.
    • Aider: A terminal agent with deep Git integration. It builds a repository map and auto-commits changes with descriptive messages. Best for maintaining clean, reviewable Git histories.
    • Cline: A VS Code extension with 'Plan' and 'Act' modes. It features deep Model Context Protocol (MCP) integration and requires explicit permission for actions. Best for human-in-the-loop editor workflows.
    • OpenHands: A platform/framework for building agents with sandboxed execution and multi-agent collaboration. Best for custom agent workflows and security-conscious environments.
    • Continue: An IDE extension (VS Code/JetBrains) focusing on code completion and source-controlled AI checks that can run in CI. Best for embedding AI into existing IDE workflows.
    • Goose: A terminal agent built by Block that uses MCP servers to extend its capabilities (file ops, terminal, browser). Best for extensibility via the MCP ecosystem.
    • Plandex: Focused on large, multi-file tasks. It accumulates changes in a sandbox for review before applying them and supports plan branching. Best for large refactors.
    • Void: An open-source VS Code fork providing a Cursor-like experience with local configuration and no telemetry. Best for developers wanting an AI-native editor without proprietary lock-in.
  4. What is Stoneforge and how does it work?

    master

    Stoneforge is an orchestration layer designed to manage multiple AI coding agents working in parallel on the same codebase. Unlike standalone agents, Stoneforge handles the operational complexity of scaling AI work across a team.

    Core Functions

    • Task Dispatching: Assigns tasks to specific worker agents.
    • Git Worktree Isolation: Ensures each agent operates in its own isolated worktree to prevent conflicts.
    • Context Handoff: Manages the transfer of context between different agent sessions.
    • Merge Coordination: Coordinates the merging of changes produced by different agents.

    Agent Roles

    The system operates using a role-based model:

    • Director: Plans the tasks and orchestrates the workflow.
    • Workers: Execute the assigned tasks.
    • Stewards: Review the work produced by workers.

    Supported Worker Agents

    Stoneforge currently supports the following as worker agents:

    • Claude Code
    • Codex CLI
    • OpenCode
  5. What is Model Context Protocol (MCP)?

    master

    Model Context Protocol (MCP) is an open standard that provides a uniform way for AI agents (MCP clients) to connect to external tools, data sources, and services (MCP servers). It uses a client-server architecture to handle capability discovery, request formatting, and response parsing, allowing a single integration to work across multiple different AI agents.

    An MCP server exposes three primary types of capabilities:

    • Tools: Executable actions the agent can invoke (e.g., read_file, query database).
    • Resources: Data the agent can read (e.g., API documentation, Git commit history).
    • Prompts: Pre-built instruction templates suggested by the server (e.g., a code review template).

    Because MCP servers are client-agnostic, a single server (like a PostgreSQL MCP server) can be used by various agents such as Claude Code, Cursor, or VS Code with GitHub Copilot.

  6. What is Stoneforge and when should I use it?

    master

    Stoneforge is not a standalone coding agent, but an orchestration layer designed to manage multiple AI agents working in parallel on the same codebase.

    While individual agents (like Claude Code, Codex CLI, or OpenCode) handle specific tasks, Stoneforge manages the coordination overhead that occurs when scaling AI development. It automates task dispatching, monitors progress, handles retries, and manages the merge queue.

    Key Capabilities:

    • Agent-Agnostic Orchestration: Dispatches tasks to various supported agents.
    • Git Worktree Isolation: Isolates agent work in separate worktrees to prevent conflicts during execution.
    • Dependency-Aware Scheduling: Tracks dependencies between tasks to prevent wasted work.
    • Role-Based System: Uses a structured hierarchy of Directors (task assignment), Workers (execution), Stewards (review/merge), and Daemons (automatic dispatch).

    Best for: Teams where coordination between multiple parallel AI agent sessions has become a bottleneck, specifically when managing manual merge conflicts and task juggling.

  7. Git safety rules for multi-agent workspaces

    master

    Stoneforge agents operate within isolated git worktrees in a multi-agent orchestration system. Performing a checkout of a main branch will detach the main workspace from master, breaking the orchestration system for all agents.

    Critical Restrictions

    • NEVER run git checkout master, git checkout main, or git switch master/main.
    • NEVER run git checkout origin/{{baseBranch}} (this detaches HEAD in your worktree).

    If you need to inspect the state of the base branch without switching branches, use these commands:

    • Read a file from the base branch: git show origin/{{baseBranch}}:<path/to/file>
    • Diff against the base branch: git diff origin/{{baseBranch}}..HEAD or git diff origin/{{baseBranch}} -- <file>
    • Check for a specific commit in the base branch: git branch --contains <commit> --list {{baseBranch}}

    If a branch switch is absolutely necessary, create a temporary branch instead: git branch temp-{{baseBranch}}-test origin/{{baseBranch}} && git checkout temp-{{baseBranch}}-test

    # Read a file without switching
    git show origin/{{baseBranch}}:<path/to/file>
    
    # Diff against base branch
    git diff origin/{{baseBranch}}..HEAD
    
    # Create a temporary branch for testing
    git branch temp-{{baseBranch}}-test origin/{{baseBranch}} && git checkout temp-{{baseBranch}}-test
  8. Use Git Worktrees for Isolated Execution

    master

    Stoneforge uses git worktrees to provide each worker with an isolated copy of the repository. This enables safe parallel execution by multiple agents.

    Worker branches follow the naming convention: agent/{worker-name}/{task-id}-{slug}

    Example: agent/Worker1/el-3a8f-add-login-form

    Stoneforge manages the full lifecycle: creation, branch setup, and cleanup after a merge.

  9. Configure Merge Stewards and Integration

    master

    The Merge Steward automates branch integration and testing. It is highly configurable:

    • Functionality: It runs your specified test command. On success, it performs a squash-merge. On failure, it creates a task handoff to a new worker.
    • Configuration Options: You can configure the test command, merge strategy (e.g., squash or merge), auto-push, and auto-cleanup.
    • Merge Providers: Supports GitHub (via Pull Requests) or local smithy (local merge requests with direct squash-merging).

    Steward Types:

    • Merge: Auto-reviews PRs and manages integration.
    • Recovery: Cleans up stuck merges and orphaned tasks.
    • Docs: (Optional) Scans and fixes documentation accuracy.
    • Custom: (Optional) User-defined templates triggered by cron or events.
  10. How Stoneforge and Cursor AI complement each other

    master

    Stoneforge and Cursor AI are not mutually exclusive; they serve different roles in the AI development workflow.

    • Cursor AI is an AI-powered IDE used for interactive work, such as exploring code, writing features, debugging, and prototyping with real-time assistance.
    • Stoneforge is a multi-agent orchestration layer used for background work. It manages a queue of tasks, dispatches them to various AI coding agents, and coordinates the results without interfering with your active development.

    Because Stoneforge operates in isolated git worktrees, its agents never touch your active working tree, allowing you to use Cursor AI (or any other IDE) simultaneously without conflict.

  11. Understand Steward Safety Guardrails and Execution

    master

    To prevent runaway processes and resource exhaustion, Stoneforge implements several safety guardrails for steward sessions:

    • Idle Timeout: By default, a steward is killed if it stops producing output for two minutes.
    • Max Duration Timeout: By default, a steward session is stopped after thirty minutes to prevent runaway execution.
    • Scheduler Overlap Prevention: If a cron-triggered steward is still executing when its next scheduled run time arrives, the scheduler skips the new run to prevent overlapping executions.