# Kane Exploration: instructions for coding agents

Use Kane Exploration when you need to know what a whole running web app does after a change, not only whether one change works. It explores the app in real browsers, maps screens and flows, and reports issues with evidence.

## When to use it

- After a change is deployed to a preview, staging or local URL, to find broken flows, failed requests and accessibility issues across the app.
- On an app with no documentation or tests, to get its screens, flows and a first test design.
- Before a release, to see new screens, changed flows and issues that are back.

Use `kane-cli run` instead when you only need to verify one specific behaviour.

## Setup

1. `npm install -g @testmuai/kane-cli`
2. `kane-cli login`
3. `kane-cli whoami` to confirm you are signed in. If this fails, stop and ask the user to sign in.

## Explore

```
kane-cli explore run --project <id> --url <url> --policy read_only
```

- Always pass `--policy read_only` unless the user tells you the environment is safe to change. Kane CLI allows changes by default. Read-only blocks POST, PUT, PATCH and DELETE requests.
- Ask the user for the project id and the URL if you do not have them. Do not guess a URL.
- For screens behind sign-in, ask the user for a test account. Never use a real user's credentials. Do not write credentials into files, commit messages or logs.
- A run ends when nothing is left to explore, or at one hour, 400 actions or 800 model calls.

## Look at the result

```
kane-cli explore view
```

This opens the Explorer in the browser: the map (Graph), the Table of screens, flows and issues, and the Activity feed. While a run is in progress it shows the browsers live.

## Report back

Tell the user, in this order:

1. How many screens and flows were found, and which business areas they fall into.
2. The issues, highest severity first (high, medium, low, info), with their category: broken, accessibility, performance, UX, could not explore, safety or changed. For each: what happened, the screen and flow, and the evidence (the clip, the network or console log, or the screenshot).
3. The flows that are broken or changed.
4. What Kane could not reach, for example screens behind a login with no test account.

An issue is a lead, not a confirmed bug. Say so. A person promotes it to a bug, discards it or marks it resolved. Do not change an issue's status yourself.

## Design tests

```
kane-cli cover
```

This derives use cases, acceptance criteria and linked test cases from the explored screens and flows. It designs tests. It does not run them. Keep exploration, issues and test design separate from test execution in your report, and ask the user before running any test.

## Limits

- Web applications only. Mobile apps are not supported yet.
- Kane stops at a login it has no account for.
- Up to 20 browsers explore in parallel.
- Read-only does not guarantee that every interaction is free of side effects. Flag this before exploring a sensitive environment.
