SA

sneh14/ai-native-qa-automation

Developer tools
11 stars Quality 51 Trend 12

AI-powered multi-agent QA automation system that generates, validates, and optimizes test coverage across the test pyramid using Claude Code.

Overview

Built an AI-powered QA automation platform using — 4 specialized skill agents (scenario generation, test strategy, test generation, code review) that read domain knowledge, live source code, and business rules before producing output; generated (unit / API / component / E2E) for a full-stack application. - Reduced manual test design effort by using specialized AI agents to generate scenarios, assign the right test layer, and produce executable tests. - Improved test relevance by grounding generation in business rules, live source code, UI selectors, API contracts, and existing tests. - Enforced a healthy test pyramid by distributing coverage across unit, API, component, and E2E layers instead of overloading UI tests. - Increased confidence in critical workflows such as authentication, booking rules, seat allocation, and cross-user security through specification-driven validation. Most AI-assisted testing tools generate generic tests in isolation. This project is different.

README

🤖 AI-Native QA Automation Platform

Built an AI-powered QA automation platform using Claude Code multi-agent orchestration — 4 specialized skill agents (scenario generation, test strategy, test generation, code review) that read domain knowledge, live source code, and business rules before producing output; generated 53 test scenarios stratified across a proper test pyramid (unit / API / component / E2E) for a full-stack Next.js + Express + MySQL application.

Built by Snehal Patil · Senior SDET / AI-Native QA Automation Engineer


Business Impact

  • Reduced manual test design effort by using specialized AI agents to generate scenarios, assign the right test layer, and produce executable tests.
  • Improved test relevance by grounding generation in business rules, live source code, UI selectors, API contracts, and existing tests.
  • Enforced a healthy test pyramid by distributing coverage across unit, API, component, and E2E layers instead of overloading UI tests.
  • Increased confidence in critical workflows such as authentication, booking rules, seat allocation, and cross-user security through specification-driven validation.

What is this?

Most AI-assisted testing tools generate generic tests in isolation. This project is different.

EventHub is a production-quality ticket booking application used as a live system under test. On top of it sits a Claude Code multi-agent QA framework where 4 specialized AI agents collaborate in sequence — each reading domain knowledge, business rules, and actual source code before producing any output.

The result: structured test scenarios, a rationalized test pyramid, self-validating Playwright tests, and AI-driven code review — all grounded in real application behavior, not guesswork.


The 4 agents

.claude/skills/
├── create-scenarios/    AI Functional Tester    — generates 53 scenarios across 6 thinking lenses
├── test-strategy/       AI Test Architect       — assigns pyramid layers with source-traced rationale
├── generate-tests/      AI Test Engineer        — writes, runs, diagnoses, and fixes Playwright tests
└── review-tests/        AI Code Reviewer        — audits tests against standards, selectors, domain rules

Agent pipeline

/create-scenarios 
         │
         ▼
  docs/test-scenarios.md        53 scenarios · 6 categories · traced to business rules
         │
         ▼
/test-strategy 
         │
         ▼
  docs/test-strategy.md         layer assignments · rationale · anti-pattern flags
         │
         ▼
/generate-tests 
         │
         ├── reads domain knowledge + source code
         ├── writes test file
         ├── runs tests in real browser (Playwright MCP)
         ├── diagnoses failures: error message + live DOM + source code
         └── fixes and re-runs until green
         │
         ▼
/review-tests 
         │
         └── cross-references best practices · verifies selectors in source · checks domain assertions

What each agent reads before producing output

Agents don’t guess. Each follows a structured read-chain:

Knowledge source What it contains Which agents use it
eventhub-domain/SKILL.md Overview, data models, architecture All 4
eventhub-domain/business-rules.md FIFO pruning, seat atomicity, booking ref format, refund logic All 4
eventhub-domain/user-flows.md Preconditions, step-by-step flows, expected outcomes create-scenarios, generate-tests
eventhub-domain/ui-selectors.md Full data-testid map for Playwright locators generate-tests, review-tests
eventhub-domain/api-reference.md Endpoints, error codes, response shapes test-strategy, generate-tests
playwright-best-practices/SKILL.md Locator priority, assertion patterns, anti-patterns generate-tests, review-tests
frontend/app/ + frontend/components/ Live source — verify selectors actually exist generate-tests, review-tests
backend/src/services/ Business logic functions — justify unit/API layer decisions test-strategy
tests/*.spec.js Existing tests — match patterns and conventions generate-tests, review-tests

Test coverage produced

53 scenarios generated by /create-scenarios, stratified by /test-strategy into a proper test pyramid:

Layer Count Focus
Unit 5 Pure functions — randomRef(), price calc, ref uniqueness retry
API / Integration 22 Backend contracts, auth enforcement, business rules, DB state
Component 14 UI states, conditional rendering, mocked API responses
E2E 12 Critical user journeys, multi-page flows, cross-session security
Total 53

Pyramid shape: Unit (5) → API (22) → Component (14) → E2E (12) ✓

Scenarios follow a structured taxonomy:

TC range Category
TC-001–099 Happy path
TC-100–199 Business rules
TC-200–299 Security
TC-300–399 Negative / error
TC-400–499 Edge cases
TC-500–599 UI state

Defense-in-depth: critical rules covered at multiple layers

Rule Unit API Component E2E
Booking ref prefix = event title’s first character ✓ ✓ — ✓
Total price = price × quantity ✓ ✓ — implicit
Refund eligible only for qty = 1 — — ✓ —
Cross-user booking access returns 403 — ✓ — ✓
Cancel booking: data deleted, redirect shown — ✓ — ✓
FIFO pruning at 9-booking limit — ✓ — —
Auth required on all booking endpoints — ✓ — —

Anti-patterns the /test-strategy agent flagged and avoided

Anti-pattern Correct layer instead
Testing input validation (qty = 0, qty > 10) at E2E API — POST /api/bookings → assert 400
Testing 4-second refund spinner at E2E (login + navigate + wait) Component — render with mocked quantity prop
Testing FIFO pruning at E2E (requires 9 pre-seeded bookings) API — precise DB setup per test
Testing “Booking not found” by navigating to /bookings/99999 at E2E Component — mock isError=true via route interception
Testing 401 responses by manipulating UI session API — send requests without Authorization header

The system under test

EventHub is a real, production-quality ticket booking application. It gives the agents meaningful complexity: layered architecture, business rules with edge cases, security boundaries, and client-side state machines.

Tech stack

Layer Technology
Frontend Next.js 14 (App Router), React 18, TypeScript, Tailwind CSS, React Query v5
Backend Node.js, Express.js, Prisma ORM, Swagger UI
Database MySQL 8
Auth JWT (7-day expiry), bcryptjs
Testing Playwright E2E — Chromium

Business rules baked into the agents’ domain knowledge

  • Booking limit: max 9 per user — FIFO pruning on overflow; oldest booking deleted first, with same-event fallback that permanently burns a seat
  • Booking reference format: [FIRST_CHAR_OF_EVENT_TITLE]-[6_RANDOM_ALPHANUM] — validated at unit + API + E2E layers for defense-in-depth
  • Seat atomicity: seat count decrements on booking, restores on cancellation
  • Refund eligibility: client-side only — qty = 1 is eligible, qty > 1 is not; 4-second simulated check with spinner state machine
  • Security boundary: cross-user booking access returns 403 Access Denied — enforced at service layer, validated at API and E2E layers
  • Event limit: max 6 user-created events — FIFO pruning on overflow
  • Static events: seeded events are immutable — cannot be edited or deleted

Application pages

Page Path
Home /
Events list /events
Event detail + booking /events/:id
My bookings /bookings
Booking detail /bookings/:id
Admin — events /admin/events
Admin — bookings /admin/bookings

Project structure

eventhub/
│
├── .claude/skills/
│   ├── create-scenarios/SKILL.md     ← Scenario generation agent
│   ├── test-strategy/SKILL.md        ← Pyramid assignment agent
│   ├── generate-tests/SKILL.md       ← Test writing + self-healing debug agent
│   ├── review-tests/SKILL.md         ← Code review agent
│   ├── eventhub-domain/              ← Domain knowledge (rules, flows, selectors, API)
│   │   ├── SKILL.md
│   │   ├── business-rules.md
│   │   ├── user-flows.md
│   │   ├── ui-selectors.md
│   │   └── api-reference.md
│   └── playwright-best-practices/    ← Coding standards enforced by all agents
│
├── docs/
│   ├── test-scenarios.md             ← 53 generated scenarios (output of /create-scenarios)
│   └── test-strategy.md              ← Layer assignments + rationale (output of /test-strategy)
│
├── tests/
│   └── booking-management.spec.js    ← Playwright E2E suite (output of /generate-tests)
│
├── frontend/                         ← Next.js 14 app (port 3000)
├── backend/                          ← Express API (port 3001)
│   └── src/
│       ├── services/                 ← Business logic — agents read this to assign unit/API layers
│       ├── routes/
│       ├── controllers/
│       ├── repositories/
│       └── validators/
├── playwright.config.ts
└── CLAUDE.md                         ← Project conventions for Claude Code

Running locally

Prerequisites

  • Node.js 18+
  • MySQL 8+

Setup

# Clone and install
git clone 
cd eventhub
npm run setup

# Create the database
mysql -u root -p -e "CREATE DATABASE eventhub CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"

# Configure environment
# backend/.env:
#   DATABASE_URL="mysql://root:your_password@localhost:3306/eventhub"
#   PORT=3001
#   NODE_ENV=development
#   CORS_ORIGIN=http://localhost:3000
#
# frontend/.env.local:
#   NEXT_PUBLIC_API_URL=http://localhost:3001/api

# Push schema and seed data
npm run db:push
npm run seed

# Start both servers
npm run dev
Service URL
Frontend http://localhost:3000
Backend API http://localhost:3001
Swagger UI http://localhost:3001/api/docs

Running the tests

npm run test                                                          # all tests, headless
npm run test:ui                                                       # Playwright UI mode
npx playwright test tests/booking-management.spec.js --reporter=line # single file

Using the agents

With Claude Code installed and this repo open:

/create-scenarios booking-flow      # generate structured test scenarios
/test-strategy booking              # assign pyramid layers with rationale
/generate-tests booking-flow        # write, run, debug, and fix Playwright tests
/review-tests tests/booking-management.spec.js   # audit against standards and domain rules

Each agent reads its full knowledge chain before producing a single line of output.


API reference

Base URL: http://localhost:3001

Method Endpoint Description
GET /api/health API status + DB connection
GET /api/events List events — paginated, filterable by category / city / search
GET /api/events/:id Single event
POST /api/events Create event
PUT /api/events/:id Update event
DELETE /api/events/:id Delete event (cascades bookings)
GET /api/bookings List bookings — paginated
GET /api/bookings/:id Single booking
GET /api/bookings/ref/:ref Lookup by booking reference code
POST /api/bookings Create booking — atomically decrements available seats
DELETE /api/bookings/:id Cancel booking — atomically restores seats

Scripts

Script What it does
npm run dev Start frontend + backend concurrently
npm run setup Install npm deps in both /backend and /frontend
npm run seed Insert 10 sample events
npm run test Run all Playwright tests headless
npm run test:ui Playwright UI mode
npm run db:push Push Prisma schema to DB (no migration files)
npm run migrate Run prisma migrate dev — interactive
npm run build Build Next.js frontend for production
View the full README on GitHub

Recommended Tools

Try a different keyword or remove a filter.

Install

npx skillfish add sneh14/ai-native-qa-automation
New to MCP? Start with the mcpskill.org guide →