qa-expert
This skill should be used when establishing comprehensive QA testing processes for any software project. Use when creating test strategies, writing test cases following Google Testing Standards, executing test plans, tracking bugs with P0-P4 classification, calculating quality metrics, or generating progress reports. Includes autonomous execution capability via master prompts and complete documentation templates for third-party QA team handoffs. Implements OWASP security testing and achieves 90% coverage targets.
1How It Works & Mechanism
The project skeleton is generated entirely to disk by scripts/init_qa_project.py using standard library mkdir + open: 4 directory levels (tests/docs, tests/docs/templates, tests/e2e, tests/fixtures) are hardcoded lists with no reliance on template engines or third-party packages.
dirs = [ "tests/docs", "tests/docs/templates", "tests/e2e", "tests/fixtures" ]
The CSV column names act as an implicit data contract between the two scripts: init writes 13 columns, and calculate_metrics.py subsequently reads and aggregates them using that exact same set of column names (Test Case ID/Status/Result/Bug ID/Priority/Notes).
headers = [ "Test Case ID", "Category", "Priority", "Test Name", "Estimated Time (min)", "Prerequisites", "Status", "Result", "Bug ID", "Execution Date", "Executed By", "Notes", "Screenshot/Log" ]
Metric calculation criteria are hardcoded in the script: executed count = rows where Status is strictly 'Completed', passed count = rows where Result is strictly '✅ PASSED'; the execution rate denominator is all valid test case rows, and the pass rate denominator is executed rows.
executed = len([t for t in tests if t['Status'] == 'Completed']) passed = len([t for t in tests if t['Result'] == '✅ PASSED']) failed = len([t for t in tests if t['Result'] == '❌ FAILED'])
Only 3 quality gates are implemented in the script (100% execution rate, ≥80% pass rate, P0=0), and the P0 determination relies on checking whether the Notes column contains the string 'P0', which represents weak-evidence matching.
gates = { "Test Execution ≥100%": execution_rate >= 100, "Pass Rate ≥80%": pass_rate >= 80, "P0 Bugs = 0": len([t for t in tests if t['Bug ID'].startswith('BUG') and 'P0' in t['Notes']]) == 0, }
The 'Ground Truth Principle' establishes documentation as the sole source of truth while the CSV merely tracks execution status, forming the core discipline of this skill (addressing lessons learned from real incidents where the consistency rate between CSV and document test case IDs was only 3.2%).
- **Test case documents** (e.g., `02-CLI-TEST-CASES.md`) = **authoritative source** for test steps
'Autonomous execution' is not implemented via code, but through a pasteable master prompt: it instructs the host LLM to inspect the CSV for progress, execute test cases sequentially, and update the CSV immediately after each test, enabling resume-from-breakpoint execution.
You are a senior QA engineer with 20+ years of experience at Google. Execute the QA test plan.
The state recovery patch enables resumability: the master prompt instructs the LLM to read TEST-EXECUTION-TRACKING.csv to identify the last 'Completed' case and proceed from the next one, enforcing that 'updates must be made immediately after each test, strictly prohibiting batch updates'.
- Auto-resume from last completed test (reads tracking CSV)
The test case system originates from templates rather than code generation: the test case structure is defined by assets/templates/TEST-CASE-TEMPLATE.md (AAA + TC-[CATEGORY]-[NUMBER] naming + P0-P4 priority).
### TC-[CATEGORY]-[NUMBER]: [Descriptive Title]
A gap exists between the files actually generated on disk by init and those claimed in the documentation: the generated README/MASTER-QA-PROMPT references files such as QA-HANDOVER-INSTRUCTIONS.md and categorized test case documents that init does not actually create.
1. Read `QA-HANDOVER-INSTRUCTIONS.md`
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| cli | python3(执行自带脚本;仅标准库 os/sys/csv/pathlib/datetime/collections) |
| cli | git(master prompt 中克隆被测仓库的示例步骤) |
| cli | docker / npx supabase(Day 1 环境搭建示例:起本地数据库) |
| cli | pnpm / npm(Day 1 安装依赖示例) |
| cli | curl(诊断脚本:检查本地 dev server 是否响应) |
| network | 文档内参考外链(仅 Markdown 超链接,代码不访问) |
4Recommended Governance & Evidence
- scripts/: Executes local script or command: python3 scripts/init_qa_project.py <project-name> [output-directory] (writes directories and files)
- 本地工作目录: File I/O and artifact output: creates tests/docs, tests/docs/templates, tests/e2e, and tests/fixtures 4-tier directory structure under the target directory (via mkdir)
5Second-Pass Verification
- [ok] 无网络/无凭证:脚本执行面反查 — 对 qa-expert/ 全目录 grep subprocess|requests|urllib|socket|http|os.system|os.environ|getenv|eval|exec:脚本侧零命中,仅参考文献里的 localhost 示例、文档外链与 docker ps 等示例命令。两脚本 import 仅 os/sys/csv/pathlib/datetime/collections。第一遍『无网络、无凭证』结论成立。
- [discrepancy] init 落盘清单 vs SKILL.md/生成文档的自我引用 — init 只创建 6 个文件:TESTS-EXECUTION-TRACKING.csv、BUG-TRACKING-TEMPLATE.csv、BASELINE-METRICS.md、WEEKLY-PROGRESS-REPORT.md、MASTER-QA-PROMPT.md、README.md(均在 tests/docs 或 tests/docs/templates 下)。但生成的 README 正文写『1. Read `QA-HANDOVER-INSTRUCTIONS.md`』并索引 QA-HANDOVER-INSTRUCTIONS.md、01-[CATEGORY]-TEST-CASES.md、02-SECURITY-TEST-CASES.md,MASTER-QA-PROMPT.md 也要求先读 tests/docs/QA-HANDOVER-INSTRUCTIONS.md——这些文件 init 一律不生成,第三方按模板走会在第一步中断。SKILL.md『What gets created』同样未提示该缺口。
- [discrepancy] 质量门禁:SKILL.md 6 条 vs 脚本 3 条 — SKILL.md 门禁表列 Test Execution 100% / Pass Rate ≥80% / P0=0 / P1≤5 / Code Coverage ≥80% / Security 90% 六条并标注均为 Blocker;calculate_metrics.py 的 gates 字典只有前三条,且 P0 判定实现为『Bug ID 以 BUG 开头且 Notes 含 P0』这一启发式。P1≤5、覆盖率、OWASP 三项无任何自动判定。
- [ok] 指标口径与 CSV 键名契约 — calculate_metrics 读取的键 Test Case ID/Status/Result/Bug ID/Priority/Notes 均存在于 init 写出的 13 列表头中,跨脚本契约自洽。但口径依赖精确字符串:Status=='Completed'、Result=='✅ PASSED'、Notes 含 'P0',大小写或写法的任何偏差都会静默计 0(无校验、无告警)——这是口径脆弱性而非事实错误。
- [discrepancy] llm_prompts_library『30+ prompts』宣称 — SKILL.md 两处写『30+ ready-to-use prompts』/『30+ ready-to-use reporting prompts』。独立计数(grep '^```' = 36 行 → 18 个围栏代码块;'### ' 小节 29 个,其中含 Best Practices/Common Mistakes/Troubleshooting 等非 prompt 小节)→ 可粘贴 prompt 块实为 18 个,最宽口径(含故障排查内的短示例)也不足 30。宣称偏高。
- [ok] 关键方法论声明与实际内容一致性(AAA/5 小时/OWASP 90%/P0-P4) — day1_onboarding.md 首行即『**Time**: 5 hours (with breaks)』,与 SKILL.md 的 5 小时时间线一致;google_testing_standards.md 确实给出 AAA 三段结构、TC-[CATEGORY]-[NUMBER] 命名与 P0-P4 定义;SKILL.md 的 OWASP A01-A07 清单与『**Target**: 90% OWASP coverage (9/10 threats mitigated)』自洽;模板文件 TEST-CASE-TEMPLATE.md 含 AAA 字段与实例。无夸大。
- [ok] Ground Truth 原则的双向核对 — SKILL.md『Test case documents … = authoritative source for test steps』与 ground_truth_principle.md『Ground Truth: 02-CLI-TEST-CASES.md (detailed test specifications)』/『Lesson Learned: … 3.2% consistency rate』表述一致,纪律有事故依据,非泛泛口号。
- [ok] pin commit 与目录资产面核对 — git rev-parse HEAD = d5c4678cb5d4fd6acc9c922690df035dbd33d247,提交时间 2026-09-09T20:31:25+08:00(= UTC 12:31:25Z),与任务给定一致。glob 全量(含隐藏文件)确认 qa-expert/ 仅 SKILL.md + scripts/2 + references/5 + assets/templates/1,无隐藏脚本、无二进制、无 .env。
6Verdict & Scenarios
a79a23756c922164…