You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. ---
  2. name: 'step-02-generation-mode'
  3. description: 'Choose AI generation or recording mode'
  4. outputFile: '{test_artifacts}/atdd-checklist-{story_key}.md'
  5. nextStepFile: '{skill-root}/steps-c/step-03-test-strategy.md'
  6. ---
  7. # Step 2: Generation Mode Selection
  8. ## STEP GOAL
  9. Choose the appropriate generation mode for ATDD tests.
  10. ## MANDATORY EXECUTION RULES
  11. - 📖 Read the entire step file before acting
  12. - ✅ Speak in `{communication_language}`
  13. ---
  14. ## EXECUTION PROTOCOLS:
  15. - 🎯 Follow the MANDATORY SEQUENCE exactly
  16. - 💾 Record outputs before proceeding
  17. - 📖 Load the next step only when instructed
  18. ## CONTEXT BOUNDARIES:
  19. - Available context: config, loaded artifacts, and knowledge fragments
  20. - Focus: this step's goal only
  21. - Limits: do not execute future steps
  22. - Dependencies: prior steps' outputs (if any)
  23. ## MANDATORY SEQUENCE
  24. **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
  25. ## 1. Default Mode: AI Generation
  26. Use AI generation when:
  27. - Acceptance criteria are clear
  28. - Scenarios are standard (CRUD, auth, API, navigation)
  29. - **If {detected_stack} is `backend`:** Always use AI generation (no browser recording needed)
  30. Proceed directly to test strategy if this applies.
  31. ---
  32. ## 2. Optional Mode: Recording (Complex UI)
  33. **Skip this section entirely if {detected_stack} is `backend`.** For backend projects, use AI generation from API documentation, OpenAPI/Swagger specs, or source code analysis instead.
  34. **If {detected_stack} is `frontend` or `fullstack`:**
  35. Use recording when UI interactions need live browser verification.
  36. **Tool selection based on `config.tea_browser_automation`:**
  37. If `auto`:
  38. > **Note:** `${timestamp}` is a placeholder the agent should replace with a unique value (e.g., epoch seconds) for session isolation.
  39. - **Simple recording** (snapshot selectors, capture structure): Use CLI
  40. - `playwright-cli -s=tea-atdd-${timestamp} open <url>` → `playwright-cli -s=tea-atdd-${timestamp} snapshot` → extract refs
  41. - **Complex recording** (drag/drop, wizards, multi-step state): Use MCP
  42. - Full browser automation with rich tool semantics
  43. - **Fallback:** If preferred tool unavailable, use the other; if neither, skip recording
  44. If `cli`:
  45. - Use Playwright CLI for all recording
  46. - `playwright-cli -s=tea-atdd-${timestamp} open <url>`, `snapshot`, `screenshot`, `click <ref>`, etc.
  47. If `mcp`:
  48. - Use Playwright MCP tools for all recording (current behavior)
  49. - Confirm MCP availability, record selectors and interactions
  50. If `none`:
  51. - Skip recording mode entirely, use AI generation from documentation
  52. ---
  53. ## 3. Confirm Mode
  54. State the chosen mode and why. Then proceed.
  55. ---
  56. ## 4. Save Progress
  57. **Save this step's accumulated work to `{outputFile}`.**
  58. - **If `{outputFile}` does not exist** (first save), create it with YAML frontmatter:
  59. ```yaml
  60. ---
  61. stepsCompleted: ['step-02-generation-mode']
  62. lastStep: 'step-02-generation-mode'
  63. lastSaved: '{date}'
  64. ---
  65. ```
  66. Then write this step's output below the frontmatter.
  67. - **If `{outputFile}` already exists**, update:
  68. - Add `'step-02-generation-mode'` to `stepsCompleted` array (only if not already present)
  69. - Set `lastStep: 'step-02-generation-mode'`
  70. - Set `lastSaved: '{date}'`
  71. - Append this step's output to the appropriate section.
  72. Load next step: `{nextStepFile}`
  73. ## 🚨 SYSTEM SUCCESS/FAILURE METRICS:
  74. ### ✅ SUCCESS:
  75. - Step completed in full with required outputs
  76. ### ❌ SYSTEM FAILURE:
  77. - Skipped sequence steps or missing outputs
  78. **Master Rule:** Skipping steps is FORBIDDEN.