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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. ---
  2. name: 'step-02-discover-tests'
  3. description: 'Discover and catalog tests by level'
  4. nextStepFile: '{skill-root}/steps-c/step-03-map-criteria.md'
  5. outputFile: '{test_artifacts}/traceability-matrix.md'
  6. ---
  7. # Step 2: Discover & Catalog Tests
  8. ## STEP GOAL
  9. Identify tests relevant to the resolved coverage oracle and classify by test level.
  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. Discover Tests
  26. Search `{test_dir}` for:
  27. - Test IDs (e.g., `1.3-E2E-001`)
  28. - Feature name matches
  29. - Resolved oracle item IDs/titles
  30. - Spec patterns (`*.spec.*`, `*.test.*`)
  31. When the oracle is synthetic (`synthetic_requirements` or `user_journeys`), also search for:
  32. - route/path matches
  33. - page/screen/component names
  34. - visible UI labels and CTA names
  35. - form action verbs (create, edit, save, delete, submit, search, checkout, etc.)
  36. - auth/session/logout flows
  37. ---
  38. ## 2. Categorize by Level
  39. Classify as:
  40. - E2E
  41. - API
  42. - Component
  43. - Unit
  44. Record test IDs, describe blocks, priority markers, and the per-test identity fields needed for machine-readable output:
  45. - Stable identity fields: `id`, `title`, `file`, `line`, `level`
  46. - Execution state flags: `skipped`, `pending`, `fixme`
  47. - Skip or blocker reason when it can be discovered from the test source or runtime metadata
  48. ---
  49. ## 3. Build Coverage Heuristics Inventory
  50. Capture explicit coverage signals so Phase 1 can detect common blind spots:
  51. - API endpoint coverage
  52. - Inventory endpoints referenced by requirements/specs and endpoints exercised by API tests
  53. - Mark endpoints with no direct tests
  54. - Authentication/authorization coverage
  55. - Detect tests for login/session/token flows and permission-denied paths
  56. - Mark auth/authz requirements with missing negative-path tests
  57. - Error-path coverage
  58. - Detect validation, timeout, network-failure, and server-error scenarios
  59. - Mark criteria with happy-path-only tests
  60. - UI journey coverage (when tracing UI/source-derived oracle items)
  61. - Inventory routes/screens/journeys referenced by the oracle and journeys exercised by E2E/component tests
  62. - Mark journeys with no end-to-end coverage
  63. - UI state coverage
  64. - Detect loading, empty, validation, error, and permission-denied state assertions
  65. - Mark journeys that only verify happy-path rendering
  66. Record these findings in step output as `coverage_heuristics` for Step 3/4.
  67. ---
  68. ### 4. Save Progress
  69. **Save this step's accumulated work to `{outputFile}`.**
  70. - **If `{outputFile}` does not exist** (first save), create it using the workflow template (if available) with YAML frontmatter:
  71. ```yaml
  72. ---
  73. stepsCompleted: ['step-02-discover-tests']
  74. lastStep: 'step-02-discover-tests'
  75. lastSaved: '{date}'
  76. ---
  77. ```
  78. Then write this step's output below the frontmatter.
  79. - **If `{outputFile}` already exists**, update:
  80. - Add `'step-02-discover-tests'` to `stepsCompleted` array (only if not already present)
  81. - Set `lastStep: 'step-02-discover-tests'`
  82. - Set `lastSaved: '{date}'`
  83. - Append this step's output to the appropriate section of the document.
  84. Load next step: `{nextStepFile}`
  85. ## 🚨 SYSTEM SUCCESS/FAILURE METRICS:
  86. ### ✅ SUCCESS:
  87. - Step completed in full with required outputs
  88. ### ❌ SYSTEM FAILURE:
  89. - Skipped sequence steps or missing outputs
  90. **Master Rule:** Skipping steps is FORBIDDEN.