> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stably.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify Your App with stably verify

> Use stably verify to check that your application works correctly against a natural language description — no test files needed

`stably verify` checks whether your application works correctly by describing what it should do in plain English. It launches an AI agent that navigates your app with a real browser, interacts with it, takes screenshots, and reports a structured **PASS / FAIL / INCONCLUSIVE** verdict.

No test files are generated — it verifies and reports.

```bash theme={null}
stably verify "the login form accepts email and password and redirects to /dashboard"
```

<Tip>
  To run verification in a Stably-hosted browser, add `--browser=cloud` or set `STABLY_CLOUD_BROWSER=1`. See [Cloud Browsers for Stably CLI](/stably-cli/cloud-browser).
</Tip>

## How It Works

```
1. You run: stably verify "users can add items to cart and see updated total"
   |
2. Interactive preflight (auto-detects your dev server and credentials)
   |
3. AI agent launches a browser and systematically verifies each requirement
   - Navigates to the app
   - Interacts with the UI (clicks, fills forms, scrolls)
   - Takes screenshots as evidence at each step
   - Checks DOM state, network responses, and visual output
   |
4. Agent reports a structured verdict: PASS, FAIL, or INCONCLUSIVE
   |
5. CLI prints a formatted summary and sets the exit code
   - Exit 0 = PASS
   - Exit 1 = FAIL
   - Exit 2 = INCONCLUSIVE
```

## Prerequisites

<Card title="Stably CLI" icon="terminal" href="/stably-cli/quickstart">
  Install and initialize the Stably CLI in your project.
</Card>

## Usage

```bash theme={null}
# Verify a feature works
stably verify "the login form accepts email and password and redirects to /dashboard"
stably verify "the login form accepts email and password and redirects to /dashboard" --browser=cloud

# Verify with a specific starting URL
stably verify "the pricing page shows 3 tiers" --url https://localhost:3000/pricing

# Set a budget cap (default: $5)
stably verify "checkout flow completes successfully" --max-budget 10
```

### Options

| Option                   | Description                                                              |
| ------------------------ | ------------------------------------------------------------------------ |
| `-u, --url <url>`        | Starting URL to verify against (auto-detected from localhost if omitted) |
| `--max-budget <dollars>` | Maximum budget in USD for the session (default: `5`)                     |
| `--no-interactive`       | Skip interactive preflight (for CI or agent use)                         |

### Exit Codes

| Code | Verdict      | Meaning                                                             |
| ---- | ------------ | ------------------------------------------------------------------- |
| `0`  | PASS         | All requirements in the prompt were verified                        |
| `1`  | FAIL         | One or more requirements were not met                               |
| `2`  | INCONCLUSIVE | Could not determine pass or fail (app unreachable, auth wall, etc.) |

## Example Output

### PASS

```
VERIFICATION PASSED

Prompt: "users can add items to cart and see updated total"

Steps performed:
1. Navigated to /products
2. Clicked "Add to Cart" on first product -> cart badge updated to 1
3. Clicked "Add to Cart" on second product -> cart badge updated to 2
4. Opened cart -> shows 2 items with correct total of $45.98

Evidence:
- Screenshot: products page with items visible
- Screenshot: cart showing 2 items and $45.98 total
- DOM check: .cart-total element contains "$45.98"
```

### FAIL

```
VERIFICATION FAILED

Prompt: "users can add items to cart and see updated total"

Steps performed:
1. Navigated to /products
2. Clicked "Add to Cart" on first product -> cart badge updated to 1
3. Clicked "Add to Cart" on second product -> cart badge stayed at 1

Failure reason:
Cart badge did not update after adding second item. Expected "2", saw "1".
The cart total also only reflects one item ($22.99) instead of two.

Evidence:
- Screenshot: cart badge showing "1" after adding 2 items
```

## Using stably verify with AI Agents

`stably verify` is especially powerful when used inside AI coding agents. The agent writes code, then runs `stably verify` to check if the feature actually works — creating a build-then-verify iteration loop.

### Install the Skill

Install the `stably-verify` skill to teach your agent how to use the command:

```bash theme={null}
npx skills add https://github.com/stablyai/agent-skills --skill stably-verify
```

### Agent Iteration Loop

```
Agent makes code changes
        ↓
  stably verify "feature description"
        ↓
  ┌─ PASS?  → Done
  └─ FAIL?  → Agent reads the verdict, fixes code, re-verifies
```

### Example: Claude Code

```
You:    Build a search bar that filters products by name

Agent:  I'll add the search component to the products page...
        [writes code]
        Let me verify this works.

        $ stably verify "the products page has a search bar that filters
          products by name as you type" --url http://localhost:3000/products

        VERIFICATION FAILED
        Steps performed:
        1. Navigated to /products — 12 product cards visible
        2. Found search input and typed "blue"
        3. Product list did not change — still showing all 12 products

        Failure reason: Search input exists but typing does not filter.

Agent:  The search input isn't wired up to filter state. Let me fix that...
        [fixes code]

        $ stably verify "the products page has a search bar that filters
          products by name as you type" --url http://localhost:3000/products

        VERIFICATION PASSED
        Steps performed:
        1. Navigated to /products — 12 product cards visible
        2. Typed "blue" in search bar → 2 products shown
        3. Cleared search → all 12 products restored

Agent:  Search bar is working correctly.
```

### Example: Cursor / Windsurf

Ask your agent naturally — the skill is triggered automatically:

```
"Use stably verify to check that the checkout flow works end to end"
"Verify the dashboard shows the correct charts after my changes"
```

### The Skill Prompt

<Accordion title="stably-verify SKILL.md">
  ```markdown theme={null}
  ---
  name: stably-verify
  description: |
    Verify that an application works correctly using stably verify. Use when
    an AI agent has made code changes and needs to validate the feature works
    in a real browser. Triggers on: "verify this works", "stably verify",
    "check if this works", "validate my changes", "verify my feature".
  license: MIT
  metadata:
    author: stably
    version: '1.0.0'
  ---

  # Verify App Behavior with stably verify

  Use `stably verify` to check that your application behaves correctly against
  a natural language description. The command launches an AI agent that navigates
  your app in a real browser, interacts with it, and reports a PASS/FAIL/INCONCLUSIVE
  verdict. No test files are generated.

  ## Pre-flight

  Always run `stably --version` first. If not found, install with
  `npm install -g stably` or use `npx stably`.

  ## Usage

  stably verify "description of expected behavior"
  stably verify "pricing page shows 3 tiers" --url http://localhost:3000/pricing
  stably verify "checkout completes" --max-budget 10
  stably verify "login works" --no-interactive

  ## Options

  --url <url>            Starting URL (auto-detected if omitted)
  --max-budget <dollars> Budget cap in USD (default: $5)
  --no-interactive       Skip preflight prompts (for CI/agents)

  ## Exit Codes

  0 = PASS (all requirements verified)
  1 = FAIL (one or more requirements not met)
  2 = INCONCLUSIVE (unable to determine — app not reachable, auth wall, etc.)

  ## Iteration Loop

  After making code changes, verify with stably verify. If the verdict is FAIL:

  1. Read the failure reason and evidence from the output
  2. Fix the application code based on the specific failure
  3. Re-run stably verify with the same prompt
  4. Repeat until PASS

  Important: stably verify does not create or modify files. It only observes
  and reports. Fix the code yourself based on its findings.

  ## Composing in Scripts

  stably verify "login works" && echo "Feature verified!"

  stably verify "checkout completes" ; code=$?
  if [ $code -eq 0 ]; then echo "PASS";
  elif [ $code -eq 1 ]; then echo "FAIL";
  else echo "INCONCLUSIVE"; fi
  ```
</Accordion>

## Combining with Other Stably Commands

| Command         | Purpose                                   | When to Use                                    |
| --------------- | ----------------------------------------- | ---------------------------------------------- |
| `stably verify` | Verify app behavior against a description | Quick feature validation, no test files needed |
| `stably create` | Generate Playwright test files            | Building lasting regression tests              |
| `stably test`   | Run existing Playwright tests             | Running your committed test suite              |
| `stably fix`    | Auto-fix failing tests                    | Tests broke and need AI-powered repair         |

A typical workflow with an AI agent:

<Steps>
  <Step title="Build and verify">
    Use `stably verify` to quickly check that your feature works as you build it. No test files to manage — just describe what should happen.
  </Step>

  <Step title="Create lasting tests">
    Once the feature is stable, use `stably create` to generate Playwright test files for regression coverage.
  </Step>

  <Step title="Maintain with test + fix">
    For future changes, run `stably test` to check the suite and `stably fix` to auto-repair failures.
  </Step>
</Steps>

## CI/CD Integration

`stably verify` works in CI pipelines with `--no-interactive`:

```yaml theme={null}
# .github/workflows/verify.yml
- name: Verify feature
  run: npx stably verify "checkout flow completes successfully" --no-interactive
  env:
    STABLY_API_KEY: ${{ secrets.STABLY_API_KEY }}
    STABLY_PROJECT_ID: ${{ secrets.STABLY_PROJECT_ID }}
```

Use exit codes to gate deployments:

```bash theme={null}
stably verify "all critical flows work" --no-interactive && deploy.sh
```

## Next Steps

<CardGroup cols={2}>
  <Card title="CLI Quickstart" icon="terminal" href="/stably-cli/quickstart">
    Get set up with the Stably CLI
  </Card>

  <Card title="CLI Commands" icon="book" href="/stably-cli/commands">
    Full command reference
  </Card>

  <Card title="Create Tests" icon="wand-magic-sparkles" href="/stably-cli/create">
    Generate Playwright test files with AI
  </Card>

  <Card title="Auto-fix Tests" icon="wrench" href="/stably-cli/fix">
    AI-powered test fixing
  </Card>
</CardGroup>
