Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

step-04-docs-and-scripts.md 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. ---
  2. name: 'step-04-docs-and-scripts'
  3. description: 'Document setup and add package.json scripts'
  4. nextStepFile: '{skill-root}/steps-c/step-05-validate-and-summary.md'
  5. outputFile: '{test_dir}/README.md'
  6. progressFile: '{test_artifacts}/framework-setup-progress.md'
  7. ---
  8. # Step 4: Documentation & Scripts
  9. ## STEP GOAL
  10. Create test documentation and add build/test scripts appropriate for `{detected_stack}`.
  11. ## MANDATORY EXECUTION RULES
  12. - 📖 Read the entire step file before acting
  13. - ✅ Speak in `{communication_language}`
  14. ---
  15. ## EXECUTION PROTOCOLS:
  16. - 🎯 Follow the MANDATORY SEQUENCE exactly
  17. - 💾 Record outputs before proceeding
  18. - 📖 Load the next step only when instructed
  19. ## CONTEXT BOUNDARIES:
  20. - Available context: config, loaded artifacts, and knowledge fragments
  21. - Focus: this step's goal only
  22. - Limits: do not execute future steps
  23. - Dependencies: prior steps' outputs (if any)
  24. ## MANDATORY SEQUENCE
  25. **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
  26. ## 1. tests/README.md
  27. Create `{outputFile}` and include:
  28. - Setup instructions
  29. - Running tests (local/headed/debug)
  30. - Architecture overview (fixtures, factories, helpers)
  31. - Best practices (selectors, isolation, cleanup)
  32. - CI integration notes
  33. - Knowledge base references
  34. ---
  35. ## 2. Build & Test Scripts
  36. **If {detected_stack} is `frontend` or `fullstack`:**
  37. Add to `package.json` at minimum:
  38. - `test:e2e`: framework execution command (e.g., `npx playwright test`)
  39. **If {detected_stack} is `backend` or `fullstack`:**
  40. Add the idiomatic test commands for the detected framework:
  41. - **Python (pytest)**: Add to `pyproject.toml` scripts or `Makefile`: `pytest`, `pytest --cov`, `pytest -m integration`
  42. - **Java (JUnit)**: Add to `build.gradle`/`pom.xml`: `./gradlew test`, `mvn test`, `mvn verify` (integration)
  43. - **Go**: Add to `Makefile`: `go test ./...`, `go test -race ./...`, `go test -cover ./...`
  44. - **C#/.NET**: Add to CI scripts or `Makefile`: `dotnet test`, `dotnet test --collect:"XPlat Code Coverage"`
  45. - **Ruby (RSpec)**: Add to `Gemfile` binstubs or `Makefile`: `bundle exec rspec`, `bundle exec rspec spec/integration`
  46. ---
  47. ### 3. Save Progress
  48. **Save this step's accumulated work to `{progressFile}`.**
  49. - **If `{progressFile}` does not exist** (first save), create it with YAML frontmatter:
  50. ```yaml
  51. ---
  52. stepsCompleted: ['step-04-docs-and-scripts']
  53. lastStep: 'step-04-docs-and-scripts'
  54. lastSaved: '{date}'
  55. ---
  56. ```
  57. Then write this step's output below the frontmatter.
  58. - **If `{progressFile}` already exists**, update:
  59. - Add `'step-04-docs-and-scripts'` to `stepsCompleted` array (only if not already present)
  60. - Set `lastStep: 'step-04-docs-and-scripts'`
  61. - Set `lastSaved: '{date}'`
  62. - Append this step's output to the appropriate section of the document.
  63. Load next step: `{nextStepFile}`
  64. ## 🚨 SYSTEM SUCCESS/FAILURE METRICS:
  65. ### ✅ SUCCESS:
  66. - Step completed in full with required outputs
  67. ### ❌ SYSTEM FAILURE:
  68. - Skipped sequence steps or missing outputs
  69. **Master Rule:** Skipping steps is FORBIDDEN.