Generates E2E test cases for a codebase through a validated multi-step pipeline. Each step runs in an isolated subagent and must pass deterministic validation before the next step begins. Use when the user wants to generate tests, create test scenarios, or build a test suite for their project.
How this skill is triggered — by the user, by Claude, or both
Slash command
/autonoma-test-planner:generate-testsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are orchestrating a 6-step test generation pipeline. Each step runs as an isolated subagent.
You are orchestrating a 6-step test generation pipeline. Each step runs as an isolated subagent. Every step MUST complete successfully and pass validation before the next step begins. Do NOT skip steps. Do NOT proceed if validation fails.
After steps 1, 2, 3, 4, and 5 you MUST present the summary and ask the user for confirmation
using AskUserQuestion. After calling it, wait for the response. Only proceed after they confirm.
You do NOT issue curl commands to report step start/complete/uploads. Plugin hooks do that:
UserPromptSubmit (pipeline-kickoff.sh) creates the setup record on /generate-tests.PostToolUse (validate-pipeline-output.sh) runs after every Write. It validates output,
emits step.completed/step.started, uploads artifacts, and enforces the validation gate
(test files cannot be written until autonoma/.endpoint-validated exists).mkdir -p autonoma/skills autonoma/qa-tests
The kickoff hook has already written autonoma/.docs-url and autonoma/.generation-id.
Spawn kb-generator:
Analyze the codebase and generate the knowledge base. Write
autonoma/AUTONOMA.mdwith YAML frontmatter (app_name, app_description, core_flows, feature_count, skill_count), create skill files inautonoma/skills/, and writeautonoma/features.json(features array + totals). Fetch instructions first:curl -sSfL "$(cat autonoma/.docs-url)/llms/test-planner/step-1-knowledge-base.txt".
After completion: verify files exist, present core_flows table, AskUserQuestion, then Write autonoma/.step-1-ack (single character body).
Spawn entity-audit-generator:
Read the knowledge base. Audit how each database model is created. For every model, find the dedicated creation function in a service/repository/helper. Classify as
independently_created: true(factory) orfalse(raw SQL fallback). Record side_effects (informational). Outputautonoma/entity-audit.mdwith frontmatter listing each model. Fetch:curl -sSfL "$(cat autonoma/.docs-url)/llms/test-planner/step-2-entity-audit.txt".
After completion: present the audit, AskUserQuestion, Write autonoma/.step-2-ack.
Spawn scenario-generator:
Read the knowledge base and
autonoma/entity-audit.md. Generate test data scenarios. Writeautonoma/scenarios.mdwith frontmatter (scenario_count, scenarios summary, entity_types, variable_fields, planning_sections). Mark values as variable only when they must vary across runs (globally unique, time-sensitive, backend-generated, or when the app lacks natural per-run isolation). Design entity tables so they serialise as nested trees rooted at the scope entity. Fetch:curl -sSfL "$(cat autonoma/.docs-url)/llms/test-planner/step-3-scenarios.txt".
After completion: present scenarios, AskUserQuestion, Write autonoma/.step-3-ack.
Spawn env-factory-generator:
Read
autonoma/entity-audit.mdandautonoma/scenarios.md. Install SDK packages and configure the handler. Register a factory for every model withindependently_created: true(call the audit'screation_file/creation_function— never reimplement inline). Implement the auth callback using the app's real session/token creation. Run adiscoversmoke test. Run the factory-integrity check. ThenWriteautonoma/.endpoint-implementedwith a short summary. Do NOT runup/down— that is step 5. Fetch:curl -sSfL "$(cat autonoma/.docs-url)/llms/test-planner/step-4-implement.txt"andcurl -sSfL "$(cat autonoma/.docs-url)/llms/guides/environment-factory.txt". UseAUTONOMA_SHARED_SECRETandAUTONOMA_SIGNING_SECRETas env var names.
After completion: verify autonoma/.endpoint-implemented exists, present implementation summary,
AskUserQuestion ("Ready to validate the full up/down lifecycle?"), Write autonoma/.step-4-ack.
Spawn scenario-validator:
Read
autonoma/entity-audit.md,autonoma/scenarios.md, and the handler created in step 4. Rundiscover/up/downagainst every scenario with HMAC-signed curl. Iterate (up to 5 times): if a scenario fails because of a handler bug, fix the handler and retry; if it fails because the scenario itself is wrong/unfeasible, editscenarios.mdto match reality. On success for every scenario, emitautonoma/scenario-recipes.json(nested tree rooted at the scope entity;variablesblock for any{{token}}placeholders; one validated recipe per scenario), runpreflight_scenario_recipes.pyagainst it, and writeautonoma/.scenario-validation.jsonas the terminal artifact. ThenWriteautonoma/.endpoint-validated. If you hit the iteration cap OR preflight fails, STOP and report — do NOT write the sentinel. Fetch:curl -sSfL "$(cat autonoma/.docs-url)/llms/test-planner/step-5-validate.txt". Verify: every audited model appears indiscover.schema.models, everyindependently_createdmodel has a registered factory,authis non-empty, DB state is correct before and afterdown, and preflight exits 0.
After completion:
If autonoma/.endpoint-validated exists AND autonoma/scenario-recipes.json is valid JSON
AND autonoma/.scenario-validation.json has status: "ok" with preflightPassed: true:
enforce and upload the recipes to the dashboard, then ack.
AUTONOMA_ROOT="${AUTONOMA_ROOT:-.}"
VALIDATION_ARTIFACT="$AUTONOMA_ROOT/autonoma/.scenario-validation.json"
RECIPE_PATH="$AUTONOMA_ROOT/autonoma/scenario-recipes.json"
# Enforce terminal artifact contract
python3 - "$VALIDATION_ARTIFACT" <<'PY'
import json, sys
payload = json.load(open(sys.argv[1]))
if payload.get("status") != "ok":
raise SystemExit("status must be ok before Step 5 can upload recipes")
if payload.get("preflightPassed") is not True:
raise SystemExit("preflightPassed must be true before Step 5 can upload recipes")
PY
[ -s "$RECIPE_PATH" ] || { echo "scenario-recipes.json missing or empty"; exit 1; }
python3 -c "import json; json.load(open('$RECIPE_PATH'))" \
|| { echo "scenario-recipes.json is not valid JSON"; exit 1; }
# Re-run preflight at the orchestrator level for belt-and-suspenders safety.
python3 "$(cat /tmp/autonoma-plugin-root)/hooks/preflight_scenario_recipes.py" "$RECIPE_PATH" \
|| { echo "Preflight failed at orchestrator gate"; exit 1; }
# Upload to dashboard
GENERATION_ID=$(cat "$AUTONOMA_ROOT/autonoma/.generation-id")
UPLOAD_RESPONSE=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X POST \
"${AUTONOMA_API_URL}/v1/setup/setups/${GENERATION_ID}/scenario-recipe-versions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${AUTONOMA_API_TOKEN}" \
-d @"$RECIPE_PATH")
UPLOAD_STATUS=$(echo "$UPLOAD_RESPONSE" | grep -o "HTTP_STATUS:[0-9]*" | cut -d: -f2)
UPLOAD_BODY=$(echo "$UPLOAD_RESPONSE" | sed '/HTTP_STATUS:/d')
echo "Scenario recipe upload response (HTTP $UPLOAD_STATUS): $UPLOAD_BODY"
if [ "$UPLOAD_STATUS" != "200" ] && [ "$UPLOAD_STATUS" != "201" ]; then
echo "Recipe upload failed (HTTP $UPLOAD_STATUS). Step 5 cannot complete." >&2
exit 1
fi
Then present validation summary (scenarios passed, any edits made to scenarios.md,
recipes uploaded), AskUserQuestion, Write autonoma/.step-5-ack.
If any of those artifacts are missing/invalid: the agent failed — surface the failure report to the user and STOP. Do NOT proceed to step 6. The validation gate in the hook will also block test file writes.
Spawn test-case-generator:
Read
autonoma/AUTONOMA.md,autonoma/skills/, andautonoma/scenarios.md(the latter has been reconciled with reality in step 5 — use it as the source of truth). Parse thevariable_fieldsfrontmatter — test steps MUST use the{{token}}placeholders for any variable value (typed, asserted, or navigated to), never the hardcoded literal. Treat scenarios as fixture input, not as the subject under test — do NOT generate meta-tests that "audit" seeded counts or fixture existence. Generate test cases inautonoma/qa-tests/. Writeautonoma/qa-tests/INDEX.mdwith frontmatter (total_tests, total_folders, folder breakdown, coverage_correlation). Each test file needs frontmatter (title, description, criticality, scenario, flow). Fetch:curl -sSfL "$(cat autonoma/.docs-url)/llms/test-planner/step-6-e2e-tests.txt".
After completion:
autonoma/qa-tests/INDEX.md existsWrite autonoma/.pipeline-complete with a short summary. The hook emits step.completed
for the final step, marking the setup complete.Summarize each step:
npx claudepluginhub autonoma-ai/test-planner-plugin --plugin autonoma-test-plannerProvides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.