Overview
Sandcastle is a powerful TypeScript library designed to orchestrate AI coding agents within isolated, configurable sandboxes. It simplifies the process of running, managing, and integrating AI-driven code modifications by providing a unified sandcastle.run() interface. Sandcastle handles the complexities of creating isolated environments, managing code changes through branching strategies, and merging those changes back, making it an ideal solution for automating code development and review pipelines.
Key Features
- Unified Agent Orchestration: Execute AI coding agents with a single, intuitive
sandcastle.run()function. - Flexible Sandboxing: Supports multiple sandbox providers including Docker, Podman, and Vercel, with the ability to create custom providers for tailored environments.
- Configurable Branching Strategies: Precisely control how agent commits are managed, from simple head commits to dedicated branches for review and integration.
- Provider-Agnostic Design: Seamlessly switch between different sandbox environments without altering your agent orchestration logic.
- Automated Workflow Management: Handles the creation and cleanup of sandboxes, worktrees, and Git operations, freeing you to focus on agent logic.
createSandbox()for Reusability: Efficiently run multiple agents or iterative development cycles within a single, persistent sandbox, preserving dependencies and build artifacts.createWorktree()for Independent Worktree Management: Manage Git worktrees as first-class entities, enabling interactive sessions before handing them off to sandboxed agents.- Extensive Configuration Options: Fine-tune agent behavior, sandbox setup, lifecycle hooks, timeouts, and logging for complete control over your AI workflows.
Typical Use Cases
- Automated Code Review Pipelines: Integrate AI agents into your CI/CD to automatically review and even fix code based on predefined rules or prompts.
- Parallel Agent Execution: Run multiple AI agents concurrently in independent sandboxes to accelerate development tasks, such as feature implementation or bug fixing.
- AI-Driven Feature Development: Empower AI agents to implement new features by providing them with clear specifications and allowing them to commit changes to dedicated branches.
- Complex Refactoring and Migration: Orchestrate AI agents to perform large-scale code refactoring or data migration tasks within safe, isolated environments.
- Interactive Agent Exploration: Utilize
interactive()andcreateSandbox()for hands-on development with AI agents, iterating on prompts and observing their output in real-time. - Custom Tooling Development: Build bespoke developer tools that leverage AI agents for tasks like code generation, debugging assistance, or documentation creation.
