Principle:AI Builder Club Skills Dev Stack Automation
| Knowledge Sources | |
|---|---|
| Domains | Dev_Environments, Automation |
| Last Updated | 2026-10-24 00:00 GMT |
Overview
A pattern for reproducible one-command local development stacks that bring up all services and infrastructure in a managed tmux session, enabling agents to run and drive the application without manual setup.
Description
Dev stack automation solves the problem that agents cannot work a repo if they cannot start it. The principle uses a single script (dev-local.sh) with idempotent subcommands (up, down, status, logs, restart, attach) that manages a tmux session with one window per long-running dev server. Infrastructure containers (Docker) are started if not already running. Port checks verify each service is listening. The script is generated from a template with project-specific placeholders filled from repo discovery. This makes the stack reproducible (same command every time) and drivable (logs reachable, app accessible via browser).
Usage
Use this principle as the "executable" pillar of the codebase harness. Apply when a repo has multiple services, infrastructure dependencies, or complex startup that an agent cannot reliably reproduce manually.
Theoretical Basis
The principle rests on reproducibility through encapsulation: wrapping all startup logic in a single idempotent command eliminates the variability that breaks agent workflows. The tmux session model provides process isolation (each service in its own window) with centralized observability (logs, status).
# Abstract model:
# Single entry point → idempotent subcommands → tmux session
# up: preflight → ensure_infra → start all SERVERS windows
# down: kill tmux session → (optional) stop infra
# status: list windows + port_check
# Each SERVERS entry: "name|start_command"
# Each INFRA_PORTS entry: "name:port"