Skip to content

Use Garry Tan's exact Claude Code setup: 23 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA

TypeScript
5.9 KB
Raw Blame

/qa: Test → Fix → Verify (web app)

You test a running web app in the browser, fix the bugs you find in source, prove each fix, and write a report. Work through the phases in order. Each phase ends with a named output; do not start the next phase until that output exists.

Phase 0: Inputs

Read these from the user's request. Use the default when a value is not given.

Input Default Example override
URL Detected local app (see Phase 1) https://staging.example.com
Mode Full if a URL is given; Diff-aware on a feature branch with no URL --quick, --regression <baseline.json>
Fix tier Standard --quick (critical+high), --exhaustive (all)
Report dir .gstack/qa-reports/run-<UTC timestamp>/ Output to /tmp/qa

If both --quick and --regression are given, ask the user which mode to run before doing anything else.

Run git status --porcelain. If it prints anything, stop and ask the user to choose: (A) commit current changes first, (B) stash and pop afterwards, (C) abort. Do only what they choose.

Output: the four inputs above, written as the first lines of report.md in the report dir.

Phase 1: Find the app

Use the URL if given. Otherwise try http://localhost:3000, :4000, :8080 in that order and use the first that answers; then any staging/preview URL in the PR description. If none answer, ask the user for a URL and wait.

If the app needs sign-in, ask the user to sign in in the browser and tell you when done. Never ask for or type a password.

Output: the base URL, recorded in report.md.

Phase 2: Choose pages

  • Full: every page reachable from the homepage navigation (cap at 30).
  • Quick: homepage plus the first 5 navigation links.
  • Diff-aware: run git diff <base>...HEAD --name-only; map each changed route, view, component or stylesheet to the pages that use it; add one adjacent page per flow. If nothing maps, use the Quick list.
  • Regression: the Full list, plus every page named in the baseline's issues.

Output: the page list, written to report.md under "Plan" before you open any page.

Phase 3: Explore

For each page on the list:

  1. Open it, take a full-page screenshot (screenshots/page-<name>.png), and record console errors.
  2. Click every primary control, submit each form once with valid data and once empty, and check the empty, loading and error states you can reach.
  3. In Full and Diff-aware modes, repeat step 1 at a 375px-wide viewport.

When something looks wrong, retry it once. If it happens again, it is an issue; if not, note it as "not reproduced" and move on.

Severity (pick the highest that applies):

  • Critical: data loss, security exposure, or the app unusable.
  • High: a main task cannot be finished and there is no workaround.
  • Medium: a task is harder but a workaround exists.
  • Low: cosmetic or wording.

Output: each issue appended to report.md as soon as it is confirmed: ID (ISSUE-001…), title, severity, page URL, steps to reproduce, expected vs actual, and a screenshot path.

Phase 4: Baseline score

Score each category 0-100:

  • Console (15%): 0 unique errors → 100, 1-3 → 70, 4-10 → 40, 11+ → 10.
  • Links (10%): 100 − 15 per unique broken link, floor 0.
  • Functional (20%), UX (15%), Accessibility (15%), Visual (10%), Performance (10%), Content (5%): start at 100; −25 per Critical, −15 per High, −8 per Medium, −3 per Low issue in that category; floor 0.

Each issue counts in one category only. Final score = Σ(score × weight) ÷ Σ(weights of tested categories), rounded half up; mark it provisional and name any untested category. Write baseline.json with date, url, healthScore, issues (id, title, severity), and categoryScores.

In Regression mode, compare with the supplied baseline: list issues fixed (only in the old baseline), new issues (only in this run), and the score delta.

Output: health score and baseline.json.

Phase 5: Fix loop

Fix issues in severity order, only those inside the fix tier (Quick: critical + high; Standard: + medium; Exhaustive: + low). Mark the rest, and anything not fixable from this repository (third-party widgets, infrastructure), as deferred.

For each issue:

  1. Reproduce it again and find the responsible source file(s). Edit only those files.
  2. Write a failing test first if the repo has a test framework: a unit or integration test that sets up the bug's precondition and asserts the correct behavior. Run it and confirm it fails for the bug's reason. Skip this step only for pure CSS fixes or when no framework exists, and say which.
  3. Fix with the smallest change that makes the test pass. No refactors.
  4. Re-test: run the new test, then repeat the original reproduction steps in the browser and take screenshots/issue-NNN-after.png. Check the console.
  5. Classify: verified (test passes and the browser shows the fix), best-effort (fix applied but you could not fully check it, with the reason), or reverted (the fix broke something: undo only your change and mark the issue deferred).
  6. Commit verified and best-effort fixes one per commit with their test: fix(qa): ISSUE-NNN — <title>.

Stop and ask the user whether to continue after 2 reverts, after any edit to a file unrelated to the issue, or after every 10 fixes. Never make more than 30 fixes in one run.

Output: every issue has a status of verified, best-effort, reverted, or deferred.

Phase 6: Final check and report

Re-run Phase 3 on every page you touched in Phase 5, recompute the health score, and warn at the top of the report if it is lower than the baseline.

Finish report.md with:

  • Health score: baseline → final
  • Table of issues: ID, severity, status, commit SHA, test file
  • Deferred issues with the reason
  • One PR line: "QA found N issues, fixed M, health score X → Y."

Output: the completed report.md, baseline.json, and the screenshots/ folder. Tell the user the report path and the PR line.