360 Secure SkillHub
360 安全技能中心

qa-crew

为每个用户角色各派一个子代理做功能 QA:先读代码列功能与预期权限,用浏览器按角色爬页面和接口找权限漏洞,再让测试者以正常与异常数据覆盖每个功能;浏览器守卫拦截删除、退款与发送,主代理复核复现报告、修复确认缺陷后重测并输出报告。

分类:开发
wincrack07
热度 0.00
最近更新 2026-11-29 17:57:25

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add wincrack07/qa-crew/qa-crew
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
qa-crew
description
Functional QA of a whole web app, dashboard or admin panel by a crew of subagent testers, one per user role, who try every function (every page, button, form, filter, export and permission) while a guard in their browser blocks every delete, refund and send. First maps what each role reaches from its menu and by typing the address, and calls every endpoint and export with every login to find permission holes. Then the testers create, edit, search and break things with odd data. You check every bug they report against the browser log, reproduce it, fix the confirmed ones and test again. Levels light, med (default) and high. Use when asked to test every function of an app, run QA, check roles and permissions («prueba todas las funciones», «haz QA del dashboard», «pruébalo con cada rol», «revisa los permisos», «pásale los testers»), or test a change across roles, even if they never say "skill". Not for first-time-user usability (dummy-user), unit tests or code review.
argument-hint
[permissions|retest] [light|med|high] [app URL, area or changes] [--roles admin,cashier] [--allow refund] [--report-only]

QA crew: every function, every role

A dashboard breaks where nobody looks: in the function nobody clicked since it was written, and in the role nobody logged in as. The crew covers both. A map shows what each role can reach. Testers try every function of each role with normal and odd data. You, the lead, check every report before calling it a bug, fix what is confirmed, and test again.

You set up, map, plan, launch, check, fix and report. The testers only drive the app through scripts/browser.mjs and say what happened.

Safety

These rules hold at every level and override any request:

  • Nothing is deleted. browser.mjs blocks every request that deletes: the DELETE method, a path or action that says delete, remove, eliminar or borrar, a method override, a JSON Patch remove, a GraphQL delete mutation, a write batch with a delete key. No flag turns this off. Never go around it with curl, SQL, a script or a database console. When the user wants deletion tested, the crew stops at the confirmation and reports the request the app would have sent; a person runs it.
  • Not on production. init gives write mode only to local, private and test-named hosts (localhost, staging, dev, preview...). Anywhere else the crew only reads. Pass --confirm-host <host> only after the user says that host is a test environment with test data.
  • Irreversible and outward actions are blocked: refunds, voids, cancellations, resets, and anything that sends messages or charges money. The user can allow a group (--allow refund); you never allow one on your own.
  • Test accounts only, one per role. Never the user's own account. Passwords never go in a command, a brief, a log or the report: use --password-file, --password-env, or let the user log in in the window login opens.
  • Test data carries the run's tag (QA-7K2P, and each tester's own QA-7K2P-3) in its name, and testers only edit what they created. Other people's accounts, passwords and permissions are never changed: reaching such a control is the finding.
  • The repository's instructions (AGENTS.md, CLAUDE.md, CONTRIBUTING) override this skill.

Language

Talk to the user in their language. Write the briefs and the report in the user's language, and quote the app's own words exactly as they appear. For Spanish, a ready brief, the questions and the report headings are in references/brief-es.md.

Usage

/qa-crew [permissions|retest] [level] [target] [flags] (in Codex, $qa-crew), or in plain language ("run a high QA on orders").

  • level: light, med (default) or high. leve means light.
  • target: by default, the whole app of the current repository. It can be an area ("orders", /settings), a URL, or changes (cambios): only the functions the current branch touches against its base.
  • permissions (permisos): only who reaches what. The map, the expected access and, on high, the intruder. No functional tests.
  • retest (reprobar): runs the steps of every bug in the last report again, against the code as it is now.
  • --roles admin,cashier: only these roles. anon, someone not logged in, is always mapped.
  • --allow refund,send: groups the user allows. --report-only (--solo-reporte): no code changes. --no-questions (--sin-preguntas).

Levels

light med (default) high
Map: every page and endpoint as every role yes yes yes
Testers none one per role, up to 4 one per role and area, up to 8, plus the intruder
What they try every function of the role: the normal way, then validation, odd data, numbers, lists, exports, and what the role should not do the same, plus two tabs at once, back and reload halfway, phone width, and every field with the full set of odd data
Rounds 1 2: test, fix, retest what was fixed 2, and the retest covers every area a fix touched
What gets fixed nothing, report only confirmed bugs that need no product decision the same, each with a regression test where the repository has tests

A tester driving a browser by commands can take 10 to 20 minutes and a few hundred thousand tokens. Before launching on high, say in one line how many testers and rounds you are about to start.

Step 1: ask

Ask once, in a single message, offering your best guess for each answer from the repository, so the user can say "yes" or correct one word. If the session has a tool for questions with options, use it.

  1. Where? The address of a test environment, or "start the dev server", with the command you found in package.json, the README or docker-compose.
  2. Which roles, and how does each log in? The roles you found in the code (an enum, the seeds, the policies), with the test accounts from the seeds or fixtures. Or the user logs in by hand in a window. Never their own account.
  3. What may each role do? The access you read from the code, as a short table of role × area. The user corrects it. This is what the crew tests against.
  4. What is off limits? Areas not to touch, real integrations (payment gateways, email, WhatsApp), and whether refunds or sends may run (default: no).

Skip what the user already said, or everything with --no-questions. On light, ask only what the repository cannot answer, usually the accounts. When you assume, say so in the report.

Step 2: set up

Run every script from the project root. <skill> is this skill's folder.

node <skill>/scripts/browser.mjs doctor                               # Node, Playwright, a browser
node <skill>/scripts/browser.mjs init --url http://localhost:3000     # mode, tag and .qa-crew/
node <skill>/scripts/browser.mjs login --role admin --user admin@example.test --password-file <file>
node <skill>/scripts/browser.mjs login --role cashier                 # a window opens; the user logs in
  • .qa-crew/ holds the config, the saved logins, the sessions and the map, and ignores itself in git. Only init creates it: doctor, list and report leave nothing behind.
  • If the app is not running, start it with the project's own command in the background, and stop it at the end.
  • A role without an account: with the user's yes, and only in write mode, the admin session creates one through the app, with the tag in its name.
  • If Playwright is missing, doctor prints the one command that installs it outside the project.

Step 3: list the functions and the expected access

Read the code, not only the screens: routes and pages, API endpoints, server actions, the menu's config, every role check (middleware, policies, guards, can(), row level security), feature flags. Where to look in each framework: references/inventory.md.

Write two files in .qa-crew/:

  • inventory.md: areas, and in each one its functions as a verb and an object ("create a product", "export sales as CSV", "change a user's role"). For each function: which roles should do it, and where that is enforced (server, or only the interface). This list is the coverage target. In the report, every function × role ends up tested, or skipped with a reason.
  • expected.json: the same access as page and endpoint patterns, for the map:
{ "pages": { "/users": ["admin"], "/reports*": ["admin", "manager"], "*": ["admin", "manager", "cashier"] },
  "api":   { "/api/users*": ["admin"], "/api/reports/*": ["admin", "manager"], "*": ["admin", "manager", "cashier"] } }

With changes, list only the functions the diff touches, plus the ones that share their code.

Step 4: map

node <skill>/scripts/map.mjs --expect .qa-crew/expected.json

It crawls the app once per role, read only, opens every page any role found as every other role, calls every GET endpoint and export with every login, and writes .qa-crew/map/map.md:

  • Against the expected access: what a role reaches but should not (a hole), and what it should open but cannot.
  • Pages: per role, menu, by address, denied, login, 404 or error.
  • Endpoints and exports: the status and the size of the answer for each login.
  • Controls only some roles see, errors found while crawling and links not opened.

Every hole, block and error in the map is a candidate: check it in Step 7 like any tester's report. Compare the map with the inventory too. A function in the code that no page reaches is dead or hidden. A page the inventory lacks goes into it.

On light, and with permissions below high, go from here to the report.

Step 5: write the charters

Split the inventory into charters. On med, one per role. On high, one per role and area, plus the intruder. Each charter lists:

  • the role and the session name;
  • every function to cover, with what the role should and should not be able to do;
  • what to try on each, from references/charters.md: forms, lists, numbers, files, permissions, navigation, the odd data set;
  • the tag for the data it creates.

A charter that covers too much comes back shallow. Keep each one to about 10 functions; split if it is bigger.

Step 6: launch the crew

  1. Start one session per tester yourself, so testers never touch a login: node <skill>/scripts/browser.mjs start --role cashier --name cashier-1. Each session gets its own tag (QA-7K2P-3), printed by start and on every page it shows: give it to that tester, so each one can tell its records from the others'. Add --mobile for the phone-width tester on high.
  2. Launch the testers in parallel, on a mid-size model (in Claude Code, the Agent tool with model: "sonnet"). The simplest models lose track of a browser driven by commands and cannot judge whether a total is right. Put the intruder on the strongest model you have. How to launch them in Codex, T3 Code and other agents: references/environments.md.
  3. Give each tester only the brief below, filled in. No code, no diff, no map. A tester who knows where the bug is stops testing everything else.
  4. The intruder (on high and with permissions) gets the lowest role's session, plus a session with no login, and its charter is the other roles' functions: every page, button and endpoint the role should not reach, by the menu, by address, and by changing ids in addresses. See "The intruder" in references/charters.md.

Tester brief (copy it and fill in the braces)

The user asked for a QA pass of their app with a crew of testers, and you are one of them. You test as
{role} in a {test environment / read-only copy of production}. You may create and edit; nothing you do
can delete, refund or send anything, because a guard in your browser blocks it and records what the app
tried to send.

Your browser, already logged in. Run every command from {project root}:
  node {skill}/scripts/browser.mjs {session} <action>
Actions:
  snap · goto <path> · click <target> · dblclick <target> · fill <target> "<text>" · type <target> "<text>"
  select <target> "<option>" · check <target> · uncheck <target> · press <key> · press <target> <key>
  upload <target> <file> · back · reload · text [ref] · find "<text>" · row "<text in a row>"
  wait "<text>" · dialog dismiss · shot [name] · log
A target is a ref from the last output (e12), a role and a name (button "Save"), or a visible text.
Each action prints a numbered line (#14), what happened (saved, http errors, uncaught errors, blocked
requests, dialogs, downloads) and the page as text. Refs change on every output: use the latest.

Rules:
- Only use the app through these commands. No curl, no other browser, no reading code or files.
- Put {tag} at the start of the name of everything you create. Edit and act only on what you created;
  open other records only to check whether you can.
- Never log out. Never change another person's account, password or permissions: if your role reaches
  such a control, that is the bug; report it without using it.
- Destructive buttons (delete, refund, cancel, void): click them, so we see whether the app asks first.
  The guard stops the request. Report whether there was a confirmation, what it said, and what the app
  did after.
- "Saved" on screen is not proof. Find the record where it should show: in the list, in the detail,
  after a reload.
- If the tool fails (a ref is gone, a timeout), take a new snap and try once more. Then note it and
  move on. Do not spend more than about 15 actions on one function.

Your charter:
{the functions, each with what this role should and should not be able to do}

For each function: do it the normal way and check the result. Then try to break it:
{the checks from the charter: empty and wrong fields, zero, negative, huge, decimals, long text, accents
and emoji, duplicates, double click on save, cancel halfway, back and reload, totals against their rows,
search with capitals and accents, every page of a list, the export against the screen, and opening by
address what the role should not reach}

When you finish, write your whole report in your last message: only the last one reaches me.

## Coverage
| Function | Result: works / bug / denied as it should / reached but should not / not tested | Actions |

## Bugs
For each one: a title · the role and the page · the steps, as the commands you ran with their numbers ·
what you expected · what happened, copying the app's words exactly · the evidence (action numbers,
http and error lines, screenshot paths) · how sure you are (certain / likely)

## Questions
What you could not tell whether it is a bug, because it depends on what the business wants.

## Not tested, and why

## Records you created

Step 7: check every report

A tester sometimes calls a bug what was the tool, the guard or its own mistake, and sometimes says "works" without looking. Before believing it:

  1. Read what really happened. node <skill>/scripts/browser.mjs report lists, per session, the server errors, page errors, blocked requests and records created. .qa-crew/sessions/<name>/actions.jsonl has every action with what it sent and got. Look for: "works" with an error in the log, "saved" with no save request, a bug that the log does not show.
  2. Reproduce each bug yourself in a new session with the same role, following the tester's steps. Mark it confirmed, not reproduced, or not a bug (the tool, the guard, the tester).
  3. A request the guard blocked is not a bug of the app. What the app did around it can be: no confirmation before deleting, a confirmation that does not name the record, an error page instead of a message.
  4. Prove permission holes at the server. A button the role should not see is a small bug when the server refuses the request, and a hole when it accepts it. The map's endpoint table and the session's http lines say which.
  5. Rate each one, and merge duplicates across testers:
    • critical: data lost or corrupted, a role does what it should not (at the server), money or totals wrong, the main flow of a role broken;
    • high: a function broken without a way around it, "saved" when nothing was saved, an export or report that fails;
    • medium: broken with a way around it, validation that lets bad data in, no confirmation before something destructive, an error with no message;
    • low: wrong text, a raw translation key, a cosmetic slip.

Step 8: fix (unless light or --report-only)

  • Fix the confirmed bugs in the code, at the right layer: permissions on the server, never only by hiding the button; validation on the server and in the form; totals where they are computed.
  • What needs a product decision goes to "Questions for you", not into the code.
  • On high, add a regression test for each fix where the repository has tests.
  • Run the repository's checks (tests, lint, types). Commit, push and PR only if the user asks.

Step 9: test again

Restart the app if the fix needs it. Start new sessions and run the steps of every fixed bug again. After a permission fix, run the map again with --expect. On high, run again the charters of every area a fix touched. In the report, mark each bug fixed (with the retest's action numbers) or still failing.

retest mode is this step alone, on the bugs of .qa-crew/report.md.

Final report

Save it as .qa-crew/report.md and give it to the user:

# QA crew · {app} · level {level}
Where: {address} ({write/read} mode) · Roles: {roles and accounts, never passwords} · Testers: {n} ({model})
Expected access from: {the user / the code / assumed} · Tag: {tag}

## Verdict
{Two or three sentences: can each role do its job, and what must be fixed before release.}

## Permission holes
| # | Role | Reaches | Should be | Proof | Fixed? |

## Bugs
| # | Severity | Role | What happens | Steps | Expected | Evidence | Fixed? |

## Coverage
| Area · function | {role} | {role} | ... |
(each cell: works · bug #n · denied, as it should · reached, should not (#n) · not tested: why)

## Stopped by the guard
- {what the app would have sent, from which button, and whether it asked first}. A person runs these.

## Questions for you
- {behavior that depends on what the business wants}

## Test data created
- {records with the tag, from `browser.mjs report`}: remove them with the app or ask whoever owns the data.

## Limits
- {what was not tested and why, tool failures, roles without an account}

## Changes applied
- {files} · Repository checks: {result} · Retest: {result}

Do not

  • Delete anything, or run anything the guard stopped by another route.
  • Use write mode on a host the user did not name as a test environment.
  • Put a password in a command, a brief, a log or the report.
  • Give testers the code, the map or the bugs you suspect.
  • Report a tester's bug you did not reproduce as confirmed.
  • Fix a permission hole by hiding a button.
  • Stop the testers' sessions before you have reproduced their bugs. At the end, browser.mjs stop --all.