---
version: 1.0
updated: 2026-06-11
ported_from: ai-automation-qc-base
---

# /qc-report — QC Test Report & Evidence

> Stage 6 (cuối) của QC automation pipeline native (qc-analyze → qc-plan → qc-design-test → qc-review → qc-run-test → qc-report). Port từ bước report của qa-runner team QC.

## Gate
{{include:steps/gate.md}}

*Lưu ý: Với lệnh này, target ở Bước 1 là một UC-ID. Sinh report từ lần chạy `/qc-run-test` gần nhất. Dùng module **qc-playwright** (pytest-html + Playwright Trace — không Allure, không dashboard viết tay).*

## Context
{{include:steps/context-loader.md}}

---

## Role

Bạn là stage **QC Report** — biến lần chạy gần nhất thành report + evidence chia sẻ được.

## Skill (`{paths.qc_skills_dir}/qa-runner/report/`)

- `report.md` — tự đủ: pytest-html (`--html=reports/<feature>/report.html
  --self-contained-html`) + Playwright Trace (`test-results/<nodeid>/trace.zip`, xem qua
  `python3 -m playwright show-trace <file>`), kèm screenshot/evidence đính trên FAIL/SKIP.

## Procedure

1. Định vị artifact của lần chạy gần nhất cho `{UC-ID}` (report pytest-html + trace).
2. Sinh/làm mới `reports/<feature>/report.html` (self-contained) và đảm bảo mỗi
   FAIL/SKIP có trace + screenshot đính kèm.
3. Tóm tắt TOTAL / PASS / FAIL / SKIP; với mỗi FAIL gồm lệnh `show-trace` và
   phân loại là script-bug hay product-gap.
4. **Bàn giao product-gap về spec (có nhắc).** Với mỗi FAIL phân loại **product-gap**
   (defect thật, impl ≠ spec — không phải script-bug), in một
   `/report-bug {UC-ID} {one-line expected-vs-actual}` sẵn-chạy để QC file nó vào spec repo dùng chung.
   BUG_FLOW của `/report-bug` rồi định tuyến root cause (Code / BDD / PRD / Design / Env). Không bao giờ
   fake-pass một product-gap — nó giữ FAIL trong `qc_status` cho tới khi fix + chạy lại. **script-bug
   KHÔNG được file** (QC fix script và chạy lại). Liệt kê các lệnh; đừng tự tạo report.

## Report

{{include:steps/report-footer.md}}

```
/qc-report Hoàn tất — {UC-ID}
Report: reports/<feature>/report.html   (TOTAL {N} · PASS {p} · FAIL {f} · SKIP {s})
Trace : test-results/<nodeid>/trace.zip  (python3 -m playwright show-trace <file>)

Product-gap cần file ({g}):   ← chạy các lệnh này để PO/Dev thấy trên /sync (script-bug bị loại)
  /report-bug {UC-ID} {gap 1 — expected vs actual}
  /report-bug {UC-ID} {gap 2 …}
  (không có → skip)

Next: /validate-traces {UC-ID}   ← làm mới Living Docs (qc_status), rồi tạo PR
```
