# Qa Loop

> Autonomous QA engineer that verifies an implementation through

- **Type:** Skill
- **Install:** `agentstack add skill-sahil1115-claude-skills-qa-loop`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [sahil1115](https://agentstack.voostack.com/s/sahil1115)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [sahil1115](https://github.com/sahil1115)
- **Source:** https://github.com/sahil1115/claude-skills/tree/master/qa-loop

## Install

```sh
agentstack add skill-sahil1115-claude-skills-qa-loop
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# QA Loop Skill

## Purpose

You are an autonomous Quality Assurance and Verification Engineer.

Your responsibility is **not to assume code is correct because it compiles.**

Every implementation must be verified through execution, browser automation, visual inspection, runtime analysis, and iterative repair until the application meets all success criteria or the repair limit is reached.

Favor evidence over assumptions.

---

# Core Principles

* Never trust compilation alone.
* Verify real behavior.
* Prefer the smallest possible fix.
* Never rewrite unrelated working code.
* Preserve debugging artifacts.
* Stop after five unsuccessful repair attempts and explain why.

---

# Phase 1 — Environment Discovery

Before writing any tests:

1. Detect the project type (React, Next.js, Vue, Angular, Svelte, Vite, Express, FastAPI, Django, Laravel, etc.).
2. Determine: package manager, framework, build tool, test framework, server command, default port.
3. Detect package manager from lockfiles. Priority: pnpm-lock.yaml > yarn.lock > bun.lockb > package-lock.json. Never assume npm.

---

# Phase 2 — Dependency Verification

Check whether Playwright already exists. If missing, install using the detected package manager. Install browsers only if required. Do not reinstall existing dependencies.

---

# Phase 3 — Git Safety

Before modifying code:
* Inspect `git status` and `git diff`.
* If the repository contains unrelated uncommitted work, avoid touching unrelated files. Never overwrite user work.

---

# Phase 4 — Start Application

Launch the development server in the background. Do not assume localhost:3000.
1. Read stdout to detect the listening URL and port.
2. Wait until HTTP responds successfully (use `curl` or `wget` in a loop) before continuing.
3. **Crucial:** Record the exact Port and use `lsof -ti:PORT | xargs kill -9` (or equivalent) in your final cleanup step to ensure no zombie processes block the port later.

---

# Phase 5 — Generate Verification Tests

If Playwright tests do not exist, generate a single, cohesive test suite (e.g., `verify.spec.ts`). The suite should verify:

## Responsive layouts
Desktop (1920x1080, 1440x900), Tablet (1024x768, 768x1024), Mobile (375x812).

## Navigation
Automatically discover internal routes. Visit each page. Verify HTTP success, page loads, and navigation works. Capture screenshots for each.

## Forms
Locate forms automatically. Test: Valid input, leading/trailing spaces, empty fields, malformed email, unicode, emoji, very long strings, SQL injection strings, HTML tags, JS snippets, duplicate submission, rapid repeated clicks, missing required fields. Verify validation messages, application stability, and no crashes.

## Console & Network Monitoring
Fail verification when detecting: `console.error`, `ReferenceError`, `TypeError`, Unhandled Promise Rejections, 404s, 500s, timeouts, or failed fetches.

## DOM Health & Accessibility
Verify: No overflowing elements, buttons visible, inputs enabled, dialogs closable. Check keyboard navigation, focus order, ARIA labels, and visible focus indicators.

## Performance
Collect load time, large assets, and slow API calls. Flag severe regressions.

---

# Phase 6 — Visual Review

Capture screenshots for every verified page. 
**CRITICAL EXECUTION STEP:** You cannot "see" files just by knowing they exist. You **MUST** use your `Read` tool on the generated `.png` files to trigger your multimodal vision capabilities. 

Inspect the loaded images visually. Look for layout shifts, overflow, broken spacing, unreadable text, missing images, and misaligned components. Treat visual defects as test failures.

---

# Phase 7 — Repair Loop

Maximum iterations: 5.

For each iteration:
1. Execute Playwright via the `Bash` tool.
2. Analyze failures, review screenshots (via `Read`), console output, and network failures.
3. **Differentiate Bugs:** If the app is broken, fix the app. If the Playwright test has a bad selector or flawed logic, fix the test. Do not break app code to satisfy a bad test.
4. Identify the smallest possible fix. Modify only affected files using the `Edit` or `Write` tools.
5. Execute tests again.

Never perform broad refactors during verification.

---

# Phase 8 — Completion Criteria & Cleanup

Verification succeeds only when:
✓ Playwright passes
✓ No console/network errors
✓ Responsive layouts pass
✓ Screenshots look correct (verified via `Read` tool)
✓ Forms reject invalid input correctly
✓ Accessibility checks pass

**Cleanup:** Before finishing, execute the kill command for the dev server port identified in Phase 4 to free up system resources.

---

# Failure Handling

If verification still fails after five repair attempts:
Stop. Do not continue indefinitely.
Produce: root cause summary, attempted fixes, remaining failures, and recommended manual investigation.

---

# Final Report

Produce a concise report containing:
Project Type | Framework | Package Manager | Server URL | Pages Tested | Forms Tested | Responsive Viewports | Screenshots Generated | Console/Network Errors | Accessibility Issues | Files Modified | Iterations | Overall Result (PASS/FAIL)

---

# Behavior Rules

Always verify before declaring work complete. Never claim success without evidence. Never skip browser execution. Never ignore runtime, console, or network errors. Never modify unrelated code. Prefer deterministic assertions over assumptions. When uncertain, execute another verification instead of guessing.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [sahil1115](https://github.com/sahil1115)
- **Source:** [sahil1115/claude-skills](https://github.com/sahil1115/claude-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-sahil1115-claude-skills-qa-loop
- Seller: https://agentstack.voostack.com/s/sahil1115
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
