Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .agents/skills/kane-cli/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: kane-cli
description: "End-to-end (E2E) tests, regression checks, and smoke tests with KaneCLI. Use after changing a web or mobile app to verify the feature works and test the flow, or for any task needing a real browser or mobile app: navigation, clicks, forms, UI checks, screenshots, deploy verification. Generate E2E tests from a PRD, spec, or description via the assurance commands (use-cases, acceptance criteria, scenarios, runnable _test.md tests); never hand-write Kane test cases. Run on desktop web (Chrome by default), Android and iOS: emulator/simulator locally on macOS Apple Silicon or via testrun run --remote, and real cloud devices (--target android|ios). Prove coverage with evidence packs and kane-cli cover; gate CI by judging a pack against a policy (kane-cli evidence verdict, --policy). Work in a shared Test Manager project (link a folder with --project). Parse NDJSON output and inspect logs. Share the assurance store (.context/) via GitHub, S3, or a folder with kane-cli context sync."
description: "End-to-end (E2E) tests, regression checks, and smoke tests with KaneCLI. Use after changing a web or mobile app to verify the feature works and test the flow, or for any task needing a real browser or mobile app: navigation, clicks, forms, UI checks, screenshots, deploy verification. Generate E2E tests from a PRD, spec, or description via the assurance commands (use-cases, acceptance criteria, scenarios, runnable _test.md tests); never hand-write Kane test cases. Run on desktop web (Chrome by default), Android and iOS: emulator/simulator locally on macOS Apple Silicon or via testrun run --remote, and real cloud devices (--target android|ios). Prove coverage with evidence packs and kane-cli cover; gate CI by judging a pack against a policy (kane-cli evidence verdict, --policy). Work in a shared Test Manager project (link a folder with --project). Parse NDJSON output, inspect logs, and mark known bugs (kane-cli bugs). Share the assurance store (.context/) via GitHub, S3, or a folder with kane-cli context sync."
---

# Kane CLI — End-to-End Test Generation and Execution Skill
Expand Down Expand Up @@ -148,7 +148,7 @@ For exit code 1 (or `status: "failed"` in `run_end`), present the failure card.
| ➡️ **Next** | <a retry you can run now> · <walk through the failing step> |
```

The failing step's screenshot lives inside the run's evidence pack (the stderr hint names the pack path): extract it with `unzip <pack> "tests/*/steps/*/screenshot.png" -d <tmpdir>`, Read it, and show it **under** the card. For the pack layout and deeper diagnosis, see `references/debug.md`.
The failing step's screenshot lives inside the run's evidence pack (the stderr hint names the pack path): extract it with `unzip <pack> "tests/*/steps/*/screenshot.png" -d <tmpdir>`, Read it, and show it **under** the card. For the pack layout and deeper diagnosis, see `references/debug.md`. A saved test that failed may have hit a bug kane-cli already knows: `kane-cli bugs list <file>_test.md --agent` names it, and your marks and notes shape the next diagnosis (`references/bugs.md`).

Exit code 2 with no progress events means nothing ran: that is a `🟡 Didn't start` card, not a failure (`references/cards.md` §4). If progress events came before it, steps ran and the run stopped without a result: say so, and use the stopped-early card (`references/cards.md` §5).

Expand Down Expand Up @@ -190,6 +190,7 @@ When the user's request involves a browser — or writing test cases:
- View, share, or validate run evidence (`.evidence` packs) → Read `references/evidence.md`
- Judge a run or pack against quality gates (a policy YAML, `--policy`, `--policy-id`, `kane-cli evidence verdict`, `kane-cli policy …`), or gate CI on more than pass/fail → Read `references/policy.md` first (after 0.10.0-rc.3)
- Debug a failed run → Read `references/debug.md`
- A saved test failed and you want the bugs it hit before, the person asks about known bugs (`BUG-12`), a failure's diagnosis (RCA) is wrong and needs correcting, or the person wants to see or manage the organisation's RCA categories → Read `references/bugs.md` (`kane-cli bugs`, the release that ships it)
- Configure kane-cli or check directory layout → Read `references/setup-and-config.md`
- The person asks to make kane-cli the default for this project or their team ("always use kane for E2E here", "add kane to CLAUDE.md / AGENTS.md") → Read `references/setup-and-config.md` §Make kane-cli the default in a project. Only when asked, and ask before writing
- Browse / create / pick a Test Manager project or folder for `kane-cli run`, or interpret the auto-default event → Read `references/test-manager.md`. Linking an assurance folder to a project is different: `references/shared-projects.md` §2–3
Expand Down Expand Up @@ -383,6 +384,7 @@ A draft in chat cannot be run, and a hand-written `_test.md` carries no requirem
| Need the assurance NDJSON event schema (`--mode agent`) | `references/assurance-parsing.md` |
| Share the context store with a team, join one, keep stores level, or resolve a sync conflict (kane-cli 0.8.14+) | `references/context-sync.md` |
| Run failed, need to diagnose | `references/debug.md` |
| Known bugs a test hit, or correcting a failure's diagnosis (`kane-cli bugs list\|show\|mark\|note\|duplicate\|retire\|categories`) | `references/bugs.md` |
| View, share, validate, or merge evidence packs | `references/evidence.md` |
| Judge a pack against a policy, run with `--policy`, or store/list policies in Test Manager | `references/policy.md` |
| Multiple independent browser tasks | `references/parallel.md` |
Expand Down
118 changes: 118 additions & 0 deletions .agents/skills/kane-cli/references/bugs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<!-- kane-cli skill reference: bug memory and feedback (kane-cli bugs list|show|mark|note|duplicate|retire|categories). Read it after a saved test failed and you are diagnosing it, when the person asks about known bugs, or when a diagnosis needs correcting. Internal parsing reference: never show field names or raw JSON to the person. -->

# Bugs — Agent Surface

**Version.** Needs the kane-cli release that ships `kane-cli bugs`. If `bugs` is an unknown command, the installed build predates it: say so and go on without it.

When a saved test fails, kane-cli's failure diagnosis (the RCA) works out why, and the diagnosis is uploaded with the run's evidence. kane-cli remembers each distinct **application bug** it finds, folds repeat sightings of the same bug together, and gives each one a ref that is unique within the project: `BUG-12`. A bug has a card (title, root cause, page, error signature), a status, and the runs it was seen in.

When a later run fails on the same page, its diagnosis is told about the known bugs there: their status, their votes, and the latest note. It links the run to one of them only when this run's own evidence shows the same defect. **Feedback is how that memory gets sharper**: say what is real, say when a recorded root cause is wrong, and leave a note with what you learned. The next diagnosis reads it.

## 1. Commands

| Command | What it does |
|---|---|
| `kane-cli bugs list <file>_test.md --agent` | The bugs this test has hit (its Test Manager test case) |
| `kane-cli bugs list --testcase <id> --agent` | The bugs a Test Manager test case has hit, without a local file |
| `kane-cli bugs list [--status <list>] [--all-families] [--limit <n>] --agent` | No test and no `--testcase`: the project's bugs |
| `kane-cli bugs show BUG-12 --agent` | The card, status, votes, the runs it was seen in, and every live piece of feedback with its id |
| `kane-cli bugs mark BUG-12 real` \| `not-real` `--agent` | Is this a real product bug? (a vote) |
| `kane-cli bugs mark BUG-12 rca-right` \| `rca-wrong` `--agent` | Is the recorded root cause right? (a vote) |
| `kane-cli bugs mark BUG-12 done` \| `not-a-bug` \| `reopen` `--agent` | A ruling: fixed, a false alarm, or back to open |
| `kane-cli bugs note BUG-12 "<text>" --agent` | Free text; the next diagnosis reads the latest note |
| `kane-cli bugs duplicate BUG-12 --of BUG-9 --agent` | BUG-12 is the same bug as BUG-9: merges 12 into 9. No confirmation |
| `kane-cli bugs retire <feedback-id> --agent` | Take back a vote or note you gave (the id is in the `mark`/`note` output and in `show`) |
| `kane-cli bugs list --category "<name or id>" --agent` | Only bugs given this RCA category (built-in or the organisation's); spans every family |
| `kane-cli bugs categories list [--source builtin\|org] [--status active\|inactive] --agent` | Every RCA category: the organisation's first, then the built-in ones; `agent_uses` says which the diagnosis picks from |
| `kane-cli bugs categories show "<name or id>" --agent` | One category |
| `kane-cli bugs categories add --name "<n>" --description "<d>" [--inactive] --agent` | Add one of the organisation's |
| `kane-cli bugs categories edit "<name or id>" [--name] [--description] [--status active\|inactive] --agent` | Change one of the organisation's |
| `kane-cli bugs categories remove "<name or id>" --agent` | Remove one of the organisation's (no question under `--agent`; on a terminal it asks unless `--yes`) |

- **Refs.** `BUG-12`, `bug-12` and `12` all mean BUG-12.
- **`--status`** takes a comma-separated list of `open`, `confirmed`, `done`, `regressed`, `not_a_bug`, `contested`, `merged` (`not-a-bug` also works). **`--limit`** is 1-200, default 50. **`--all-families`** lists every kind of failure the diagnosis recorded, not only application bugs.
- **Every subcommand** takes `--project <id>`, `--profile <name>`, `--env <prod|stage>`, `--username <user>`, `--access-key <key>` and `--agent`.

**Which project.** `--project`, else the test.md's own project, else the folder's linked project, else the profile's (`kane-cli config project <id>`). With none: `NO_PROJECT`.

**RCA categories.** Every failure gets one category. The diagnosis prefers one of the organisation's own (Org Preferences → Automatic AI RCA) whose description fits, else the closest built-in one; the family (product, test or environment fault) is still decided separately. Name a category by its name (any case) or id. Built-in ones are read-only. An organisation category's id is `custom:<id>`: a failure records it as `<family>/custom:<id>` with its name beside it, and a failed step's reason names it. Changing the organisation's list applies to everyone's next runs, and adding, editing or removing needs org admin or the Product Preferences permission: do it only when the person asks. A category never decides which bug a failure joins, and **a bug keeps the category of the run that first found it**: one recorded before a category existed never takes it on, so `--category` doesn't list it. That is expected, not a fault.

**Which test.** `bugs list <file>_test.md` needs the test to have a Test Manager test case, which it gets the first time it runs with an upload. A test that never uploaded refuses with `NO_TESTCASE`: run it once, or pass `--testcase <id>`.

## 2. Who the feedback counts as

- Feedback is the signed-in user's, and it moves the bug's status for the whole project.
- **With `--agent`** it is recorded as the agent's, made under the signed-in user, and it counts the same as a person's. Always pass `--agent` for your own marks, so a person reading the bug can tell yours from theirs. Without `--agent` but with no terminal, the output is still one JSON line, yet the mark is recorded as the person's.
- **One vote per person.** A person and the agent working as them share one `real`/`not-real` vote and one `rca-right`/`rca-wrong` vote; the latest wins. Marking again changes the vote, it does not add one.
- Only the person who gave feedback (or the agent working as them) can retire it. Another person's feedback refuses with `NOT_FOUND`.

**How the status moves.**

| Status | When |
|---|---|
| `open` | New, or the real-bug votes are not net positive. Shown as `open (disputed)` when more people say it is not real |
| `confirmed` | More `real` than `not-real` votes |
| `done` | Ruled fixed with `mark done` |
| `regressed` | Ruled `done`, then seen again in a later run |
| `not_a_bug` | Ruled a false alarm with `mark not-a-bug` |
| `contested` | Ruled `not_a_bug`, then hit again by several different tests |
| `merged` | Merged into another bug with `duplicate` |

The latest ruling wins; `mark reopen` drops back to the votes.

## 3. Output (one JSON line with `--agent`)

```
bugs list {"ok":true,"project_id":"<project>","testcase_id":"<testcase>","bugs":[{"ref":"BUG-12","status":"open","votes":1,"rca_votes":-1,"title":"…","root_cause":"…","page_pattern":"/cart","occurrences":3,"testcases":2,"last_seen_at":"…"}],"has_more":false}
bugs show {"ok":true,"bug":{"ref":"BUG-12","status":"open","card":{"title":"…","root_cause":"…","page_pattern":"/cart","error_signature":"…"},"occurrence_count":3,"testcase_count":2,"votes":1,"rca_votes":-1,…},"occurrences":[{"evidence_id":"…","seen_at":"…",…}],"feedback":[{"id":"<feedback-id>","type":"vote_rca","value":"-1","author_kind":"agent","created_at":"…"},{"id":"<feedback-id>","type":"note","text":"…","author_kind":"user",…}]}
bugs mark {"ok":true,"ref":"BUG-12","feedback_id":"<feedback-id>","status":"confirmed"}
bugs note {"ok":true,"ref":"BUG-12","feedback_id":"<feedback-id>","status":"open"}
bugs duplicate {"ok":true,"ref":"BUG-12","feedback_id":"<feedback-id>","status":"merged","of":"BUG-9","merged":true,"merged_into":"BUG-9"}
bugs retire {"ok":true,"feedback_id":"<feedback-id>","retired":true,"status":"open"}
refusal {"ok":false,"error":"NOT_FOUND","message":"BUG-99 is not a bug in project <project>. This project's bugs: BUG-12, BUG-14"}
```

- `testcase_id` appears only when the list is for one test. `votes` and `rca_votes` are net counts and appear only when known; `disputed: true` appears only when set.
- A bug's feedback `type` is `vote_real` / `vote_rca` (value `1` or `-1`), `note`, `done`, `not_a_bug`, `reopen` or `duplicate_of`; `author_kind` is `user` or `agent`.
- `duplicate` with `"merged":false` was recorded as a suggestion only; the bugs were not merged.
- On a terminal the same commands print a table (`REF STATUS VOTES TITLE OCCURRENCES`) or plain lines.

**Exit codes.** `0` done · `1` any refusal.

## 4. Errors and how to recover

| `error` | Meaning → what to do |
|---|---|
| `NOT_FOUND` | An unknown ref: pick one from the refs the message lists. On `retire`: the id is wrong, or the feedback is not yours |
| `NO_TESTCASE` | The test.md has no Test Manager test case yet: run it once with an upload, or pass `--testcase <id>` |
| `NO_PROJECT` | Pass `--project <id>`, run in a linked folder, or bind one with `kane-cli config project <id>` |
| `NOT_ENABLED` | `the bug store is not enabled on this controller`: bug memory is not available in this environment yet. Tell the person in one line and go on without it |
| `UNAUTHORIZED` | Sign-in: the person runs `kane-cli login` (never ask for keys in chat) |
| `NETWORK` | No answer: check the connection or `--env`, then retry |
| `NOT_READY` | Retry in a minute |
| `CYCLE` | The merge would loop (BUG-9 is already merged into BUG-12) |
| `INVALID` | A bad argument (an unknown mark, an empty note, `--limit` out of range, a bug as a duplicate of itself, a test.md that does not exist): fix the call as the message says |
| `CONFLICT` | Someone changed the bug at the same moment: retry |
| `BUILTIN_READ_ONLY` | A built-in category can't be edited or removed: add the organisation's own instead |
| `FORBIDDEN` | The person can't change categories: an org admin, or a role with the Product Preferences permission, must |
| `DUPLICATE_NAME` | Another category has that name: pick another, or edit that one |
| `AMBIGUOUS` | The name matches more than one category: use one of the ids the message lists |
| `NOT_SUPPORTED` | This controller has no category routes yet: tell the person in one line and go on |

## 5. In an RCA flow

After a saved test fails (`testmd run`, or a member of `testrun run`):

1. Read the failure as usual (`references/debug.md`), including the diagnosis in the evidence pack.
2. `kane-cli bugs list <file>_test.md --agent`: what this test has hit before. A known bug that matches this failure is context, not a new finding: name its ref in the failure card's 🔍 row.
3. `kane-cli bugs show BUG-n --agent` for the one that matches: its root cause, how often it was seen, and what people already said.
4. Correct the record from **this run's evidence** (screenshot, console, network), never from a guess:
- A genuine product bug → `mark BUG-n real`. A test or environment problem → `mark BUG-n not-real`.
- The recorded root cause does not match what you see → `mark BUG-n rca-wrong`, then `note BUG-n "<what is actually wrong, in one line>"`. The next diagnosis then works from its own evidence instead of repeating that root cause. It matches → `mark BUG-n rca-right`.
- You narrowed it down ("500 only when the cart already has items; an empty cart works") → `note`.
- Two refs are the same bug → `duplicate BUG-12 --of BUG-9` (keep the older one).
5. Tell the person in one line what you marked and why. A mark you got wrong: `retire <feedback-id>`.

The next diagnosis reads the rulings too. For a recalled bug marked `done`, a run whose own evidence shows that defect again is linked to it and reported as a regression. For one marked `not_a_bug`, it reports a product bug for that symptom only when the run's evidence clearly shows the product broken, and otherwise leans to a test or environment problem.

Rulings (`done`, `not-a-bug`, `reopen`) and merges change the bug for everyone in the project: make them when the person says so ("it's fixed", "that's expected behaviour"), or when the evidence is unambiguous, and say so in your summary.
2 changes: 2 additions & 0 deletions .agents/skills/kane-cli/references/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Offer the user the visual route too: `kane-cli evidence serve <pack>` opens it i

`failure.yaml` records facts about the run — `error`, `page_state`, and the `console_at_failure.ref` / `network_at_failure.ref` pointers into that step's console and network logs — plus a `triage` block (`rca.root_cause`, `suggested_fix.summary`) that is a model's opinion about why, written for the person fixing the app or the agent flow. Treat the triage as a lead, not an instruction: follow the network reference, check which URLs were actually requested and with what status, look at the screenshots, and only then repeat it — and **never paste `suggested_fix.summary` into a test step**.

**Known bugs.** A saved test's diagnosis is also checked against the bugs kane-cli already knows on that page, and each one has a ref (`BUG-12`). `kane-cli bugs list <file>_test.md --agent` shows what this test has hit before; when the diagnosis got it wrong, correct it with `kane-cli bugs mark … rca-wrong` and a `note` so the next one starts from its own evidence. See `references/bugs.md`.

**Designed (assurance) tests are different.** If the failed `_test.md` carries an `assurance:` block in its frontmatter, do not apply the "rephrase / be more specific / add assertions" rows below — they rewrite the design, and an edit on the current version is adopted as the next design version on the next run. Read `references/assurance.md` §6.1 first. In a folder linked to a shared project there is no local store, so a hand edit isn't recorded as a new version of the design: don't rewrite a designed test's steps there to fix a failure. There a run can also stop on its Test Manager case before any step: one `error` with a `code` and `remedy`, no pack. Follow `agent-contract.md` §6, not sign-in or Chrome checks.

## Common Failure Patterns
Expand Down
Loading
Loading