ultraqa
Adversarial dynamic end-to-end QA - generate hostile scenarios, test, verify, fix, report, and clean up. Use for robust behavior verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Adversarial dynamic end-to-end QA - generate hostile scenarios, test, verify, fix, report, and clean up. Use for robust behavior verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run a regression-tests-first, smell-by-smell deslop/refactor workflow that preserves behavior and raises signal quality. Use when the user asks to "cleanup", "refactor", "deslop", or when follow-up code has duplicates, dead code, weak boundaries, or fallback-like slop.
Run read-only deep repository analysis and return a ranked synthesis with explicit confidence, concrete file references, and clear evidence-vs-inference boundaries. Use when a user says "analyze", "investigate", "why does", "what's causing", or needs grounded cross-file explanation before any changes are proposed.
Deprecated compatibility shim for Claude advisor requests. Use `ask` with the claude backend instead.
Deprecated compatibility shim for Gemini advisor requests. Use `ask` with the gemini backend instead.
Ask a locally installed external advisor CLI (Claude or Gemini) for focused questions, reviews, brainstorming, or second opinions, and capture a reusable artifact. Use when the user wants a Claude/Gemini second opinion, "ask claude", or "ask gemini".
Strict autonomous delivery loop that runs deep-interview, ralplan, ultragoal, code-review, and ultraqa in order with automatic re-planning when gates are not clean. Use on "autopilot", "autonomous", "build me", "create me", "make me", "full auto", "handle it all", or "I want a/an…".
| name | ultraqa |
| category | review |
| status | active |
| core | true |
| description | Adversarial dynamic end-to-end QA - generate hostile scenarios, test, verify, fix, report, and clean up. Use for robust behavior verification. |
| agent_created | true |
| triggers | ["ultraqa","adversarial qa","e2e qa","hostile scenario testing","robustness test"] |
Ported from oh-my-codex
ultraqa. OMX runtime conventions ($macroinvocation,omxCLI,.omx/state directory) are replaced with WorkBuddy idioms (Skill tool, Agent tool, task list,.workbuddy/memory).
continue, advance the current verified next step instead of restarting discovery.[ULTRAQA ACTIVATED - ADVERSARIAL DYNAMIC E2E QA CYCLING]
UltraQA finds real behavior failures by combining normal verification commands with generated end-to-end scenarios, hostile user modeling, temporary harnesses when useful, and a structured evidence report. The workflow repeats test → diagnose → fix → retest until the goal is met, a bounded stop condition is reached, or a safety boundary blocks further execution.
Parse the goal from arguments. Supported formats:
| Invocation | Goal Type | What to Check |
|---|---|---|
/ultraqa --tests | tests | Existing tests plus adversarial dynamic e2e scenarios for the changed behavior |
/ultraqa --build | build | Build succeeds and generated smoke/e2e probes still run against the built artifact when applicable |
/ultraqa --lint | lint | Lint passes and no generated harness/test artifact violates project hygiene |
/ultraqa --typecheck | typecheck | Typecheck passes and generated typed harnesses compile when applicable |
/ultraqa --custom "pattern" | custom | Custom success pattern is verified against behavior, not trusted as misleading success output |
/ultraqa --interactive | interactive | CLI/service behavior is tested with generated hostile and edge-case interactions |
If no structured goal is provided, interpret the argument as a custom behavior goal and derive a runnable e2e strategy from repository context.
Before declaring success, create and maintain a scenario matrix (in memory or a temp file). Each row must include: scenario id, intent, user/attacker model, setup, command or harness, expected signal, actual result, fixes applied, evidence, and cleanup status.
The matrix must include normal-path coverage plus adversarial dynamic e2e scenarios selected from the current goal and codebase. Unless clearly irrelevant or impossible, include these hostile and edge-case classes:
continue, stop/cancel/abort wording, interrupted command output, retries after partial progress.Generated harnesses are part of the QA evidence chain; until setup succeeds, they are evidence about the harness apparatus, not product behavior.
/tmp or another scratch directory but imports repository code, resolve the repo root explicitly and import built modules with an absolute path or pathToFileURL(join(repoRoot, "dist", ...)).href. Never rely on ./dist/... from the harness's temp directory.${...}, shell metacharacters, or prompt-injection strings. If a shell heredoc is unavoidable, quote the delimiter and verify the written file before execution; do not use interpolating heredocs for JavaScript assertions.OMX_ROOT/OMX_STATE_ROOT-style env unset (e.g. env -u OMX_ROOT -u OMX_STATE_ROOT ...) — and in WorkBuddy, never reference .omx/. Use a clean cwd so ambient boxed state cannot redirect reads/writes away from the scenario fixture.Track each cycle in the task list: TaskCreate a cycle task (in_progress → completed).
PLAN ADVERSARIAL QA
RUN BASELINE VERIFICATION
--tests: run the project's test command.--build: run the project's build command.--lint: run the project's lint command.--typecheck: run the project's type check command.--custom: run the appropriate command and check the pattern plus exit status and failure markers.--interactive: harness the CLI/service with generated hostile and edge-case interactions (spawn a qa-tester-style Agent if available, otherwise drive it directly via Bash).RUN ADVERSARIAL DYNAMIC E2E SCENARIOS
CHECK RESULT
ARCHITECT DIAGNOSIS
architect/analyze skill via the Skill tool if available (skill: architect / skill: analyze); otherwise perform the diagnosis directly.FIX ISSUES
executor/plan skill via the Skill tool if available; otherwise implement directly. Constraints: preserve unrelated dirty work, clean temporary harnesses, keep safety bounds.CLEAN UP AND ROLLBACK
REPEAT
UltraQA must stay inside these safety bounds:
| Condition | Action |
|---|---|
| Goal Met | Exit success: ULTRAQA COMPLETE: Goal met after N cycles plus the structured report |
| Cycle 5 Reached | Exit with diagnosis: ULTRAQA STOPPED: Max cycles plus failures, fixes attempted, residual risks, evidence |
| Same Failure 3x | Exit early: ULTRAQA STOPPED: Same failure detected 3 times plus root cause, safety notes, next owner |
| Safety Boundary | Exit: ULTRAQA BLOCKED: [destructive/credentialed/external-production/unbounded action] plus safe substitute evidence |
| Environment Error | Exit: ULTRAQA ERROR: [port/dependency/hung command issue] plus cleanup status |
Every terminal UltraQA result must include this report shape:
# UltraQA Report
## Goal and success criteria
- Goal:
- Stop condition:
- Safety bounds applied:
## Scenario matrix
| ID | User/attacker model | Scenario | Command/harness | Expected signal | Actual result | Status | Evidence | Cleanup |
|----|---------------------|----------|-----------------|-----------------|---------------|--------|----------|---------|
## Commands run
- `[exit code] command` — purpose, duration/timeout, key output evidence
## Failures found
- Scenario ID, failure signal, root cause, user impact, safety impact
## Fixes applied
- Files changed, rationale, linked failing scenario(s), regression evidence
## Cleanup and rollback
- Generated artifacts removed or intentionally kept
- State/process cleanup performed
- Worktree status before/after
## Residual risks
- Untested or blocked scenarios with reasons and safe substitutes
## Evidence
- Test output, e2e logs, harness output, transcripts when relevant, rerun/flake evidence
Output progress each cycle:
[ULTRAQA Cycle 1/5] Planning adversarial scenario matrix...
[ULTRAQA Cycle 1/5] Running baseline tests...
[ULTRAQA Cycle 1/5] Running ADV-E2E-003 prompt-injection harness...
[ULTRAQA Cycle 1/5] FAILED - stale state resume accepted misleading success output
[ULTRAQA Cycle 1/5] Architect diagnosing scenario ADV-E2E-003...
[ULTRAQA Cycle 1/5] Fixing: src/hooks/... - validate exit code before success phrase
[ULTRAQA Cycle 1/5] Cleaning temporary harnesses and state...
[ULTRAQA Cycle 2/5] PASSED - baseline + 9 adversarial scenarios pass
[ULTRAQA COMPLETE] Goal met after 2 cycles
Use the task list for UltraQA lifecycle state (create a task per cycle; update current_phase via status/description). For durable cross-session resume context, append a short note to .workbuddy/memory/YYYY-MM-DD.md (e.g. mode: ultraqa, iteration: N, scenario_matrix: <summary>). Never call omx state.
TaskCreate the run with current_phase: planning.TaskUpdate the cycle task (qa → adversarial-e2e → diagnose → fix → cleanup).Good: The user says continue after the workflow already has a clear next step. Continue the current branch, rerun the relevant adversarial scenario, update the report instead of restarting discovery.
Good: The user changes only the output shape or downstream delivery step (e.g. make a PR). Preserve earlier non-conflicting constraints and apply the update locally.
Good: A CLI prints SUCCESS while exiting 1. Mark the misleading-success-output scenario failed, fix the parser/reporting path, rerun the generated harness.
Bad: The workflow runs only npm test/build/lint/typecheck, sees green, and declares UltraQA complete without adversarial dynamic e2e coverage.
Bad: A generated harness leaves untracked files, state, or a child process behind and the final report omits cleanup status.
Bad: The user says continue, and the workflow restarts discovery or stops before missing verification/evidence is gathered.
The user can cancel (e.g. /cancel), which clears UltraQA state. Cancellation itself should be tested in cancel/resume scenarios when relevant, but UltraQA must not block an explicit user cancellation.
When goal met OR max cycles reached OR exiting early: mark all UltraQA cycle tasks completed/deleted and remove temporary e2e harnesses, fixtures, and logs unless they are intentional artifacts listed in the report. Do not delete files outside the run's scope.
Begin ULTRAQA cycling now. Parse the goal, build the adversarial dynamic e2e scenario matrix, and start cycle 1.