Qa

From pageel/para-workspace · View interactive version

Qa is an AI agent skill from the GitHub repository pageel/para-workspace. Sidecar data for /qa workflow — Red Team personas, dimension checklists, and QA report templates loaded just-in-time.

How to use this skill

Skill file

QA Review Skills

Architecture: Sidecar Skill

Parent Workflow: /qa

This skill provides the data structures, templates, and complex persona definitions required by the /qa workflow. By keeping this out of the main workflow file, we maintain a lean execution loop while ensuring high-quality, standardized Q&A outputs.

When to Load

| File | When | Purpose |

|:--|:--|:--|

| This file (§1) | Step 0.5 — Pre-QA Strategy | QA Report template structure (created at kickoff) |

| This file (§2) | Step 2 — Generate Questions | Persona question banks (inspiration) |

| This file (§3) | Step 2 — Generate Questions | Dimension seed patterns (per tag) |

| This file (§5) | Step 0.5 — Process Selection | Process selection logic & comparison matrix |

| stacks/[name].md | Step 0 — Pre-flight | Stack-specific QA gotchas & Skill Router |

| domains/csa.md | Step 0 — Pre-flight | CSA-specific QA checks & persona definition |

| scripts/lint-qa.js | Step 10 — Save Report | QA Report structural & housekeeping linter |

| references/process-full-plan.md | Step 0.5 — Process = Full-Plan | Waterfall Gate process template |

| references/process-phase-loop.md | Step 0.5 — Process = Phase-Loop | Iterative Gate process template |

| references/process-risk-driven.md | Step 0.5 — Process = Risk-Driven | Pareto Gate process template |

| references/process-adversarial.md | Step 0.5 — Process = Adversarial | Devil's Advocate process template |

1. QA Report Template

When creating the QA Report at Step 0.5 (Pre-QA Strategy), the Agent MUST format the file according to this structure and save it to Projects/[project]/artifacts/qa/qa-[date]-[mode]-[target]-[seq].md.

Language Guard: The Agent MUST translate all headers, table columns, and labels in this template (e.g., "Executive Summary", "Verdict", "Action Items") into the user's preferred language defined in .para-workspace.yml (e.g., Vietnamese), while keeping the markdown structure and logic tags ([LOGIC], [SEC]) intact.

# 🛡️ QA Review Report: [Target Artifact Name]

> **Target:** `[Path to artifact]`
> **Target Version:** `[Last Modified Timestamp or Git Hash]`
> **Workflow Mode:** `/qa [plan/spec/artifact/audit]`
> **Process:** `[full-plan / phase-loop (specify N phases) / risk-driven (specify N risks) / adversarial]` (MUST specify the exact count of phases/risks in parentheses to prevent context decay)
> **Dimensions:** `[LOGIC, SEC, FEAS, COMP, CONS, DEP, GOV, OSS]`
> **Verdict:** `[✅ Ready | ⚠️ Action Required | 🔴 Blocked | ⏳ Pending (Round N - Q[N] Brainstorming)]`

## 0. QA Strategy (Pre-QA)

### Focus Areas — Coverage Tracker

| # | Focus Area | Round 1 | Round 2 | Status |
|---|---|---|---|---|
| 1 | **[Area Name]** — [Brief scope description] | — | — | ⏳ Pending |
| ... | | | | |

### Red Team Roster
- 🏗️ **[Persona]:** [Justification for selection]
- ...

### Process Log

| Round | Trigger | Scope | Questions | Critical | Fixed |
|---|---|---|---|---|---|
| *(empty — rows appended after each round)* |

### 🚀 Next Steps

*(Generated by Agent after each round — see Step 7. Mode-dependent selection)*

**For Plan Mode:**

| Action | Command | Description |
|---|---|---|
| **Start Development** | `/plan [project-name] dev` | Activate plan and start execution via Plan Dev Gate (Mandatory per Rule 3d) |
| **Deep review** | `deep [aspect]` | Add another review round if needed. |
| **Full audit** | `/qa audit` | Run Compliance Audit on the fixed Plan. |
| **Close QA** | `done` | Close the QA report, no further review. |

**For Spec Mode:**

| Action | Command | Description |
|---|---|---|
| **Create Plan** | `/plan create [version]` | Create a new implementation plan based on the approved spec (Recommended next step) |
| **Sync Backlog** | `/backlog sync` | Synchronize spec acceptance criteria into project backlog |
| **Deep review** | `deep [aspect]` | Add another review round on the specification if needed |
| **Close QA** | `done` | Close the QA report, no further review |


## 1. Executive Summary

| Category | Count |
| :--- | :--- |
| **Total Questions Raised** | 0 |
| **✅ Resolved/OK** | 0 |
| **⚠️ Minor Issues** | 0 |
| **🔴 Critical Blockers** | 0 |

## 2. Red Team Findings

*(Group findings by Phase or Section. Use the Personas to label the questions).*

### 📌 [Phase/Section Name]

#### 🏗️ Principal Architect
**Q [LOGIC]:** [Question]
**A:** [Answer/Resolution]
**Verdict:** [✅/⚠️/🔴]

#### 🤖 AI Security Expert
**Q [SEC]:** [Question]
**A:** [Answer/Resolution]
**Verdict:** [✅/⚠️/🔴]

#### 💼 Project Tech Lead
**Q [GOV]:** [Question]
**A:** [Answer/Resolution]
**Verdict:** [✅/⚠️/🔴]

## 3. Action Items & Fixes Applied

- [ ] (Fixed) Changed API payload to include proper validation in Phase 2.
- [ ] (Pending) Update timeline for Phase 3 integration testing.

2. Persona Question Banks

CRITICAL RULE FOR AGENTS: DO NOT copy these reference questions verbatim. They serve strictly as a guide to illustrate the style and angle of questioning for each Persona. The Agent MUST dynamically generate the actual probing questions based on the target Spec's technical details, the active system design (sysdesign-*.md), and the physical entities (APIs, DB tables, files) of the codebase.

🏗️ Principal Architect (`[LOGIC]`, `[DEP]`)

🛡️ Security Auditor (`[SEC]`)

🤖 AI Security & Boundary Expert (`[SEC]`, `[LOGIC]`)

🌍 Open Source Maintainer (`[OSS]`, `[CONS]`)

⏱️ Delivery Manager (`[FEAS]`, `[COMP]`)

🔍 QA/Test Lead (`[CONS]`)

💼 Project Tech Lead (`[GOV]`, `[COMP]`)

Context requirement: This persona's questions are only meaningful AFTER loading

the project's full governance context (rules, skills, release process) in Pre-flight Step 5.

📐 CSA Expert (`[CSA]`)

📊 Graph Impact Integration (v1.1.0+)

When running /qa on a plan or spec, the Agent MUST check if a Graph Impact Report exists for the target phases (e.g., artifacts/reports/graph/graph-impact-phase-[N].md).

IF a report exists, the Red Team Personas MUST read and incorporate its findings:

  1. 🏗️ Principal Architect:
  1. 🛡️ Security Auditor / AI Security Expert:
  1. 💼 Project Tech Lead:

3. Dimension Seed Patterns

Quick-reference seed patterns per dimension tag. Agent uses these alongside

the Persona Question Banks (§2) when generating questions at Step 2.

[LOGIC] Logic & Sequencing

[SEC] Security & Safety

[FEAS] Feasibility

[COMP] Completeness

[CONS] Consistency

[DEP] Dependencies

[GOV] Project Governance

4. Deep Review Aspects (Dual-Pass)

When the user triggers a deep review in Step 3, the Agent shifts focus from surface architecture to raw source code analysis.

5. Process Selection Router

When: Loaded at Step 0.5 (Pre-QA Strategy) BEFORE generating questions.

Agent MUST present the process selection menu and wait for user choice.

This is the QA equivalent of Plan Template Selection.

5.1 Available Processes

| # | Process | Slug | Philosophy | Template |

|:--|:--|:--|:--|:--|

| 1 | 📋 Full-Plan Review | full-plan | Waterfall Gate | references/process-full-plan.md |

| 2 | 🔄 Phase-by-Phase Loop | phase-loop | Iterative Gate | references/process-phase-loop.md |

| 3 | 🎯 Risk-Driven Review | risk-driven | Pareto Gate | references/process-risk-driven.md |

| 4 | ⚔️ Adversarial Red Team | adversarial | Devil's Advocate | references/process-adversarial.md |

5.2 Comparison Matrix

| Dimension | Full-Plan | Phase-Loop | Risk-Driven | Adversarial |

|:--|:--|:--|:--|:--|

| Token cost | 🟡 Medium | 🟢 Low/round | 🟢 Low | 🔴 High |

| Depth | 🟡 Medium | 🔴 High | 🔴 Critical-only | 🔴 Very High |

| Rounds | 1-2 | N (per Phase) | 3 (by risk tier) | 3 (attack→debate→ruling) |

| Best for | Small plans, specs | Large/TDD plans | Security/production | Architecture, OSS release |

| Output | Q&A Report | Phase Verdicts + Report | Risk Matrix + Report | Debate Log + Certification |

5.3 Auto-Suggest Heuristics

Agent MUST auto-suggest a process based on artifact analysis.

User may override the suggestion.

IF mode = spec OR mode = artifact
  → suggest: full-plan (no Phase structure to iterate)
ELIF artifact has ≥ 5 phases AND mode = plan
  → suggest: phase-loop
ELIF artifact has Risks table with ≥ 3 entries
  → suggest: risk-driven
ELIF user requests "stress test" OR "thorough review" OR "red team"
  → suggest: adversarial
ELIF artifact has ≤ 4 phases
  → suggest: full-plan
ELSE
  → suggest: full-plan (default)

5.4 Selection Prompt Template

Agent MUST present this prompt at Step 0.5 and STOP for user selection:

🛡️ QA PROCESS SELECTION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Target: [artifact name]
Mode: [plan/spec/artifact/audit]
Phases: [N] | Risks: [N] | Lines: [N]

  1. 📋 Full-Plan Review     — Scan everything at once (🟡 Medium cost)
  2. 🔄 Phase-by-Phase Loop  — Review each phase independently (🟢 Low/round)
  3. 🎯 Risk-Driven Review   — Focus on highest risks first (🟢 Low cost)
  4. ⚔️ Adversarial Red Team — Multi-persona debate (🔴 High cost)

💡 Suggested: [N]. [Name] — [reason]

❓ Select a process (1-4) or press Enter for suggested:

⛔ CHECKPOINT: Agent MUST STOP the workflow here and wait for the user's

explicit process selection. Do NOT proceed to generate questions until the

user selects a process.

5.5 Post-Selection

After user selects a process:

  1. Load the corresponding references/process-*.md template.
  2. Extract the process flow and adapt the QA Strategy section accordingly.
  3. Add > **Process:** [slug] to the QA Report header.
  4. Proceed to the rest of Step 0.5 (Focus Areas, Red Team Roster, Process Log).

6. Spec Audit Process & Templates

The specification audit and review process (Action: spec) is designed to automate the discovery of architectural drift and ensure that safety and technical standards are established before code execution.

6.1 Spec Audit Report Template

When saving the Spec Audit report, the Agent MUST use the following structure:

# 🛡️ Spec Audit Report: [Spec Name]

> **Target:** `[Path to spec file]`
> **Sysdesign Reference:** `[Path to sysdesign file]` (if `--sys` is enabled)
> **Verdict:** `[Pass ✅ | ⚠️ Warning | 🔴 Blocked]`

## 1. Spec Quality Checklist Results (spec-quality-checklist.md)
*   **Score:** [passed]/[total] Pass
*   **Issues/Recommendations:**
    - [List failed or warning checklist items, e.g., "C4: Missing code style sample"]

## 2. Sysdesign Alignment & Spec Overlap Report
*   **API Interface Drift:** [None / Detected payload or endpoint mismatch]
*   **Database Schema Drift:** [None / Detected data type drift or foreign key conflict]
*   **Structure Drift:** [None / Incorrect proposed file location]
*   **Spec Overlap Check:** [None / Detected overlap with other specs without clear boundaries]

## 3. CSA Anchors Audit
*   **Total Anchors:** [N] anchors
*   **CSA G1 (One-to-One):** [Pass ✅ / Fail]
*   **CSA G2 (Reverse Validation):** [Pass ✅ / Fail]
*   **CSA G3 (No Blanket):** [Pass ✅ / Fail]

6.2 Agent Execution Steps

  1. Ingest Spec & Sysdesign: Read the entire target specification and the corresponding system design file (if available).
  2. Evaluate 30 Checklist Items: Run the 30 checks from spec-quality-checklist.md.
  3. Cross-Check Database, APIs, and Spec Overlap:
  1. Validate CSA Anchors: Scan the anchors and ensure no blanket anchors are used at the H1/H2 levels.
  2. Output Report: Create the QA report and propose spec fixes directly to the user.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.