name: ‘step-01-preflight-and-context’ description: ‘Verify prerequisites and load story, framework, and knowledge base’ outputFile: ‘{test_artifacts}/atdd-checklist-{story_key}.md’ nextStepFile: ‘{skill-root}/steps-c/step-02-generation-mode.md’
Verify prerequisites and load all required inputs before generating red-phase acceptance test scaffolds.
{communication_language}CRITICAL: Follow this sequence exactly. Do not skip, reorder, or improvise.
Read config.test_stack_type from {config_source}.
Auto-Detection Algorithm (when test_stack_type is "auto" or not configured):
{project-root} for project manifests:
package.json with react/vue/angular/next dependencies, playwright.config.*, vite.config.*, webpack.config.*pyproject.toml, pom.xml/build.gradle, go.mod, *.csproj/*.sln, Gemfile, Cargo.tomlfullstack; only frontend = frontend; only backend = backendtest_stack_type config value overrides auto-detectiontest_stack_type is not in config, treat as "auto" (preserves current frontend behavior for existing installs)Store result as {detected_stack} = frontend | backend | fullstack
frontend or fullstack: playwright.config.ts or cypress.config.tsbackend: relevant test config exists (e.g., conftest.py, src/test/, *_test.go, .rspec)If any are missing: HALT and notify the user.
{story_file} (or ask user if not provided)story_key from the story filename when available (for BMM stories, this is the filename without .md, e.g. 1-2-user-authentication)story_id from story metadata, the H1 heading, or the filename when available (for BMM stories, this is typically {epic_num}.{story_num})story_key is not available, create and persist a stable slug from the story title:
-story_key and for {outputFile} basename so all checklist and handoff paths stay consistentstory_id is still unavailable after metadata/H1/filename parsing, set it to the final story_key so story_id is never empty{story_file} as a tracked artifact path for later handoff into BMM dev-story{test_dir} for existing test patterns, fixtures, helpersFrom {config_source}:
tea_use_playwright_utilstea_use_pactjs_utilstea_pact_mcptea_browser_automationtest_stack_typeLoad fragments based on their tier classification in tea-index.csv:
Context Efficiency: Loading only core fragments reduces context usage by 40-50% compared to loading all fragments.
If tea_use_playwright_utils is enabled, select the appropriate loading profile:
API-only profile (when {detected_stack} is backend or no page.goto/page.locator found in test files):
Load: overview, api-request, auth-session, recurse (~1,800 lines)
Full UI+API profile (when {detected_stack} is frontend/fullstack or browser tests detected):
Load: all Playwright Utils core fragments (~4,500 lines)
Detection: Scan {test_dir} for files containing page.goto or page.locator. If none found, use API-only profile.
If tea_use_pactjs_utils is enabled (and {detected_stack} is backend or fullstack, or microservices indicators detected):
Load: pactjs-utils-overview.md, pactjs-utils-consumer-helpers.md, pactjs-utils-provider-verifier.md, pactjs-utils-request-filter.md, pact-consumer-di.md, pact-consumer-framework-setup.md, pact-broker-webhooks.md
If tea_use_pactjs_utils is disabled but contract testing is relevant:
Load: contract-testing.md
If tea_pact_mcp is "mcp":
Load: pact-mcp.md
Use {knowledgeIndex} to load:
Core (always):
data-factories.mdcomponent-tdd.mdtest-quality.mdtest-healing-patterns.mdIf {detected_stack} is frontend or fullstack:
selector-resilience.mdtiming-debugging.mdPlaywright Utils (if enabled and {detected_stack} is frontend or fullstack):
overview.md, api-request.md, network-recorder.md, auth-session.md, intercept-network-call.md, recurse.md, log.md, file-utils.md, network-error-monitor.md, fixtures-composition.mdPlaywright CLI (if tea_browser_automation is “cli” or “auto” and {detected_stack} is frontend or fullstack):
playwright-cli.mdMCP Patterns (if tea_browser_automation is “mcp” or “auto” and {detected_stack} is frontend or fullstack):
Traditional Patterns (if utils disabled and {detected_stack} is frontend or fullstack):
fixture-architecture.mdnetwork-first.mdBackend Patterns (if {detected_stack} is backend or fullstack):
test-levels-framework.mdtest-priorities-matrix.mdci-burn-in.mdPact.js Utils (if enabled):
pactjs-utils-overview.md, pactjs-utils-consumer-helpers.md, pactjs-utils-provider-verifier.md, pactjs-utils-request-filter.md, pact-consumer-di.md, pact-consumer-framework-setup.md, pact-broker-webhooks.mdContract Testing (if pactjs-utils disabled but relevant):
contract-testing.mdPact MCP (if tea_pact_mcp is “mcp”):
pact-mcp.mdSummarize loaded inputs and confirm with the user. Then proceed.
Save this step’s accumulated work to {outputFile}.
{outputFile} does not exist (first save), create it with YAML frontmatter: ---
stepsCompleted: ['step-01-preflight-and-context']
lastStep: 'step-01-preflight-and-context'
lastSaved: '{date}'
---
Then write this step’s output below the frontmatter.
{outputFile} already exists, update:
'step-01-preflight-and-context' to stepsCompleted array (only if not already present)lastStep: 'step-01-preflight-and-context'lastSaved: '{date}'Update frontmatter fields:
storyId to {story_id}storyKey to {story_key}storyFile to {story_file}atddChecklistPath to {outputFile}generatedTestFiles to []inputDocuments to the list of artifact paths loaded in this step (e.g., knowledge fragments, test design documents, configuration files)Load next step: {nextStepFile}