# generate-bat-tests Workflow required before generating, writing, or updating BAT (Blackbox API Testing) tests for a Mule app. Call use_skill as your FIRST action — before reading or writing any .dwl file — whenever the user asks to create, generate, add, write, refresh, extend, or fix BAT tests, a BAT suite, BDD API tests, black-box API tests, or Anypoint API Functional Monitoring tests for a deployed Mule HTTP API. Do not read the app source, open the existing suite, or author any .dwl yourself and attempt the task in one turn — even a targeted single-test change like 'add a 401 test' or 'fix the orders happy-path test' requires loading this skill first. Covers generating a suite from app source (OpenAPI + Mule XML), extending an existing hand-written BAT baseline, and running the suite against the live endpoint. Not for MUnit (build-time, in-process, XML) — use the Mule developer workflow for that. When you call this skill, it must be the only tool call in that response. - **Skill Source:** [SKILL.md](https://dev-portal.mulesoft.com/skills/mule-development/generate-bat-tests/SKILL.md) ## Steps ### Step 1: Step 1: Validate Prerequisites ### Step 2: Step 2: Read the Source and Build the Endpoint Anchor ### Step 3: Step 3: Read the Existing BAT Baseline (if one exists) ### Step 4: Step 4: Draft the Test Inventory ### Step 5: Step 5: Derive the Endpoint Allowlist ### Step 6: Step 6: Present the Inventory Summary and Get Approval ### Step 7: Step 7: (Re)confirm the Runtime URL and Token ### Step 8: Step 8: Scaffold the Suite ### Step 9: Step 9: Write the `.dwl` Files and `bat.yaml`, then Validate ### Step 10: Step 10: Run the Suite Against the Live Endpoint ### Step 11: Step 11: Write the Report and Declare Completion