Test environment selection

From makifbaysal/tasktrooper · View interactive version

Test environment selection is an AI agent skill from the GitHub repository makifbaysal/tasktrooper. Use before booting anything - choosing local (start_task_preview or a workspace boot), the task's preview or stage, confirming the build is the PR head, and what to do when nothing can run

How to use this skill

Skill file

Test Environment Selection

Overview

Before executing a single scenario, decide WHERE the product will run, in this order:

  1. Backend, worker or full-stack repository: local. DB rows, logs and third-party stubs are only observable there. First choice start_task_preview — it checks out the task branch in the task workspace, detects how to run it, starts it, stops a stale server, and returns a localhost URL for the browser tools; call it again if the URL isn't there yet. Only when it cannot run the project (e.g. a backend+frontend pair, or a worker it doesn't detect), boot by hand (backend-manual-testing).
  2. Frontend-only repository: the task's own preview, else local. When the component is deployed with a per-branch preview environment, get_task_preview returns it — use it when status: "ready" AND built_from_pr_head: true. Anything else (building, built_from_pr_head: false, error, canceled, none, or an empty list) is not the code under test: fall back to start_task_preview.
  3. Stage. Used when the repository is configured for stage verification, or when the app cannot boot locally (managed secrets, heavy infra the workspace lacks) — always after confirming stage is actually running the PR head (see Stage rules).

Production is never a test environment. No scenario is ever executed against the prod base URL or prod data — not a "harmless" GET, not seeding, not cleanup.

How to decide

  1. Identify the repository shape (backend/worker/full-stack vs frontend-only) and apply the order above.
  2. Read the repository settings (list_repositories): build_command, test_command, verify_command — and any comment the developer left on the task (a clean run leaves none). These are the project's declared way of running and checking itself. get_project_brief has the same information plus what each component talks to.
  3. If neither a usable preview nor a local boot nor stage works, you are blocked — see below.

Preview rules

Stage rules

When none is possible

If there is no usable preview, the app cannot boot in the workspace (including via start_task_preview) AND no stage target exists (or it isn't running the PR head), do not fake a verdict and do not read the code as a substitute. Apply the blocker triage (qa-verify-before-verdict): the project cannot boot from its own documented commands → need_revision with the failing command and its output, a developer-fixable defect. A blocker only a human can lift (no stage configured at all, a credential you don't have) → one ask_user question with concrete options, not a need_revision the developer cannot act on.

Red Flags

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.