This file provides guidance to LLMs when working with code in this repository.
Builder Playground is a CLI tool for spinning up self-contained Ethereum development networks optimized for block building and MEV testing. It uses Go to generate artifacts and orchestrate Docker Compose deployments.
# Build
make build # Build CLI binary
# Testing
make test # Run unit tests (go test -v ./...)
make integration-test # Run integration tests with INTEGRATION_TESTS=true
# Code Quality
make lint # Run gofmt, gofumpt, go vet, staticcheck
make fmt # Format code with gofmt, gci, gofumpt, go mod tidy
# Documentation
make generate-docs # Auto-generate recipe documentation (run after adding/modifying recipes)The system operates in three phases: Artifact Generation → Topology/Manifest Generation → Docker Execution
Components represent individual compute resources (execution clients, consensus clients, sidecars). Each implements the ComponentGen interface:
type ComponentGen interface {
Apply(ctx *ExContext) *Component
}Components use template syntax for dynamic values:
{{Port "name" defaultPort}}- Port declarations{{Service "name" "port"}}- Service connections
Recipes orchestrate multiple components into complete environments. Key methods:
Name(),Description()- MetadataFlags()- CLI flag definitionsArtifacts()- Generates genesis configs, keys, etc.Apply(ctx *ExContext)- Assembles componentsOutput(manifest *Manifest)- User-facing output
Available recipes: L1 (recipe_l1.go), OpStack (recipe_opstack.go), BuilderNet (recipe_buildernet.go)
- Manifest: Describes complete environment topology (services, ports, volumes, artifacts)
- LocalRunner: Executes manifest via Docker Compose, manages health checks
main.go- CLI entry point (Cobra commands)playground/artifacts.go- L1/L2 genesis state, validator keystores, JWT secretsplayground/interactive.go- TUI interfaceplayground/local_runner.go- Docker execution engine
- Create struct implementing
ComponentGeninterface - Implement
Apply(ctx *ExContext) *Component - Use
component.NewService(name)to add services - Use template syntax for ports/connections
- Add health checks with
WithReady()
- Create struct implementing
Recipeinterface - Implement: Name, Description, Flags, Artifacts, Apply, Output
- Register in
main.gorecipes slice - Run
make generate-docsto update documentation
IMPORTANT: When asked to implement something, always follow through completely: 1.. Create a feature branch
- based on the latest
mainbranch - use descriptive branch names like
claude/issue-123-add-feature
- Make the code changes
- Commit the changes
- Push the branch
- Create the PR with
gh pr create --title "..." --body "..."and reference the issue number in the PR description (e.g., "Closes #123")
Do NOT stop at providing links — complete the entire workflow automatically.