End-to-end backend API test automation from test case input to working automated tests.
Prerequisite: Rosetta Prep Steps.
Terminology. External systems are named by role throughout this workflow and its phases: Test Management System (TMS), Issue Tracker, and Wiki. TestRail, Jira, and Confluence are canonical examples only — adapt identifiers, URLs, requests, calls, and query syntax to the systems resolved for the current project (from repository-root gain.json, explicit user input, recognizable URLs/handles, and available integrations).
At completion the user has: corrected, passing API test files in the repository; the per-session artifacts under plans/api-aqa-{IDENTIFIER}/ (raw-data.md, api-analysis.md, analysis.md, test-specs.md, execution-report.md); and agents/TEMP/<FEATURE>/api-aqa-state.md recording phase completion, metrics, and HITL approvals.
- Phases 0→7 MUST run in order; sanctioned skips per
<skip_rules> only.
- All Rosetta prep steps MUST be FULLY completed, SKILL
load-project-context loaded and fully executed.
- NO ASSUMPTIONS: never assume endpoints, payloads, auth mechanisms, or response schemas — ask the user when missing.
- MUST ALWAYS use todo tasks ledger, ASAP. Prioritize ACCURACY over SPEED. Proactively use available tools/MCPs, if question can be answered from code or MCP call - do that first.
- Drive loop (owned by this workflow): execute phases in order — for each: APPLY PHASE its phase file → update
agents/TEMP/<FEATURE>/api-aqa-state.md → verify the phase-output gate → next; keep todos matched to the active phase; never batch-load future phases; never skip without approval (<skip_rules>). When a phase delegates work to subagents, dispatch per USE SKILL orchestration.
- Phase-output gate (verify before advancing): each phase's mandatory artifact must exist and pass its phase-file completion gate before the next phase starts — notably Phase 4: every
ATC-NNN in test-specs.md traces to a Phase 3 source (a raw-data.md test case and/or an analysis.md G[N]/C[N]/A[N] finding); also Phase 1 raw-data.md, Phase 2 api-analysis.md, and Phase 6 execution-report.md present and non-placeholder.
This block owns ONLY the api-aqa-flow-specific skip rules below: a set of always-in-force carve-outs plus a single verification-failure unilateral-start override (the only no-ask deviation; its preconditions are in the table further down). The carve-outs bind unconditionally; the override is subordinate to them. Gate-execution mechanics (how to run an approval gate, token handling) are owned by USE SKILL hitl — defer to it; not restated here.
Always-in-force carve-outs (the override never suppresses these):
- Per-phase HITL gates (Phases 3-7 marked
type="HITL") — explicit user approval per the hitl skill.
- NO ASSUMPTIONS rule (above) — every non-skip-gate decision.
- Safety / destructive confirmations — file deletion, edits outside
plans/api-aqa-{IDENTIFIER}/, comparable irreversible actions.
Verification-failure unilateral-start override — subordinate to the hitl skill + the carve-outs above; the only no-ask deviation, applies only at this skip-verification gate.
| Precondition (ALL true, independently verified) |
Action |
(a) user asserts Phases 0-2 complete this turn AND (b) agents/TEMP/<FEATURE>/api-aqa-state.md marks them complete AND (c) raw-data.md + api-analysis.md exist under plans/api-aqa-{IDENTIFIER}/ |
Print (a)/(b)/(c) each with its concrete evidence (user-assertion quote · the api-aqa-state rows · the two artifact paths), then skip Phases 0-2 and resume at Phase 3. Any precondition not showable with concrete evidence → treat as uncertain (last row). |
| Any of (a)/(b)/(c) false AND user instruction unambiguous |
Print failing conditions; begin Phase 0 same turn. |
| Any precondition uncertain |
Fall back to normal HITL ask. Ambiguity defaults to ASK. |
agents/TEMP/<FEATURE>/api-aqa-state.md carries: header (Last Updated / Current Phase 0-7 / Test Case Source / Feature / IDENTIFIER — matching the Phase 0 stub; API Base URL is appended once Phase 2 resolves it) + 8-row ## Phase Completion Status checklist (one row per phase 0-7) + per-phase append blocks. Each phase file owns its own state-update snippet (the delta it appends after running) — this workflow does not restate the full template.
Subagents: discoverer · architect · engineer · executor (optional, mechanical actions).
Cross-phase skills: qa-structure (paths / identifier / state-file shape) and qa-knowledge (modes, taxonomies, artifact skeletons — loads its own assets at point of use).
Integrations: TMS, Issue Tracker, and Wiki per <description_and_purpose> Terminology.
1---2name: api-aqa-flow3description: Workflow for backend API test automation: TMS / Issue Tracker test cases → automated API tests, HITL-gated.4---56<api_aqa_flow>78<description_and_purpose>910End-to-end backend API test automation from test case input to working automated tests.1112Prerequisite: Rosetta Prep Steps.1314**Terminology.** External systems are named by role throughout this workflow and its phases: **Test Management System (TMS)**, **Issue Tracker**, and **Wiki**. TestRail, Jira, and Confluence are canonical examples only — adapt identifiers, URLs, requests, calls, and query syntax to the systems resolved for the current project (from repository-root `gain.json`, explicit user input, recognizable URLs/handles, and available integrations).1516**At completion the user has:** corrected, passing API test files in the repository; the per-session artifacts under `plans/api-aqa-{IDENTIFIER}/` (`raw-data.md`, `api-analysis.md`, `analysis.md`, `test-specs.md`, `execution-report.md`); and `agents/TEMP/<FEATURE>/api-aqa-state.md` recording phase completion, metrics, and HITL approvals.1718</description_and_purpose>1920<workflow_phases>2122- **Phases 0→7 MUST run in order**; sanctioned skips per `<skip_rules>` only.23- All Rosetta prep steps MUST be FULLY completed, SKILL `load-project-context` loaded and fully executed.24- NO ASSUMPTIONS: never assume endpoints, payloads, auth mechanisms, or response schemas — ask the user when missing.25- MUST ALWAYS use todo tasks ledger, ASAP. Prioritize ACCURACY over SPEED. Proactively use available tools/MCPs, if question can be answered from code or MCP call - do that first.26- **Drive loop (owned by this workflow):** execute phases in order — for each: APPLY PHASE its phase file → update `agents/TEMP/<FEATURE>/api-aqa-state.md` → verify the phase-output gate → next; keep todos matched to the active phase; never batch-load future phases; never skip without approval (`<skip_rules>`). When a phase delegates work to subagents, dispatch per USE SKILL `orchestration`.27- **Phase-output gate (verify before advancing):** each phase's mandatory artifact must exist and pass its phase-file completion gate before the next phase starts — notably **Phase 4: every `ATC-NNN` in `test-specs.md` traces to a Phase 3 source** (a `raw-data.md` test case and/or an `analysis.md` `G[N]`/`C[N]`/`A[N]` finding); also Phase 1 `raw-data.md`, Phase 2 `api-analysis.md`, and Phase 6 `execution-report.md` present and non-placeholder.2829<skip_rules>3031This block owns ONLY the api-aqa-flow-specific skip rules below: a set of **always-in-force carve-outs** plus a single **verification-failure unilateral-start override** (the only no-ask deviation; its preconditions are in the table further down). The carve-outs bind unconditionally; the override is subordinate to them. Gate-execution mechanics (how to run an approval gate, token handling) are owned by USE SKILL `hitl` — defer to it; not restated here.3233- **Always-in-force carve-outs** (the override never suppresses these):34 1. Per-phase HITL gates (Phases 3-7 marked `type="HITL"`) — explicit user approval per the `hitl` skill.35 2. NO ASSUMPTIONS rule (above) — every non-skip-gate decision.36 3. Safety / destructive confirmations — file deletion, edits outside `plans/api-aqa-{IDENTIFIER}/`, comparable irreversible actions.3738- **Verification-failure unilateral-start override** — subordinate to the `hitl` skill + the carve-outs above; the only no-ask deviation, applies only at this skip-verification gate.3940 | Precondition (ALL true, independently verified) | Action |41 |---|---|42 | (a) user asserts Phases 0-2 complete this turn AND (b) `agents/TEMP/<FEATURE>/api-aqa-state.md` marks them complete AND (c) `raw-data.md` + `api-analysis.md` exist under `plans/api-aqa-{IDENTIFIER}/` | **Print (a)/(b)/(c) each with its concrete evidence** (user-assertion quote · the api-aqa-state rows · the two artifact paths), then skip Phases 0-2 and resume at Phase 3. Any precondition not showable with concrete evidence → treat as uncertain (last row). |43 | Any of (a)/(b)/(c) false AND user instruction unambiguous | Print failing conditions; begin Phase 0 same turn. |44 | Any precondition uncertain | Fall back to normal HITL ask. **Ambiguity defaults to ASK.** |4546</skip_rules>4748<execution_policy>49- If user did not specify preferences, perform all steps except optional.50- MUST follow JIT phase-by-phase: do not load/act IN ADVANCE.51- User CAN customize: specific phases, already-done phases, specific goals, specific cases — LISTEN and ADOPT.52- USE SKILL `coding` before implementation or correction work that touches repository test code or shared utilities.53- **Repository coding standards:** follow `<coding_standards_precedence>`.54- Prefer extending existing test files and utilities over creating new ones.55- **Overall workflow done when:** every phase required for this run is marked complete in `agents/TEMP/<FEATURE>/api-aqa-state.md`, expected artifacts for those phases exist under `plans/api-aqa-{IDENTIFIER}/` (and related paths named in phase docs), and the user accepts the last test outcome or explicitly stops the run.56</execution_policy>5758<project_config_loading phase="0" applies="ALL" subagent="discoverer" role="AQA project config loader" subagent_required_model="inherit" type="HITL-CONDITIONAL">59- APPLY SKILL FILE `phases/api-aqa-flow-project-config-loading.md`60- Input: user request. Output: project config file, initial data file, session directory at `plans/api-aqa-{IDENTIFIER}/`.61- HITL gate: **ASK USER FOR PROJECT INFO** if config does not already exist.62- Required skills: `qa-structure`, `sensitive-data` (redaction at intake)63- Recommended skills: `questioning` (config-missing interview)64- Update `agents/TEMP/<FEATURE>/api-aqa-state.md`; Phase 0 is not complete until its output spot-check passes.65</project_config_loading>6667<data_collection phase="1" applies="ALL" subagent="discoverer" role="AQA data collector" subagent_required_model="inherit">68- APPLY SKILL FILE `phases/api-aqa-flow-data-collection.md`69- Input: project config + initial data. Output: `plans/api-aqa-{IDENTIFIER}/raw-data.md` (test cases, documentation, existing test patterns).70- Required skills: `data-collection` (TMS + Wiki collector), `qa-knowledge` (`code_analysis` mode — existing-test + backend-source scan), `reverse-engineering`, `qa-structure`71- Update `agents/TEMP/<FEATURE>/api-aqa-state.md`; Phase 1 is not complete until its output spot-check passes.72</data_collection>7374<api_spec_analysis phase="2" applies="ALL" subagent="discoverer" role="API spec analyst" subagent_required_model="inherit">75- APPLY SKILL FILE `phases/api-aqa-flow-api-spec-analysis.md`76- Input: raw data + project config. Output: `plans/api-aqa-{IDENTIFIER}/api-analysis.md` (endpoint contracts, auth, data dependencies).77- Required skills: `qa-knowledge` (`code_analysis` mode — API-contract extraction), `reverse-engineering`, `sensitive-data`, `qa-structure`78- Update `agents/TEMP/<FEATURE>/api-aqa-state.md`; Phase 2 is not complete until its output spot-check passes.79</api_spec_analysis>8081<gap_and_requirements_clarification phase="3" applies="ALL" subagent="architect" role="Test requirements analyst" subagent_required_model="inherit" type="HITL">82- APPLY SKILL FILE `phases/api-aqa-flow-gap-and-requirements-clarification.md`83- Input: raw data + API analysis. Output: `plans/api-aqa-{IDENTIFIER}/analysis.md` (gaps, contradictions, ambiguities resolved).84- HITL gate: **WAIT FOR USER ANSWERS** before Phase 4.85- Required skills: `qa-knowledge` (`gap_analysis` mode), `qa-structure`86- Recommended skills: `questioning`87- Update `agents/TEMP/<FEATURE>/api-aqa-state.md`; Phase 3 is not complete until its output spot-check passes.88</gap_and_requirements_clarification>8990<test_case_specification phase="4" applies="ALL" subagent="architect" role="Test specification author" subagent_required_model="inherit" type="HITL">91- APPLY SKILL FILE `phases/api-aqa-flow-test-case-specification.md`92- Input: all phase 1-3 outputs. Output: `plans/api-aqa-{IDENTIFIER}/test-specs.md` (Given-When-Then scenarios).93- HITL gate: **WAIT FOR EXPLICIT USER APPROVAL** before Phase 5; comments, questions, suggestions, and review feedback are not approval.94- Required skills: `qa-knowledge` (`scenario_design` mode), `sensitive-data`, `qa-structure`95- Recommended skills: `hitl`96- Update `agents/TEMP/<FEATURE>/api-aqa-state.md`; Phase 4 is not complete until its output spot-check passes.97</test_case_specification>9899<test_implementation phase="5" applies="ALL" subagent="engineer" role="Test automation engineer" subagent_required_model="inherit" type="HITL">100- APPLY SKILL FILE `phases/api-aqa-flow-test-implementation.md`101- Input: approved test specs + existing patterns + API analysis. Output: implemented test files.102- HITL gate: **STOP AND WAIT** — user must provide actual execution results (output, report path, or pass/fail); confirmation alone does not satisfy this gate.103- Required skills: `qa-knowledge` (`implementation_modes` — API impl), `qa-structure`104- Recommended skills: `testing`, `coding` (repo conventions)105- Update `agents/TEMP/<FEATURE>/api-aqa-state.md`; Phase 5 is not complete until its output spot-check passes.106</test_implementation>107108<execution_and_report_analysis phase="6" applies="ALL" subagent="engineer" role="Test failure analyst" subagent_required_model="inherit" type="HITL">109- APPLY SKILL FILE `phases/api-aqa-flow-execution-and-report-analysis.md`110- Input: test execution report (user-provided or from `agents/user-instructions/`). Output: `plans/api-aqa-{IDENTIFIER}/execution-report.md` (failure analysis).111- HITL gate: **WAIT FOR USER TO PROVIDE TEST EXECUTION RESULTS**.112- Required skills: `qa-knowledge` (`test_execution_triage` mode), `sensitive-data`, `qa-structure`113- Update `agents/TEMP/<FEATURE>/api-aqa-state.md`; Phase 6 is not complete until its output spot-check passes.114</execution_and_report_analysis>115116<test_corrections phase="7" applies="ALL" subagent="engineer" role="Test correction engineer" subagent_required_model="inherit" type="HITL">117- APPLY SKILL FILE `phases/api-aqa-flow-test-correction.md`118- Input: execution report + test files + test specs. Output: corrected test files.119- HITL gate: **WAIT FOR EXPLICIT USER APPROVAL** before applying changes; comments, questions, suggestions, and review feedback are not approval.120- Required skills: `qa-knowledge` (`correction` mode), `qa-structure`121- Recommended skills: `coding` (authors the proposed/applied edits), `debugging` (root-cause alignment), `hitl`122- Update `agents/TEMP/<FEATURE>/api-aqa-state.md`; Phase 7 is not complete until its output spot-check passes.123</test_corrections>124125</workflow_phases>126127<coding_standards_precedence>128Conflict rule is binary: if guidance from a loaded skill conflicts with repository markdown (`docs/CONTEXT.md`, `docs/ARCHITECTURE.md`, `agents/IMPLEMENTATION.md` — or the paths `gain.json` configures — and `project_description.md` if present) on naming, structure/layout, tooling, or test patterns, repository markdown wins and the conflicting skill snippet is ignored for that decision. If there is no conflict, apply both. `gain.json` wins for file locations.129Example: if a skill suggests `/tests/api/` but `docs/ARCHITECTURE.md` requires `/qa/api/tests/`, use `/qa/api/tests/`.130</coding_standards_precedence>131132<failure_handling>133- **Phase-file load failure** (APPLY PHASE for a required phase returns nothing): retry once, then stop, record in `agents/TEMP/<FEATURE>/api-aqa-state.md`, ask the user — never improvise an undocumented phase.134- **Missing prior artifact:** do not fabricate; with user agreement re-run the producing phase, or stop and ask the user to restore it.135- **Unreadable `agents/TEMP/<FEATURE>/api-aqa-state.md`:** pause, rebuild minimal phase pointers from `plans/api-aqa-{IDENTIFIER}/` when possible, then ask the user to confirm.136- **State-note example (phase-file load failure):** `Phase 5 blocked: APPLY SKILL FILE `phases/api-aqa-flow-test-implementation.md` returned nothing at 2026-05-25T15:00Z; awaiting user action.`137</failure_handling>138139<state_file>140141`agents/TEMP/<FEATURE>/api-aqa-state.md` carries: header (Last Updated / Current Phase 0-7 / Test Case Source / Feature / IDENTIFIER — matching the Phase 0 stub; `API Base URL` is appended once Phase 2 resolves it) + 8-row `## Phase Completion Status` checklist (one row per phase 0-7) + per-phase append blocks. Each phase file owns its own state-update snippet (the delta it appends after running) — this workflow does not restate the full template.142143</state_file>144145<references>146147Subagents: `discoverer` · `architect` · `engineer` · `executor` (optional, mechanical actions).148149Cross-phase skills: `qa-structure` (paths / identifier / state-file shape) and `qa-knowledge` (modes, taxonomies, artifact skeletons — loads its own assets at point of use).150151Integrations: TMS, Issue Tracker, and Wiki per `<description_and_purpose>` Terminology.152153</references>154155</api_aqa_flow>