Scaffold Create
---
name: stoobly-scaffold-create
description: Bootstraps a new Stoobly scaffold app and services. Use when the user
wants to get started with Stoobly, create a scaffold app, add services, or run
their first workflow.
---
# Scaffold Create
You are helping the user bootstrap a Stoobly scaffold application.
## Step 1: Detect existing state
Check if `.stoobly/services/.config.yml` exists in the current directory.
- If it exists, read it and report the user's current config (app name, runtime, proxy mode). Then ask: "You already have a scaffold app. Do you want to add more services, or start fresh?"
- If it does not exist, proceed to Step 2.
## Step 2: Read the docs
Read the local file `.stoobly/docs/faq/scaffold/README.md` to get current command syntax. If it doesn't exist, fetch `https://docs.stoobly.com/faq/scaffold.md` instead.
## Step 3: Ask the user these questions (ask all at once, in a single message)
1. **App name**: What do you want to call this scaffold app? (e.g., `my-app`)
2. **Runtime**: Local (faster, no Docker required) or Docker (recommended for teams and CI/CD)?
3. **Proxy mode**: Forward proxy (your app/tests explicitly use `http://localhost:8080` as a proxy) or Reverse proxy (traffic routed transparently by hostname — better for browser-based apps)?
4. **E2E testing**: Are you setting up E2E tests? If so, which framework — Playwright, Cypress, both, or neither?
5. **Services**: List the backend service(s) you want to mock. For each, provide:
- A short name (e.g., `api`, `payments-service`)
- The hostname of the real service (e.g., `api.example.com` or `localhost`)
- The port (e.g., `3000`, `443`)
- The scheme (`http` or `https`)
## Step 4: Create scaffold script and execute
Ask the user what to name the script file and where to put it (default: `scaffold.sh` in the project root).
Write a shell script with all substituted values using this structure:
- App and service create commands (uncommented, run directly)
- Workflow commands (commented out, for reference)
Follow the template from the docs exactly. Then show the script to the user and ask: "Ready to run this? (yes / let me review first)"
Once confirmed:
1. Write the script file to disk
2. Run `bash <script-path>` to execute it
After execution, report whether it succeeded or failed. If it fails, stop and show the full error output before asking how to proceed.
## Step 5: Surface next steps
After all commands succeed, tell the user:
- How to route traffic through the proxy (proxy env vars for forward proxy, or hostname setup for reverse proxy)
- If recording HTTPS, remind them the CA cert was installed (or how to install it manually if skipped)
- Offer to immediately start the record workflow
End with:
> **Next steps:**
> - Now that your Stoobly scaffold is created, you can now run workflows! See [How to Run a Workflow](https://docs.stoobly.com/guides/how-to-integrate-e2e-testing/how-to-run-a-workflow)
> - Or to further customize a workflow, see [Customizing a Workflow](https://docs.stoobly.com/guides/how-to-integrate-e2e-testing/how-to-scaffold-an-app/customizing-a-workflow)
>
> Docs: https://docs.stoobly.com/faq/scaffold
>
> Runtime comparison: https://docs.stoobly.com/faq/scaffold/runtimeLast updated