evizi-kit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/README.md +506 -0
  2. package/kits/agent/.agent/skills/claude-code-subagent-creator/SKILL.md +292 -0
  3. package/kits/agent/.agent/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
  4. package/kits/agent/.agent/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
  5. package/kits/agent/.agent/skills/skill-creator/LICENSE.txt +202 -0
  6. package/kits/agent/.agent/skills/skill-creator/SKILL.md +485 -0
  7. package/kits/agent/.agent/skills/skill-creator/agents/analyzer.md +274 -0
  8. package/kits/agent/.agent/skills/skill-creator/agents/comparator.md +202 -0
  9. package/kits/agent/.agent/skills/skill-creator/agents/grader.md +223 -0
  10. package/kits/agent/.agent/skills/skill-creator/assets/eval_review.html +146 -0
  11. package/kits/agent/.agent/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  12. package/kits/agent/.agent/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  13. package/kits/agent/.agent/skills/skill-creator/references/schemas.md +430 -0
  14. package/kits/agent/.agent/skills/skill-creator/scripts/__init__.py +0 -0
  15. package/kits/agent/.agent/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  16. package/kits/agent/.agent/skills/skill-creator/scripts/generate_report.py +326 -0
  17. package/kits/agent/.agent/skills/skill-creator/scripts/improve_description.py +247 -0
  18. package/kits/agent/.agent/skills/skill-creator/scripts/package_skill.py +136 -0
  19. package/kits/agent/.agent/skills/skill-creator/scripts/quick_validate.py +103 -0
  20. package/kits/agent/.agent/skills/skill-creator/scripts/run_eval.py +310 -0
  21. package/kits/agent/.agent/skills/skill-creator/scripts/run_loop.py +328 -0
  22. package/kits/agent/.agent/skills/skill-creator/scripts/utils.py +47 -0
  23. package/kits/agent/manifest.json +10 -0
  24. package/kits/claude/.claude/agents/code-pusher.md +46 -0
  25. package/kits/claude/.claude/agents/feature-document-updater.md +37 -0
  26. package/kits/claude/.claude/agents/self-reviewer.md +32 -0
  27. package/kits/claude/.claude/agents/web-auto-agentic-workflow-initializer.md +42 -0
  28. package/kits/claude/.claude/agents/web-auto-assisted-fix-and-runner.md +36 -0
  29. package/kits/claude/.claude/agents/web-auto-chrome-devtools-selector-extractor.md +36 -0
  30. package/kits/claude/.claude/agents/web-auto-coder.md +33 -0
  31. package/kits/claude/.claude/agents/web-auto-fe-selector-extractor.md +31 -0
  32. package/kits/claude/.claude/agents/web-auto-fix-and-runner.md +35 -0
  33. package/kits/claude/.claude/agents/web-auto-lessons-learned-extractor.md +34 -0
  34. package/kits/claude/.claude/agents/web-auto-playwright-mcp-selector-extractor.md +37 -0
  35. package/kits/claude/.claude/agents/web-auto-source-instructions-updater.md +43 -0
  36. package/kits/claude/.claude/agents/web-auto-test-cases-generator.md +29 -0
  37. package/kits/claude/.claude/agents/web-auto-ticket-designer.md +35 -0
  38. package/kits/claude/.claude/agents/web-auto-ticket-playbook-planner.md +36 -0
  39. package/kits/claude/.claude/agents/web-auto.md +382 -0
  40. package/kits/claude/.claude/skills/claude-code-subagent-creator/SKILL.md +292 -0
  41. package/kits/claude/.claude/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
  42. package/kits/claude/.claude/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
  43. package/kits/claude/.claude/skills/skill-creator/LICENSE.txt +202 -0
  44. package/kits/claude/.claude/skills/skill-creator/SKILL.md +485 -0
  45. package/kits/claude/.claude/skills/skill-creator/agents/analyzer.md +274 -0
  46. package/kits/claude/.claude/skills/skill-creator/agents/comparator.md +202 -0
  47. package/kits/claude/.claude/skills/skill-creator/agents/grader.md +223 -0
  48. package/kits/claude/.claude/skills/skill-creator/assets/eval_review.html +146 -0
  49. package/kits/claude/.claude/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  50. package/kits/claude/.claude/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  51. package/kits/claude/.claude/skills/skill-creator/references/schemas.md +430 -0
  52. package/kits/claude/.claude/skills/skill-creator/scripts/__init__.py +0 -0
  53. package/kits/claude/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  54. package/kits/claude/.claude/skills/skill-creator/scripts/generate_report.py +326 -0
  55. package/kits/claude/.claude/skills/skill-creator/scripts/improve_description.py +247 -0
  56. package/kits/claude/.claude/skills/skill-creator/scripts/package_skill.py +136 -0
  57. package/kits/claude/.claude/skills/skill-creator/scripts/quick_validate.py +103 -0
  58. package/kits/claude/.claude/skills/skill-creator/scripts/run_eval.py +310 -0
  59. package/kits/claude/.claude/skills/skill-creator/scripts/run_loop.py +328 -0
  60. package/kits/claude/.claude/skills/skill-creator/scripts/utils.py +47 -0
  61. package/kits/claude/manifest.json +10 -0
  62. package/kits/cursor/.cursor/agents/code-pusher.agent.md +43 -0
  63. package/kits/cursor/.cursor/agents/feature-document-updater.agent.md +34 -0
  64. package/kits/cursor/.cursor/agents/self-reviewer.agent.md +29 -0
  65. package/kits/cursor/.cursor/agents/web-auto-agentic-workflow-initializer.agent.md +37 -0
  66. package/kits/cursor/.cursor/agents/web-auto-assisted-fix-and-runner.agent.md +33 -0
  67. package/kits/cursor/.cursor/agents/web-auto-chrome-devtools-selector-extractor.agent.md +31 -0
  68. package/kits/cursor/.cursor/agents/web-auto-coder.agent.md +30 -0
  69. package/kits/cursor/.cursor/agents/web-auto-fe-selector-extractor.agent.md +28 -0
  70. package/kits/cursor/.cursor/agents/web-auto-fix-and-runner.agent.md +32 -0
  71. package/kits/cursor/.cursor/agents/web-auto-lessons-learned-extractor.agent.md +31 -0
  72. package/kits/cursor/.cursor/agents/web-auto-playwright-mcp-selector-extractor.agent.md +32 -0
  73. package/kits/cursor/.cursor/agents/web-auto-source-instructions-updater.agent.md +40 -0
  74. package/kits/cursor/.cursor/agents/web-auto-test-cases-generator.agent.md +26 -0
  75. package/kits/cursor/.cursor/agents/web-auto-ticket-designer.agent.md +32 -0
  76. package/kits/cursor/.cursor/agents/web-auto-ticket-playbook-planner.agent.md +33 -0
  77. package/kits/cursor/.cursor/agents/web-auto.agent.md +379 -0
  78. package/kits/cursor/.cursor/skills/claude-code-subagent-creator/SKILL.md +292 -0
  79. package/kits/cursor/.cursor/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
  80. package/kits/cursor/.cursor/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
  81. package/kits/cursor/.cursor/skills/skill-creator/LICENSE.txt +202 -0
  82. package/kits/cursor/.cursor/skills/skill-creator/SKILL.md +485 -0
  83. package/kits/cursor/.cursor/skills/skill-creator/agents/analyzer.md +274 -0
  84. package/kits/cursor/.cursor/skills/skill-creator/agents/comparator.md +202 -0
  85. package/kits/cursor/.cursor/skills/skill-creator/agents/grader.md +223 -0
  86. package/kits/cursor/.cursor/skills/skill-creator/assets/eval_review.html +146 -0
  87. package/kits/cursor/.cursor/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  88. package/kits/cursor/.cursor/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  89. package/kits/cursor/.cursor/skills/skill-creator/references/schemas.md +430 -0
  90. package/kits/cursor/.cursor/skills/skill-creator/scripts/__init__.py +0 -0
  91. package/kits/cursor/.cursor/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  92. package/kits/cursor/.cursor/skills/skill-creator/scripts/generate_report.py +326 -0
  93. package/kits/cursor/.cursor/skills/skill-creator/scripts/improve_description.py +247 -0
  94. package/kits/cursor/.cursor/skills/skill-creator/scripts/package_skill.py +136 -0
  95. package/kits/cursor/.cursor/skills/skill-creator/scripts/quick_validate.py +103 -0
  96. package/kits/cursor/.cursor/skills/skill-creator/scripts/run_eval.py +310 -0
  97. package/kits/cursor/.cursor/skills/skill-creator/scripts/run_loop.py +328 -0
  98. package/kits/cursor/.cursor/skills/skill-creator/scripts/utils.py +47 -0
  99. package/kits/cursor/manifest.json +10 -0
  100. package/kits/github/.github/agents/code-pusher.agent.md +45 -0
  101. package/kits/github/.github/agents/feature-document-updater.agent.md +36 -0
  102. package/kits/github/.github/agents/self-reviewer.agent.md +31 -0
  103. package/kits/github/.github/agents/web-auto-agentic-workflow-initializer.agent.md +39 -0
  104. package/kits/github/.github/agents/web-auto-assisted-fix-and-runner.agent.md +35 -0
  105. package/kits/github/.github/agents/web-auto-chrome-devtools-selector-extractor.agent.md +33 -0
  106. package/kits/github/.github/agents/web-auto-coder.agent.md +32 -0
  107. package/kits/github/.github/agents/web-auto-fe-selector-extractor.agent.md +30 -0
  108. package/kits/github/.github/agents/web-auto-fix-and-runner.agent.md +34 -0
  109. package/kits/github/.github/agents/web-auto-lessons-learned-extractor.agent.md +33 -0
  110. package/kits/github/.github/agents/web-auto-playwright-mcp-selector-extractor.agent.md +34 -0
  111. package/kits/github/.github/agents/web-auto-source-instructions-updater.agent.md +42 -0
  112. package/kits/github/.github/agents/web-auto-test-cases-generator.agent.md +28 -0
  113. package/kits/github/.github/agents/web-auto-ticket-designer.agent.md +34 -0
  114. package/kits/github/.github/agents/web-auto-ticket-playbook-creator.agent.md +35 -0
  115. package/kits/github/.github/agents/web-auto.agent.md +382 -0
  116. package/kits/github/.github/skills/claude-code-subagent-creator/SKILL.md +310 -0
  117. package/kits/github/.github/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
  118. package/kits/github/.github/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +37 -0
  119. package/kits/github/.github/skills/skill-creator/LICENSE.txt +202 -0
  120. package/kits/github/.github/skills/skill-creator/SKILL.md +485 -0
  121. package/kits/github/.github/skills/skill-creator/agents/analyzer.md +274 -0
  122. package/kits/github/.github/skills/skill-creator/agents/comparator.md +202 -0
  123. package/kits/github/.github/skills/skill-creator/agents/grader.md +223 -0
  124. package/kits/github/.github/skills/skill-creator/assets/eval_review.html +146 -0
  125. package/kits/github/.github/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  126. package/kits/github/.github/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  127. package/kits/github/.github/skills/skill-creator/references/schemas.md +430 -0
  128. package/kits/github/.github/skills/skill-creator/scripts/__init__.py +0 -0
  129. package/kits/github/.github/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  130. package/kits/github/.github/skills/skill-creator/scripts/generate_report.py +326 -0
  131. package/kits/github/.github/skills/skill-creator/scripts/improve_description.py +247 -0
  132. package/kits/github/.github/skills/skill-creator/scripts/package_skill.py +136 -0
  133. package/kits/github/.github/skills/skill-creator/scripts/quick_validate.py +103 -0
  134. package/kits/github/.github/skills/skill-creator/scripts/run_eval.py +310 -0
  135. package/kits/github/.github/skills/skill-creator/scripts/run_loop.py +328 -0
  136. package/kits/github/.github/skills/skill-creator/scripts/utils.py +47 -0
  137. package/kits/github/manifest.json +10 -0
  138. package/kits/shared/docs/ai-code-review.md +440 -0
  139. package/kits/shared/docs/increase-unit-test-coverage.md +77 -0
  140. package/kits/shared/docs/pr-review-agent.md +501 -0
  141. package/kits/shared/docs/self-review-agent.md +246 -0
  142. package/kits/shared/docs/web-auto-agentic-workflow.md +506 -0
  143. package/kits/shared/manifest.json +11 -0
  144. package/kits/shared/skills/fix-automation-tests/SKILL.md +280 -0
  145. package/kits/shared/skills/fix-automation-tests/scripts/fetch_pr_changes.py +300 -0
  146. package/kits/shared/skills/fix-automation-tests/templates/impact-report.template.md +42 -0
  147. package/kits/shared/skills/increase-unit-test-coverage/SKILL.md +117 -0
  148. package/kits/shared/skills/increase-unit-test-coverage/scripts/filter_low_coverage.py +447 -0
  149. package/kits/shared/skills/pr-review/SKILL.md +200 -0
  150. package/kits/shared/skills/pr-review/references/automation.md +62 -0
  151. package/kits/shared/skills/pr-review/references/backend.md +95 -0
  152. package/kits/shared/skills/pr-review/references/frontend.md +103 -0
  153. package/kits/shared/skills/pr-review/references/mobile.md +108 -0
  154. package/kits/shared/skills/pr-review/references/output-schema.md +130 -0
  155. package/kits/shared/skills/pr-review/scripts/post-review.py +1395 -0
  156. package/kits/shared/skills/push-code/SKILL.md +176 -0
  157. package/kits/shared/skills/self-review/SKILL.md +234 -0
  158. package/kits/shared/skills/self-review/evals/evals.json +23 -0
  159. package/kits/shared/skills/self-review/references/automation.md +62 -0
  160. package/kits/shared/skills/self-review/references/backend.md +95 -0
  161. package/kits/shared/skills/self-review/references/frontend.md +103 -0
  162. package/kits/shared/skills/self-review/references/mobile.md +108 -0
  163. package/kits/shared/skills/self-review/templates/issues.template.md +72 -0
  164. package/kits/shared/skills/update-feature-document/SKILL.md +156 -0
  165. package/kits/shared/skills/update-feature-document/templates/delta.template.yaml +58 -0
  166. package/kits/shared/skills/update-feature-document/templates/feature.template.md +25 -0
  167. package/kits/shared/skills/web-auto-assisted-fix-and-run/SKILL.md +130 -0
  168. package/kits/shared/skills/web-auto-assisted-fix-and-run/references/resolve-api-error.md +108 -0
  169. package/kits/shared/skills/web-auto-assisted-fix-and-run/references/resolve-selector.md +60 -0
  170. package/kits/shared/skills/web-auto-assisted-fix-and-run/templates/issues-resolution-report-append.template.md +54 -0
  171. package/kits/shared/skills/web-auto-chrome-devtools-mcp-extract-selectors/SKILL.md +284 -0
  172. package/kits/shared/skills/web-auto-coding/SKILL.md +152 -0
  173. package/kits/shared/skills/web-auto-extract-lessons-learned/SKILL.md +168 -0
  174. package/kits/shared/skills/web-auto-extract-lessons-learned/templates/lessons-learned.template.md +115 -0
  175. package/kits/shared/skills/web-auto-fe-extract-selectors/SKILL.md +282 -0
  176. package/kits/shared/skills/web-auto-fe-extract-selectors/evals/evals.json +23 -0
  177. package/kits/shared/skills/web-auto-fix-and-run-test/SKILL.md +183 -0
  178. package/kits/shared/skills/web-auto-fix-and-run-test/templates/issues-resolution-report.template.md +77 -0
  179. package/kits/shared/skills/web-auto-generate-best-practices/SKILL.md +123 -0
  180. package/kits/shared/skills/web-auto-generate-instructions/SKILL.md +200 -0
  181. package/kits/shared/skills/web-auto-generate-instructions/evals/evals.json +23 -0
  182. package/kits/shared/skills/web-auto-generate-instructions/references/analysis-guide.md +145 -0
  183. package/kits/shared/skills/web-auto-generate-instructions/templates/web-auto-instructions.template.md +184 -0
  184. package/kits/shared/skills/web-auto-generate-project-blueprint/SKILL.md +181 -0
  185. package/kits/shared/skills/web-auto-generate-project-blueprint/evals/evals.json +57 -0
  186. package/kits/shared/skills/web-auto-generate-project-blueprint/templates/web-auto-project-blueprint.template.md +161 -0
  187. package/kits/shared/skills/web-auto-playwright-mcp-extract-selectors/SKILL.md +293 -0
  188. package/kits/shared/skills/web-auto-test-cases/SKILL.md +138 -0
  189. package/kits/shared/skills/web-auto-test-cases/evals/evals.json +129 -0
  190. package/kits/shared/skills/web-auto-test-cases/templates/test-cases.template.md +53 -0
  191. package/kits/shared/skills/web-auto-ticket-design/SKILL.md +199 -0
  192. package/kits/shared/skills/web-auto-ticket-design/templates/ticket-design.template.md +138 -0
  193. package/kits/shared/skills/web-auto-ticket-playbook/SKILL.md +218 -0
  194. package/kits/shared/skills/web-auto-ticket-playbook/evals/evals.json +23 -0
  195. package/kits/shared/skills/web-auto-ticket-playbook/templates/ticket-playbook.template.md +148 -0
  196. package/kits/shared/skills/web-auto-update-source-instructions/SKILL.md +156 -0
  197. package/kits/shared/skills/web-auto-update-source-instructions/evals/evals.json +22 -0
  198. package/kits/shared/skills/workspace-ai-nav-creator/SKILL.md +168 -0
  199. package/kits/shared/skills/workspace-ai-nav-creator/templates/agents-md.template.md +112 -0
  200. package/kits/shared/skills/workspace-ai-nav-creator/templates/claude-md.template.md +86 -0
  201. package/package.json +16 -0
@@ -0,0 +1,183 @@
1
+ ---
2
+ name: web-auto-fix-and-run-test
3
+ description: Fix code issues from a review report (issues.md), run the test command once, and report a structured PASS/FAIL result. Reads issues.md and ticket-playbook.md for a given ticket, applies fixes in priority order (Critical → Warnings → Suggestions), executes the test command once, and on failure emits a structured failure summary for the master agent to route to web-auto-assisted-fix-and-run. Use this skill whenever someone mentions fixing review issues and running tests, resolving code review feedback, running a ticket after review, or any variation of "fix and run". Also trigger for requests like "apply fixes and test ticket X", "resolve issues for ABC-123", "run tests after code review for fe-2026", "fix the review report issues", or "process issues.md for ticket Y" — even if the user doesn't explicitly say "fix and run".
4
+ ---
5
+
6
+ # Web Automation Fix and Run Test
7
+
8
+ Read a review report (`issues.md`) for a given ticket ID, fix all identified issues in priority order, and run the test command once. Report a structured PASS/FAIL result — on failure the master agent routes to `web-auto-assisted-fix-and-run` for user-assisted retry.
9
+
10
+ This skill occupies a specific position in the pipeline: it receives output from `web-auto-self-reviewer` (which creates `issues.md`) and hands off to either `push-code` (on success) or `web-auto-assisted-fix-and-run` (on failure). The structured result block at the end is how the master agent reads the outcome and decides what to do next.
11
+
12
+ ## Input Parameters
13
+
14
+ | Parameter | Type | Required | Description |
15
+ |-----------|------|----------|-------------|
16
+ | `TICKET_ID` | string | Yes | The ticket identifier (e.g., TKT-001, ABC-123) |
17
+
18
+ **If `TICKET_ID` is not provided:** Ask the user for the ticket ID before proceeding.
19
+
20
+ ## Workflow
21
+
22
+ ### Step 1: Read and Parse the Review Report
23
+
24
+ Search for the issues file:
25
+
26
+ ```
27
+ .tickets/{TICKET_ID}/issues.md
28
+ ```
29
+
30
+ **If not found:** Inform the user and stop:
31
+
32
+ ```
33
+ Error: issues.md not found for ticket {TICKET_ID}.
34
+ Run the review step first to create it.
35
+ ```
36
+
37
+ **If found:** Extract:
38
+ - **Verdict** — APPROVED / APPROVED WITH WARNINGS / NEEDS CHANGES
39
+ - **Critical Issues** — must fix before running
40
+ - **Warnings** — should fix after critical issues
41
+ - **Suggestions** — optional improvements
42
+ - **Notes for Fix-and-Run** — special instructions including the test run command
43
+
44
+ Organize by priority:
45
+ 1. **Critical** — fix first because they are bugs or breaking changes that will definitely cause test failures
46
+ 2. **Warnings** — fix after critical issues because they are code quality concerns that could cause flaky or unreliable behavior
47
+ 3. **Suggestions** — fix if time permits (optional); these are style and readability improvements that won't affect test outcomes
48
+
49
+ ### Step 2: Read Context Files
50
+
51
+ Before touching any code, build a mental model of what the code does and how it should look. This prevents blind fix application that introduces more problems than it solves.
52
+
53
+ 1. **Ticket Playbook:** Read `ticket-playbook.md` in the same ticket directory
54
+ - Understand what the code implements, its dependencies, and the expected file structure
55
+ - **If not found:** Inform the user and stop — without the playbook you have no context for whether a fix is correct
56
+
57
+ 2. **Instructions Used:** Location specified in Section 1 of the ticket playbook
58
+ - Understand the specific coding standards, naming conventions, and patterns to follow
59
+
60
+ ### Step 3: Fix All Issues
61
+
62
+ Work through issues in priority order. Group issues that target the same file so you can read the file once, apply all relevant fixes, then verify — this reduces the chance of stale reads and conflicting edits.
63
+
64
+ For each issue:
65
+
66
+ **3.1 — Understand**
67
+ - Read the issue description, file path, line number, and category
68
+ - Read the recommended fix
69
+ - Confirm the referenced code still exists at the expected location — the code may have shifted since the review. If the exact line doesn't match, search the file for the relevant code pattern
70
+
71
+ **3.2 — Fix**
72
+ - Read the target file (or use the already-loaded content if you grouped same-file issues)
73
+ - Locate the problematic code
74
+ - Apply the recommended fix following project patterns and coding standards from Step 2
75
+ - If two issues recommend conflicting changes to the same code (e.g., one says rename a method, another says relocate it), apply the higher-severity fix first and then adapt the lower-severity fix to work with the result
76
+
77
+ **3.3 — Verify**
78
+ - Check for syntax and linting errors in the modified file
79
+ - If a fix introduces a new error (broken import, syntax issue, type mismatch), **revert that specific fix** and move on — a bad fix is worse than the original issue because it may cascade across the codebase
80
+ - Check cross-file impacts: if you changed a method signature, export name, or file path, verify that other files importing or calling it are still compatible. The playbook's dependency map (from Step 2) tells you which files reference which
81
+
82
+ Fix all Critical Issues and Warnings before proceeding to Step 4. Suggestions are optional — skip them if fixing them risks introducing instability.
83
+
84
+ ### Step 4: Run Tests
85
+
86
+ **Get the run command:**
87
+ - Use the command from the "Notes for Fix-and-Run" section of `issues.md`
88
+ - If unclear, check the project configuration file (e.g., `package.json`) for available test scripts
89
+
90
+ **Execute:**
91
+ 1. Run the command and capture full output (stdout and stderr)
92
+ 2. Analyze the result:
93
+ - **Success** → proceed to Step 6
94
+ - **Failure** → proceed to Step 5 (diagnose runtime error)
95
+
96
+ ### Step 5: Diagnose Runtime Error
97
+
98
+ Do not apply any fixes in this step. The purpose is to produce a precise diagnosis so that `web-auto-assisted-fix-and-run` (or the user) can act on it with full context. A good diagnosis saves the next step significant time; a vague one wastes it.
99
+
100
+ **5.1 — Parse error output**
101
+ - Identify error type, file, line number, error message, and stack trace
102
+ - Capture the relevant stack trace excerpt (the first 5-10 meaningful frames, skipping framework internals)
103
+
104
+ **5.2 — Classify the error**
105
+
106
+ | Error Type | Description | Common Cause |
107
+ |------------|-------------|--------------|
108
+ | SyntaxError | Malformed code — brackets, quotes, semicolons | A fix introduced a typo or unclosed bracket |
109
+ | TypeError | Null/undefined reference or wrong variable type | Accessing a property on a variable that doesn't exist yet |
110
+ | ReferenceError | Variable or function not defined | Missing import or misspelled identifier |
111
+ | TimeoutError | Element not found in time or navigation too slow | Wrong selector, page hasn't loaded, or element is conditionally rendered |
112
+ | AssertionError | Test expectation did not match actual result | Wrong expected value or test logic issue |
113
+ | LocatorError | Selector did not match any element in the DOM | Element has changed, was renamed, or doesn't exist on the page |
114
+ | ImportError | Wrong import path or missing export | Typo in path, missing barrel export, or wrong package name |
115
+ | NetworkError | API call failed, connection refused, or timeout | Wrong endpoint, auth failure, or test environment down |
116
+ | ConfigurationError | Missing environment variable, wrong config, or setup issue | Test environment misconfigured or missing prerequisite |
117
+ | Other | Does not fit the above categories | Include the raw error name and classify as best as possible |
118
+
119
+ **5.3 — Summarize findings**
120
+ - State the error type, exact location (file:line), and the verbatim error message
121
+ - Include the relevant stack trace excerpt
122
+ - Note the likely cause based on the classification and surrounding context
123
+ - If the error is selector-related (LocatorError, element TimeoutError), note this for `web-auto-assisted-fix-and-run` so it can apply the selector resolution cascade from `references/resolve-selector.md`
124
+ - If the error is API-related (NetworkError with HTTP status, auth failure), note this for the API error resolution cascade from `references/resolve-api-error.md`
125
+ - Do NOT apply any code changes — proceed directly to Step 7
126
+
127
+ ### Step 6: Success — Create Resolution Report
128
+
129
+ Create `issues-resolution-report.md` in the same ticket directory using the **Success Template** from [templates/issues-resolution-report.template.md](templates/issues-resolution-report.template.md).
130
+
131
+ ```
132
+ .tickets/{TICKET_ID}/issues-resolution-report.md
133
+ ```
134
+
135
+ Emit the following result block so the master agent can detect the outcome and route to `push-code`:
136
+
137
+ ```
138
+ FIX-AND-RUN RESULT: PASSED
139
+ Issues Fixed: Critical: {count}, Warnings: {count}
140
+ Files Modified: {comma-separated list}
141
+ Report saved to: .tickets/{TICKET_ID}/issues-resolution-report.md
142
+ ```
143
+
144
+ ### Step 7: Failure — Create Resolution Report and Emit Failure Summary
145
+
146
+ Create `issues-resolution-report.md` in the same ticket directory using the **Failure Template** from [templates/issues-resolution-report.template.md](templates/issues-resolution-report.template.md).
147
+
148
+ ```
149
+ .tickets/{TICKET_ID}/issues-resolution-report.md
150
+ ```
151
+
152
+ Emit the following structured failure block so the master agent can pass it to `web-auto-assisted-fix-and-run`:
153
+
154
+ ```
155
+ FIX-AND-RUN RESULT: FAILED
156
+ Ticket: {TICKET_ID}
157
+ Error Type: {error type}
158
+ Location: {file:line}
159
+ Message: {error message}
160
+ Stack Trace:
161
+ {first 5-10 meaningful stack frames}
162
+ Likely Cause: {diagnosis from Step 5}
163
+ Issues Fixed Before Run: Critical: {count}, Warnings: {count}
164
+ Files Modified: {comma-separated list}
165
+ Report saved to: .tickets/{TICKET_ID}/issues-resolution-report.md
166
+ ```
167
+
168
+ ## Why This Skill Only Runs Once
169
+
170
+ This skill gets exactly one test run. If that run fails, it diagnoses the error and hands off to `web-auto-assisted-fix-and-run`, which has access to user hints and specialized reference guides (selector resolution cascades, API error resolution) to handle runtime failures. Trying to autonomously fix runtime errors here would duplicate that skill's logic and often leads to cascading bad fixes — a wrong selector guess triggers a different error, which triggers another guess, and so on. The clean separation means this skill focuses on what it's good at (applying known review fixes) and delegates runtime debugging to the right specialist.
171
+
172
+ ## Important Rules
173
+
174
+ - **1 run attempt maximum** — the test runs exactly once. If it fails, diagnose and report. Runtime fixing is handled downstream by `web-auto-assisted-fix-and-run`, which has user hints and specialized tools for it
175
+ - **Read issues.md first** — it is the primary input and contains the run command
176
+ - **Fix Critical issues before running** — critical issues are bugs that will definitely cause test failures; running with unresolved criticals wastes the single run attempt
177
+ - **Understand before fixing** — read each issue fully and confirm the code still matches before applying any change; blind fixes on shifted code introduce new bugs
178
+ - **Group same-file fixes** — reading a file once and applying all its fixes together avoids stale-read conflicts where fix 2 overwrites fix 1
179
+ - **Revert bad static fixes** — if a fix from issues.md introduces a new linter or syntax error, revert that fix rather than trying to patch on top of it; a clean codebase going into the test run is more important than fixing every review item
180
+ - **Check cross-file impacts** — when a fix changes a method signature, export name, or file path, verify callers and importers are still compatible
181
+ - **Always emit the result block** — the structured `FIX-AND-RUN RESULT:` block (on both success and failure) is how the master agent reads the outcome; without it the pipeline stalls
182
+ - **No runtime fixes** — after the test run, do not touch code; only diagnose and report
183
+ - **Document all fixes** — create issues-resolution-report.md using the resolution report template so the next step has a full history of what changed
@@ -0,0 +1,77 @@
1
+ # Issues Resolution Report Template
2
+
3
+ Use one of the templates below to create `issues-resolution-report.md` in the ticket directory after completing the fix-and-run process.
4
+
5
+ ---
6
+
7
+ ## Success Template
8
+
9
+ ```markdown
10
+ # Fix-and-Run Resolution
11
+
12
+ | Field | Value |
13
+ |-------|-------|
14
+ | Run Status | SUCCESS |
15
+
16
+ ### Issues Fixed
17
+
18
+ | # | Severity | File | Line | Description | Fix Applied |
19
+ |---|----------|------|------|-------------|-------------|
20
+ | 1 | Critical | {file} | {line} | {description} | {fix} |
21
+ | 2 | Warning | {file} | {line} | {description} | {fix} |
22
+
23
+ ### Final Run Output
24
+
25
+ \`\`\`
26
+ {paste the final successful run output here}
27
+ \`\`\`
28
+ ```
29
+
30
+ ---
31
+
32
+ ## Failure Template
33
+
34
+ ```markdown
35
+ # Fix-and-Run Resolution
36
+
37
+ | Field | Value |
38
+ |-------|-------|
39
+ | Run Status | FAILED (Autonomous Attempt) |
40
+ | Total Run Attempts | 1/1 |
41
+
42
+ ### Issues Fixed Before Failure
43
+
44
+ | # | Severity | File | Line | Description | Fix Applied |
45
+ |---|----------|------|------|-------------|-------------|
46
+ | 1 | Critical | {file} | {line} | {description} | {fix} |
47
+
48
+ ### Issues Skipped / Reverted
49
+
50
+ | # | Severity | File | Line | Description | Reason |
51
+ |---|----------|------|------|-------------|--------|
52
+ | 1 | Warning | {file} | {line} | {description} | {reason — e.g., "Fix introduced SyntaxError, reverted"} |
53
+
54
+ _(Omit this section if all issues were fixed successfully.)_
55
+
56
+ ### Runtime Error Diagnosis
57
+
58
+ | Field | Value |
59
+ |-------|-------|
60
+ | Error Type | {error type} |
61
+ | File | {file path} |
62
+ | Line | {line number} |
63
+ | Message | {error message} |
64
+ | Likely Cause | {diagnosis from Step 5} |
65
+
66
+ ### Stack Trace Excerpt
67
+
68
+ \`\`\`
69
+ {paste the first 5-10 meaningful stack frames here, skipping framework internals}
70
+ \`\`\`
71
+
72
+ ### Test Run Output
73
+
74
+ \`\`\`
75
+ {paste the relevant portion of the test output — the failure message and surrounding context}
76
+ \`\`\`
77
+ ```
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: web-auto-generate-best-practices
3
+ description: "Format web automation best practices provided by the user into a structured Do's / Don'ts table with Code Examples and save to `.documents-design/web-auto-best-practices.md`. Input can be in any form — prose, bullet points, numbered rules, code examples, or mixed. Use when asked to add best practices, document coding rules, record anti-patterns, update web-auto-best-practices, format automation standards, or anytime the user mentions best practices, coding standards, do's and don'ts, or anti-patterns in a web automation context. Triggers on requests like 'add these best practices', 'update web-auto-best-practices', 'document these rules', 'format best practices', 'add this anti-pattern', 'what we learned should become a best practice'."
4
+ ---
5
+
6
+ # Web Auto Generate Best Practices
7
+
8
+ This skill maintains the project's central best practices file — the shared reference that every coding agent and human contributor consults when writing web automation tests. Good best practices are specific, actionable, and grounded in real project experience. Vague advice ("write clean code") has no place here; concrete guidance ("wrap assertions in `subExpect()` for Allure reporting") does.
9
+
10
+ The file has three sections that serve different purposes:
11
+ - **Do's** table — recommended patterns with reasons
12
+ - **Don'ts** table — anti-patterns with explanations of the harm they cause
13
+ - **Code Examples** — wrong/correct code pairs for practices that are hard to express in a single table row
14
+
15
+ ## Output
16
+
17
+ ```
18
+ .documents-design/web-auto-best-practices.md
19
+ ```
20
+
21
+ If the file already exists, **merge** new items into the existing sections — never overwrite what's already documented.
22
+
23
+ ## Relationship to Other Documentation Files
24
+
25
+ These three files work together but serve distinct roles. Understanding the boundaries prevents duplication:
26
+
27
+ | File | Role | What belongs here |
28
+ |------|------|-------------------|
29
+ | `web-auto-project-blueprint.md` | *What* the project is | Architecture, tech stack, directory structure, naming conventions |
30
+ | `web-auto-best-practices.md` (this output) | *How* to write good code | Rules, standards, anti-patterns — things that apply across many tickets |
31
+ | `web-auto-instructions.md` | *Concrete patterns* | Copy-paste-ready code templates extracted from the codebase |
32
+
33
+ A common duplication trap: a best practice says "use `waitForSpinnerLoading()` after actions that trigger loading" (rule), while instructions.md has the actual code template showing how to call it (pattern). Both are needed — the rule explains *why*, the template shows *how*. If a new item fits better as a code template in `web-auto-instructions.md`, suggest that to the user instead of adding it here.
34
+
35
+ ## Output Format
36
+
37
+ ```markdown
38
+ # Best Practices
39
+
40
+ ## Do's
41
+
42
+ | Practice | Reason |
43
+ |----------|--------|
44
+ | [what to do] | [why it matters] |
45
+
46
+ ## Don'ts
47
+
48
+ | Anti-Pattern | Why to Avoid |
49
+ |--------------|--------------|
50
+ | [what NOT to do] | [why it causes problems] |
51
+
52
+ ## Code Examples
53
+
54
+ ### [Descriptive Title] — Correct Pattern
55
+
56
+ \```typescript
57
+ // Wrong — [brief explanation of the problem]
58
+ [wrong code]
59
+
60
+ // Correct — [brief explanation of the fix]
61
+ [correct code]
62
+ \```
63
+ ```
64
+
65
+ ## Workflow
66
+
67
+ ### Step 1: Parse the Input
68
+
69
+ Accept best practices from the user in any format — prose, bullet points, numbered rules, code examples, or a mix.
70
+
71
+ ### Step 2: Classify Each Item
72
+
73
+ For each extracted item, determine its type:
74
+
75
+ | Input signals | Classify as |
76
+ |---------------|-------------|
77
+ | "always", "prefer", "use", "make sure", "should" | Do |
78
+ | "never", "avoid", "don't", "do not", "forbidden" | Don't |
79
+ | A rule stated positively | Do |
80
+ | A rule stated negatively | Don't |
81
+ | A wrong → correct code pair | Don't (anti-pattern row) + Do (correct approach row) + Code Example |
82
+ | A nuanced pattern that needs code to explain | Do or Don't row + Code Example |
83
+
84
+ When an item contains both a wrong and a correct approach, create entries in all three sections: a Don't row for the anti-pattern, a Do row for the correct approach, and a Code Example with the side-by-side comparison. The table rows give the quick reference; the code example shows exactly what the code looks like. This triple-entry pattern is what makes the file genuinely useful — the tables are scannable, and the examples are copy-pasteable.
85
+
86
+ ### Step 3: Read Existing File and Deduplicate
87
+
88
+ Read the existing best practices file (if it exists). For each new item, check whether it's already covered:
89
+
90
+ | Check | Action |
91
+ |-------|--------|
92
+ | **Exact match** — same practice already exists in a table row | Skip it |
93
+ | **Semantic match** — different wording but same underlying guidance (e.g., "avoid hardcoded waits" vs "don't use `browser.pause()` with fixed delays") | Skip it |
94
+ | **Partial overlap** — related guidance exists but the new item adds a meaningful distinction (e.g., existing says "use explicit waits" but new item specifies "use `waitForSpinnerLoading` specifically for async dropdown content") | Keep the new item — it's a valuable specialization |
95
+ | **Contradicts existing** — new item conflicts with something already documented | Flag it to the user with both versions and ask which is correct |
96
+
97
+ Also read `web-auto-instructions.md` if it exists. If the new item is essentially a code template (not a rule), suggest adding it to instructions instead.
98
+
99
+ ### Step 4: Write the Output
100
+
101
+ Apply new items to the appropriate sections of the file:
102
+
103
+ **For Do's and Don'ts table rows:**
104
+ - **Practice / Anti-Pattern column**: one concise sentence — what to do or not do. Inline code with backticks is encouraged for specificity (e.g., "Use `waitForDisplayed(toast)` before asserting toast text")
105
+ - **Reason / Why to Avoid column**: one sentence — why it matters, grounded in the real consequence (e.g., "Toasts appear asynchronously — asserting without waiting causes flaky failures")
106
+
107
+ **For Code Examples:**
108
+ - Use a descriptive heading that names the pattern (e.g., "### Toast Assertion — Correct Pattern")
109
+ - Show the wrong approach first with a `// Wrong —` comment explaining the problem
110
+ - Show the correct approach with a `// Correct —` comment explaining the fix
111
+ - Keep examples minimal — just enough code to illustrate the point, not a full page object
112
+
113
+ **Placement**: add new rows near related existing entries rather than appending to the bottom. Group similar practices together — a new selector-related Don't should sit near other selector Don'ts.
114
+
115
+ ### Step 5: Confirm
116
+
117
+ Show the user what was added:
118
+ - List each new Do row
119
+ - List each new Don't row
120
+ - List each new Code Example title
121
+ - Note any items that were skipped (already documented) or flagged (contradictions)
122
+
123
+ Confirm the file path where changes were saved.
@@ -0,0 +1,200 @@
1
+ ---
2
+ name: web-auto-generate-instructions
3
+ description: "Analyze a web automation test codebase and generate a comprehensive AI coding guide saved to `.documents-design/web-auto-instructions.md`. Works with any language (TypeScript, JavaScript, Python, Java, etc.) and any framework (Playwright, Cypress, WebdriverIO, Selenium, Robot Framework, etc.). Use this skill whenever someone asks to create a web automation coding guide, generate test instructions, analyze automation patterns, produce AI-ready test documentation, update/regenerate existing test instructions, extract coding patterns from an automation codebase, or document how tests are written in a project. Also use it when someone wants to onboard an AI agent to an existing test suite, prepare a project for AI-assisted test writing, or says things like 'how do tests work in this project' and wants a written guide. Triggers on requests like 'create web automation instructions', 'generate automation coding guide', 'analyze test codebase and write instructions', 'document our test patterns', 'extract test conventions', 'web-auto-generate-instructions'."
4
+ ---
5
+
6
+ # Web Auto Generate Instructions
7
+
8
+ Analyze the existing web automation test codebase and generate a comprehensive coding guide that enables an AI agent to write tests that strictly follow the project's established conventions and patterns.
9
+
10
+ The output file is the practical coding companion — real code pulled from the codebase, not rules or architecture. An AI agent reading this file should be able to write a new test that fits seamlessly into the existing suite without ever looking at the original test files.
11
+
12
+ ## Output
13
+
14
+ Save the generated guide to:
15
+
16
+ ```
17
+ .documents-design/web-auto-instructions.md
18
+ ```
19
+
20
+ If the file already exists, update it — preserving any sections that are still accurate and replacing sections that need updating.
21
+
22
+ ## Workflow
23
+
24
+ ### Step 1: Read Existing Project Documentation
25
+
26
+ Read all available project documentation before touching the codebase. This step exists because the three `.documents-design/web-auto-*.md` files form a coordinated documentation system — each file has a distinct role, and the instructions file must not duplicate content from its siblings.
27
+
28
+ **Web automation specific docs (highest priority — read these first):**
29
+
30
+ | File | What it Contains |
31
+ |------|-----------------|
32
+ | `.documents-design/web-auto-project-blueprint.md` | Project overview, architecture, tech stack, directory structure, and high-level conventions for the automation project |
33
+ | `.documents-design/web-auto-best-practices.md` | Established best practices, coding standards, and rules for the automation project |
34
+
35
+ **General project standards (read if present):**
36
+
37
+ | Location | Purpose |
38
+ |----------|---------|
39
+ | `.github/copilot-instructions.md` | Copilot instructions |
40
+ | `project-blueprint.md`, `.github/project-blueprint.md`, `.cursor/rules/project-blueprint.mdc` | General project blueprint |
41
+ | `.cursor/rules/*.md`, `.cursor/rules/*.mdc`, `.cursorrules` | Cursor rules |
42
+ | `CONTRIBUTING.md`, `AGENTS.md`, `.editorconfig` | Other conventions |
43
+
44
+ **After reading, build a "covered topics" list** — a concrete list of every topic already documented (e.g., "selector strategy", "file naming convention", "directory structure"). Check each topic you write in the output against this list. If it is already covered, replace the content with a cross-reference.
45
+
46
+ **If no documentation files exist yet** (first-time run on a new project), there is nothing to deduplicate — proceed to Step 2 and produce the fullest possible guide. Note in Step 5 that the blueprint and best practices files are missing and recommend generating them.
47
+
48
+ **The three `.documents-design/web-auto-*.md` files serve distinct roles:**
49
+
50
+ | File | Role |
51
+ |------|------|
52
+ | `web-auto-project-blueprint.md` | *What* the project is — architecture, structure, tech choices |
53
+ | `web-auto-best-practices.md` | *How* to write good code — rules, standards, anti-patterns |
54
+ | `web-auto-instructions.md` (output) | *Concrete patterns from the actual codebase* — copy-paste-ready code examples, selectors, templates, and checklists extracted from existing tests |
55
+
56
+ ### Step 2: Detect Framework & Analyze Structure
57
+
58
+ **2.1 — Detect the test framework** using the signals in [references/analysis-guide.md](references/analysis-guide.md).
59
+
60
+ Read the framework configuration file to extract:
61
+ - Base URL, timeouts, retries, browser settings
62
+ - Test directory paths and spec patterns
63
+ - Reporter configuration
64
+ - Environment-specific settings
65
+
66
+ **2.2 — Map the test directory structure.** Document the actual layout found in the project:
67
+ ```
68
+ Typical structures to look for:
69
+ ├── e2e/ or tests/ or test/ or src/
70
+ │ ├── pages/ or pageObjects/ or page-objects/ → Page Object classes
71
+ │ ├── fixtures/ or data/ or testdata/ → Test data
72
+ │ ├── helpers/ or utils/ or support/ → Shared utilities
73
+ │ ├── specs/ or features/ or __tests__/ → Test specs
74
+ │ └── setup/ or support/ or conftest → Setup/teardown
75
+ ```
76
+
77
+ Not every project follows this shape. If the structure is non-standard (flat layout, monorepo with multiple test roots, or a custom convention), document what actually exists rather than forcing it into a conventional shape. The goal is accuracy, not conformance to a template.
78
+
79
+ **2.3 — Identify shared utilities:**
80
+ - Base class / page base fixture
81
+ - Custom commands or helper methods
82
+ - API helpers for test data setup/teardown
83
+ - Authentication utilities
84
+ - Environment configuration helpers
85
+
86
+ For detailed framework-specific analysis guidance, see [references/analysis-guide.md](references/analysis-guide.md).
87
+
88
+ ### Step 3: Analyze Test Patterns
89
+
90
+ Read **5–8 test files** and **3–5 Page Object files** across different features. Extract the patterns listed below. For detailed checklists, see [references/analysis-guide.md](references/analysis-guide.md).
91
+
92
+ **Sampling strategy:** diversity matters more than volume. Pick files from different feature areas and different authors (check git blame if available) to capture the project's conventions rather than one developer's style. Prioritize files that look well-maintained (recent commits, consistent formatting) as pattern sources — they are more likely to reflect the team's current standards.
93
+
94
+ **If the codebase has fewer files than the targets above** (e.g., a young project with only 2–3 tests), read everything available. The output will naturally be shorter, and that is fine — document what exists and note the limited sample in Step 5.
95
+
96
+ **If no Page Objects exist** (some projects use plain helper functions, or no abstraction at all), skip Section 1 in the output and document whatever abstraction layer is used instead (e.g., helper modules, custom commands, or direct selectors in test files).
97
+
98
+ **3.1 — Page Object patterns:**
99
+ - Class structure, naming, and export conventions
100
+ - How selectors are defined (getters, constants, factory methods)
101
+ - Async rules (e.g., which getters must/must-not be async)
102
+ - Action and verification method patterns
103
+ - Step wrapper usage (allure.step, custom step/expect wrappers)
104
+
105
+ **3.2 — Test file patterns:**
106
+ - Import structure and ordering
107
+ - `describe` / test block organization and naming
108
+ - Setup and teardown hooks — what belongs where
109
+ - Assertion library and style
110
+ - Step organization ownership rules (which page object owns which steps)
111
+ - Tag/annotation conventions
112
+
113
+ **3.3 — Test data patterns:**
114
+ - Data file structure and location
115
+ - Dynamic/unique value generation utilities used in the project
116
+ - Type definitions or data model shapes used for test data
117
+ - Pre-test cleanup convention (before hook vs inline)
118
+
119
+ **3.4 — API/backend helper patterns:**
120
+ - Auth pattern (how credentials or tokens are obtained for programmatic API calls)
121
+ - Data seeding and teardown patterns (REST, GraphQL, DB, or other)
122
+ - Any project-specific rules or gotchas for API helpers
123
+
124
+ **3.5 — Cross-cutting patterns:**
125
+ - Login and navigation flows
126
+ - Common UI interactions (spinners, toasts, modals, search)
127
+
128
+ > If pitfalls or anti-patterns are found during analysis, add them to `.documents-design/web-auto-best-practices.md` — not to the instructions file. The instructions file documents *what the codebase does*; the best practices file documents *what it should do*.
129
+
130
+ ### Step 4: Generate the Coding Guide
131
+
132
+ Create `.documents-design/web-auto-instructions.md` using the structure from [templates/web-auto-instructions.template.md](templates/web-auto-instructions.template.md).
133
+
134
+ **Critical rules:**
135
+ 1. **No duplication** — If a topic is already covered in `web-auto-project-blueprint.md`, `web-auto-best-practices.md`, or any other standards file read in Step 1, do NOT repeat it. Add a cross-reference instead (e.g., _"See `web-auto-best-practices.md` for selector rules."_). **Exception: Section 6 must always be self-contained** — fill in actual path patterns and commands directly in the checklist items, even if the same information appears in the blueprint. The reason is that Section 6 is meant for quick reference when starting a new test — the reader should not need to open another file.
136
+ 2. **Evidence-based** — Include only patterns and conventions actually observed in the codebase. If you saw it in the code, include it. If you didn't, leave it out — inventing conventions that nobody follows is worse than having a gap.
137
+ 3. **Real examples only** — Extract actual code from existing tests; no placeholder pseudocode. Change variable names to be generic (e.g., `featureName` instead of `specificProduct`) so examples are reusable, but keep the structure and style identical to the source.
138
+ 4. **Immediately usable** — Every code block must be copy-paste ready. A developer should be able to drop a template into a new file and start editing it without fixing syntax or imports.
139
+ 5. **Complete coverage** — Sample across multiple feature areas, not just one.
140
+ 6. **Flag discrepancies** — If observed codebase patterns conflict with documented standards, add the discrepancy to `web-auto-best-practices.md` with a note like _"Observed in codebase but conflicts with documented standard — needs team alignment."_
141
+ 7. **Flag gaps** — If the codebase lacks patterns for something important (e.g., no cleanup, no test data separation), note it as a recommendation rather than inventing a convention.
142
+
143
+ **Which sections to include:**
144
+
145
+ | Section | Include When | Decision Signal |
146
+ |---------|-------------|-----------------|
147
+ | 1. Page Object Patterns | Always (even if brief) | Project has page objects or equivalent abstraction |
148
+ | 2. Test Structure & Patterns | Always (even if brief) | Tests exist |
149
+ | 3. Test Data Management | Dedicated data files or fixture modules exist | Look for `fixtures/`, `data/`, factory files, or shared constants files |
150
+ | 4. API & Backend Helpers | Programmatic API helpers exist for test data setup | Look for REST/GraphQL client wrappers, seed scripts, or helper modules that call backend APIs |
151
+ | 5. Common Workflow Patterns | Recurring multi-step patterns appear across 3+ test files | Login flows, search-select patterns, modal confirmations, form submissions |
152
+ | 6. Implementation Checklist | Always | Required for every project |
153
+
154
+ > Framework, directory structure, file naming, selector strategy, anti-patterns, and coding rules belong in `.documents-design/web-auto-project-blueprint.md` or `.documents-design/web-auto-best-practices.md`. Do not create sections for them here. If pitfalls or anti-patterns are discovered during codebase analysis, add them to `web-auto-best-practices.md` instead.
155
+
156
+ **Section 6 (Implementation Checklist) is the most important section.** Fill in the actual file path patterns and commands so the checklist is immediately usable as a quick reference when starting a new test case — without needing to read the full document.
157
+
158
+ ### Step 5: Verify and Present
159
+
160
+ 1. Confirm the file was saved to `.documents-design/web-auto-instructions.md`
161
+ 2. Present a structured summary:
162
+
163
+ ```
164
+ ## Summary
165
+
166
+ - **Output**: `.documents-design/web-auto-instructions.md`
167
+ - **Framework**: [detected framework] ([language])
168
+ - **Files analyzed**: [N] test files, [N] page objects, [N] helpers
169
+ - **Sections generated**: [list of sections included]
170
+ - **Sections omitted**: [list with reason, e.g., "Section 4 — no API helpers found"]
171
+ - **Discrepancies flagged**: [count, with brief descriptions]
172
+ - **Gaps noted**: [count, with brief descriptions]
173
+ - **Missing companion docs**: [list any .documents-design files that don't exist yet]
174
+ ```
175
+
176
+ 3. Ask: "Does this guide accurately capture the project's testing patterns and conventions?" If the user identifies inaccuracies, update the affected sections and re-confirm.
177
+
178
+ ## Edge Cases & Error Recovery
179
+
180
+ | Situation | What to Do |
181
+ |-----------|-----------|
182
+ | **Very few test files** (< 3) | Read all available tests. Produce a shorter guide. Note limited sample in summary and recommend revisiting after more tests are written. |
183
+ | **No page objects / no abstraction layer** | Skip Section 1. Document how selectors and actions are organized in the test files directly (Section 2). |
184
+ | **Mixed patterns** (e.g., some tests use POM, others don't) | Document the dominant pattern as the primary convention. Note the alternative in a "Variations" subsection with a cross-reference. |
185
+ | **Non-standard directory structure** | Document the actual structure as-is. Do not force it into conventional categories. |
186
+ | **Existing instructions file is outdated** | Compare existing sections against current codebase. Update sections where patterns have changed, preserve sections that are still accurate. Note what changed in the summary. |
187
+ | **No companion docs exist** (blueprint, best-practices) | Produce the fullest guide possible (no deduplication needed). Recommend generating the missing files in the summary. |
188
+ | **Codebase contradicts documented standards** | Flag the discrepancy in `web-auto-best-practices.md`. In the instructions file, document the actual codebase pattern (because other tests should match what exists, not what was planned). |
189
+
190
+ ## Important Rules
191
+
192
+ - **Respect existing patterns** — Even if a pattern isn't globally considered best practice, if the project uses it consistently, document it as the convention to follow. Consistency within a codebase matters more than theoretical correctness — an AI agent writing a test that follows a "better" pattern but doesn't match the rest of the suite creates more problems than it solves.
193
+ - **Be comprehensive** — Sample across multiple feature areas so the guide enables AI to write tests for any feature, not just the ones analyzed.
194
+ - **Accuracy over completeness** — A shorter guide with accurate, verified patterns is better than a longer guide that includes speculation. Every code block should be traceable to a real file in the codebase.
195
+ - **Keep the file maintainable** — Write in a way that makes future updates easy. Use clear section boundaries so individual sections can be updated without re-reading the entire document.
196
+
197
+ ## Additional Resources
198
+
199
+ - Detailed codebase analysis guidance: [references/analysis-guide.md](references/analysis-guide.md)
200
+ - Output template structure: [templates/web-auto-instructions.template.md](templates/web-auto-instructions.template.md)
@@ -0,0 +1,23 @@
1
+ {
2
+ "skill_name": "web-auto-generate-instructions",
3
+ "evals": [
4
+ {
5
+ "id": 1,
6
+ "prompt": "I just joined a team that has a Playwright TypeScript automation project with about 20 test files, page objects, and API helpers. I need to generate a coding guide so our AI agent can write tests that match our existing patterns. The project has .documents-design/web-auto-project-blueprint.md and web-auto-best-practices.md already. Can you analyze the codebase and create the instructions file?",
7
+ "expected_output": "A .documents-design/web-auto-instructions.md file that: (1) does NOT duplicate content from the existing blueprint/best-practices files but cross-references them, (2) contains real code extracted from the codebase in all sections, (3) has a self-contained Section 6 Implementation Checklist with actual paths and commands, (4) includes sections 1-5 based on what exists in the codebase, (5) presents a structured summary at the end",
8
+ "files": []
9
+ },
10
+ {
11
+ "id": 2,
12
+ "prompt": "We have a small Cypress project — only 3 test files and no page objects, just helper functions. No .documents-design files exist yet. Can you create the web automation instructions for it?",
13
+ "expected_output": "A .documents-design/web-auto-instructions.md file that: (1) handles the edge case of no page objects gracefully (skips or adapts Section 1), (2) reads all 3 available test files since there are fewer than the 5-8 target, (3) produces a complete guide without duplication concerns since no companion docs exist, (4) notes the limited sample and missing companion docs in the summary, (5) recommends generating blueprint and best-practices files",
14
+ "files": []
15
+ },
16
+ {
17
+ "id": 3,
18
+ "prompt": "Our web-auto-instructions.md file is outdated — we refactored our page objects last month and added a new API helper layer. Can you regenerate it? The blueprint and best practices files are up to date.",
19
+ "expected_output": "An updated .documents-design/web-auto-instructions.md that: (1) compares existing sections against the current codebase, (2) updates sections where patterns have changed (page objects, API helpers), (3) preserves sections that are still accurate, (4) notes what changed in the summary, (5) flags any discrepancies between the codebase and documented standards to the best-practices file",
20
+ "files": []
21
+ }
22
+ ]
23
+ }