一键导入
qa-analyze
Analyze smart component code for QA patterns and discuss findings with user
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze smart component code for QA patterns and discuss findings with user
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | qa-analyze |
| description | Analyze smart component code for QA patterns and discuss findings with user |
| disable-model-invocation | true |
Analyze smart component code to verify patterns, identify edge cases, and discuss findings with the user.
Key principle: QA should verify that code matches functional expectations, not just document what code does.
/qa-analyze <component-name>
Example: /qa-analyze cc-addon-admin
This skill produces a findings file: QA-findings-<component-name>.md
The findings file is used as input for /qa-generate to create the final QA test document.
When the user invokes this skill with a component name, follow these phases:
Before analyzing code, classify the component type to establish expected behavior patterns:
| Component Type | Characteristics | Key Patterns to Verify |
|---|---|---|
| Form Component | Creates/submits data (forms, creation wizards) | Reset on success ONLY, preserve data on error |
| Action Component | Performs operations (delete, update buttons) | Confirmation for destructive actions, loading states |
| List+CRUD Component | List with add/edit/delete operations | Item-level states, optimistic updates |
| Read-Only Component | Displays data without modification | No action patterns needed |
Use the AskUserQuestion tool to confirm the component type if unclear from the component name. Present these options:
Based on component type, create a checklist of expected behaviors BEFORE reading code:
| Pattern | Expected Behavior | Where to Look |
|---|---|---|
| Form reset | ONLY on success, NEVER on error | resetForm() calls in smart.js |
| Error state | Preserves all form data for retry | .catch() blocks should NOT reset |
| Success toast | notifySuccess() - auto-dismiss | After successful operations |
| Error toast | notifyError() - auto-dismiss | In .catch() blocks |
| Info toast | notify({ timeout: 0, closeable: true }) - persistent | User-actionable info |
| Loading states | Three-state: idle → loading → idle | updateComponent() calls |
| State cleanup | Guaranteed state reset (via .finally(), .catch(), or both paths) | Ensures no stuck states |
| Field errors | API errors → specific form field errors | Error mapping in catch blocks |
| Event dispatch | dispatchEvent() after significant operations | Parent notification |
| Initialization | Explicit state setup during component setup | onContextUpdate() or constructor |
Form Component must have:
resetForm() called ONLY in success path.catch() blocks preserve form data.finally(), .catch(), or both paths)dispatchEvent() after successful creationAction Component must have:
.finally(), .catch(), or both paths)dispatchEvent() after successful actionList+CRUD Component must have:
Read smart.js CRITICALLY to verify each expected behavior:
Find in src/components/<component-name>/:
<component-name>.smart.js - Main logic to verify<component-name>.stories.js - Story exports for test states<component-name>.smart.md - Documentation and metadataSearch for these patterns and verify correctness:
Reset Pattern Analysis
resetForm() or equivalent reset calls.then() success pathsresetForm() in .catch() blocks = ISSUEresetForm() outside promise chains = WARNError Handling Analysis
.catch() blocksnotifyError() or equivalentState Cleanup Analysis
.finally() blocks OR state reset in both .then() and .catch().finally() is preferred but .catch() handling state reset is validNotification Analysis
notifySuccess, notifyError, notifynotify() with wrong timeout configuration = WARNEvent Dispatch Analysis
dispatchEvent() or this.dispatchEventLoading State Analysis
updateComponent, _state =)After pattern verification, actively hunt for edge cases the developer may have overlooked.
Think like a hostile user or unstable network. Ask: "What could break this that isn't already handled?"
Timing & Race Conditions:
Network & Connectivity:
User Behavior:
State Machine Gaps:
Input Boundaries:
Missing Handling:
For each relevant category, note:
Before discussing with user, produce a verification report:
### Pattern Compliance
| Pattern | Expected | Found | Status |
|---------|----------|-------|--------|
| Form reset on success | Reset in .then() only | [what was found] | [OK/WARN/ISSUE/MISSING] |
| Error preserves data | No reset in .catch() | [what was found] | [OK/WARN/ISSUE/MISSING] |
| State cleanup | Guaranteed state reset on all paths | [what was found] | [OK/WARN/ISSUE/MISSING] |
| Success notification | notifySuccess() | [what was found] | [OK/WARN/ISSUE/MISSING] |
| Error notification | notifyError() | [what was found] | [OK/WARN/ISSUE/MISSING] |
| Event dispatch | dispatchEvent() present | [what was found] | [OK/WARN/ISSUE/MISSING] |
[OK] - Pattern found and correctly implemented[WARN] - Pattern present but non-standard implementation[ISSUE] - Potential bug or clear deviation from patterns[MISSING] - Expected pattern not found in codeSTOP and use the AskUserQuestion tool to ask about each WARN, ISSUE, or MISSING finding before proceeding.
For each deviation found, first present context to the user, then use AskUserQuestion with these options:
Context to present (as regular text before the question):
I found the following deviation from expected patterns:
**[ISSUE/WARN/MISSING]**: [Description of what was found]
Expected behavior: [What the pattern should be]
Actual code: [What the code does]
Risk: [Potential impact if this is a bug]
Then use AskUserQuestion with header "Finding" and these options:
For edge-case concerns (from Phase 4), present context then use AskUserQuestion:
Context to present (as regular text before the question):
**[EDGE CASE]**: {Scenario description}
Potential issue: {What could go wrong}
Code check: {Whether any handling exists}
Risk level: Low/Medium/High
Then use AskUserQuestion with header "Edge Case" and these options:
Do NOT proceed to findings file generation until all deviations are resolved.
Store the resolution for each finding:
After all findings are resolved, generate the findings file.
Create file: QA-findings-<component-name>.md
# QA Findings: <component-name>
## Component Classification
- **Type**: [Form Component | Action Component | List+CRUD Component | Read-Only Component]
- **Characteristics**: [brief description]
## Pattern Compliance
| Pattern | Status | Code Location | Notes |
|---------|--------|---------------|-------|
| Form reset on success | [OK/WARN/ISSUE/MISSING] | [file:line] | [details] |
| Error preserves data | [OK/WARN/ISSUE/MISSING] | [file:line] | [details] |
| State cleanup | [OK/WARN/ISSUE/MISSING] | [file:line] | [details] |
| Success notification | [OK/WARN/ISSUE/MISSING] | [file:line] | [details] |
| Error notification | [OK/WARN/ISSUE/MISSING] | [file:line] | [details] |
| Event dispatch | [OK/WARN/ISSUE/MISSING] | [file:line] | [details] |
## Edge Cases Investigated
| Scenario | Status | Notes |
|----------|--------|-------|
| Double-click submit | [OK/UNTESTED/CONCERN] | [details] |
| Network timeout | [OK/UNTESTED/CONCERN] | [details] |
| Navigate away mid-request | [OK/UNTESTED/CONCERN] | [details] |
| [other relevant scenarios] | ... | ... |
## Resolutions
| Finding | Decision | Rationale |
|---------|----------|-----------|
| [Description] | [INTENTIONAL/BUG/UNCERTAIN/SHOULD_TEST] | [User's reasoning] |
## Additional Notes
[Any other observations from analysis]
After generating the findings file, inform the user:
Analysis complete! Findings saved to: QA-findings-<component-name>.md
To generate the QA test document (HTML), run:
/qa-generate <component-name>
Generate, validate, and render Mermaid diagrams — flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, Gantt charts, mindmaps, and more. Use this skill whenever the user asks to create, draw, validate, fix, or render a Mermaid diagram, or when you need to verify diagram syntax is render-safe. Also use it when a diagram won't render or renders incorrectly and needs fixing.
Automate browser interactions, test web pages and work with Playwright tests.
Scaffold or update the per-project files that run browser/Playwright tests inside the official Playwright Docker image on a NixOS host. Use this when tests need to run but the project has no `playwright-docker/` directory yet (first-time setup), or to bump it when the project's Playwright version changes. To actually run tests once set up, use the `pw_test` tool (auto-registered in projects that have `playwright-docker/`).
Search the web and read web pages, returning standardized JSON. Use when the user asks to search the web, look something up online, find current or recent information, check docs/news, or fetch and read the contents of a URL.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Interview the user to deeply explore an idea, feature, or problem through Q&A. Use when the user asks to be interviewed, wants to think through something, or needs help clarifying a concept.