From rawgentic
WF5 — Adversarially review a TEXT artifact (design, spec, implementation plan, PRD, ADR, RFC, README) using an independent DIFFERENT-MODEL reviewer via the Codex CLI. Report-only — writes a severity-ranked findings report to <project>/docs/reviews/ and NEVER edits the artifact. NOT for reviewing code diffs (use /code-review or /rawgentic:security-audit) — this complements same-model critique (reflexion:critique) with a cross-model second opinion on planning artifacts. Invoke with /rawgentic:adversarial-review followed by an artifact path. Requires the Codex CLI to be installed and authenticated.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rawgentic:adversarial-review Artifact path (e.g., "docs/design/feature.md") with optional type hint (design|spec|plan|prd|adr|rfc|readme)Artifact path (e.g., "docs/design/feature.md") with optional type hint (design|spec|plan|prd|adr|rfc|readme)The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<role>
Determine the active project using this fallback chain:
Level 1 -- Conversation context: If a previous /rawgentic:switch in this session set the active project, use that.
Level 2 -- Session registry: Read claude_docs/session_registry.jsonl. Grep for your session_id. If found, use the project from the most recent matching line.
Level 3 -- Workspace default: Read .rawgentic_workspace.json from the Claude root directory. If exactly one project has active == true, use it. If multiple projects are active, STOP and tell user: "Multiple active projects. Run /rawgentic:switch <name> to bind this session."
At any level:
.rawgentic_workspace.json missing -> STOP. Tell user: "No rawgentic workspace found. Run /rawgentic:new-project.".rawgentic_workspace.json malformed -> STOP. Tell user: "Workspace file is corrupted. Run /rawgentic:new-project to regenerate, or fix manually."activeProject.path may be relative (e.g., ./projects/my-app). Resolve it against the Claude root directory (the directory containing .rawgentic_workspace.json) to get the absolute path for file operations.1b. Disabled skill check: After resolving the active project, read .rawgentic_workspace.json (if not already read in step 1) and find the active project's entry.
disabledSkills array and this skill's bare name appears in it: STOP.
/rawgentic:setup or edit disabledSkills in .rawgentic_workspace.json."
Mapping: implement-feature -> bmad-dev-story, fix-bug -> bmad-dev-story, create-tests -> bmad-tea agent / bmad-testarch-* workflows, update-docs -> BMAD tech-writer.disabledSkills in .rawgentic_workspace.json to re-enable."bmadDetected is true but the project entry has no disabledSkills field: STOP. Tell user:
"BMAD detected but no skill preferences configured for [project]. Run /rawgentic:switch or /rawgentic:setup to configure."capabilities object, so all 11
workflow skills and the docs table cannot drift apart):
python3 hooks/capabilities_lib.py derive \
--config <activeProject.path>/.rawgentic.json
/rawgentic:setup). A config.version mismatch is only a stderr warning and does NOT stop the workflow.{"config": {...}, "capabilities": {...}}. Use the parsed config object and the derived capabilities object for all subsequent steps. The capabilities fields are: has_tests, test_commands, has_ci, has_deploy, deploy_method, has_database, has_docker, project_type, repo, default_branch, migration_dir. Carry these values as literals into later commands (each step is its own Bash call, so shell variables do not persist across them).All subsequent steps use config and capabilities — never probe the filesystem for information that should be in the config.
<config-loading> to resolve the active project and its absolute path (PROJECT_ROOT = <activeProject.path>). Log the resolved project and repo in session notes.*spec* → spec, *plan* → plan, *adr* → adr, README* → readme) and fall back to generic.PROJECT_ROOT (the engine enforces this — traversal/absolute escape is rejected). If it is outside the project, STOP and tell the user the artifact must live inside the active project.<path>."RAWGENTIC_ADV_REVIEW_MAX_BYTES are truncated (with a warning in the report); note this to the user.WF5 Adversarial Review
======================
Project: <name>
Artifact: <path>
Type: <resolved type>
Size: <bytes> (cap <MAX_BYTES>)
generic.python3 -c "import sys; sys.path.insert(0,'hooks'); from adversarial_review_lib import prereq_status; ok,msg=prereq_status(headless=__import__('os').environ.get('RAWGENTIC_HEADLESS')=='1'); print(msg); sys.exit(0 if ok else 2)"
(Equivalently: python3 hooks/adversarial_review_lib.py prereq [--headless].)curl -fsSL https://codex.openai.com/install.sh | bashcodex loginprintenv OPENAI_API_KEY | codex login --with-api-keyRAWGENTIC_HEADLESS=1) and Codex is unauthenticated, this is a terminal ERROR — do not wait for an interactive login. Post an error and exit.Codex CLI: installed and authenticated [OK]
or the verbatim install/login instructions on failure.
python3 -c "import sys; sys.path.insert(0,'hooks'); from adversarial_review_lib import read_artifact, scan_for_secrets, egress_warning; t,_=read_artifact('<artifact>','<PROJECT_ROOT>'); print(egress_warning(scan_for_secrets(t)))"
RAWGENTIC_ADV_REVIEW_BLOCK_SECRETS=1 is set, the engine will refuse egress in Step 4 when secrets are present (status error); surface that to the user.The egress warning text (and any detected secret categories).
python3 hooks/adversarial_review_lib.py review \
--artifact "<artifact>" \
--type "<resolved type>" \
--project-root "<PROJECT_ROOT>" \
--date "$(date -u +%Y-%m-%d)" \
[--headless]
0 → success; the path of the written report is printed on stdout.2 → prerequisite failure (not installed / unauthenticated). STOP (should have been caught in Step 2).3 → Codex error or timeout. STOP and report; do not fabricate findings.4 → Codex output could not be parsed/validated. STOP and report.The path to the generated report (on success) or the failure reason.
<PROJECT_ROOT>/docs/reviews/<slug>-<date>.md.Adversarial Review Complete (report-only)
=========================================
Report: <absolute path>
Findings: N (Critical X, High Y, Medium Z, Low W)
Top findings:
- [Critical] ...
- [High] ...
The artifact was NOT modified. Incorporate findings at your discretion.
If invoked mid-conversation, detect state:
docs/reviews/? → Step 5 (present it).Announce the detected state before resuming: "Detected prior progress. Resuming at Step N."
If ANY item fails, complete it before declaring "WF5 complete." You may NOT output "WF5 complete" until all items pass.
npx claudepluginhub 3d-stories/rawgentic --plugin rawgenticGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.