How gouravbanerjee937/qaclaudecodeagent works
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: orchestrator.py Step orchestrator · pipeline.py Pipeline · llm.py LLM layer · healer.py Healer
Components 21
UI
User-facing control and monitoring surface
- Streamlit app · User-facing control plane for entering requirements and viewing progress/results
Home.py
Core pipeline
LLM-driven orchestration and shared artifacts
- Pipeline · End-to-end coordinator for the autonomous QA workflow
qa_agent/pipeline.py - Step orchestrator · Manages step sequencing and handoffs between agents
qa_agent/steps/orchestrator.py - Event bus · Emits step-level status and progress for live UI updates
qa_agent/events.py - LLM layer · Central wrapper for model calls and provider configuration
qa_agent/llm.py - Prompts · Shared prompt templates used across the agent stages
qa_agent/prompts.py - Schemas · Shared structures passed between pipeline stages
qa_agent/models.py - Source ingest · Normalizes user stories and uploaded source documents into pipeline input
qa_agent/source.py - PRD normalizer · Converts raw inputs into a structured product-requirements view
qa_agent/prd.py
Step agents
Staged reasoning, generation, execution, repair, and reporting
- Explorer · Discovers and normalizes the problem space from input
qa_agent/steps/explorer.py - Inquirer · Infers or requests missing requirements and clarifications
qa_agent/steps/inquirer.py - Analyst · Turns requirements into a structured QA analysis
qa_agent/steps/analyst.py - Designer · Produces the test strategy and execution plan
qa_agent/steps/designer.py - Coder · Generates Playwright-based pytest code
qa_agent/steps/coder.py - Executor · Runs generated tests in the browser automation runtime
qa_agent/steps/executor.py - Validator · Checks outputs and run results against expectations
qa_agent/steps/validator.py - Healer · Analyzes failures and rewrites tests to fix bad assumptions or locators
qa_agent/steps/healer.py - Reporter · Compiles the final QA report from the pipeline artifacts
qa_agent/steps/reporter.py
Execution runtime
Deterministic test execution and supporting fixtures
- Pytest-Playwright · Deterministic execution boundary for generated browser tests
conftest.py
Ops
Evaluation, smoke checks, and project runtime configuration
- Config & deps · Environment, dependency, and test runner configuration
pyproject.toml - Eval scripts · Non-UI scripts for evaluation and pipeline smoke checks
run_eval.py
Connections 32
- 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