# zakariabentouhami-bit/qa-ai-agent-poc architecture

> Architecture diagram of the GitHub repository zakariabentouhami-bit/qa-ai-agent-poc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zakariabentouhami-bit/qa-ai-agent-poc
- Repository: https://github.com/zakariabentouhami-bit/qa-ai-agent-poc

## Overview

#### Purpose and Operating Model
This repository is a personal POC for autonomous QA engineering: an AI agent turns a functional story into risk-based test assets, Playwright automation, live execution evidence, and qualified outcomes. It targets public demo systems only and supports both agent-led MCP execution and conventional Playwright runs.

Primary human/agent entry points are `README.md`, `.claude/skills/autonomous-test-agent/SKILL.md`, and the Playwright test command.

#### Story and Source Intake
Stories are the canonical test-design inputs. Local, normalized requirements live in:
- `stories/story-001.md`
- `stories/story-002.md`

Raw external material can be retained before conversion into a story:
- `inputs/the-internet-login-source.md`

This separates imported/public source documentation from the actionable story artifact consumed by the agent workflow.

#### Autonomous QA Orchestration
The process contract is encoded as a Claude Code skill:
- `.claude/skills/autonomous-test-agent/SKILL.md`

It defines the agent boundary: read a story, derive test strategy and Xray-compatible cases, generate/update Playwright coverage, execute against the target, classify results as PASS/FAIL/BLOCKED, and create defect reporting only for confirmed product issues. Supporting design intent and implementation planning are recorded in:
- `docs/specs/design-qa-ai-agent-poc_20260915.md`
- `docs/plans/plan-implementation-autonomous-test-agent_20260915.md`

#### Test Design and Evidence Artifacts
Risk-based strategies are durable review artifacts, one per processing cycle/story:
- `docs/strategie-test-20260915.md`
- `docs/strategie-test-20260916.md`

Generated execution deliverables are deliberately separate from test code:
- `outputs/cas-test-20260915.csv`
- `outputs/rapport-execution-20260916.md`

CSV outputs represent Xray-oriented test cases; Markdown reports preserve execution context, verdicts, and environmental findings. This makes the agent’s reasoning and evidence inspectable outside the runtime.

#### Automation and Execution Boundary
Executable browser coverage resides in:
- `tests/story-001.spec.ts`
- `tests/story-002.spec.ts`

Playwright configuration is centralized in:
- `playwright.config.ts`

Tests exercise external public sites, notably SauceDemo and The Internet. They may run through the normal Playwright runner (`npx playwright test`) or be driven interactively by Claude through the Playwright MCP server configured by `.mcp.json`.

The MCP browser must use an isolated profile; this is an important safety and reproducibility boundary because personal-browser password/security behavior previously interfered with UI interactions.

#### Runtime, Dependencies, and CI
The material runtime is Node.js with npm dependency resolution:
- `package.json`
- `package-lock.json`

GitHub Actions provides the continuous validation path:
- `.github/workflows/playwright.yml`

On pushes and pull requests, CI runs the combined Playwright suite, independently verifying the generated scripts rather than requiring an interactive AI/MCP session.

Main entry points: [`.claude/skills/autonomous-test-agent/SKILL.md`](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/.claude/skills/autonomous-test-agent/SKILL.md) (Autonomous test skill), [`tests/story-001.spec.ts`](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/tests/story-001.spec.ts) (Playwright story tests), [`tests/story-002.spec.ts`](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/tests/story-002.spec.ts) (Second story tests), [`.github/workflows/playwright.yml`](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/.github/workflows/playwright.yml) (GitHub Actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Requirements Intake"]
  node_readme["Project entry point<br/>documentation<br/>[README.md]"]
  node_raw_source["Raw login source<br/>source material"]
  node_stories["Canonical stories<br/>requirements<br/>[story-001.md]"]
  node_story_002["Second story<br/>requirements<br/>[story-002.md]"]
end

subgraph group_agent["Autonomous QA"]
  node_agent_skill["Autonomous test skill<br/>Claude Code skill<br/>[SKILL.md]"]
  node_design_spec["Agent design spec<br/>design documentation"]
  node_implementation_plan["Implementation plan<br/>planning documentation"]
end

subgraph group_artifacts["Review Artifacts"]
  node_strategy["Risk test strategies<br/>test strategy"]
  node_xray_cases["Xray test cases<br/>CSV output"]
  node_execution_report["Execution report<br/>Markdown output"]
end

subgraph group_execution["Browser Execution"]
  node_playwright_tests["Playwright story tests<br/>browser tests<br/>[story-001.spec.ts]"]
  node_story_002_tests["Second story tests<br/>browser tests<br/>[story-002.spec.ts]"]
  node_playwright_config["Playwright config<br/>test configuration"]
  node_mcp_server{{"Playwright MCP<br/>interactive browser runtime<br/>[.mcp.json]"}}
end

subgraph group_delivery["Runtime &amp; CI"]
  node_node_runtime["Node/npm runtime<br/>package runtime<br/>[package.json]"]
  node_github_actions{{"GitHub Actions<br/>CI workflow<br/>[playwright.yml]"}}
end

node_raw_source -->|"normalized into"| node_stories
node_stories -->|"test-design input"| node_agent_skill
node_story_002 -->|"test-design input"| node_agent_skill
node_design_spec -.->|"design intent"| node_agent_skill
node_implementation_plan -.->|"implementation guidance"| node_agent_skill
node_agent_skill -->|"derives risks"| node_strategy
node_agent_skill -->|"generates cases"| node_xray_cases
node_agent_skill -->|"generates or updates"| node_playwright_tests
node_agent_skill -->|"generates or updates"| node_story_002_tests
node_playwright_tests -->|"uses"| node_playwright_config
node_story_002_tests -->|"uses"| node_playwright_config
node_agent_skill -->|"interactive execution"| node_mcp_server
node_mcp_server -.->|"drives"| node_playwright_tests
node_playwright_tests -->|"execution evidence"| node_execution_report
node_story_002_tests -->|"execution evidence"| node_execution_report
node_node_runtime -->|"runs"| node_playwright_tests
node_node_runtime -->|"provides dependencies"| node_github_actions
node_github_actions -->|"validates on push/PR"| node_playwright_tests
node_github_actions -->|"validates on push/PR"| node_story_002_tests
node_readme -.->|"introduces workflow"| node_agent_skill

click node_readme "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/README.md"
click node_raw_source "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/inputs/the-internet-login-source.md"
click node_stories "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/stories/story-001.md"
click node_story_002 "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/stories/story-002.md"
click node_agent_skill "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/.claude/skills/autonomous-test-agent/SKILL.md"
click node_design_spec "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/docs/specs/design-qa-ai-agent-poc_20260915.md"
click node_implementation_plan "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/docs/plans/plan-implementation-autonomous-test-agent_20260915.md"
click node_strategy "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/docs/strategie-test-20260915.md"
click node_xray_cases "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/outputs/cas-test-20260915.csv"
click node_execution_report "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/outputs/rapport-execution-20260916.md"
click node_playwright_tests "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/tests/story-001.spec.ts"
click node_story_002_tests "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/tests/story-002.spec.ts"
click node_playwright_config "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/playwright.config.ts"
click node_mcp_server "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/.mcp.json"
click node_node_runtime "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/package.json"
click node_github_actions "https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/.github/workflows/playwright.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_readme,node_raw_source,node_stories,node_story_002 toneBlue
class node_agent_skill,node_design_spec,node_implementation_plan toneAmber
class node_strategy,node_xray_cases,node_execution_report toneMint
class node_playwright_tests,node_story_002_tests,node_playwright_config,node_mcp_server toneRose
class node_node_runtime,node_github_actions toneIndigo
```

## Components

### Requirements Intake

- [Project entry point](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/README.md): documentation · `README.md`
- [Raw login source](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/inputs/the-internet-login-source.md): source material · Imported public documentation before story normalization. · `inputs/the-internet-login-source.md`
- [Canonical stories](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/stories/story-001.md): requirements · Normalized functional inputs for test design. · `stories/story-001.md`
- [Second story](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/stories/story-002.md): requirements · `stories/story-002.md`

### Autonomous QA

- [Autonomous test skill](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/.claude/skills/autonomous-test-agent/SKILL.md): Claude Code skill · Defines the story-to-evidence agent contract. · `.claude/skills/autonomous-test-agent/SKILL.md`
- [Agent design spec](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/docs/specs/design-qa-ai-agent-poc_20260915.md): design documentation · `docs/specs/design-qa-ai-agent-poc_20260915.md`
- [Implementation plan](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/docs/plans/plan-implementation-autonomous-test-agent_20260915.md): planning documentation · `docs/plans/plan-implementation-autonomous-test-agent_20260915.md`

### Review Artifacts

- [Risk test strategies](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/docs/strategie-test-20260915.md): test strategy · Durable, per-story risk-based review artifacts. · `docs/strategie-test-20260915.md`
- [Xray test cases](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/outputs/cas-test-20260915.csv): CSV output · Generated test cases for Xray-oriented review. · `outputs/cas-test-20260915.csv`
- [Execution report](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/outputs/rapport-execution-20260916.md): Markdown output · Preserves verdicts and environment findings. · `outputs/rapport-execution-20260916.md`

### Browser Execution

- [Playwright story tests](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/tests/story-001.spec.ts): browser tests · Executable coverage for public demo targets. · `tests/story-001.spec.ts`
- [Second story tests](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/tests/story-002.spec.ts): browser tests · `tests/story-002.spec.ts`
- [Playwright config](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/playwright.config.ts): test configuration · `playwright.config.ts`
- [Playwright MCP](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/.mcp.json): interactive browser runtime · Uses an isolated browser profile for safe reproducible agent runs. · `.mcp.json`

### Runtime & CI

- [Node/npm runtime](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/package.json): package runtime · Dependencies and test tooling resolution. · `package.json`
- [GitHub Actions](https://github.com/zakariabentouhami-bit/qa-ai-agent-poc/blob/master/.github/workflows/playwright.yml): CI workflow · Runs the combined suite on pushes and pull requests. · `.github/workflows/playwright.yml`

## Connections

- Raw login source → Canonical stories: normalized into
- Canonical stories → Autonomous test skill: test-design input
- Second story → Autonomous test skill: test-design input
- Agent design spec → Autonomous test skill: design intent
- Implementation plan → Autonomous test skill: implementation guidance
- Autonomous test skill → Risk test strategies: derives risks
- Autonomous test skill → Xray test cases: generates cases
- Autonomous test skill → Playwright story tests: generates or updates
- Autonomous test skill → Second story tests: generates or updates
- Playwright story tests → Playwright config: uses
- Second story tests → Playwright config: uses
- Autonomous test skill → Playwright MCP: interactive execution
- Playwright MCP → Playwright story tests: drives
- Playwright story tests → Execution report: execution evidence
- Second story tests → Execution report: execution evidence
- Node/npm runtime → Playwright story tests: runs
- Node/npm runtime → GitHub Actions: provides dependencies
- GitHub Actions → Playwright story tests: validates on push/PR
- GitHub Actions → Second story tests: validates on push/PR
- Project entry point → Autonomous test skill: introduces workflow
