name: ‘step-02-load-context’ description: ‘Load documents, configuration, and knowledge fragments for the chosen mode’ nextStepFile: ‘{skill-root}/steps-c/step-03-risk-and-testability.md’ knowledgeIndex: ‘./resources/tea-index.csv’
Load the required documents, config flags, and knowledge fragments needed to produce accurate test design outputs.
{communication_language}CRITICAL: Follow this sequence exactly. Do not skip, reorder, or improvise.
From {config_source}:
tea_use_playwright_utilstea_use_pactjs_utilstea_pact_mcptea_browser_automationtest_stack_type (if not set, default to "auto")test_artifactsStack Detection (for context-aware loading):
If test_stack_type is "auto" or not configured, infer {detected_stack} by scanning {project-root}:
playwright.config.*, cypress.config.*, package.json with react/vue/angularpyproject.toml, pom.xml/build.gradle, go.mod, *.csproj, Gemfile, Cargo.tomlfullstack; only frontend → frontend; only backend → backendtest_stack_type overrides auto-detectionLoad:
Extract:
Load:
Extract:
If epic-level:
tests/, spec, e2e, api folders)tea_browser_automation is cli or auto)Fallback: If CLI is not installed, fall back to MCP (if available) or skip browser exploration and rely on code/doc analysis.
CLI Exploration Steps: All commands use the same named session to target the correct browser:
playwright-cli -s=tea-explore open <target_url>playwright-cli -s=tea-explore snapshot → capture page structure and element refsplaywright-cli -s=tea-explore screenshot --filename={test_artifacts}/exploration/explore-<page>.pngplaywright-cli -s=tea-explore closeStore artifacts under {test_artifacts}/exploration/
Session Hygiene: Always close sessions using
playwright-cli -s=tea-explore close. Do NOT useclose-all— it kills every session on the machine and breaks parallel execution.
Load 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
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 — enables agent to use SmartBear MCP “Fetch Provider States” and “Matrix” tools to understand existing contract landscape during test design.
Use {knowledgeIndex} to select and load only relevant fragments.
adr-quality-readiness-checklist.mdnfr-criteria.mdtest-levels-framework.mdrisk-governance.mdtest-quality.mdrisk-governance.mdprobability-impact.mdtest-levels-framework.mdtest-priorities-matrix.mdEpic-Level NFR Loading:
nfr-criteria.md when the epic/story includes security, performance, reliability, scalability, compliance, maintainability, or operational requirements.test-design-architecture.md or test-design-qa.md if present.Playwright CLI (if tea_browser_automation is “cli” or “auto”):
playwright-cli.mdMCP Patterns (if tea_browser_automation is “mcp” or “auto”):
Pact.js Utils (if enabled — both System-Level and Epic-Level):
pactjs-utils-overview.md, pactjs-utils-consumer-helpers.md, pactjs-utils-provider-verifier.md, pactjs-utils-request-filter.mdContract Testing (if pactjs-utils disabled but relevant):
contract-testing.mdPact MCP (if tea_pact_mcp is “mcp”):
pact-mcp.mdSummarize what was loaded and confirm with the user if anything is missing.
Save this step’s accumulated work to {outputFile}.
{outputFile} does not exist (first save), create it with YAML frontmatter: ---
workflowStatus: 'in-progress'
totalSteps: 5
stepsCompleted: ['step-02-load-context']
lastStep: 'step-02-load-context'
nextStep: '{nextStepFile}'
lastSaved: '{date}'
---
Then write this step’s output below the frontmatter.
{outputFile} already exists, update:
workflowStatus: 'in-progress'totalSteps: 5'step-02-load-context' to stepsCompleted array (only if not already present)lastStep: 'step-02-load-context'nextStep: '{nextStepFile}'lastSaved: '{date}'Update inputDocuments: Set inputDocuments in the output template frontmatter to the list of artifact paths loaded in this step (e.g., knowledge fragments, test design documents, configuration files).
Load next step: {nextStepFile}