293 lines
17 KiB
Markdown
293 lines
17 KiB
Markdown
---
|
||
name: frontend-visual-qa
|
||
description: Use when Codex needs to verify or improve the user-visible quality of a web frontend after implementation, especially React applications; when the task involves exercising real routes and workflows, responsive layout, forms, navigation, loading/error/empty states, browser console and network failures, accessibility basics, visual regressions, or comparing implementation against an approved design/source of truth. This skill is for evidence-based QA and narrowly scoped fixes, not unsolicited redesign.
|
||
---
|
||
|
||
# Frontend Visual QA
|
||
|
||
Version: **2.0**.
|
||
|
||
Verify the frontend as a user experiences it. Do not declare a UI task complete merely because tests, lint, or `npm build` pass. Exercise the relevant routes and workflows in a browser-capable environment when available, inspect visual/runtime evidence, fix only confirmed in-scope defects, re-check the affected states, and report what was and was not verified.
|
||
|
||
This skill is designed to compose with `bortstack-context` and `webapp-feature`/`webapp-debug`. The context skill owns project/task/decision/handoff semantics. Feature/debug skills own implementation/root-cause workflow. This skill owns **frontend experiential verification**.
|
||
|
||
## Repository workflow
|
||
|
||
In a BortStack project, use `bortstack-context` with the applicable repository `AGENTS.md` before task work. They govern scope and authorisation, branch/worktree policy, lifecycle, manual acceptance, and handoff. Find the maintained overview, current state, decisions, task and handoff records through repository instructions and layout. Use the paths and task IDs the project already uses. Follow context's canonical discussion, mission and lifecycle guidance when interpreting authority or changing task status. If a required BortStack skill is unavailable, report the dependency. If an installed skill lacks a required reference, use the reference from a verified Forge package with a matching manifest. If the required guidance is unavailable, pause the affected action.
|
||
|
||
For edits, inspect Git status and worktrees, confirm authorised scope and the source candidate, and follow the current branch policy. Use direct integration-branch work where authorised and a dedicated branch/worktree where required. Preserve unrelated work. Read-only specialist work does not require a new worktree. When acting as an authorised contributor, use `bortstack-contributor` for contributor permissions, finalisation and submission. For ordinary specialist work, use the project's normal authority.
|
||
|
||
When manual testing is relevant, discover the documented commands, configuration and hooks in the target repository. Use its supported workflow, including an existing `testtask` wrapper and its project-specific config or hook where documented. Preserve a working adapter and its supported invocation. Before use, inspect its supported arguments, candidate handling, runtime and cleanup behavior. If no adapter is required, use the established development environment. Record candidate identity, actual checks, limitations and pending human acceptance in the project's handoff. Refresh stale candidates after edits and make fixes in the authoritative source. A source snapshot, wrapper, automated check or startup alone does not establish a manual pass. Follow context and repository rules for task transitions and closure.
|
||
|
||
Outside BortStack, follow the repository's own scope, branch, test and reporting conventions and proceed with the specialist workflow. BortStack skills and records are optional there.
|
||
|
||
## Core rules
|
||
|
||
1. **Read repository instructions and design context first.** Obey `AGENTS.md`, project context, existing design-system/component/layout docs, task acceptance criteria, screenshots/mockups explicitly approved by the user, and repository-specific frontend validation commands.
|
||
2. **Preserve the approved design.** Visual QA is not permission to redesign, restyle, modernize, simplify, or add controls/content that were not requested.
|
||
3. **Exercise the real UI when practical.** Prefer a browser against the actual local/test app over reasoning solely from JSX/CSS or successful builds.
|
||
4. **Verify states, not just pages.** Check relevant default, loading, empty, populated, validation-error, server-error, disabled, success, authenticated/unauthenticated, expanded/collapsed, and responsive states where the workflow supports them.
|
||
5. **Check runtime evidence.** Browser console errors, failed network requests, uncaught exceptions, broken assets, hydration/runtime warnings, and API failures are QA findings even when the layout looks correct.
|
||
6. **Use representative viewports.** At minimum test the task's supported desktop and narrow/mobile layouts when responsive behavior is relevant; include tablet/intermediate widths when the layout has breakpoint-sensitive composition.
|
||
7. **Fix only evidence-backed, in-scope defects.** Do not perform opportunistic design polish or component refactors while checking one feature.
|
||
8. **Respect visual source-of-truth order.** Approved project screenshots/design docs/user decisions outrank generic aesthetic preference. Existing working conventions outrank invented alternatives.
|
||
9. **Do not hide application defects with CSS.** Trace functional failures to the appropriate frontend/backend layer and hand off to `webapp-debug` when root cause is not a visual implementation issue.
|
||
10. **Accessibility checks are practical, not ceremonial.** Verify keyboard reachability, labels/names, focus visibility, semantic controls, obvious contrast/readability, and basic screen-size robustness when relevant. Do not claim formal WCAG compliance unless it was actually audited.
|
||
11. **Capture before/after evidence where tooling permits.** Screenshots, DOM/state observations, console/network evidence, and exact reproduction steps are preferable to vague statements such as “looks good”.
|
||
12. **Re-run the exact failing state after a fix.** Then run relevant automated frontend checks/builds.
|
||
13. **Do not commit, push, deploy, switch branches, or start another task unless explicitly requested.**
|
||
14. **Report limitations honestly.** If no browser/runtime is available, say the visual portion was not verified; static inspection/build success is not equivalent.
|
||
|
||
## Establish the QA contract
|
||
|
||
Before changing anything, determine:
|
||
|
||
- the route(s), component(s), and workflow(s) in scope;
|
||
- the accepted visual/design source of truth, if any;
|
||
- supported viewport/breakpoint expectations;
|
||
- required authentication/data state;
|
||
- which interaction states matter to the task;
|
||
- whether visual fixes are authorized or the task is verification-only;
|
||
- what automated checks exist for the frontend;
|
||
- what evidence will count as passing.
|
||
|
||
If a task says only “check the frontend”, inspect project context and the changed feature to narrow the smallest useful QA surface rather than browsing the whole application indefinitely.
|
||
|
||
When design fidelity is in scope, use the project’s approved design reference and version. In BortStack, use the `bortstack-design` handoff when applicable and respect any recorded override. Report fidelity as unverified when no comparison reference is available. Verify the exact implementation independently in the browser, through the real application route and navigation. Send design discrepancies that require a change to the approved direction back through design and context. Keep QA evidence distinct from human acceptance.
|
||
|
||
## 1. Inspect before launching
|
||
|
||
Read the relevant implementation and project conventions:
|
||
|
||
- route definitions and page/component entry points;
|
||
- shared layout/header/footer/navigation components;
|
||
- CSS/SCSS modules, tokens, variables, design-system docs;
|
||
- reusable form/input/button/card/table/modal components;
|
||
- relevant context/store/API-client code;
|
||
- existing component/frontend tests;
|
||
- environment/start/build commands;
|
||
- approved screenshots/mockups or design docs if present.
|
||
|
||
Identify expected content and responsive behavior from repository evidence. Do not infer requirements from fashionable UI patterns.
|
||
|
||
## 2. Start the app using repository conventions
|
||
|
||
Identify the exact build or working-tree candidate, including intended untracked changes where applicable. If using a repository test snapshot, verify that it reflects that candidate and refresh it before retesting fixes.
|
||
|
||
Use the project's documented local/test workflow. Prefer existing scripts/Compose/dev-server commands rather than inventing a new environment.
|
||
|
||
Before visual inspection, establish that:
|
||
|
||
- frontend loads without fatal runtime errors;
|
||
- required backend/API dependencies are available or intentionally mocked by repository convention;
|
||
- the intended route can be reached;
|
||
- required fixture/test data or account state can be established safely.
|
||
|
||
Do not mutate production data or use real credentials merely to perform visual QA.
|
||
|
||
If the runtime cannot be started, continue with available automated/static checks but report **browser visual QA blocked** rather than claiming the UI passed.
|
||
|
||
## 3. Exercise the workflow
|
||
|
||
Follow the user journey, not just the DOM structure.
|
||
|
||
For each in-scope workflow, verify as applicable:
|
||
|
||
- page entry/navigation;
|
||
- primary action;
|
||
- form entry and submission;
|
||
- client-side validation;
|
||
- backend/API validation rendering;
|
||
- loading/progress behavior;
|
||
- success confirmation and resulting state;
|
||
- empty state;
|
||
- populated/list/detail state;
|
||
- error/retry state;
|
||
- modal/dropdown/accordion/tab interactions;
|
||
- destructive-action confirmation;
|
||
- authentication/authorization presentation;
|
||
- back/refresh/deep-link behavior where relevant.
|
||
|
||
Check browser console and network activity during the workflow, not only after it.
|
||
|
||
Use `references/state-matrix.md` to avoid forgetting relevant states.
|
||
|
||
## 4. Check responsive layout deliberately
|
||
|
||
Do not equate “responsive” with “nothing visibly overflows at one phone width”.
|
||
|
||
At relevant widths inspect:
|
||
|
||
- horizontal overflow and clipped content;
|
||
- navigation collapse/wrapping;
|
||
- page gutters and container widths;
|
||
- grids/cards/tables/forms stacking behavior;
|
||
- controls that become too narrow or overlap;
|
||
- typography wrapping/truncation;
|
||
- images/media aspect ratios;
|
||
- fixed/sticky elements covering content;
|
||
- modal/dropdown boundaries;
|
||
- long labels, validation messages, and realistic content;
|
||
- touch-target usability on narrow screens;
|
||
- vertical spacing that breaks when content wraps.
|
||
|
||
Prefer representative widths around the application's actual breakpoints. If none are documented, use a sensible broad desktop, intermediate/tablet, and narrow mobile sample and state what was tested.
|
||
|
||
Do not add new breakpoints unless evidence shows the current responsive contract cannot satisfy the task.
|
||
|
||
## 5. Check visual consistency against project conventions
|
||
|
||
Inspect only within the approved design language:
|
||
|
||
- typography hierarchy;
|
||
- spacing rhythm;
|
||
- alignment;
|
||
- component variants;
|
||
- button hierarchy;
|
||
- form-label/help/error treatment;
|
||
- card/table/list consistency;
|
||
- icon usage;
|
||
- loading/empty/error presentation;
|
||
- header/footer/layout alignment;
|
||
- light/dark theme behavior if the project supports themes.
|
||
|
||
A difference is not a defect simply because you prefer another style. Record a visual defect when it conflicts with accepted design evidence, causes usability/readability problems, or is internally inconsistent with established components.
|
||
|
||
## 6. Check browser/runtime health
|
||
|
||
During visual QA inspect, when tooling exposes them:
|
||
|
||
### Console
|
||
|
||
Look for:
|
||
|
||
- uncaught exceptions;
|
||
- React runtime warnings relevant to the workflow;
|
||
- missing-key or lifecycle/effect warnings introduced by the change;
|
||
- failed asset/module loads;
|
||
- accessibility/runtime warnings from existing tooling;
|
||
- repeated errors caused by render/request loops.
|
||
|
||
Do not fail a task solely for unrelated pre-existing warnings. Separate new/relevant findings from known baseline noise.
|
||
|
||
### Network
|
||
|
||
Check relevant requests for:
|
||
|
||
- unexpected 4xx/5xx responses;
|
||
- wrong URL/method/query/payload;
|
||
- requests firing repeatedly or not at all;
|
||
- unauthenticated/authorization failures;
|
||
- stale or incorrect response rendering;
|
||
- broken asset/font/image requests;
|
||
- CORS/CSRF/token problems;
|
||
- user actions that appear successful despite request failure.
|
||
|
||
If the UI defect originates in backend/auth/data behavior, switch to or recommend `webapp-debug`; do not mask it with frontend presentation changes.
|
||
|
||
## 7. Check practical accessibility basics
|
||
|
||
For relevant interactions, verify:
|
||
|
||
- interactive elements are actual semantic controls where practical;
|
||
- keyboard users can reach and activate primary interactions;
|
||
- focus remains visible and logically placed;
|
||
- form fields have associated accessible names/labels;
|
||
- validation/error messages are understandable and associated with the action/field where feasible;
|
||
- icon-only controls have an accessible name;
|
||
- dialogs/modals do not create obvious keyboard traps or lose focus catastrophically;
|
||
- headings/page landmarks are reasonably structured;
|
||
- content remains readable at narrow widths/zoom-like conditions;
|
||
- obvious color-only state communication has another cue where the project convention permits.
|
||
|
||
Automated accessibility tooling can supplement this, but do not claim comprehensive accessibility compliance from a quick scan.
|
||
|
||
Use `references/accessibility-basics.md` as a lightweight checklist.
|
||
|
||
## 8. Classify findings before editing
|
||
|
||
For each finding, classify it as one of:
|
||
|
||
- **Functional runtime defect** — action/request/state is wrong; often route to debugging workflow.
|
||
- **Visual/layout defect** — presentation violates task/design contract or impairs use.
|
||
- **Responsive defect** — presentation fails at supported width/state.
|
||
- **Accessibility defect** — basic interaction/name/focus/semantic problem.
|
||
- **Design discrepancy** — implementation differs from an explicit approved source of truth.
|
||
- **Pre-existing unrelated issue** — record/report without silently expanding scope.
|
||
- **Unable to verify** — environment/data/tooling prevented confirmation.
|
||
|
||
Prioritize blockers to the task's core workflow over cosmetic inconsistencies.
|
||
|
||
## 9. Make the smallest authorized fix
|
||
|
||
When fixes are in scope:
|
||
|
||
- reuse existing components/tokens/layout conventions;
|
||
- change the narrowest CSS/component/state code that explains the defect;
|
||
- preserve API/domain behavior unless that behavior is the actual defect;
|
||
- avoid global CSS changes for a local problem unless the shared primitive itself is proven wrong;
|
||
- avoid arbitrary pixel nudges that only work at the tested viewport;
|
||
- test realistic long/empty/error content after layout fixes;
|
||
- do not redesign adjacent pages for consistency unless explicitly included in scope.
|
||
|
||
If the correct fix requires a product/design decision not already established, stop at the decision boundary and present the concrete alternatives/evidence.
|
||
|
||
## 10. Re-verify after fixes
|
||
|
||
For every fixed finding:
|
||
|
||
1. repeat the exact reproduction at the viewport/state where it failed;
|
||
2. check neighboring responsive widths/states for regressions;
|
||
3. re-run the affected interaction;
|
||
4. check console/network again;
|
||
5. run targeted component/frontend tests;
|
||
6. run repository lint/type/static checks as appropriate;
|
||
7. run the production frontend build when relevant;
|
||
8. run any project-specific visual/E2E checks.
|
||
|
||
Do not substitute an automated build for re-checking a visual defect in a browser.
|
||
|
||
If the project has screenshot/visual-regression tests, update baselines only when the visual change is explicitly intended and approved. Never accept a changed baseline merely to make the test pass.
|
||
|
||
## 11. Update project context appropriately
|
||
|
||
When used with BortStack:
|
||
|
||
- follow `bortstack-context` for task status and handoff semantics;
|
||
- record significant verified frontend weaknesses in the project’s current-state record when they materially affect the documented state;
|
||
- do not turn every QA observation into authorised implementation work;
|
||
- recording follow-up work is appropriate only where project conventions/user instruction permit it;
|
||
- do not add a durable design decision merely because a small implementation detail changed.
|
||
|
||
## Completion standard
|
||
|
||
Frontend visual QA is complete only when, to the extent supported by the available environment:
|
||
|
||
- the in-scope workflow has been exercised;
|
||
- relevant viewport/state coverage has been checked;
|
||
- console/network health was inspected;
|
||
- confirmed in-scope findings were fixed or explicitly left unresolved;
|
||
- fixed findings were re-verified;
|
||
- relevant automated frontend validation passed or limitations were recorded;
|
||
- no unrelated redesign/refactor was introduced;
|
||
- context was updated when materially required.
|
||
|
||
A successful `npm build` alone does **not** satisfy this completion standard.
|
||
|
||
## Final report
|
||
|
||
Report concisely:
|
||
|
||
1. routes/workflows and design evidence inspected;
|
||
2. runtime/browser environment used;
|
||
3. viewport/state matrix actually tested;
|
||
4. findings, classified by type and severity/impact;
|
||
5. files changed and exact fixes, if fixes were authorized;
|
||
6. console/network observations;
|
||
7. accessibility checks performed;
|
||
8. automated validation and exact results;
|
||
9. anything that could not be verified;
|
||
10. final task/QA status and any context updates.
|
||
|
||
Do not claim the whole application is visually correct when only a subset was inspected.
|