> 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/getting-started/configuring-an-ai-assistant/skills/stoobly.md).

# Stoobly

```markdown
---
name: stoobly
description: Entry point for anything Stoobly — API recording, mocking, E2E testing, snapshots,
  scaffolds, and troubleshooting. Use when the user wants help with Stoobly but hasn't named a
  specific workflow ("help me with Stoobly", "I want to mock my APIs", "set up E2E testing"), or
  when it's unclear which Stoobly skill applies. Routes to the specific stoobly-* skill. If the
  user has already named the workflow, use that skill directly instead.
---

# Stoobly

You are the front door for Stoobly — a router that figures out what the user wants to do and hands
off to the right skill. You do not do the work yourself; you pick a destination and follow it.

## Step 1: Detect existing state (read-only)

Do **not** `cat` or read `.config.yml` or any scaffold directory file directly to determine state —
always use the CLI.

- Check `stoobly-agent` is installed: run `stoobly-agent --version`. If it's not found, skip
  straight to Step 5 (docs fallback) using the **Installation** row of the Index table.
- Check whether `.stoobly/services/.config.yml` exists in the current directory to tell scaffold
  from standalone (existence check only — do not read its contents).
- If it exists, run `stoobly-agent scaffold describe` to get the app/context info.

Report the detected setup in one line (e.g. "You have a scaffold app configured" / "No scaffold
detected — you're running standalone"). This determines which menu you show in Step 3: no config
file → Menu A; config file exists → Menu B.

## Step 2: Skip the menu if intent is already clear

If the user's request already maps clearly to one row in the table below, skip the menu — say
which skill you're using and why in one line, then jump to Step 4.

## Step 3: Ask what the user wants to do

If intent isn't already clear, ask a single message using the menu that matches Step 1's
detection. Post the full numbered menu below as **message text** — don't rely on a choice tool
to display it, since those commonly cap at four options and would silently drop the rest.
Then, if a choice tool is available, use one to capture the answer — it's a nicer experience
than plain text. Put the four most likely items (by the menu's own ordering) on it as buttons,
and make its question text say any item can be reached by typing it (e.g. via an "Other"
option) — never present fewer than all eight as reachable.

**Menu B — scaffold detected** (day-to-day loop first):

> What do you want to do with Stoobly?
> 1. **Something's broken** — errors, 499s, certs, won't start, traffic not intercepted, or a failing E2E test
> 2. **Record, mock, or test API traffic** — the day-to-day intercept loop
> 3. **Fix a wrong or outdated request/response** — one specific request is bad
> 4. **Scenarios, snapshots, and sharing** — refresh recordings after an API change, commit/restore via Git
> 5. **Manage an existing scaffold** — add/remove/inspect services, logs, hostnames, reset (also pick this for standalone setups: agent config, intercept settings, restarts)
> 6. **Wire Stoobly into my JS test code** — Playwright, Cypress, or another E2E framework
> 7. **Set up another scaffold app**
> 8. **Just a question** — how something works, concepts, install, CLI syntax

**Menu A — no scaffold detected** (onboarding first, same eight intents reordered):

> What do you want to do with Stoobly?
> 1. **Set up Stoobly for the first time** — create a scaffold app and services
> 2. **Wire Stoobly into my JS test code** — Playwright, Cypress, or another E2E framework
> 3. **Record, mock, or test API traffic** — the day-to-day intercept loop
> 4. **Something's broken** — errors, 499s, certs, won't start, traffic not intercepted, or a failing E2E test
> 5. **Fix a wrong or outdated request/response** — one specific request is bad
> 6. **Scenarios, snapshots, and sharing** — refresh recordings after an API change, commit/restore via Git
> 7. **Manage an existing scaffold** — add/remove/inspect services, logs, hostnames, reset (also pick this for standalone setups: agent config, intercept settings, restarts)
> 8. **Just a question** — how something works, concepts, install, CLI syntax

If the user picks **Something's broken** and it's not already clear whether this is happening
inside a failing E2E test, ask that one clarifying question directly instead of another numbered
menu (see the first disambiguation rule below).

## Step 4: Route

Route by the menu **label** the user picked, not its number — the two menus number the same
labels differently. Not every label has a dedicated skill; labels whose destination is **Docs
fallback** in the table below are handled by Step 5 instead.

| Choice | Destination |
|---|---|
| Something's broken — general usage | `stoobly-triage` |
| Something's broken — inside a failing E2E test | `stoobly-troubleshoot-e2e-test` |
| Set up Stoobly / set up another scaffold app | `stoobly-scaffold-create` |
| Wire Stoobly into my JS test code | `stoobly-js-client` |
| Fix a wrong or outdated request/response | `stoobly-update-request` |
| Record, mock, or test API traffic | Docs fallback — go to Step 5, start at the **Intercept**, **Run**, or **API Testing** row |
| Scenarios, snapshots, and sharing | Docs fallback — go to Step 5, start at the **Scenario** or **Snapshot** row |
| Manage an existing scaffold | Docs fallback — go to Step 5, start at the **Scaffold**, **Scaffold: Runtime**, or **Config** row |
| Just a question | Docs fallback — go to Step 5, match the Index normally |

Disambiguation rules:

- **499s or wrong/stale responses**: if it's happening **inside a failing scaffolded E2E test**
  (Playwright, Cypress, etc.), route to `stoobly-troubleshoot-e2e-test`. Otherwise (general usage,
  outside a test run), route to `stoobly-triage`.
- **One request/response wrong**: `stoobly-update-request`. **A scenario stale after an API
  change**: docs fallback (Scenario / Snapshot rows of the Index table).
- **Authoring vs debugging the JS client**: setting up the Playwright/Cypress interceptor for the
  first time → `stoobly-js-client`. A test that's already wired but failing →
  `stoobly-troubleshoot-e2e-test`.
- **First-time setup that mentions Playwright/Cypress**: no scaffold yet → `stoobly-scaffold-create`
  (it supports `--plugin playwright`/`--plugin cypress`). A scaffold already exists and only the
  test wiring is missing → `stoobly-js-client`.

Once you've picked a skill, announce it in one line (e.g. "Using `stoobly-triage` — it covers cert
errors and broken traffic interception"), then read that skill's instructions and follow them in
order starting from its own Step 1. If the skill isn't installed locally, read it from this docs
site instead — local path `getting-started/configuring-an-ai-assistant/Skills/<name>.md` under
wherever the docs were cloned, or
`https://docs.stoobly.com/getting-started/configuring-an-ai-assistant/Skills/<name>` as a fallback.
Do not re-ask questions the sub-skill is about to ask, and do not route again mid-flow — once
handed off, the sub-skill owns the rest of the conversation. If the request genuinely spans two
skills, pick whichever is blocking right now and mention the other in your next-steps at the end.

## Step 5: Docs fallback (no skill fits)

Use this whenever Step 4 pointed here — no dedicated skill for the chosen task, no skill matches
the question, or `stoobly-agent` isn't installed.

Read `.stoobly/docs/getting-started/configuring-an-ai-assistant/llm-rules.md` (fallback:
`https://docs.stoobly.com/getting-started/configuring-an-ai-assistant/llm-rules.md`) and follow its
own routing workflow (§5 Index). If Step 4 named an Index row for this branch, start there instead
of re-matching from scratch; otherwise match the question against the Index table's "Example
Questions" column. Read the matched Local Doc, and answer using the Example Answer Template —
complete CLI commands prefixed `stoobly-agent`, and a link to the relevant `docs.stoobly.com` page.
Do not answer from memory.

## Step 6: Surface next steps

If you routed to a skill, its own next-steps apply — don't duplicate them. If you answered from
docs (Step 5), close with:

> Typical Stoobly workflow: scaffold a new app, record traffic, mock it, test against it, then
> update recordings as the API changes (see the docs for exact commands).
> Something broken? Use the Triage skill. Ask again any time to pick a different task.
>
> Docs: https://docs.stoobly.com

## Reference documentation

| Topic | Doc |
| ----- | --- |
| Set up Stoobly for the first time | [Scaffold Create](stoobly-scaffold-create.md) |
| Something's broken (general usage) | [Triage](stoobly-triage.md) |
| Something's broken (inside an E2E test) | [Troubleshoot E2E Test](stoobly-troubleshoot-e2e-test.md) |
| Wire Stoobly into JS test code | [JS Client](stoobly-js-client.md) |
| Fix a wrong or outdated request/response | [Update Request](stoobly-update-request.md) |
| Full routing index for everything else | [LLM Rules](../llm-rules.md) |
```
