> For the complete documentation index, see [llms.txt](https://docs.stoobly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stoobly.com/guides/how-to-integrate-e2e-testing/how-to-scaffold-an-app/applying-a-scaffold-config.md).

# Applying a Scaffold Config

## Background

{% hint style="info" %}
`stoobly-agent scaffold apply` requires **stoobly-agent v2.5.0 or later**.
{% endhint %}

`scaffold apply` runs a declarative config file, so the whole setup can be reviewed, version-controlled, and reproduced by teammates with one command — this is the recommended way to scaffold an app and its services. The previous pages also show how to run the same steps as individual commands: `scaffold app create`, then `scaffold service create` per service. That's still fully supported and useful for one-off scaffolds or quick experiments, but typing out each command by hand doesn't leave you with anything to check into version control.

For the full command reference and config schema:

{% content-ref url="/pages/vNbSv8Y3FUGMz3PL3GyX" %}
[Apply](/faq/scaffold/apply.md)
{% endcontent-ref %}

## Steps to Apply a Scaffold Config

{% stepper %}
{% step %}

#### Write `.stoobly/scaffold.yml`

Create a `.stoobly/` directory in your app's root if it doesn't already exist, and write a config describing your app and its services:

```yaml
# .stoobly/scaffold.yml
version: 1
commands:
  - resource: app
    action: create
    options:
      app_name: <APP-NAME>
      # For E2E testing, add plugin: [playwright] or plugin: [cypress]
      plugin: [playwright]

  - resource: service
    action: create
    options:
      service_name: <SERVICE-NAME>
      hostname: <SERVICE-HOSTNAME>
      scheme: <SERVICE-SCHEME>
      port: <SERVICE-PORT>

  # Add one service block per service. Repeat as needed.
```

{% endstep %}

{% step %}

#### Validate with `--dry-run`

```bash
stoobly-agent scaffold apply .stoobly/scaffold.yml --dry-run
```

This checks the config's schema and each step's options without creating anything. Fix any reported errors before continuing.

{% hint style="warning" %}
A clean dry run means the config is well-formed — it doesn't guarantee the real apply will succeed, since some checks (like a required directory existing) only run when a command actually executes.
{% endhint %}
{% endstep %}

{% step %}

#### Apply for real

```bash
stoobly-agent scaffold apply .stoobly/scaffold.yml
```

Each step logs as it runs. If a step fails, `scaffold apply` stops there — earlier steps' side effects stay in place, and later steps don't run. Fix the error and re-run the same command.
{% endstep %}

{% step %}

#### Commit `.stoobly/scaffold.yml` to version control

Check the config into the same repository as your app. Any teammate can now reproduce the exact same scaffold setup with the same two commands.
{% endstep %}
{% endstepper %}

## Next Steps

Now that your app and services are scaffolded, you can run workflows:

{% content-ref url="/pages/7J10qWFxe9zweKA3YQtH" %}
[How to Run a Workflow](/guides/how-to-integrate-e2e-testing/how-to-run-a-workflow.md)
{% endcontent-ref %}

To regenerate scaffold files after upgrading stoobly-agent, or to add more steps to your config later:

{% content-ref url="/pages/33Q0OfLXlzbByHH9QvmZ" %}
[How to Update a Scaffold](/guides/how-to-integrate-e2e-testing/how-to-update-a-scaffold.md)
{% endcontent-ref %}
