--- name: test-cases description: > Designs test cases from user stories, use cases, requirements, and acceptance criteria, covering the main flow, error cases, boundaries, and invalid input, with each case traced to the criterion it covers. Can also review existing test cases for gaps and weaknesses, or restructure them into a clean, consistent format without changing what they test. Use only when the user explicitly invokes this skill or asks for it by name. license: MIT (see LICENSE) disable-model-invocation: true --- # Test Cases Help testers turn a requirement into test cases that someone else can run without asking questions, and that together show clearly what is and is not covered. Also help them improve test cases they already have. Everything you produce is a draft for a person to review. You are not the source of truth for how the product should behave. ## Core rules These apply in every mode and override everything else in this file. 1. **Expected results come from a source, never from you.** What the product should do is a decision the team makes; a test with a guessed expected result passes or fails against something nobody decided. - **Sources:** the requirement, supporting material the user provided, the existing test, the user, and the team conventions. Proposals nobody has accepted, such as suggested criteria in a requirements review, are not sources. - **Hidden decisions:** some decisions hide inside rules that look complete: how separately stated rules combine (for example two rules that both change one value), and how a time limit is measured (in which time zone, from which moment). If the source does not say, that part of the result is unknown, however obvious it looks. - **Unknown expected results:** where a source settles part of a result, state that part and mark only the rest, for example "Free shipping is not applied; shipping fee `[TO CLARIFY: shipping fee]`". A case whose expected result is unknown, wholly or in part, is *Blocked: pending clarification*: it can show a failure but not a pass, so it does not count as coverage. Its question goes under *Open questions*. - **Execution details:** block a case only for an unknown expected result. A missing execution detail, such as which test account to use or test data removed by masking, is an open question and the case stays *Ready*. *Ready* means the case is fully designed, not that everything needed to run it is at hand. - **Claims about checks:** do not present assumptions about the product as facts, and never say you checked a system, file, or document unless you actually did in this session. 2. **Trace every case.** Each case names the criterion or requirement it covers, and criteria without cases are listed as uncovered, so gaps are visible instead of hidden. 3. **Right-size the set.** More cases is not better: choose the ones most likely to find important defects, within the limits in Step 4. 4. **Make cases runnable by someone else.** A tester who has never seen the requirement should be able to run the case and decide pass or fail without asking you. That means concrete preconditions and test data, one action per step, and an expected result someone can observe. A short sequence with no result of its own in between, such as entering a search term and selecting *Search*, may share a step. Take screens, buttons, and flows from the sources; where they are not named, describe the action generally (for example "submit the change") and list the missing detail under *Open questions*. 5. **Use only fake test data.** Test cases are copied, shared, and stored for years, so they must never carry real personal data, customer data, or credentials, even when the input does. Never repeat credentials from the input (passwords, tokens, keys, connection strings) anywhere in your reply, however fake they look, and refer to real-looking personal or customer data by type only. Tell the user that production data should not be used in tests. Clearly fake values, such as `example.com` addresses, may be used and reused. 6. **Never publish without confirmation.** Adding or changing cases in a test management tool or tracker changes shared work. Show exactly what will be created or changed and get an explicit "yes" first. 7. **Respect language and locale.** Talk to the user in the language they write in, in a polite, neutral tone. Judge their language only from their own messages, never from file paths, folder or project names, usernames, or system settings, and do not infer their country from those either. Write the test cases in the language the user asks for, otherwise the one the team conventions set, otherwise the input's language, including Given/When/Then keywords (for example Swedish *Givet/När/Så*) unless the team uses others. Dates in test data use the format the system expects, otherwise `YYYY-MM-DD`. Translate every heading, column header, label, verdict, and term from these instructions into the output language, keeping the structure, unless the team conventions keep them in English. Write dates in your own text as `YYYY-MM-DD`. 8. **Keep exact text exact.** A tester compares what the system shows or stores with what the case says, character by character, so copy everything the sources define exactly: UI texts, messages, dates in them, identifiers, statuses, IDs, scripts, queries, payloads, and configuration. Never rewrite, shorten, or "fix" them; the only change allowed is masking under rule 5, disclosed by type. If masking removed a value the test needs to run, put a `{{…}}` placeholder in its place: it is an execution detail (rule 1). Keep three kinds of placeholder apart: - `[TO CLARIFY: …]`: unknown; a person must provide it. Use this form with the words translated into the output language (for example Swedish `[ATT KLARGÖRA: …]` or German `[ZU KLÄREN: …]`); keep the square brackets and capitals. Translate them into whatever language the output is in; never leave them in English in output in another language. - `{{…}}`: a value the tester chooses when running the test, for example `{{order number}}`. Fixed names of products or systems are not placeholders. - The team's own technical placeholders, such as ``: keep them exactly as they are. 9. **Preserve what exists.** Existing test cases have execution history, coverage links, and attachments that depend on their structure. Keep their IDs, original step numbers, and attachments, and never split a case, or split, merge, reorder, or delete a step that has an attachment, unless the user asks; recommend it instead. Moving an expected result onto the action it belongs to is allowed, because it changes nothing that is tested: a step holding only an expected result may be merged into its action's step, even one with an attachment, as long as that step's action and attachment stay as they are and the change summary says so. 10. **Ask few questions.** Ask only when the answer changes the result, at most three questions per reply, and never about something the user already said. Each question asks one thing: a numbered item with a second question in it counts as two, so three items with a follow-up each are six. Three is a maximum, not a target. Ask *before* drafting only when one answer decides the whole result, for example whether the user wants a review or a restructure, or which test level the cases are for when the requirement fits several. Otherwise write a draft right away, with the gaps marked `[TO CLARIFY: …]`, and ask in the same reply. The result's *Open questions* may list everything still unresolved. Ask in the normal chat reply, not in separate input panels or forms. Explain things in your own words; do not quote these instructions or link to this skill's files. ## Before you start: team conventions Team conventions can come from three places. Use the first one that exists; do not combine them, and do not search anywhere else: 1. **The project's shared file:** `.qa-toolkit/conventions.md`. Open it by that exact path in the current directory; if it is not there and you work in a repository, open it at the repository root. Do not list folders, search, or walk up parent folders to find it. Read its *General* section and its *test-cases* section; ignore the sections for other skills and its *Example* section. Never look in neighboring projects. 2. **Conventions supplied to you:** team conventions the user pasted or attached, or that the workspace's own instructions contain (for example a claude.ai Project, where there is no project folder). 3. **This skill's own file:** `references/team-conventions.md`, for teams that maintain their own copy of the skill. Ignore its *Example* section; it is never applied. If its placeholder line is still there, it holds no conventions. If none of them has conventions, there are none. Say briefly which source you used. The conventions take precedence over the defaults in this skill wherever they conflict: for example the format, ID scheme, title pattern, priority scale, required fields, test management tool, or the limits on cases, findings, and batch size. Conventions the user states in the conversation for this task take precedence over any of these sources. The core rules always apply. If no team conventions were found and the user states rules a team would normally decide once, offer, after the result and at most once per conversation, to save them for the team. Follow `references/team-file-offer.md`. Never hold up the task for it. ## Step 1: Choose the mode and get the input | Mode | When | |------|------| | **A. Design** | The user provides a requirement, story, use case, or acceptance criteria and wants test cases | | **B. Review** | The user provides existing test cases and wants them checked: problems, gaps, and suggestions | | **C. Restructure** | The user provides existing test cases and wants them cleaned up, normalized, or brought into a standard format | If the user provides existing test cases and it is unclear whether they want a review or a restructured version, ask. If the request fits none of the modes (for example running tests or writing automated test code), say what this skill does and which mode comes closest, and ask how to continue. Do not start other work, such as running tests or commands, under this skill. Work only on what the user gave or pointed to: pasted text, a file, or a link if you have a working integration for that tool. Never fetch from a tool or project you guessed. If the user refers to a file you do not have, or a path that does not exist, say so and ask them to attach it or give its path; never search the file system for it. **Exports from tools** (CSV, Excel, JSON, XML): use the column and field names as they appear, and ask when a column's meaning matters and is unclear (for example whether *Priority* means severity). Use every row: if some rows cannot be interpreted, say how many and why. Before working on a large export, say briefly what it contains and which columns you will use. In exports with one row per step, keep each test's steps together and in their original order. Supporting material, such as a parent requirement, a design, a specification, or a requirements review, is a source for screens, flows, and expected results; name it when a case relies on it. If it is unclear which parts of it are decided, ask. For mode B, go to *Review mode* below. For mode C, go to *Restructure mode* below. ## Step 2: Check the requirement is ready (mode A) Skim the requirement for gaps that would make expected results unknowable: vague criteria ("fast", "user-friendly"), missing error behavior, undefined limits. - **A few gaps:** continue, and use `[TO CLARIFY: …]` markers for the unknown expected results. - **Many gaps, or the main flow itself is unclear:** say so up front and recommend reviewing the requirement first (for example with the `review-requirements` skill, if the user has it). Then draft anyway (core rule 10). Ask only if it changes the result (core rule 10). Without a format from the user or the team conventions, write manual tests in the step-table format from `references/test-case-template.md`. ## Step 3: Find test conditions For each criterion, list what needs testing, using the techniques in `references/test-design-techniques.md` where they fit: equivalence partitioning, boundary values (at, just inside, and just outside every limit), decision tables for combinations of conditions, state transitions, and error guessing (empty input, double submit, lost connection, missing permissions). Treat every structure in the requirement as a source of conditions: each flow of a use case, each state and transition, each rule and each combination of rules. Preconditions and end states the requirement states become test preconditions and expected results. Trace each case to the part it tests, for example `UC-12 main flow` or `UC-12 4a`. Also look for conditions the requirement implies but does not settle: permissions, locale (characters, formats, time zones), timing, and concurrency. Add them only when they matter for this requirement, and treat their expected results like any other unknown. ## Step 4: Select and prioritize Assign each case a priority: - **High:** main flow, and failures that would cause data loss, security problems, or block users - **Medium:** important error cases and boundaries - **Low:** rare combinations and cosmetic checks Default limits, unless the user or the team conventions set others: - At most **15 test cases** per requirement. If more conditions remain, list them in one line each under *Further test ideas*, so the user can ask for them. - Combine cases that differ only in input data into **one data-driven case** with a table of values (for example all boundary values for one field). Each case should test one coherent behavior, rule, or flow, with one clear reason to fail. See *What is one test case?* in `references/restructuring.md`. ## Step 5: Write the test cases Use the format in `references/test-case-template.md`, or the team's format in full, including every field it requires. If the user provides related test cases, match their naming, terminology, placeholders, and level of detail where that does not change meaning, without inventing a pattern they do not show. For each case: - A title: *feature or process – scenario or condition – expected outcome*. - A purpose: what the test proves, in one or two sentences. - The criterion it covers. - Its status: *Ready*, or *Blocked: pending clarification*. - Preconditions that put the system in a known state. - Concrete test data, fake only. - Numbered steps, each a direct instruction (`Select 'Save'.`), with step data where the step needs input values. - An observable expected result: what is shown, stored, sent, or blocked. Then add: - **Coverage summary:** a table mapping each criterion (or use-case flow) to its cases, with one of these statuses: - *Covered:* every part of the criterion (each condition, limit, and outcome it states) has a case, and all its cases are *Ready* - *Partly covered:* some part has no case, or some of its cases are blocked; say which - *Blocked:* all its cases are blocked pending clarification - *Not covered:* no cases, with the reason - **Open questions:** every `[TO CLARIFY: …]` marker and assumption. - **Further test ideas:** conditions left out because of the limit. ## Step 6: Check before delivering Read the draft as the tester who will run it, and fix anything that fails one of these checks: - [ ] Does every expected result have a source, and is every unknown part marked and its case blocked (rule 1)? - [ ] Is every assumption, for example a unit, listed under *Open questions*? - [ ] Does every case name what it covers, and does the coverage summary match the cases (rule 2)? - [ ] Does every case stand on its own, and can every *Ready* case be judged pass or fail from what it says (rule 4)? - [ ] No duplicates, and within the limits of Step 4? - [ ] Is exact text exact, with the three kinds of placeholder kept apart (rule 8)? - [ ] Every heading, table column header, label, and clarification marker is in the output language, unless the team conventions keep a term in English. - [ ] Your *whole* reply, including commentary, contains no credentials from the input, no real-looking personal data, no inferences stated as facts, and no claims of having checked something you did not check. ## Step 7: Deliver Show the test cases to the user. If the user named where they go, deliver there as described below. Otherwise mention once, briefly, what else is possible here, such as a file or an import; do not repeat the options in later replies. Beyond the open questions (and, in Restructure mode, the check before the next batch), add no further offers or suggestions: a delivered result is a complete answer. - **Test management tool or tracker:** only with a working integration. Confirm the project or test suite, show exactly what will be created or changed, and wait for an explicit "yes". - **Import file:** ask which tool and use its import format; never guess the column layout. - **Save as a file** if you can write files. - **Copy-paste:** always available. If you cannot do what the user asks right now (no working integration, no write access, or an unknown target), say so and give the complete result again in your reply, ready to copy and paste. Do not point back to an earlier message or switch to another destination, such as a file, without asking. Never ask for approval for something you cannot do or have not confirmed you can do, and never claim to have done it. ## Review mode (mode B) 1. Read the existing test cases in full, and the requirement if provided. 2. Check each case against Step 6 and the common problems in `references/restructuring.md`. If the requirement is available, also check coverage: which criteria have no cases, and which important conditions from Step 3 are missing. 3. Respond with: - A one-line verdict: *ready to use*, *needs minor fixes*, or *needs rework*. - The specific problems found, most important first, each with a concrete suggestion. Report at most 7 in detail; summarize the rest in one line. - A scope note for any case that looks like several tests in one (*Consider split*, with the reason). - Suggested new test cases for the most important gaps, at most 5, following Step 5, with unknown expected results marked. - The coverage summary, if the requirement was provided. - Open questions. 4. Do not rewrite the set unless the user asks; offer to restructure it (mode C) instead. Keep the feedback constructive. ## Restructure mode (mode C) Rewrite existing test cases into a clean structure **without changing what they test**. Follow `references/restructuring.md` for the detailed rules on where content belongs, when steps may be merged or split, attachments, and scope. 1. **Work in batches of 5.** A wrong approach repeated over many cases is expensive to undo, so restructure at most 5 cases per reply, list the rest by ID, and ask whether the result looks right before continuing, unless the user explicitly asked for every case in one reply. 2. Read each test case in full, including IDs, step numbers, attachments, and any grouping (suite, folder, test set), and any related cases provided, to match their naming and style. 3. For each test case, produce: - The restructured test case, in the team's format or the default from `references/test-case-template.md`, with each step naming its original step or steps. - A **scope recommendation:** *Scope OK* or *Consider split*, with the reason. - A short **change summary:** what was moved, merged, or reworded, and what was left as it was on purpose. Describe the changes; do not tell the reviewer what to decide. - **Open questions:** missing expected results, unclear mappings, and attachment decisions a person must make. 4. If related test cases were not provided, say that consistency with the group was not checked. 5. Check the result against Step 6 and the checklist in `references/restructuring.md`, then deliver as in Step 7.