Prepare a worktree environment
Use your project's existing development tools to give each ticket a working application environment. Any environment can fit, provided it supports independent Git worktrees and repeatable setup.
You need: a ready execution environment and the repository. Use this guide when the project's environment still needs worktree support. It helps you choose and check commands before applying them.
Make the project worktree-compatible
A Git worktree is a separate working directory for a branch of the same repository. Tickets use these directories to work in parallel. Separate source files alone do not separate running services or data.
Your project must support:
- Fresh directories: install dependencies and prepare configuration without relying on files from your main checkout. Git metadata may be a
.gitfile pointing elsewhere, rather than a directory. - Parallel instances: use distinct application names, ports, databases and writable data where tickets must not affect each other.
- Repeatable setup: reuse a ready environment and safely start or prepare one that is missing.
- Scoped cleanup: stop or remove only the resources belonging to that worktree. Preserve or export data you need.
Connect the project's setup
Repository scripts prepare the application. Identify the commands to put in .bakers/project.config.js. The next step, connecting the checkout, applies these choices and verifies the configuration.
Lifecycle hooks connect setup and cleanup commands to ticket work. The Node.js and Compose examples show stack-specific commands. The Configuration reference owns timing, environment and failure rules.
Prepare the application on demand
If a task or its checks need a running application, configure the provision_up tool to prepare or reuse it on demand. If they only need source files and installed dependencies, application services can stay stopped. The project script owns installation, readiness checks and the resulting URL.
Runtime addons can add tools or discover services, but enabling an addon alone does not install your application. Need a concrete pattern? Follow the example matching your project, then return to the check below.
Check tools and access
Review the available tools and security context before the first run. provision_up and addon tools can execute outside the agent sandbox; their scripts and permissions must be trusted. Neither application containers nor worktrees automatically isolate the agent.
Verify independent operation
Test the setup with two disposable worktrees before using it for parallel tickets. Run preparation twice, check both applications, then clean up one and confirm the other still works.
Lifecycle hook failures are logged and work continues; put mandatory checks in WORKFLOW.md. A failed provision_up call returns an error to the agent. Configuration validation follows when you connect the project.
Done when: you know the preparation, readiness and cleanup commands, and have checked that they keep worktrees independent.