# gouravbanerjee937/qaclaudecodeagent architecture

> Architecture diagram of the GitHub repository gouravbanerjee937/qaclaudecodeagent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gouravbanerjee937/qaclaudecodeagent
- Repository: https://github.com/gouravbanerjee937/qaclaudecodeagent

## Overview

1. **What this repo is**
   - This is an autonomous QA pipeline that turns a natural-language User Story or PRD into executable Playwright-based tests, runs them, repairs failures, and produces a final QA report.
   - The architecture is centered on an LLM-driven workflow rather than a traditional app-server/data-store setup.

2. **Primary entry points**
   - `Home.py` is the user-facing Streamlit app.
   - `run_eval.py` and `run_pipeline_check.py` are non-UI helper scripts for evaluation and smoke-checking the pipeline.
   - The main backend logic lives under `qa_agent/`.

3. **Presentation layer**
   - The Streamlit UI is the monitoring and control plane.
   - It likely accepts pasted requirements or uploaded documents, triggers the pipeline, and streams progress/results back to the user.
   - The README’s “cyberpunk-themed” UI and real-time monitoring suggest the UI is not doing business logic itself; it delegates to the pipeline and subscribes to events.

4. **Pipeline orchestration**
   - `qa_agent/pipeline.py` is the central coordinator.
   - It likely owns the end-to-end execution order: ingest requirement → analyze/explore → plan → design → generate code → execute → validate/heal → report.
   - `qa_agent/steps/orchestrator.py` appears to manage the sequence and handoff between step agents.

5. **Agent-based step architecture**
   - Each file in `qa_agent/steps/` represents a distinct functional stage:
     - `explorer.py`: discovers or normalizes the problem space from the user input.
     - `inquirer.py`: asks for or infers missing requirements.
     - `analyst.py`: converts raw requirements into a structured QA perspective.
     - `designer.py`: produces the test strategy/plan.
     - `coder.py`: generates the Playwright test implementation.
     - `executor.py`: runs the generated tests.
     - `validator.py`: checks outputs against expectations.
     - `healer.py`: analyzes failures and rewrites tests to fix bad assumptions/locators.
     - `reporter.py`: compiles the final QA report.
   - This is a staged pipeline with explicit boundaries between reasoning, code generation, execution, and remediation.

6. **LLM abstraction and prompts**
   - `qa_agent/llm.py` is the model access layer, likely wrapping OpenAI calls and centralizing model configuration.
   - `qa_agent/prompts.py` holds the prompt templates used by each step, which is important for keeping agent behavior consistent and reproducible.
   - This separation makes the prompt logic a first-class architectural component rather than scattering prompts throughout the code.

7. **Shared data and artifacts**
   - `qa_agent/models.py` likely defines the shared schemas/structures passed between steps.
   - `qa_agent/prd.py` and `qa_agent/source.py` suggest requirement normalization and document/source ingestion.
   - `source.py` is especially important because the README says the app supports `.pdf` and `.docx` uploads in addition to plain text user stories.

8. **Eventing and UI feedback loop**
   - `qa_agent/events.py` is the bridge between backend execution and live UI progress.
   - The architecture likely emits step-level status/events so Streamlit can show what the agents are doing in real time.
   - This keeps long-running LLM/test execution observable without coupling the UI to internal step logic.

9. **Execution boundary with Playwright/Pytest**
   - The generated tests are Python `pytest-playwright` tests, and execution happens in the test runtime rather than inside the LLM layer.
   - `conftest.py`, `pytest.ini`, and `requirements.txt` indicate the repo uses Pytest configuration and fixtures to control browser/test behavior.
   - The README notes Chrome/local browser use and Playwright browser installation, so the execution subsystem depends on local browser automation infrastructure.

10. **Healing loop**
   - A key architectural feature is the feedback loop from `executor.py` back into `healer.py`.
   - When tests fail, failure logs are analyzed and the code is rewritten, with the README stating up to 3 repair attempts.
   - This makes the system a closed-loop agent pipeline rather than a one-shot code generator.

11. **Outputs and persistence**
   - The main outputs are a structured QA plan, generated test code, execution results, and `final_qa_report.md`.
   - The architecture appears file-artifact oriented: intermediate reasoning is transformed into generated code and markdown reports rather than stored in a database.

12. **Configuration and runtime assumptions**
   - `.env.example` and the README indicate OpenAI API key configuration through environment variables.
   - `pyproject.toml`, `uv.lock`, and `pytest.ini` show a Python 3.12+ project with pinned dependencies and test tooling.
   - `CONTEXT.md` likely provides repo-specific operating context for agents or developers, which matters because LLM behavior is highly context-sensitive.

13. **External dependencies that materially affect the design**
   - Streamlit provides the interactive frontend.
   - OpenAI provides the LLM backbone for analysis, planning, code generation, and healing.
   - Playwright/Pytest provide the browser automation and execution engine.
   - The README mentions CrewAI, which suggests the agent workflow may be built on a crew-style multi-agent orchestration pattern even if the repo abstracts most of that behind its own step modules.

14. **How to draw the architecture**
   - A useful diagram would show:
     - User input/doc upload into Streamlit
     - Source extraction/PRD normalization
     - Orchestrated agent chain
     - LLM/prompt layer feeding each step
     - Test generation into Pytest/Playwright execution
     - Failure feedback into the healer loop
     - Final report generation back to the UI
   - The critical boundary is between “reasoning/generation” and “deterministic execution,” with events connecting both back to the UI.

Main entry points: [`qa_agent/steps/orchestrator.py`](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/orchestrator.py) (Step orchestrator), [`qa_agent/pipeline.py`](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/pipeline.py) (Pipeline), [`qa_agent/llm.py`](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/llm.py) (LLM layer), [`qa_agent/steps/healer.py`](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/healer.py) (Healer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["UI"]
  node_home["Streamlit app<br/>ui<br/>[Home.py]"]
end

subgraph group_core["Core pipeline"]
  node_pipeline["Pipeline<br/>orchestrator<br/>[pipeline.py]"]
  node_orch["Step orchestrator<br/>coordination<br/>[orchestrator.py]"]
  node_events(("Event bus<br/>progress events<br/>[events.py]"))
  node_llm["LLM layer<br/>model access<br/>[llm.py]"]
  node_prompts["Prompts<br/>prompt library<br/>[prompts.py]"]
  node_models["Schemas<br/>data models<br/>[models.py]"]
  node_source["Source ingest<br/>document ingest<br/>[source.py]"]
  node_prd["PRD normalizer<br/>requirements model<br/>[prd.py]"]
end

subgraph group_steps["Step agents"]
  node_explorer["Explorer<br/>step agent<br/>[explorer.py]"]
  node_inquirer["Inquirer<br/>step agent<br/>[inquirer.py]"]
  node_analyst["Analyst<br/>step agent<br/>[analyst.py]"]
  node_designer["Designer<br/>step agent<br/>[designer.py]"]
  node_coder["Coder<br/>step agent<br/>[coder.py]"]
  node_executor["Executor<br/>step agent<br/>[executor.py]"]
  node_validator["Validator<br/>step agent<br/>[validator.py]"]
  node_healer["Healer<br/>repair agent<br/>[healer.py]"]
  node_reporter["Reporter<br/>report agent<br/>[reporter.py]"]
end

subgraph group_runtime["Execution runtime"]
  node_pytest["Pytest-Playwright<br/>test runtime<br/>[conftest.py]"]
end

subgraph group_ops["Ops"]
  node_config["Config & deps<br/>project config<br/>[pyproject.toml]"]
  node_eval["Eval scripts<br/>smoke/eval<br/>[run_eval.py]"]
end

node_home -->|"starts"| node_pipeline
node_home -->|"subscribes"| node_events
node_pipeline -->|"ingests"| node_source
node_source -->|"normalizes"| node_prd
node_pipeline -->|"coordinates"| node_orch
node_orch -->|"runs"| node_explorer
node_orch -->|"runs"| node_inquirer
node_orch -->|"runs"| node_analyst
node_orch -->|"runs"| node_designer
node_orch -->|"runs"| node_coder
node_orch -->|"runs"| node_executor
node_orch -->|"runs"| node_validator
node_orch -->|"runs"| node_healer
node_orch -->|"runs"| node_reporter
node_explorer -->|"uses"| node_llm
node_inquirer -->|"uses"| node_llm
node_analyst -->|"uses"| node_llm
node_designer -->|"uses"| node_llm
node_coder -->|"uses"| node_llm
node_healer -->|"uses"| node_llm
node_reporter -->|"uses"| node_llm
node_pipeline -->|"loads"| node_prompts
node_pipeline -->|"passes"| node_models
node_pipeline -->|"emits"| node_events
node_executor -->|"executes"| node_pytest
node_executor -->|"reports"| node_validator
node_validator -->|"fails to"| node_healer
node_healer -->|"rewrites"| node_coder
node_reporter -->|"returns"| node_home
node_eval -->|"checks"| node_pipeline
node_config -->|"configures"| node_pytest
node_config -->|"configures"| node_llm

click node_home "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/Home.py"
click node_pipeline "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/pipeline.py"
click node_orch "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/orchestrator.py"
click node_events "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/events.py"
click node_llm "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/llm.py"
click node_prompts "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/prompts.py"
click node_models "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/models.py"
click node_source "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/source.py"
click node_prd "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/prd.py"
click node_explorer "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/explorer.py"
click node_inquirer "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/inquirer.py"
click node_analyst "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/analyst.py"
click node_designer "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/designer.py"
click node_coder "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/coder.py"
click node_executor "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/executor.py"
click node_validator "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/validator.py"
click node_healer "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/healer.py"
click node_reporter "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/reporter.py"
click node_pytest "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/conftest.py"
click node_config "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/pyproject.toml"
click node_eval "https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/run_eval.py"

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_home toneBlue
class node_pipeline,node_orch,node_events,node_llm,node_prompts,node_models,node_source,node_prd toneAmber
class node_explorer,node_inquirer,node_analyst,node_designer,node_coder,node_executor,node_validator,node_healer,node_reporter toneMint
class node_pytest toneRose
class node_config,node_eval toneIndigo
```

## Components

### UI

User-facing control and monitoring surface

- [Streamlit app](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/Home.py): ui · User-facing control plane for entering requirements and viewing progress/results · `Home.py`

### Core pipeline

LLM-driven orchestration and shared artifacts

- [Pipeline](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/pipeline.py): orchestrator · End-to-end coordinator for the autonomous QA workflow · `qa_agent/pipeline.py`
- [Step orchestrator](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/orchestrator.py): coordination · Manages step sequencing and handoffs between agents · `qa_agent/steps/orchestrator.py`
- [Event bus](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/events.py): progress events · Emits step-level status and progress for live UI updates · `qa_agent/events.py`
- [LLM layer](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/llm.py): model access · Central wrapper for model calls and provider configuration · `qa_agent/llm.py`
- [Prompts](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/prompts.py): prompt library · Shared prompt templates used across the agent stages · `qa_agent/prompts.py`
- [Schemas](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/models.py): data models · Shared structures passed between pipeline stages · `qa_agent/models.py`
- [Source ingest](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/source.py): document ingest · Normalizes user stories and uploaded source documents into pipeline input · `qa_agent/source.py`
- [PRD normalizer](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/prd.py): requirements model · Converts raw inputs into a structured product-requirements view · `qa_agent/prd.py`

### Step agents

Staged reasoning, generation, execution, repair, and reporting

- [Explorer](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/explorer.py): step agent · Discovers and normalizes the problem space from input · `qa_agent/steps/explorer.py`
- [Inquirer](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/inquirer.py): step agent · Infers or requests missing requirements and clarifications · `qa_agent/steps/inquirer.py`
- [Analyst](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/analyst.py): step agent · Turns requirements into a structured QA analysis · `qa_agent/steps/analyst.py`
- [Designer](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/designer.py): step agent · Produces the test strategy and execution plan · `qa_agent/steps/designer.py`
- [Coder](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/coder.py): step agent · Generates Playwright-based pytest code · `qa_agent/steps/coder.py`
- [Executor](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/executor.py): step agent · Runs generated tests in the browser automation runtime · `qa_agent/steps/executor.py`
- [Validator](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/validator.py): step agent · Checks outputs and run results against expectations · `qa_agent/steps/validator.py`
- [Healer](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/healer.py): repair agent · Analyzes failures and rewrites tests to fix bad assumptions or locators · `qa_agent/steps/healer.py`
- [Reporter](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/qa_agent/steps/reporter.py): report agent · Compiles the final QA report from the pipeline artifacts · `qa_agent/steps/reporter.py`

### Execution runtime

Deterministic test execution and supporting fixtures

- [Pytest-Playwright](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/conftest.py): test runtime · Deterministic execution boundary for generated browser tests · `conftest.py`

### Ops

Evaluation, smoke checks, and project runtime configuration

- [Config & deps](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/pyproject.toml): project config · Environment, dependency, and test runner configuration · `pyproject.toml`
- [Eval scripts](https://github.com/gouravbanerjee937/qaclaudecodeagent/blob/main/run_eval.py): smoke/eval · Non-UI scripts for evaluation and pipeline smoke checks · `run_eval.py`

## Connections

- Streamlit app → Pipeline: starts · UI triggers the autonomous QA workflow
- Streamlit app → Event bus: subscribes · UI receives live progress updates
- Pipeline → Source ingest: ingests · Pipeline accepts user story or uploaded documents
- Source ingest → PRD normalizer: normalizes · Source material is converted into a structured requirement view
- Pipeline → Step orchestrator: coordinates · Main pipeline delegates sequencing to the step orchestrator
- Step orchestrator → Explorer: runs · Initial discovery and normalization stage
- Step orchestrator → Inquirer: runs · Clarification and gap-filling stage
- Step orchestrator → Analyst: runs · Requirement analysis stage
- Step orchestrator → Designer: runs · Test strategy design stage
- Step orchestrator → Coder: runs · Test code generation stage
- Step orchestrator → Executor: runs · Execution stage for generated tests
- Step orchestrator → Validator: runs · Validation stage for outputs and results
- Step orchestrator → Healer: runs · Failure repair stage
- Step orchestrator → Reporter: runs · Final report assembly stage
- Explorer → LLM layer: uses · Agent reasoning is driven by model calls
- Inquirer → LLM layer: uses · Agent reasoning is driven by model calls
- Analyst → LLM layer: uses · Agent reasoning is driven by model calls
- Designer → LLM layer: uses · Agent reasoning is driven by model calls
- Coder → LLM layer: uses · Agent reasoning is driven by model calls
- Healer → LLM layer: uses · Agent reasoning is driven by model calls
- Reporter → LLM layer: uses · Agent reasoning is driven by model calls
- Pipeline → Prompts: loads · Shared templates shape agent behavior
- Pipeline → Schemas: passes · Structured artifacts move between stages
- Pipeline → Event bus: emits · Pipeline emits status for the UI
- Executor → Pytest-Playwright: executes · Generated tests run in the Pytest-Playwright boundary
- Executor → Validator: reports · Execution results feed validation
- Validator → Healer: fails to · Validation failures trigger repair attempts
- Healer → Coder: rewrites · Healer sends corrected code back through generation
- Reporter → Streamlit app: returns · Final QA report is shown in the UI
- Eval scripts → Pipeline: checks · Helper scripts exercise the pipeline outside the UI
- Config & deps → Pytest-Playwright: configures · Project settings influence test and runtime behavior
- Config & deps → LLM layer: configures · Environment variables and dependency setup support model access
