Skip to content

Commit 4c6e669

Browse files
docs(skill): document --files attachments for kane-cli generate (#83)
Adds the `--files` flag (attach local files as generation context) to the generate skill, references, user guide, and the Kiro integration. Docs-only — no behavior change. Builds on the generate docs from #67 / #79. - references/generate.md + SKILL.md section 6: the `--files` flag, an "Attaching files" section (supported types, 10-file / 50 MB caps, atomic up-front validation, new/refine-only, the `@` TUI hint), and the `--files` + `--save` invalid combo. - references/generate-parsing.md: the `generate_upload` NDJSON event (one per file, before `generate_start`; `uploading` -> `done`/`failed`). - .claude/ and .agents/ skill mirrors kept byte-identical to the source. - docs/user-guide/generate-test-cases/{overview,workflow}: `--files` option, an "Attaching files for context" section, the `@` TUI row, a workflow example, and corrected the now-stale "files not part of the CLI" notes. - Kiro power: `--files` in the kane-cli-generate steering file and the maintenance mapping. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e475bf2 commit 4c6e669

13 files changed

Lines changed: 114 additions & 8 deletions

File tree

.agents/skills/kane-cli/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ Then offer the next commands from the terminal line's Refine / Save hints (they
287287

288288
**Clarification → refine (do not skip):** if the turn ends with a clarification, that's **exit 0 — not an error**. Act on it: answer it yourself, or ask your own user, then **re-invoke** `kane-cli generate "<answer>" --refine --req <id> --agent`. Never drop a clarification.
289289

290+
**Attach files:** `--files a,b,c` adds local files (docs / images / PDF / CSV — up to 10, ≤ 50 MB each) as generation context on a **new** or **`--refine`** turn (not `--save`); each emits a `generate_upload` line before `generate_start`. Details in `references/generate.md`.
291+
290292
**Save is Functional-only:** `--save` writes only **Functional** cases to `_test.md` (under `<cwd>/.testmuai/tests` by default). Non-functional cases (Security, Performance, …) are generated and shown but not saved. Run saved files with **`kane-cli testmd run`** (`references/testmd.md`) — that's the generate → testmd pipeline.
291293

292294
Internal event/field names (`generate_snapshot`, `request_id`, …) are for parsing only — never show them to the user (§5 rule). Wire schema: `references/generate-parsing.md`.

.agents/skills/kane-cli/references/generate-parsing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Generate-specific (typed `generate_*`):
2323

2424
| `type` | Key fields | Meaning → what to do |
2525
|---|---|---|
26+
| `generate_upload` | `file`, `index`, `total`, `status` | Only when `--files` is used. Emitted once per attached file **before `generate_start`**, while the file uploads; `status` goes `"uploading"``"done"` (or `"failed"`). Progress only — narrate "attaching <file>…" or ignore. A failed upload surfaces as an `error` + non-zero exit. |
2627
| `generate_start` | `request_id`, `objective_chars`, `scenario_limit`, `per_scenario_limit`, `is_refine` | Turn began. **Capture `request_id`** — it's the handle for every later `--refine` / `--save`. `is_refine` distinguishes a new request from a continuation. |
2728
| `generate_thinking` | `took_ms` | Liveness only. Narrate "thinking…" or ignore. |
2829
| `generate_progress` | `pct` | Milestone (25 / 50 / 75 / 100). Optional progress display — not a completion signal. |

.agents/skills/kane-cli/references/generate.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
**Use this whenever a task needs test cases or scenarios written — don't hand-author them in chat or a scratch file.** Reach for it to: turn a requirement / feature description into a test suite; expand or refine coverage (more edge cases, negative paths, a narrower or broader focus); or save the Functional cases as runnable `_test.md`. It is **not** for driving a browser — that's `kane-cli run` (§3 of SKILL.md).
88

9-
> For the full web-product picture (richer inputs, dashboards), see the public docs: <https://www.testmuai.com/support/docs/generate-test-cases-with-ai/>. The CLI surface here is **text-objective only**.
9+
> For the full web-product picture (dashboards, issue-link inputs), see the public docs: <https://www.testmuai.com/support/docs/generate-test-cases-with-ai/>. The CLI takes a **text objective**, optionally with local files attached via **`--files`** (see "Attaching files" below).
1010
1111
## The three modes — one turn per invocation, then exit
1212

@@ -30,11 +30,27 @@ There is **no interactive session**. Each invocation runs exactly one generation
3030
| `--name <name>` | Names the run and the saved suite folder |
3131
| `--scenario-limit <n>` / `--per-scenario-limit <n>` | Cap scenarios / cases-per-scenario |
3232
| `--memory` | Use the memory layer — reuse relevant existing cases, reduce duplicates |
33+
| `--files <paths>` | Comma-separated local files to attach as context (new / refine only — see "Attaching files") |
3334
| `--project <id>` / `--folder <id>` | Test Manager project / folder |
3435
| `--env prod\|stage` · `--username` / `--access-key` | Environment / auth (same as `run`) |
3536

3637
If neither `--project`/`--folder` nor a saved project/folder is set when generation starts, kane-cli auto-resolves one headlessly and emits a `project_folder_auto_defaulted` event before `generate_start`. Translate it to a one-line note for the user — full handling lives in `references/test-manager.md`.
3738

39+
## Attaching files
40+
41+
Pass local files as extra context with `--files <comma-separated paths>` on a **new** generation or a **`--refine`** (not `--save`). The generator reads them and reflects them in the scenarios + cases — attach a spec, a screenshot of the UI, a PDF / Word doc, or a CSV of inputs.
42+
43+
```bash
44+
kane-cli generate "test the login flow described in the attached spec" --files ./login-spec.pdf,./wireframe.png --agent
45+
```
46+
47+
- **Supported types** — documents (`.txt .json .xml .csv .pdf .docx .xlsx`), images (`.jpg .jpeg .png .gif .bmp .webp`), audio (`.mp3 .wav .m4a`), video (`.mp4 .mov .webm .mpeg .mpga`).
48+
- **Limits** — up to **10 files**, each **≤ 50 MB**.
49+
- **Validated as a set, up front** — if any path is missing, an unsupported type, too large, or over the count, the whole command is rejected (exit `2`) **before anything is sent** and the offending paths are listed; fix and re-run. Files outside the current directory are allowed but flagged with a warning on stderr.
50+
- **`new` / `--refine` only** — combining `--files` with `--save` exits `2`.
51+
52+
Under `--agent`, each file emits a `generate_upload` line (`status` `uploading``done`) **before** `generate_start` — see `references/generate-parsing.md`. *(Interactively in the TUI, type `@` in the generate prompt to attach a file inline.)*
53+
3854
## Presenting a result (adaptive)
3955

4056
The terminal data carries the full scenarios + cases. **Present it based on size**:
@@ -114,6 +130,7 @@ Invalid flag combinations exit `2` with a message on stderr. The full set:
114130
- `--save` without `--req`
115131
- `--save` with a description (it takes none)
116132
- `--out` without `--save`
133+
- `--files` with `--save` (files attach to a new generation or a refine, not a save)
117134
- `--req` without `--refine` or `--save`
118135
- a new generation with no description
119136

.claude/skills/kane-cli/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ Then offer the next commands from the terminal line's Refine / Save hints (they
287287

288288
**Clarification → refine (do not skip):** if the turn ends with a clarification, that's **exit 0 — not an error**. Act on it: answer it yourself, or ask your own user, then **re-invoke** `kane-cli generate "<answer>" --refine --req <id> --agent`. Never drop a clarification.
289289

290+
**Attach files:** `--files a,b,c` adds local files (docs / images / PDF / CSV — up to 10, ≤ 50 MB each) as generation context on a **new** or **`--refine`** turn (not `--save`); each emits a `generate_upload` line before `generate_start`. Details in `references/generate.md`.
291+
290292
**Save is Functional-only:** `--save` writes only **Functional** cases to `_test.md` (under `<cwd>/.testmuai/tests` by default). Non-functional cases (Security, Performance, …) are generated and shown but not saved. Run saved files with **`kane-cli testmd run`** (`references/testmd.md`) — that's the generate → testmd pipeline.
291293

292294
Internal event/field names (`generate_snapshot`, `request_id`, …) are for parsing only — never show them to the user (§5 rule). Wire schema: `references/generate-parsing.md`.

.claude/skills/kane-cli/references/generate-parsing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Generate-specific (typed `generate_*`):
2323

2424
| `type` | Key fields | Meaning → what to do |
2525
|---|---|---|
26+
| `generate_upload` | `file`, `index`, `total`, `status` | Only when `--files` is used. Emitted once per attached file **before `generate_start`**, while the file uploads; `status` goes `"uploading"``"done"` (or `"failed"`). Progress only — narrate "attaching <file>…" or ignore. A failed upload surfaces as an `error` + non-zero exit. |
2627
| `generate_start` | `request_id`, `objective_chars`, `scenario_limit`, `per_scenario_limit`, `is_refine` | Turn began. **Capture `request_id`** — it's the handle for every later `--refine` / `--save`. `is_refine` distinguishes a new request from a continuation. |
2728
| `generate_thinking` | `took_ms` | Liveness only. Narrate "thinking…" or ignore. |
2829
| `generate_progress` | `pct` | Milestone (25 / 50 / 75 / 100). Optional progress display — not a completion signal. |

.claude/skills/kane-cli/references/generate.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
**Use this whenever a task needs test cases or scenarios written — don't hand-author them in chat or a scratch file.** Reach for it to: turn a requirement / feature description into a test suite; expand or refine coverage (more edge cases, negative paths, a narrower or broader focus); or save the Functional cases as runnable `_test.md`. It is **not** for driving a browser — that's `kane-cli run` (§3 of SKILL.md).
88

9-
> For the full web-product picture (richer inputs, dashboards), see the public docs: <https://www.testmuai.com/support/docs/generate-test-cases-with-ai/>. The CLI surface here is **text-objective only**.
9+
> For the full web-product picture (dashboards, issue-link inputs), see the public docs: <https://www.testmuai.com/support/docs/generate-test-cases-with-ai/>. The CLI takes a **text objective**, optionally with local files attached via **`--files`** (see "Attaching files" below).
1010
1111
## The three modes — one turn per invocation, then exit
1212

@@ -30,11 +30,27 @@ There is **no interactive session**. Each invocation runs exactly one generation
3030
| `--name <name>` | Names the run and the saved suite folder |
3131
| `--scenario-limit <n>` / `--per-scenario-limit <n>` | Cap scenarios / cases-per-scenario |
3232
| `--memory` | Use the memory layer — reuse relevant existing cases, reduce duplicates |
33+
| `--files <paths>` | Comma-separated local files to attach as context (new / refine only — see "Attaching files") |
3334
| `--project <id>` / `--folder <id>` | Test Manager project / folder |
3435
| `--env prod\|stage` · `--username` / `--access-key` | Environment / auth (same as `run`) |
3536

3637
If neither `--project`/`--folder` nor a saved project/folder is set when generation starts, kane-cli auto-resolves one headlessly and emits a `project_folder_auto_defaulted` event before `generate_start`. Translate it to a one-line note for the user — full handling lives in `references/test-manager.md`.
3738

39+
## Attaching files
40+
41+
Pass local files as extra context with `--files <comma-separated paths>` on a **new** generation or a **`--refine`** (not `--save`). The generator reads them and reflects them in the scenarios + cases — attach a spec, a screenshot of the UI, a PDF / Word doc, or a CSV of inputs.
42+
43+
```bash
44+
kane-cli generate "test the login flow described in the attached spec" --files ./login-spec.pdf,./wireframe.png --agent
45+
```
46+
47+
- **Supported types** — documents (`.txt .json .xml .csv .pdf .docx .xlsx`), images (`.jpg .jpeg .png .gif .bmp .webp`), audio (`.mp3 .wav .m4a`), video (`.mp4 .mov .webm .mpeg .mpga`).
48+
- **Limits** — up to **10 files**, each **≤ 50 MB**.
49+
- **Validated as a set, up front** — if any path is missing, an unsupported type, too large, or over the count, the whole command is rejected (exit `2`) **before anything is sent** and the offending paths are listed; fix and re-run. Files outside the current directory are allowed but flagged with a warning on stderr.
50+
- **`new` / `--refine` only** — combining `--files` with `--save` exits `2`.
51+
52+
Under `--agent`, each file emits a `generate_upload` line (`status` `uploading``done`) **before** `generate_start` — see `references/generate-parsing.md`. *(Interactively in the TUI, type `@` in the generate prompt to attach a file inline.)*
53+
3854
## Presenting a result (adaptive)
3955

4056
The terminal data carries the full scenarios + cases. **Present it based on size**:
@@ -114,6 +130,7 @@ Invalid flag combinations exit `2` with a message on stderr. The full set:
114130
- `--save` without `--req`
115131
- `--save` with a description (it takes none)
116132
- `--out` without `--save`
133+
- `--files` with `--save` (files attach to a new generation or a refine, not a save)
117134
- `--req` without `--refine` or `--save`
118135
- a new generation with no description
119136

docs/user-guide/generate-test-cases/overview.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A generation produces:
99

1010
You generate, review the result, **refine** it in plain language as many times as you like, and optionally **save** the functional cases as runnable `_test.md` files that [`kane-cli testmd`](../testmd/running.md) can execute and replay.
1111

12-
> For the full picture of AI test-case generation — including richer inputs (files, PDFs, issue links) and pushing cases into Test Manager or automation — see the docs at <https://www.testmuai.com/support/docs/generate-test-cases-with-ai/>. The **CLI here takes a text description** and writes local `_test.md` files. See [Limits and scope](#limits-and-scope).
12+
> For the full picture of AI test-case generation — including issue-link inputs, dashboards, and pushing cases into Test Manager or automation — see the docs at <https://www.testmuai.com/support/docs/generate-test-cases-with-ai/>. The **CLI takes a text description** (optionally with local files attached via [`--files`](#attaching-files-for-context)) and writes local `_test.md` files. See [Limits and scope](#limits-and-scope).
1313
1414
## Quick start
1515

@@ -52,10 +52,28 @@ The request id (`23271` above) is printed at the end of each generation and is h
5252
| `--scenario-limit <n>` | Maximum number of scenarios to generate. |
5353
| `--per-scenario-limit <n>` | Maximum test cases per scenario. |
5454
| `--memory` | Use the **memory layer** — reuse relevant existing test cases and reduce duplicates. |
55+
| `--files <paths>` | Comma-separated local files to attach as context (new generations and refines only). See [Attaching files for context](#attaching-files-for-context). |
5556
| `--project <id>` / `--folder <id>` | Test Manager project / folder. |
5657
| `--agent` | Emit structured NDJSON on stdout (auto-on when run non-interactively / piped). |
5758
| `--env`, `--username`, `--access-key` | Environment and authentication — same as [`kane-cli run`](../running-tests.md). See [Authentication](../authentication.md). |
5859

60+
## Attaching files for context
61+
62+
Give the generator more to work from by attaching local files with `--files` — a comma-separated list of paths — on a **new** generation or a **refine**:
63+
64+
```bash
65+
kane-cli generate "test the login flow described in the attached spec" --files ./login-spec.pdf,./wireframe.png
66+
```
67+
68+
The files are sent along with your description and reflected in the generated scenarios and cases — attach a spec, a screenshot of the UI, a PDF or Word document, or a CSV of inputs.
69+
70+
- **Supported types** — documents (`.txt`, `.json`, `.xml`, `.csv`, `.pdf`, `.docx`, `.xlsx`), images (`.jpg`, `.jpeg`, `.png`, `.gif`, `.bmp`, `.webp`), audio (`.mp3`, `.wav`, `.m4a`), and video (`.mp4`, `.mov`, `.webm`, `.mpeg`, `.mpga`).
71+
- **Limits** — up to **10 files**, each **50 MB** or smaller.
72+
- **Checked before anything is sent** — all paths are validated as a set; if any is missing, an unsupported type, too large, or over the count, the command stops and lists the offending paths so nothing is uploaded by mistake. Files outside the current directory are allowed but flagged with a warning.
73+
- **Not with `--save`** — files attach to a generation or refine, not a save (`--files` with `--save` is rejected).
74+
75+
In the interactive TUI, type `@` in the generate prompt to attach a file inline instead of passing `--files`.
76+
5977
## Interactive mode (TUI)
6078

6179
The commands above are the scripted surface. The kane-cli TUI **launches in Run mode** (for running tests) by default — switch to **Generate mode** with **`/generate`**, and back with `/run`. Or jump straight in: running `kane-cli generate "<objective>"` in a terminal (without `--agent`) opens the TUI directly in Generate mode and submits your objective.
@@ -65,6 +83,7 @@ Unlike the one-turn command-line surface, the TUI is a **live session** — gene
6583
| Input | Action |
6684
|---|---|
6785
| *(type any text)* | **Refine** — describe a change in plain language; the set updates in place |
86+
| `@<file>` | **Attach a file** — type `@` to pick a local file to add as context (same files as `--files`) |
6887
| `/view [S<n>]` | Open the **scenario browser** — drill scenarios → cases → case detail |
6988
| `/save` | Save the functional cases to `<cwd>/.testmuai/tests/…` |
7089
| `/cancel` | Cancel the current generation |
@@ -95,7 +114,7 @@ This is the intended path: **generate authors test cases → testmd runs them.**
95114

96115
## Limits and scope
97116

98-
- **Input is a text description.** File, PDF, audio, and issue-link inputs (and the web product's "Create / Create and Automate") are not part of the CLI.
117+
- **Input is a text description, optionally with attached files.** Attach local files with `--files` (see [Attaching files for context](#attaching-files-for-context)); issue-link inputs and the web product's "Create / Create and Automate" are not part of the CLI.
99118
- **Refinement is whole-request.** You refine the request as a whole in plain language; targeting an individual scenario or case from the CLI is not yet supported.
100119
- **Scenario and per-scenario counts** are bounded by `--scenario-limit` / `--per-scenario-limit`.
101120

docs/user-guide/generate-test-cases/workflow.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ kane-cli generate "checkout flow on a shopping site" --scenario-limit 4 --per-sc
3838

3939
Add `--memory` to reuse relevant existing cases and avoid duplicating coverage you already have.
4040

41+
Attach local files as context — a spec, a screenshot, a PDF or CSV — with `--files` (on a new generation or a refine):
42+
43+
```bash
44+
kane-cli generate "cover the flows described in the attached spec" --files ./spec.pdf,./flows.csv
45+
```
46+
47+
Up to 10 files, each 50 MB or smaller (documents, images, audio, video); all paths are validated before anything is sent. See [Attaching files for context](./overview.md#attaching-files-for-context).
48+
4149
## 2. Refine
4250

4351
Refinement is a plain-language conversation. Each refine is a fresh command with `--refine --req <id>`:

0 commit comments

Comments
 (0)