Test-plan skill
/safran:test-plan turns a ticket's acceptance criteria into test cases a person can execute or automate, points at the existing tests that the change puts at risk, and says which criteria cannot be tested as they are written. The output is a plan in text. The skill does not generate executable tests and does not claim that anything was run or passes.
Run it
/safran:test-plan PAY-1423The argument is a ticket key or a ticket URL. Without one, the skill asks which ticket and waits. Claude also starts it on its own for requests such as "test plan for PAY-1423", "what should QA cover for this ticket" or "which existing tests does PAY-1423 affect".
What it does
| Step | What happens | Tools |
|---|---|---|
| 1. Profile | Takes the output language, the glossary for searching, anything the conventions say about testing or naming, and teams and repo groups for scope. If this fails, the skill reports the error and stops. | get_company_profile |
| 2. Read the ticket completely | The ticket, all comments, the attachments (images often show the expected state), linked pages, and the parent and linked tickets that define scope. If the ticket cannot be read, the skill stops; if a part cannot, it says which, continues, and lists it at the end as not read. | get_ticket, get_ticket_comments, get_ticket_attachment, fetch_linked_doc, get_ticket_history |
| 3. Collect the acceptance criteria | Lists every criterion with its source (AC1, AC2, …): the description, a dedicated field, comments, a linked page. Later decisions override earlier text; an unresolved contradiction is reported, not resolved. | none |
| 4. Judge each criterion | Testable as written, or not. See below. | none |
| 5. Derive the cases | For every testable criterion, the cases that would convince a sceptic. See below. | none |
| 6. Regression areas and existing tests | Finds the code the ticket changes, the existing tests for that code, neighbours at risk (callers, other features in the same files, copies), and which tickets changed those files before. | search_code, grep_code, read_file, list_repos, find_past_work |
| 7. Output | Six parts in a fixed order. | none |
The one decision point
When the ticket states no acceptance criteria at all, the skill does not invent them and then plan against its own invention. It tells you, and asks: derive candidate criteria from the description for you to confirm (the plan is then marked as built on proposed criteria), or stop so the ticket can be completed first.
Testable as written
A criterion is testable when it names an observable outcome and the condition under which it must hold, precisely enough that two people would agree whether a run passed. It is marked untestable as written when it is:
- subjective or unmeasured ("fast", "user-friendly", "works correctly", "handles large files");
- missing the expected result (it says what to do, not what should happen);
- missing the condition (which user, which state, which platform, which data);
- dependent on an unanswered question or on something only named ("as in the design");
- contradictory with another criterion or a comment.
For each, the plan says exactly what is missing and writes the question that would make it testable, with who could answer. The skill does not quietly substitute a number or an interpretation. It may add a clearly labelled candidate ("if the intended threshold is N, the case would be …") when that helps the person answering.
The dimensions of a case
| Dimension | What is looked for |
|---|---|
| Happy path | The criterion satisfied in the most ordinary way. |
| Boundaries | The edges of every stated range or count: at, just below, just above. Empty and maximum. |
| Negative | Invalid input, the forbidden action, the failure of a dependency. What the user or caller sees. |
| Permissions | Each role or actor the ticket names, and one that must not be able to do it. |
| Data and state | Starting states that change the outcome: existing records, concurrent changes, repeated submission, partial earlier results. |
| Platforms | Each platform or client the ticket covers, when behaviour could differ. |
A dimension that does not apply is marked "not applicable" instead of being filled with an invented case. Each case has an id (TC1, …), the criterion it verifies, preconditions, steps, the expected result, and the level it fits best (unit, integration, end-to-end, manual) when the code that was read makes that clear. Expected results use only values the ticket states. Where a value is not specified, the case says so and points to the open question.
Regression areas
For each area the plan gives what could break, why (the citation), and the existing test file to extend, cited as repo path:start-end. When no test exists for an area, the plan says "no existing test found in the indexed code" with what was searched; that gap is a finding. If nothing about the ticket can be found in the code, the plan is delivered from the criteria alone and the regression section states that no affected code was located.
The output
- Summary: two or three sentences. How many criteria, how many testable, how many cases, the main risk.
- Coverage table: one row per criterion, with the columns Criterion, Stated in, Testable as written, Cases, What is missing.
- Untestable criteria: for each, the criterion in its own words, what is missing, the question to ask and whom.
- Test cases: grouped by criterion.
- Regression areas: area, risk, citation, existing test to extend (or "none found").
- Open questions and not read: everything unanswered, and any part of the ticket or code that could not be read, with index freshness when absence matters.
The plan closes with one line stating that it is a plan: no test was written, run or added to the tracker.
Summary
PAY-1423 states 1 acceptance criterion; it is testable as written. 4 test cases. The main risk
is rounding: the amount is rounded to two decimals before it reaches the provider.
Coverage
| Criterion | Stated in | Testable as written | Cases | What is missing |
|---|---|---|---|---|
| AC1: a refund smaller than the order total completes | Description | yes | TC1-TC4 | - |
Untestable criteria
None.
Test cases
AC1
- TC1 (happy path, integration). Precondition: an order with a captured payment. Steps: request
a refund smaller than the order total. Expected: the refund completes.
- TC2 (boundary, unit). Steps: request a refund equal to the order total. Expected: not
specified in the ticket ("smaller than" is the only stated case); see open question 1.
- TC3 (negative, unit). Steps: request a refund larger than the order total. Expected: the
refund is refused. The message shown to the customer is not specified; see open question 2.
- TC4 (data, integration). Steps: request a refund with more than two decimals. Expected: the
refund completes.
Permissions, platforms: not applicable; the ticket names no roles and no platforms.
Regression areas
- Refund amount check. payments-api src/refund/policy.ts:5-13 (assertRefundable) decides what is
refundable. Existing test to extend: no existing test found in the indexed code
(searched: "refund policy test", grep "assertRefundable", grep "RefundPolicy").
- Webhook retries. payments-api src/webhook/retry.ts:6-11 was changed for PAY-1500, which this
ticket blocks.
Open questions and not read
1. Should a refund equal to the order total go through this path? Ask: the reporter.
2. What does the customer see when a refund is refused? Ask: the reporter.
Not read: hata-ekrani.png was opened; nothing else was skipped. Index: payments-api as of
2026-11-22.
This is a plan: no test was written, run or added to the tracker.Output language
The plan is written in the profile's languages.tickets, unless you write in another language; then it uses yours. Identifiers, paths and quoted code stay as they are in the code.
Limits
- No executable tests. The skill has neither
WritenorBash; it answers in the conversation. - A threshold, limit, role, message or data rule that the ticket does not state is "not specified" and becomes an open question. The plan never tests against a value the skill made up.
- A test file, suite, fixture or symbol is named only when a tool returned it. Names that would follow from a naming convention are not used.
- The tracker is never written to. Asked to add the plan to the ticket, the skill says so and gives the text to paste.