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.
- package/README.md +506 -0
- package/kits/agent/.agent/skills/claude-code-subagent-creator/SKILL.md +292 -0
- package/kits/agent/.agent/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/agent/.agent/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
- package/kits/agent/.agent/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/agent/.agent/skills/skill-creator/SKILL.md +485 -0
- package/kits/agent/.agent/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/agent/.agent/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/agent/.agent/skills/skill-creator/agents/grader.md +223 -0
- package/kits/agent/.agent/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/agent/.agent/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/agent/.agent/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/agent/.agent/skills/skill-creator/references/schemas.md +430 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/agent/manifest.json +10 -0
- package/kits/claude/.claude/agents/code-pusher.md +46 -0
- package/kits/claude/.claude/agents/feature-document-updater.md +37 -0
- package/kits/claude/.claude/agents/self-reviewer.md +32 -0
- package/kits/claude/.claude/agents/web-auto-agentic-workflow-initializer.md +42 -0
- package/kits/claude/.claude/agents/web-auto-assisted-fix-and-runner.md +36 -0
- package/kits/claude/.claude/agents/web-auto-chrome-devtools-selector-extractor.md +36 -0
- package/kits/claude/.claude/agents/web-auto-coder.md +33 -0
- package/kits/claude/.claude/agents/web-auto-fe-selector-extractor.md +31 -0
- package/kits/claude/.claude/agents/web-auto-fix-and-runner.md +35 -0
- package/kits/claude/.claude/agents/web-auto-lessons-learned-extractor.md +34 -0
- package/kits/claude/.claude/agents/web-auto-playwright-mcp-selector-extractor.md +37 -0
- package/kits/claude/.claude/agents/web-auto-source-instructions-updater.md +43 -0
- package/kits/claude/.claude/agents/web-auto-test-cases-generator.md +29 -0
- package/kits/claude/.claude/agents/web-auto-ticket-designer.md +35 -0
- package/kits/claude/.claude/agents/web-auto-ticket-playbook-planner.md +36 -0
- package/kits/claude/.claude/agents/web-auto.md +382 -0
- package/kits/claude/.claude/skills/claude-code-subagent-creator/SKILL.md +292 -0
- package/kits/claude/.claude/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/claude/.claude/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
- package/kits/claude/.claude/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/claude/.claude/skills/skill-creator/SKILL.md +485 -0
- package/kits/claude/.claude/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/claude/.claude/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/claude/.claude/skills/skill-creator/agents/grader.md +223 -0
- package/kits/claude/.claude/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/claude/.claude/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/claude/.claude/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/claude/.claude/skills/skill-creator/references/schemas.md +430 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/claude/manifest.json +10 -0
- package/kits/cursor/.cursor/agents/code-pusher.agent.md +43 -0
- package/kits/cursor/.cursor/agents/feature-document-updater.agent.md +34 -0
- package/kits/cursor/.cursor/agents/self-reviewer.agent.md +29 -0
- package/kits/cursor/.cursor/agents/web-auto-agentic-workflow-initializer.agent.md +37 -0
- package/kits/cursor/.cursor/agents/web-auto-assisted-fix-and-runner.agent.md +33 -0
- package/kits/cursor/.cursor/agents/web-auto-chrome-devtools-selector-extractor.agent.md +31 -0
- package/kits/cursor/.cursor/agents/web-auto-coder.agent.md +30 -0
- package/kits/cursor/.cursor/agents/web-auto-fe-selector-extractor.agent.md +28 -0
- package/kits/cursor/.cursor/agents/web-auto-fix-and-runner.agent.md +32 -0
- package/kits/cursor/.cursor/agents/web-auto-lessons-learned-extractor.agent.md +31 -0
- package/kits/cursor/.cursor/agents/web-auto-playwright-mcp-selector-extractor.agent.md +32 -0
- package/kits/cursor/.cursor/agents/web-auto-source-instructions-updater.agent.md +40 -0
- package/kits/cursor/.cursor/agents/web-auto-test-cases-generator.agent.md +26 -0
- package/kits/cursor/.cursor/agents/web-auto-ticket-designer.agent.md +32 -0
- package/kits/cursor/.cursor/agents/web-auto-ticket-playbook-planner.agent.md +33 -0
- package/kits/cursor/.cursor/agents/web-auto.agent.md +379 -0
- package/kits/cursor/.cursor/skills/claude-code-subagent-creator/SKILL.md +292 -0
- package/kits/cursor/.cursor/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/cursor/.cursor/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
- package/kits/cursor/.cursor/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/cursor/.cursor/skills/skill-creator/SKILL.md +485 -0
- package/kits/cursor/.cursor/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/cursor/.cursor/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/cursor/.cursor/skills/skill-creator/agents/grader.md +223 -0
- package/kits/cursor/.cursor/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/cursor/.cursor/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/cursor/.cursor/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/cursor/.cursor/skills/skill-creator/references/schemas.md +430 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/cursor/manifest.json +10 -0
- package/kits/github/.github/agents/code-pusher.agent.md +45 -0
- package/kits/github/.github/agents/feature-document-updater.agent.md +36 -0
- package/kits/github/.github/agents/self-reviewer.agent.md +31 -0
- package/kits/github/.github/agents/web-auto-agentic-workflow-initializer.agent.md +39 -0
- package/kits/github/.github/agents/web-auto-assisted-fix-and-runner.agent.md +35 -0
- package/kits/github/.github/agents/web-auto-chrome-devtools-selector-extractor.agent.md +33 -0
- package/kits/github/.github/agents/web-auto-coder.agent.md +32 -0
- package/kits/github/.github/agents/web-auto-fe-selector-extractor.agent.md +30 -0
- package/kits/github/.github/agents/web-auto-fix-and-runner.agent.md +34 -0
- package/kits/github/.github/agents/web-auto-lessons-learned-extractor.agent.md +33 -0
- package/kits/github/.github/agents/web-auto-playwright-mcp-selector-extractor.agent.md +34 -0
- package/kits/github/.github/agents/web-auto-source-instructions-updater.agent.md +42 -0
- package/kits/github/.github/agents/web-auto-test-cases-generator.agent.md +28 -0
- package/kits/github/.github/agents/web-auto-ticket-designer.agent.md +34 -0
- package/kits/github/.github/agents/web-auto-ticket-playbook-creator.agent.md +35 -0
- package/kits/github/.github/agents/web-auto.agent.md +382 -0
- package/kits/github/.github/skills/claude-code-subagent-creator/SKILL.md +310 -0
- package/kits/github/.github/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/github/.github/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +37 -0
- package/kits/github/.github/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/github/.github/skills/skill-creator/SKILL.md +485 -0
- package/kits/github/.github/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/github/.github/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/github/.github/skills/skill-creator/agents/grader.md +223 -0
- package/kits/github/.github/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/github/.github/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/github/.github/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/github/.github/skills/skill-creator/references/schemas.md +430 -0
- package/kits/github/.github/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/github/.github/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/github/.github/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/github/.github/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/github/.github/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/github/.github/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/github/.github/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/github/.github/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/github/.github/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/github/manifest.json +10 -0
- package/kits/shared/docs/ai-code-review.md +440 -0
- package/kits/shared/docs/increase-unit-test-coverage.md +77 -0
- package/kits/shared/docs/pr-review-agent.md +501 -0
- package/kits/shared/docs/self-review-agent.md +246 -0
- package/kits/shared/docs/web-auto-agentic-workflow.md +506 -0
- package/kits/shared/manifest.json +11 -0
- package/kits/shared/skills/fix-automation-tests/SKILL.md +280 -0
- package/kits/shared/skills/fix-automation-tests/scripts/fetch_pr_changes.py +300 -0
- package/kits/shared/skills/fix-automation-tests/templates/impact-report.template.md +42 -0
- package/kits/shared/skills/increase-unit-test-coverage/SKILL.md +117 -0
- package/kits/shared/skills/increase-unit-test-coverage/scripts/filter_low_coverage.py +447 -0
- package/kits/shared/skills/pr-review/SKILL.md +200 -0
- package/kits/shared/skills/pr-review/references/automation.md +62 -0
- package/kits/shared/skills/pr-review/references/backend.md +95 -0
- package/kits/shared/skills/pr-review/references/frontend.md +103 -0
- package/kits/shared/skills/pr-review/references/mobile.md +108 -0
- package/kits/shared/skills/pr-review/references/output-schema.md +130 -0
- package/kits/shared/skills/pr-review/scripts/post-review.py +1395 -0
- package/kits/shared/skills/push-code/SKILL.md +176 -0
- package/kits/shared/skills/self-review/SKILL.md +234 -0
- package/kits/shared/skills/self-review/evals/evals.json +23 -0
- package/kits/shared/skills/self-review/references/automation.md +62 -0
- package/kits/shared/skills/self-review/references/backend.md +95 -0
- package/kits/shared/skills/self-review/references/frontend.md +103 -0
- package/kits/shared/skills/self-review/references/mobile.md +108 -0
- package/kits/shared/skills/self-review/templates/issues.template.md +72 -0
- package/kits/shared/skills/update-feature-document/SKILL.md +156 -0
- package/kits/shared/skills/update-feature-document/templates/delta.template.yaml +58 -0
- package/kits/shared/skills/update-feature-document/templates/feature.template.md +25 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/SKILL.md +130 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/references/resolve-api-error.md +108 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/references/resolve-selector.md +60 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/templates/issues-resolution-report-append.template.md +54 -0
- package/kits/shared/skills/web-auto-chrome-devtools-mcp-extract-selectors/SKILL.md +284 -0
- package/kits/shared/skills/web-auto-coding/SKILL.md +152 -0
- package/kits/shared/skills/web-auto-extract-lessons-learned/SKILL.md +168 -0
- package/kits/shared/skills/web-auto-extract-lessons-learned/templates/lessons-learned.template.md +115 -0
- package/kits/shared/skills/web-auto-fe-extract-selectors/SKILL.md +282 -0
- package/kits/shared/skills/web-auto-fe-extract-selectors/evals/evals.json +23 -0
- package/kits/shared/skills/web-auto-fix-and-run-test/SKILL.md +183 -0
- package/kits/shared/skills/web-auto-fix-and-run-test/templates/issues-resolution-report.template.md +77 -0
- package/kits/shared/skills/web-auto-generate-best-practices/SKILL.md +123 -0
- package/kits/shared/skills/web-auto-generate-instructions/SKILL.md +200 -0
- package/kits/shared/skills/web-auto-generate-instructions/evals/evals.json +23 -0
- package/kits/shared/skills/web-auto-generate-instructions/references/analysis-guide.md +145 -0
- package/kits/shared/skills/web-auto-generate-instructions/templates/web-auto-instructions.template.md +184 -0
- package/kits/shared/skills/web-auto-generate-project-blueprint/SKILL.md +181 -0
- package/kits/shared/skills/web-auto-generate-project-blueprint/evals/evals.json +57 -0
- package/kits/shared/skills/web-auto-generate-project-blueprint/templates/web-auto-project-blueprint.template.md +161 -0
- package/kits/shared/skills/web-auto-playwright-mcp-extract-selectors/SKILL.md +293 -0
- package/kits/shared/skills/web-auto-test-cases/SKILL.md +138 -0
- package/kits/shared/skills/web-auto-test-cases/evals/evals.json +129 -0
- package/kits/shared/skills/web-auto-test-cases/templates/test-cases.template.md +53 -0
- package/kits/shared/skills/web-auto-ticket-design/SKILL.md +199 -0
- package/kits/shared/skills/web-auto-ticket-design/templates/ticket-design.template.md +138 -0
- package/kits/shared/skills/web-auto-ticket-playbook/SKILL.md +218 -0
- package/kits/shared/skills/web-auto-ticket-playbook/evals/evals.json +23 -0
- package/kits/shared/skills/web-auto-ticket-playbook/templates/ticket-playbook.template.md +148 -0
- package/kits/shared/skills/web-auto-update-source-instructions/SKILL.md +156 -0
- package/kits/shared/skills/web-auto-update-source-instructions/evals/evals.json +22 -0
- package/kits/shared/skills/workspace-ai-nav-creator/SKILL.md +168 -0
- package/kits/shared/skills/workspace-ai-nav-creator/templates/agents-md.template.md +112 -0
- package/kits/shared/skills/workspace-ai-nav-creator/templates/claude-md.template.md +86 -0
- package/package.json +16 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Resolve API Errors
|
|
2
|
+
|
|
3
|
+
Use this guide when a test fails due to an **incorrect API endpoint**, **wrong payload**, **unexpected HTTP status code**, or **auth failure** in an API call. Do not guess the correct value. Use the following cascade in order and fall through if unresolved.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Diagnose the API Error First
|
|
8
|
+
|
|
9
|
+
Before resolving, classify the error:
|
|
10
|
+
|
|
11
|
+
| Error Type | Symptoms | Resolution Focus |
|
|
12
|
+
|------------|----------|-----------------|
|
|
13
|
+
| Wrong endpoint URL | 404 Not Found | Correct the path |
|
|
14
|
+
| Wrong HTTP method | 405 Method Not Allowed | Correct GET/POST/PUT/DELETE |
|
|
15
|
+
| Wrong payload | 400 Bad Request, schema validation error | Fix request body structure or field names |
|
|
16
|
+
| Auth failure | 401 Unauthorized, 403 Forbidden | Fix token setup in test fixture or API helper |
|
|
17
|
+
| Wrong base URL | Connection refused, ECONNREFUSED | Fix environment config or base URL constant |
|
|
18
|
+
| Server error | 500 Internal Server Error | Usually a data/state issue — check test preconditions |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Path A — FE Source Code (first choice)
|
|
23
|
+
|
|
24
|
+
Search the workspace for FE source files (`.tsx`, `.jsx`, `.vue`, `.ts`, `.js`):
|
|
25
|
+
|
|
26
|
+
1. Identify the failing API call from the test error — endpoint path, method, or service name
|
|
27
|
+
2. Search FE files for the API call using patterns:
|
|
28
|
+
- `fetch(`, `axios.`, `api.`, `client.`, `request(`
|
|
29
|
+
- GraphQL: `gql`, `useQuery`, `useMutation`, `graphql(`
|
|
30
|
+
- Match on endpoint path fragments (e.g., `"/users"`, `"/login"`)
|
|
31
|
+
3. Extract the correct values:
|
|
32
|
+
- Endpoint path and HTTP method
|
|
33
|
+
- Required headers (especially `Content-Type`, `Authorization` format)
|
|
34
|
+
- Payload structure — field names, types, and nesting
|
|
35
|
+
- GraphQL operation name, variables, and query/mutation body
|
|
36
|
+
4. Open the failing test file or API helper, locate the incorrect values, apply fixes
|
|
37
|
+
5. Verify no syntax errors after patching
|
|
38
|
+
|
|
39
|
+
If no FE source files exist → fall through to Path B.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Path B — Chrome DevTools MCP (second choice)
|
|
44
|
+
|
|
45
|
+
Check if `chrome-devtools/*` MCP tools are available:
|
|
46
|
+
|
|
47
|
+
1. Verify connection via `list_pages`
|
|
48
|
+
2. Navigate to the relevant page and perform the action that triggers the API call
|
|
49
|
+
3. Use `evaluate_script` to intercept and capture the network request:
|
|
50
|
+
```js
|
|
51
|
+
// Example: capture the last fetch call's details
|
|
52
|
+
window.__lastRequest
|
|
53
|
+
```
|
|
54
|
+
Or use the accessibility tree to trigger the action and observe network activity
|
|
55
|
+
4. Extract from the captured request:
|
|
56
|
+
- Full URL (base + path)
|
|
57
|
+
- HTTP method
|
|
58
|
+
- Request headers
|
|
59
|
+
- Request body / payload structure
|
|
60
|
+
5. Open the failing test file or API helper, replace incorrect values with the captured ones
|
|
61
|
+
6. Verify no syntax errors after patching
|
|
62
|
+
|
|
63
|
+
If Chrome DevTools MCP is not available → fall through to Path C.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Path C — Playwright MCP (third choice)
|
|
68
|
+
|
|
69
|
+
1. Navigate to the relevant page via `browser_navigate`
|
|
70
|
+
2. Use `browser_run_javascript` to set up a request interceptor before triggering the action:
|
|
71
|
+
```js
|
|
72
|
+
window.__requests = [];
|
|
73
|
+
const orig = window.fetch;
|
|
74
|
+
window.fetch = function(...args) {
|
|
75
|
+
window.__requests.push({ url: args[0], options: args[1] });
|
|
76
|
+
return orig.apply(this, args);
|
|
77
|
+
};
|
|
78
|
+
```
|
|
79
|
+
3. Trigger the action that causes the API call via MCP interaction tools
|
|
80
|
+
4. Use `browser_run_javascript` to retrieve the captured request:
|
|
81
|
+
```js
|
|
82
|
+
window.__requests[window.__requests.length - 1]
|
|
83
|
+
```
|
|
84
|
+
5. Extract the correct endpoint, method, headers, and payload from the captured data
|
|
85
|
+
6. Open the failing test file or API helper, replace incorrect values
|
|
86
|
+
7. Verify no syntax errors after patching
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Auth Failure Resolution (all paths)
|
|
91
|
+
|
|
92
|
+
When the error is **401 Unauthorized** or **403 Forbidden**:
|
|
93
|
+
|
|
94
|
+
1. Search the test fixture or API helper for how the auth token is set up
|
|
95
|
+
2. Check that the token is being passed in the correct header (e.g., `Authorization: Bearer {token}`)
|
|
96
|
+
3. Verify the token is not expired or hardcoded to a stale value
|
|
97
|
+
4. Check if the test precondition includes a login step that generates the token
|
|
98
|
+
5. If the token setup is missing, add it following the pattern used in other tests in the codebase
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Important Rules
|
|
103
|
+
|
|
104
|
+
- **Never hardcode production credentials** — use test environment values or fixture-generated tokens
|
|
105
|
+
- **Match the exact field names** — API payloads are case-sensitive; extract exact names from source
|
|
106
|
+
- **Check base URL separately** — a ECONNREFUSED error means the base URL or port is wrong, not the endpoint path
|
|
107
|
+
- **GraphQL errors** — a 200 status with `errors` in the response body is still an API error; check the operation name and variables
|
|
108
|
+
- **Update all occurrences** — if the incorrect endpoint or payload appears in multiple places in the test file or helper, fix all of them
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Resolve Selector Errors
|
|
2
|
+
|
|
3
|
+
Use this guide when a test fails with a **LocatorError**, **TimeoutError on an element**, or a **selector-related assertion failure**. Do not guess the correct selector. Use the following cascade in order and fall through if unresolved.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Path A — FE Source Code (first choice)
|
|
8
|
+
|
|
9
|
+
Search the workspace for FE source files (`.tsx`, `.jsx`, `.vue`):
|
|
10
|
+
|
|
11
|
+
1. Identify the element from the failing test line — its description, label text, or role
|
|
12
|
+
2. Search FE files for matching attributes: `data-testid`, `id`, component name, button/label text
|
|
13
|
+
3. Extract the exact attribute value
|
|
14
|
+
4. Open the failing test file, locate the bad selector, replace it with the found value
|
|
15
|
+
5. If the same element appears elsewhere in the test file, update all occurrences
|
|
16
|
+
6. Verify no syntax errors after patching
|
|
17
|
+
|
|
18
|
+
If no FE source files exist → fall through to Path B.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Path B — Chrome DevTools MCP (second choice)
|
|
23
|
+
|
|
24
|
+
Check if `chrome-devtools/*` MCP tools are available:
|
|
25
|
+
|
|
26
|
+
1. Verify connection via `list_pages`
|
|
27
|
+
2. Navigate to the relevant page and execute preceding test steps to reach the correct application state
|
|
28
|
+
3. Take `take_snapshot` immediately before any interaction to get a fresh accessibility tree
|
|
29
|
+
4. Locate the element in the snapshot by its role, name, or description
|
|
30
|
+
5. Use `evaluate_script` with `args: [{ uid }]` to extract `data-testid`, `id`, or other stable attributes from the live DOM
|
|
31
|
+
6. Open the failing test file, replace the bad selector with the extracted value
|
|
32
|
+
7. If the same selector appears elsewhere in the file, update all occurrences
|
|
33
|
+
|
|
34
|
+
**Important:** UIDs become stale after any DOM change — always take a fresh `take_snapshot` before using a UID for interaction or extraction.
|
|
35
|
+
|
|
36
|
+
If Chrome DevTools MCP is not available → fall through to Path C.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Path C — Playwright MCP (third choice)
|
|
41
|
+
|
|
42
|
+
1. Navigate to the relevant page via `browser_navigate`
|
|
43
|
+
2. Execute preceding test steps via MCP tools to reach the correct application state
|
|
44
|
+
3. Take `browser_snapshot` immediately before any interaction
|
|
45
|
+
4. Find the element by its text content, ARIA role, or description in the snapshot
|
|
46
|
+
5. Use `browser_run_javascript` to extract `data-testid`, `id`, or other stable attributes
|
|
47
|
+
6. Open the failing test file, replace the bad selector with the extracted value
|
|
48
|
+
7. If the same selector appears elsewhere in the file, update all occurrences
|
|
49
|
+
|
|
50
|
+
**Important:** `ref` values become stale after navigation or DOM changes — always take a fresh `browser_snapshot` before using a `ref`.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Selector Priority (all paths)
|
|
55
|
+
|
|
56
|
+
1. `data-testid` — always preferred
|
|
57
|
+
2. `id` — if `data-testid` is absent
|
|
58
|
+
3. ARIA role + accessible name — if no `id`
|
|
59
|
+
4. Stable, unique CSS class — last resort only
|
|
60
|
+
5. **Never use:** position-based selectors (`:nth-child`, `:first-of-type`), dynamic/generated classes, or XPath
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Issues Resolution Report — User-Assisted Append Template
|
|
2
|
+
|
|
3
|
+
Use one of the sections below to **append** to the existing `issues-resolution-report.md` after a user-assisted fix attempt. Do NOT replace the file — add these sections after the existing content. Each invocation of the skill appends one section.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## User-Assisted Attempt — Success
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## User-Assisted Fix
|
|
13
|
+
|
|
14
|
+
| Field | Value |
|
|
15
|
+
|-------|-------|
|
|
16
|
+
| Run Status | SUCCESS (User-Assisted) |
|
|
17
|
+
| User Hint | {summary of user hint} |
|
|
18
|
+
| Fix Applied | {what was changed} |
|
|
19
|
+
|
|
20
|
+
### Run Output
|
|
21
|
+
|
|
22
|
+
\`\`\`
|
|
23
|
+
{paste the successful run output here}
|
|
24
|
+
\`\`\`
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## User-Assisted Attempt — Failure
|
|
30
|
+
|
|
31
|
+
```markdown
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## User-Assisted Fix
|
|
35
|
+
|
|
36
|
+
| Field | Value |
|
|
37
|
+
|-------|-------|
|
|
38
|
+
| Run Status | FAILED (User-Assisted) |
|
|
39
|
+
| User Hint | {summary of user hint} |
|
|
40
|
+
| Fix Applied | {what was changed} |
|
|
41
|
+
|
|
42
|
+
### Error Details
|
|
43
|
+
|
|
44
|
+
| Field | Value |
|
|
45
|
+
|-------|-------|
|
|
46
|
+
| Error Type | {error type} |
|
|
47
|
+
| File | {file path} |
|
|
48
|
+
| Line | {line number} |
|
|
49
|
+
| Message | {error message} |
|
|
50
|
+
|
|
51
|
+
### Analysis and Recommended Next Steps
|
|
52
|
+
|
|
53
|
+
{Brief analysis of why the hint did not resolve the issue, and specific recommendations for the next attempt.}
|
|
54
|
+
```
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web-auto-chrome-devtools-mcp-extract-selectors
|
|
3
|
+
description: Update placeholder selectors in a ticket-design.md file by using a Chrome DevTools MCP server to navigate the running application and extract actual selectors from the live DOM. Reads ticket-design.md, finds all steps with "Update selector for this element" placeholders, operates the test case steps via the Chrome DevTools MCP browser, takes accessibility-tree snapshots to identify elements, and replaces each placeholder with the real selector. Use this skill whenever someone asks to update selectors using Chrome DevTools MCP, fill in missing selectors via Chrome DevTools, resolve placeholder selectors by browsing the app, extract real selectors from a running app via Chrome, or browse the live page to find element locators — even if phrased casually like "open the app and grab the selectors" or "use the browser to find the test IDs". Triggers on requests like "update selectors via Chrome DevTools for TKT-001", "fill in selectors using Chrome DevTools MCP for ABC-123", "resolve missing selectors by browsing for ticket fe-2026", "use devtools to extract selectors", "browse the app and find selectors for ticket X".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Web Automation Update Selectors (Chrome DevTools MCP)
|
|
7
|
+
|
|
8
|
+
Read a `ticket-design.md` file for a given ticket ID, find all steps that contain the `<-- Update selector for this element -->` placeholder, use a Chrome DevTools MCP server to navigate through the application following the test case steps, extract actual selectors from the live DOM, and update the ticket design in place.
|
|
9
|
+
|
|
10
|
+
## Input Parameters
|
|
11
|
+
|
|
12
|
+
| Parameter | Type | Required | Description |
|
|
13
|
+
|-----------|------|----------|-------------|
|
|
14
|
+
| `TICKET_ID` | string | Yes | The ticket identifier (e.g., TKT-001, ABC-123) |
|
|
15
|
+
|
|
16
|
+
**If `TICKET_ID` is not provided:** Ask the user for the ticket ID before proceeding.
|
|
17
|
+
|
|
18
|
+
## Prerequisites
|
|
19
|
+
|
|
20
|
+
- A Chrome DevTools MCP server must be available and configured in the agent profile
|
|
21
|
+
- The application under test must be running and accessible in a Chrome browser
|
|
22
|
+
|
|
23
|
+
## Chrome DevTools MCP Tool Reference
|
|
24
|
+
|
|
25
|
+
This skill uses the Chrome DevTools MCP server. The key tools and their signatures are:
|
|
26
|
+
|
|
27
|
+
| Tool | Purpose | Key Parameters |
|
|
28
|
+
|------|---------|----------------|
|
|
29
|
+
| `navigate_page` | Navigate to a URL or go back/forward/reload | `type` (`"url"`, `"back"`, `"forward"`, `"reload"`), `url` (for type=url) |
|
|
30
|
+
| `take_snapshot` | Capture the page's accessibility tree with element `uid`s | `verbose` (boolean, optional) |
|
|
31
|
+
| `take_screenshot` | Capture a visual screenshot of the page or an element | `uid` (optional), `fullPage` (optional) |
|
|
32
|
+
| `click` | Click on an element identified by its `uid` | `uid` (required), `dblClick` (optional) |
|
|
33
|
+
| `fill` | Type text into an input, textarea, or select an option | `uid` (required), `value` (required) |
|
|
34
|
+
| `fill_form` | Fill multiple form elements at once | `elements` (array of `{uid, value}`) |
|
|
35
|
+
| `hover` | Hover over an element | `uid` (required) |
|
|
36
|
+
| `press_key` | Press a key or key combination | `key` (e.g., `"Enter"`, `"Control+A"`) |
|
|
37
|
+
| `evaluate_script` | Execute a JavaScript function in the page context | `function` (JS function declaration), `args` (optional, array of `{uid}`) |
|
|
38
|
+
| `wait_for` | Wait for specified text to appear on the page | `text` (required), `timeout` (optional) |
|
|
39
|
+
| `handle_dialog` | Accept or dismiss a browser dialog | `action` (`"accept"` or `"dismiss"`), `promptText` (optional) |
|
|
40
|
+
| `list_pages` | List all open pages | — |
|
|
41
|
+
| `select_page` | Select a page for subsequent operations | `pageIdx` (required) |
|
|
42
|
+
|
|
43
|
+
**Critical concept:** Chrome DevTools MCP operates through an **accessibility-tree snapshot** model. Every `take_snapshot` call returns a tree of elements, each with a unique `uid`. All interaction tools (`click`, `fill`, `hover`, etc.) require the `uid` from the **most recent snapshot**. Always take a fresh snapshot before interacting with elements.
|
|
44
|
+
|
|
45
|
+
## Workflow
|
|
46
|
+
|
|
47
|
+
### Step 1: Locate and Read Ticket Design
|
|
48
|
+
|
|
49
|
+
Search for the ticket design file using this glob pattern:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
.tickets/{TICKET_ID}/ticket-design.md
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**If not found:** Inform the user and stop:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
Error: ticket-design.md not found for ticket {TICKET_ID}.
|
|
59
|
+
Run the web-auto-ticket-design skill first to create it.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**If found:** Read the full file. For each test case, collect:
|
|
63
|
+
- **All steps in order** — to replay them in the browser
|
|
64
|
+
- **Steps with placeholders** — steps containing `- Selector: <-- Update selector for this element -->` and their element names, descriptions, and action context
|
|
65
|
+
|
|
66
|
+
If no placeholder selectors are found, inform the user and stop:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
No placeholder selectors found in ticket-design.md for ticket {TICKET_ID}.
|
|
70
|
+
All selectors are already populated.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Step 2: Read Project Locator Strategy
|
|
74
|
+
|
|
75
|
+
Before extracting selectors, read the project's selector strategy from the source instructions.
|
|
76
|
+
|
|
77
|
+
**Locate the instructions file:**
|
|
78
|
+
|
|
79
|
+
`.documents-design/web-auto-project-blueprint.md`
|
|
80
|
+
|
|
81
|
+
**If found:** Read the **Selector Strategy** section. Extract:
|
|
82
|
+
- The priority order of locator types (e.g., `data-testid` first, then ARIA roles, etc.)
|
|
83
|
+
- The locator format examples from the codebase
|
|
84
|
+
- Any project-specific conventions or exceptions
|
|
85
|
+
|
|
86
|
+
Use this strategy for all selector extraction in subsequent steps.
|
|
87
|
+
|
|
88
|
+
**If not found:** Fall back to this default priority: `data-testid` > `role` + name > `aria-label` > CSS selectors.
|
|
89
|
+
|
|
90
|
+
### Step 3: Verify Chrome DevTools MCP Connection
|
|
91
|
+
|
|
92
|
+
Before starting the test run, verify the Chrome DevTools MCP server is available:
|
|
93
|
+
|
|
94
|
+
1. Call `list_pages` to check that the browser is connected and pages are accessible
|
|
95
|
+
2. If the call fails → report error and **stop**:
|
|
96
|
+
```
|
|
97
|
+
Error: Chrome DevTools MCP server is not available.
|
|
98
|
+
Ensure the Chrome DevTools MCP extension is running and the browser is open.
|
|
99
|
+
```
|
|
100
|
+
3. If successful, note the available pages and select the appropriate one with `select_page` if needed
|
|
101
|
+
|
|
102
|
+
### Step 4: Navigate and Extract Selectors
|
|
103
|
+
|
|
104
|
+
Process **one test case at a time** — complete all steps of one test case before moving to the next. Browser state is cumulative (logged-in sessions, navigation history, form data), so jumping between test cases would corrupt the application state.
|
|
105
|
+
|
|
106
|
+
**4.1 — Navigate to the starting point**
|
|
107
|
+
|
|
108
|
+
Use `navigate_page` with `type: "url"` to open the application URL and navigate to the page where the test case begins (using the first step's action context — typically a navigation action).
|
|
109
|
+
|
|
110
|
+
After navigation, call `wait_for` with expected page text to confirm the page has loaded. If the page content is uncertain, take a snapshot to verify the page state. When the page doesn't load as expected, take a `take_screenshot` to visually confirm what's on screen before proceeding.
|
|
111
|
+
|
|
112
|
+
**4.2 — Walk through each step**
|
|
113
|
+
|
|
114
|
+
Process each step in the test case sequentially. Before interacting with any element, **always take a fresh snapshot** using `take_snapshot` to get current element `uid`s.
|
|
115
|
+
|
|
116
|
+
- **Steps with existing selectors or actions** — execute the action in the browser to advance the application state:
|
|
117
|
+
- **Click** → identify the element in the snapshot by matching its description, then call `click` with the element's `uid`
|
|
118
|
+
- **Type/Fill** → identify the input element, then call `fill` with the element's `uid` and the value
|
|
119
|
+
- **Fill form** → when multiple inputs need filling, use `fill_form` with an array of `{uid, value}` pairs
|
|
120
|
+
- **Navigate** → call `navigate_page` with the target URL
|
|
121
|
+
- **Key press** → call `press_key` with the key combination
|
|
122
|
+
- **Hover** → call `hover` with the element's `uid` (useful for revealing tooltips, dropdowns)
|
|
123
|
+
|
|
124
|
+
This ensures the page is in the correct state for subsequent steps.
|
|
125
|
+
|
|
126
|
+
- **Steps with placeholder selectors** — before executing, pause and extract the selector:
|
|
127
|
+
|
|
128
|
+
1. **Take a snapshot** — call `take_snapshot` (with `verbose: true` for richer attribute data) to capture the current page accessibility tree
|
|
129
|
+
2. **Identify the target element** — match the element from the ticket design to a node in the accessibility tree using these heuristics (in order):
|
|
130
|
+
- **Role + name match** — the ticket says "Login button" → look for a node with `role: button` and name containing "Login"
|
|
131
|
+
- **Label match** — the ticket says "Email input" → look for a node with label/placeholder "Email"
|
|
132
|
+
- **Text match** — the ticket says "Submit link" → look for a link node with text "Submit"
|
|
133
|
+
- **Structural match** — the ticket says "First name in the form" → find the form section in the tree, then locate the input that corresponds structurally
|
|
134
|
+
- When multiple nodes match, use the page context from the test case (which section, which modal, which form) to disambiguate
|
|
135
|
+
3. **Extract selector attributes** — once the element is identified by `uid` in the snapshot, use `evaluate_script` to extract all attributes that could be used to build a selector:
|
|
136
|
+
```javascript
|
|
137
|
+
(el) => {
|
|
138
|
+
return {
|
|
139
|
+
tag: el.tagName.toLowerCase(),
|
|
140
|
+
id: el.id,
|
|
141
|
+
testId: el.getAttribute('data-testid'),
|
|
142
|
+
dataCy: el.getAttribute('data-cy'),
|
|
143
|
+
dataTest: el.getAttribute('data-test'),
|
|
144
|
+
role: el.getAttribute('role'),
|
|
145
|
+
name: el.getAttribute('name'),
|
|
146
|
+
type: el.getAttribute('type'),
|
|
147
|
+
ariaLabel: el.getAttribute('aria-label'),
|
|
148
|
+
ariaLabelledBy: el.getAttribute('aria-labelledby'),
|
|
149
|
+
placeholder: el.getAttribute('placeholder'),
|
|
150
|
+
href: el.getAttribute('href'),
|
|
151
|
+
classes: el.className,
|
|
152
|
+
text: el.textContent?.trim().substring(0, 100)
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
Pass the element's `uid` via the `args` parameter: `args: [{ uid: "<element-uid>" }]`
|
|
157
|
+
4. **Choose the best selector** — select the highest-priority attribute per the project's locator strategy from Step 2
|
|
158
|
+
5. **Record the resolved selector** — store it for updating the ticket design later
|
|
159
|
+
6. **Execute the step** — after extracting the selector, execute the action (click, fill, etc.) to advance the app state for subsequent steps
|
|
160
|
+
|
|
161
|
+
**4.3 — Handle multi-state elements**
|
|
162
|
+
|
|
163
|
+
Some elements only appear after certain interactions (dropdowns, modals, tooltips). When a placeholder element is not visible in the current snapshot:
|
|
164
|
+
|
|
165
|
+
1. Check if a preceding action would reveal it (e.g., clicking a dropdown trigger)
|
|
166
|
+
2. Execute that action (e.g., `click` on the trigger, or `hover` over a menu item), then call `take_snapshot` again to get updated `uid`s
|
|
167
|
+
3. Use `wait_for` with expected text to confirm the dynamic content has appeared
|
|
168
|
+
4. If the element still cannot be found after revealing interactions, take a `take_screenshot` to visually inspect the page state and confirm the element truly isn't present
|
|
169
|
+
5. If still not found, mark it as unresolved with a reason
|
|
170
|
+
|
|
171
|
+
**4.4 — Handle page transitions and loading**
|
|
172
|
+
|
|
173
|
+
After actions that cause page navigation or significant DOM changes:
|
|
174
|
+
|
|
175
|
+
1. Use `wait_for` with expected text from the target page to confirm loading is complete
|
|
176
|
+
2. If the page shows a loading spinner or skeleton, wait for the actual content text to appear
|
|
177
|
+
3. Always take a **new snapshot** after any navigation — previous `uid`s become stale
|
|
178
|
+
|
|
179
|
+
**4.5 — Retry on interaction failures**
|
|
180
|
+
|
|
181
|
+
Browser interactions can fail due to loading delays, animations, or elements not yet interactive. When a `click`, `fill`, or other interaction fails:
|
|
182
|
+
|
|
183
|
+
1. Wait briefly (use `wait_for` with expected text, or pause for the element to settle)
|
|
184
|
+
2. Take a fresh snapshot — the element's `uid` may have changed due to DOM re-render
|
|
185
|
+
3. Re-identify the element and retry the interaction once
|
|
186
|
+
4. If it fails again, take a `take_screenshot` to diagnose the situation and mark the step as problematic in the summary
|
|
187
|
+
|
|
188
|
+
**4.6 — Detect design gaps**
|
|
189
|
+
|
|
190
|
+
While walking through steps, watch for situations where the ticket design doesn't match reality:
|
|
191
|
+
- A navigation step is missing (the app shows a different page than expected)
|
|
192
|
+
- A prerequisite action isn't described (e.g., need to dismiss a cookie banner or accept terms first)
|
|
193
|
+
- An element described in the design doesn't exist on the actual page
|
|
194
|
+
- The step order doesn't match the actual user flow
|
|
195
|
+
|
|
196
|
+
Record these gaps — they'll be reported in Step 7 so the ticket designer can fix them. Do not modify `ticket-design.md` to fix gaps; only replace placeholder selectors.
|
|
197
|
+
|
|
198
|
+
### Step 5: Build Selector Values
|
|
199
|
+
|
|
200
|
+
For each placeholder, apply the project's locator priority in strict order — use the first attribute that is present and stable:
|
|
201
|
+
|
|
202
|
+
| Priority | Condition | Selector format |
|
|
203
|
+
|----------|-----------|-----------------|
|
|
204
|
+
| 1 | `testId` is present | `[data-testid="<value>"]` |
|
|
205
|
+
| 2 | `name` is present on an input/select/textarea | `<tag>[name="<value>"]` (e.g. `input[name="email"]`) |
|
|
206
|
+
| 3 | `role` + `ariaLabel` are both present | `[role="<value>"][aria-label="<value>"]` |
|
|
207
|
+
| 4 | None of the above — use relative XPath | `//tag[contains(@class,"...") and text()="..."]` |
|
|
208
|
+
| — | Element not found | Keep `<-- Update selector for this element -->` unchanged |
|
|
209
|
+
|
|
210
|
+
**Avoid these anti-patterns** because they produce brittle, flaky selectors that break on routine code changes:
|
|
211
|
+
- **`id`** — often auto-generated by frameworks (e.g., `#radix-12`, `#mui-input-3`) and changes across renders
|
|
212
|
+
- **CSS class names** — typically generated by CSS-in-JS or build tools (e.g., `.styles_button__a1b2c`) and change on every build
|
|
213
|
+
- **Absolute XPath** — encodes the full DOM path (e.g., `/html/body/div[2]/main/form/button`), breaks when any ancestor element changes
|
|
214
|
+
- **Index-based selectors** — depend on element ordering (e.g., `button:nth-child(3)`) which changes when elements are added or reordered
|
|
215
|
+
- **Text-only selectors** — break when copy is updated, translated, or A/B tested
|
|
216
|
+
|
|
217
|
+
### Step 6: Update Ticket Design
|
|
218
|
+
|
|
219
|
+
For each placeholder that has a resolved selector, update the `ticket-design.md` file in place:
|
|
220
|
+
|
|
221
|
+
**Replace:**
|
|
222
|
+
```
|
|
223
|
+
- Selector: <-- Update selector for this element -->
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**With:**
|
|
227
|
+
```
|
|
228
|
+
- Selector: [resolved-selector]
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Do not modify any other lines in the step (`- Element:`, `- Action:`, `- Expected Result:`, `- Note:`). The `- Note: New element/action - needs to be implemented` line must remain — this skill only resolves selectors, not implement the automation code.
|
|
232
|
+
|
|
233
|
+
Save the updated file at its original location.
|
|
234
|
+
|
|
235
|
+
### Step 7: Summary
|
|
236
|
+
|
|
237
|
+
Display the result to the user:
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
Selectors updated for ticket {TICKET_ID}.
|
|
241
|
+
|
|
242
|
+
Updated:
|
|
243
|
+
- .tickets/{TICKET_ID}/ticket-design.md
|
|
244
|
+
|
|
245
|
+
Summary:
|
|
246
|
+
- Selectors resolved: {resolved_count}
|
|
247
|
+
- Selectors still pending: {pending_count}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
If any selectors remain unresolved, add:
|
|
251
|
+
|
|
252
|
+
```
|
|
253
|
+
Unresolved elements:
|
|
254
|
+
- [Test Case ID] Step [N]: [Element name] — [reason: not found in snapshot / element not visible / page state unclear]
|
|
255
|
+
|
|
256
|
+
Note: These elements could not be identified in the live application.
|
|
257
|
+
You can update them manually or try the FE source code approach.
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
If any design gaps were detected during navigation (Step 4.6), add:
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
⚠️ Design gaps detected — ticket-design.md was NOT modified for these:
|
|
264
|
+
- [Test Case ID] Step [N]: [description of the gap]
|
|
265
|
+
Suggested fix: [what step or action is missing]
|
|
266
|
+
|
|
267
|
+
Re-run the web-auto-ticket-designer agent to address these gaps before proceeding.
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Important Rules
|
|
271
|
+
|
|
272
|
+
- **Follow project locator strategy** — always read and follow the Selector Strategy from the project blueprint; only use the default fallback when no blueprint is found
|
|
273
|
+
- **Execute steps in order** — follow the test case step sequence to ensure the application is in the correct state before extracting each selector; skipping or reordering steps corrupts browser state
|
|
274
|
+
- **One test case at a time** — complete all steps of one test case before moving to the next to maintain correct application state
|
|
275
|
+
- **Extract from live DOM only** — selectors must come from actual page snapshots and `evaluate_script` calls; never fabricate or guess selector values
|
|
276
|
+
- **Always use fresh snapshots** — before interacting with any element, take a new `take_snapshot`; previous `uid`s become invalid after DOM changes or navigation
|
|
277
|
+
- **Use `uid` for all interactions** — Chrome DevTools MCP requires the `uid` from the latest snapshot for `click`, `fill`, `hover`, and other interaction tools; CSS selectors cannot be passed to these tools
|
|
278
|
+
- **Use `evaluate_script` for attribute extraction** — execute JavaScript in the browser context to extract DOM attributes from identified elements, passing the element `uid` via `args: [{ uid }]`
|
|
279
|
+
- **Use screenshots for debugging** — when an element can't be found or page state is unexpected, take a `take_screenshot` to visually inspect before marking as unresolved
|
|
280
|
+
- **Preserve file structure** — only modify `- Selector:` lines; do not alter step numbers, descriptions, actions, expected results, or notes
|
|
281
|
+
- **Report design gaps, never fix them** — if a missing navigation step, prerequisite action, or undescribed interaction is detected, report it in the summary under "Design gaps detected"; do not add, remove, or reorder steps in `ticket-design.md`
|
|
282
|
+
- **Keep analysis internal** — do not output snapshot data or candidate lists to the user
|
|
283
|
+
- **Handle failures gracefully** — if the MCP server is unavailable or the app is not running, inform the user and stop before making any changes
|
|
284
|
+
- **File update failure** — report the error and ask how to proceed
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web-auto-coding
|
|
3
|
+
description: Implement web automation test code based on a ticket playbook. Reads ticket-playbook.md, follows the implementation checklist to create or modify Page Objects, test data, API helpers, and test scripts while adhering to project coding standards. Use this skill whenever someone asks to implement a ticket, code test automation, write test code from a playbook, build out test scripts, implement Page Objects, or turn a playbook into working code — even casual requests like "code up ticket X" or "build the tests for ABC-123". Triggers on requests like "implement ticket TKT-001", "code the playbook for ABC-123", "write the test code for ticket fe-2026", "implement the tasks in the playbook", "start coding ticket X".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Web Automation Coding
|
|
7
|
+
|
|
8
|
+
Read a `ticket-playbook.md` file for a given ticket ID and systematically implement every task — creating or modifying Page Objects, test data, API helpers, and test scripts. The playbook is the single source of truth: it contains pre-computed file paths, dependency order, reference patterns, and coding conventions. Your job is execution, not architecture.
|
|
9
|
+
|
|
10
|
+
## Input Parameters
|
|
11
|
+
|
|
12
|
+
| Parameter | Type | Required | Description |
|
|
13
|
+
|-----------|------|----------|-------------|
|
|
14
|
+
| `TICKET_ID` | string | Yes | The ticket identifier (e.g., TKT-001, ABC-123) |
|
|
15
|
+
|
|
16
|
+
**If `TICKET_ID` is not provided:** Ask the user for the ticket ID before proceeding.
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
### Step 1: Read the Ticket Playbook
|
|
21
|
+
|
|
22
|
+
Search for the playbook file:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
.tickets/{TICKET_ID}/ticket-playbook.md
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**If not found:** Inform the user and stop:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Error: ticket-playbook.md not found for ticket {TICKET_ID}.
|
|
32
|
+
Run the web-auto-ticket-playbook skill first to create it.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**If found:** Extract:
|
|
36
|
+
- **Pre-Implementation Analysis** — component mapping (existing and new components)
|
|
37
|
+
- **Implementation Checklist** — all tasks organized by subsections
|
|
38
|
+
- **Total task count**
|
|
39
|
+
|
|
40
|
+
The playbook already incorporates all coding standards from the project and feature instructions. Each task's Guidance and Reference Pattern embed the relevant conventions — there's no need to re-read the upstream instruction files.
|
|
41
|
+
|
|
42
|
+
### Step 2: Plan and Track
|
|
43
|
+
|
|
44
|
+
Build an internal execution plan before writing any code. This plan drives your task-by-task tracking:
|
|
45
|
+
|
|
46
|
+
1. List all tasks from the playbook with their dependency numbers
|
|
47
|
+
2. Sort by dependencies — prerequisite tasks first
|
|
48
|
+
3. Group tasks that modify the same file so edits happen together (reduces context switching and avoids stale-read conflicts)
|
|
49
|
+
4. Build a file inventory:
|
|
50
|
+
- **Files to create** — note the planned path for each
|
|
51
|
+
- **Files to modify** — note which tasks touch each file and in what order
|
|
52
|
+
5. Create a progress tracker (todo list or internal checklist) with every task. Mark each task as you complete it — this prevents skipping tasks in large playbooks.
|
|
53
|
+
|
|
54
|
+
### Step 3: Execute Tasks
|
|
55
|
+
|
|
56
|
+
Work through each task in dependency order. For every task:
|
|
57
|
+
|
|
58
|
+
#### 3.1 — Prepare context
|
|
59
|
+
|
|
60
|
+
**Read existing files before modifying them.** When reading a file you're about to change, pay attention to:
|
|
61
|
+
- Import statements (you'll need to add yours without duplicating existing ones)
|
|
62
|
+
- Code structure and ordering (methods, exports, class members)
|
|
63
|
+
- Naming conventions used in that specific file (they may have minor variations from the reference pattern)
|
|
64
|
+
|
|
65
|
+
**Read the reference pattern file** specified in the task. Extract from it:
|
|
66
|
+
- The structural pattern (class hierarchy, method signatures, return types)
|
|
67
|
+
- How it handles setup/teardown or state
|
|
68
|
+
- The assertion or action style used
|
|
69
|
+
- Import paths and how they reference other components
|
|
70
|
+
|
|
71
|
+
The reference pattern is a model, not a copy-paste source. Adapt it to match the current task's requirements — different selectors, different data, different assertions — while preserving the structural pattern.
|
|
72
|
+
|
|
73
|
+
#### 3.2 — Write code
|
|
74
|
+
|
|
75
|
+
- Follow the task's **Guidance** — this is the most specific instruction for what to build and how
|
|
76
|
+
- Use the **Key Selector(s)** exactly as specified (resolved selectors are final; placeholders need resolution — see Error Recovery below)
|
|
77
|
+
- Apply the structural pattern from the **Reference Pattern** but adapted to the current task
|
|
78
|
+
- When adding to an existing file, place new code in the logical position: methods next to related methods, imports grouped with similar imports, exports at the bottom following the file's convention
|
|
79
|
+
|
|
80
|
+
#### 3.3 — Save
|
|
81
|
+
|
|
82
|
+
- Create or modify the file at the specified path
|
|
83
|
+
- Include proper imports — check for duplication against existing imports
|
|
84
|
+
- When multiple tasks modify the same file, each subsequent edit builds on the previous one (you already modified this file earlier in the session)
|
|
85
|
+
- Maintain consistent code style: indentation, quotes, semicolons, trailing commas — match what the file already uses
|
|
86
|
+
|
|
87
|
+
#### 3.4 — Verify
|
|
88
|
+
|
|
89
|
+
- Check for syntax errors and linting issues in the modified file
|
|
90
|
+
- If errors exist, fix them immediately. Common pitfalls:
|
|
91
|
+
- Missing or duplicate imports after adding new ones
|
|
92
|
+
- Mismatched brackets/braces from inserting code mid-file
|
|
93
|
+
- Wrong import path when the reference pattern lived in a different directory
|
|
94
|
+
- Do not proceed to the next task until the current file is error-free. Uncaught errors cascade — a broken import in a Page Object makes every test script that imports it fail.
|
|
95
|
+
|
|
96
|
+
#### 3.5 — Track progress
|
|
97
|
+
|
|
98
|
+
Mark the task as complete in your progress tracker. If the playbook has many tasks, briefly note what was done (e.g., "Task 3: added `fillEmail()` to RegistrationPage") to maintain orientation.
|
|
99
|
+
|
|
100
|
+
### Step 4: Final Verification
|
|
101
|
+
|
|
102
|
+
After all tasks are complete:
|
|
103
|
+
|
|
104
|
+
1. **Syntax check** — verify every created and modified file has no errors
|
|
105
|
+
2. **Import resolution** — confirm every import points to an existing file/export. Pay special attention to:
|
|
106
|
+
- New files created in this session (verify the path matches what other files import)
|
|
107
|
+
- Barrel exports (index files) — if the project uses them, add the new export
|
|
108
|
+
3. **Cross-file consistency** — check that method signatures used across files match (e.g., a Page Object method called from a test script has the same name and parameters)
|
|
109
|
+
4. **Pattern adherence** — spot-check that the code follows the reference patterns from the playbook (correct base class, correct assertion style, correct hook usage)
|
|
110
|
+
|
|
111
|
+
### Step 5: Summary
|
|
112
|
+
|
|
113
|
+
Display the result:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
Code implementation completed for ticket {TICKET_ID}.
|
|
117
|
+
|
|
118
|
+
Files Created:
|
|
119
|
+
- [path/to/new/file.ts]
|
|
120
|
+
|
|
121
|
+
Files Modified:
|
|
122
|
+
- [path/to/modified/file.ts]
|
|
123
|
+
|
|
124
|
+
Summary:
|
|
125
|
+
- Total tasks completed: {count}
|
|
126
|
+
- Test data files: {count}
|
|
127
|
+
- Page Object methods: {count}
|
|
128
|
+
- Test scripts: {count}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Error Recovery
|
|
132
|
+
|
|
133
|
+
These situations come up regularly — handle them without stopping:
|
|
134
|
+
|
|
135
|
+
| Situation | Action |
|
|
136
|
+
|-----------|--------|
|
|
137
|
+
| **Reference pattern file not found** | Search for files with similar names or in adjacent directories. If found, use it. If not, search the codebase for the same pattern type (e.g., another Page Object using the same base class) and use the closest match. Note the substitution in your progress tracker. |
|
|
138
|
+
| **Selector placeholder** (`<-- Update selector -->`) | Check if a `ticket-design.md` exists in the same ticket directory with resolved selectors. If still unresolved, add a `TODO` comment in code with the placeholder text so the downstream reviewer catches it. |
|
|
139
|
+
| **File path conflict** | If a file you need to create already exists, read it first. If it's a stub or empty scaffold, overwrite it. If it has real implementation, treat it as a modification task instead. |
|
|
140
|
+
| **Circular dependency in playbook** | If two tasks depend on each other, break the cycle: implement the one with fewer external dependencies first, using forward-declared types or placeholder imports if needed, then complete the second task and update the first. |
|
|
141
|
+
| **Playbook task is ambiguous** | Use the reference pattern as the tiebreaker. When guidance is unclear, the reference pattern shows the intended approach. If both are unclear, implement the simpler interpretation and note the ambiguity in the summary. |
|
|
142
|
+
|
|
143
|
+
## Important Rules
|
|
144
|
+
|
|
145
|
+
- **Read playbook first** — the playbook is the single source of truth; do not implement anything without reading and understanding it first
|
|
146
|
+
- **Read before modifying** — always read existing files before editing them; this prevents accidentally overwriting recent changes and ensures your additions fit the file's structure
|
|
147
|
+
- **Follow dependency order** — completing prerequisites first prevents broken imports and missing dependencies that waste time to debug
|
|
148
|
+
- **Adapt reference patterns** — use the structural pattern from the reference but adjust for the current task's specifics; blind copy-paste of a reference pattern produces code that doesn't match the task
|
|
149
|
+
- **Fix errors immediately** — a syntax error in one file cascades to every file that imports it; catching errors early prevents compounding failures
|
|
150
|
+
- **Complete all tasks** — the downstream review and test-run steps expect all playbook tasks to be implemented; skipping tasks causes test failures
|
|
151
|
+
- **Do not create files outside specified paths** — only create or modify files listed in the playbook; unexpected files confuse the project structure
|
|
152
|
+
- **Track progress** — for playbooks with many tasks, use a progress tracker to avoid skipping or repeating tasks
|