From jarrettmeyer
Adversarial multi-agent loop — Creator produces an artifact, Critic stress-tests it
How this skill is triggered — by the user, by Claude, or both
Slash command
/jarrettmeyer:ganThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Run two adversarial feedback loops on any artifact. The Creator produces; the Critic reviews without
Run two adversarial feedback loops on any artifact. The Creator produces; the Critic reviews without seeing the Creator's reasoning. Iteration stops when the Critic finds no critical or major issues, or when max rounds is reached.
The top-level skill uses Bash for git rev-parse, mkdir -p, and date. Subagents declare their
own tools independently.
/jarrettmeyer:gan <request>
/jarrettmeyer:gan --plan-only <request>
/jarrettmeyer:gan --max-rounds N <request>
/jarrettmeyer:gan --creator-role "role" --critic-role "role" --executor-role "role" <request>
--plan-only: run only the Creation Phase; stop before execution.--max-rounds N: override the default of 3 rounds per phase. N must be a positive integer ≥ 1;
invalid values fall back to 3.--creator-role "...": explicitly set the Creator agent's role description.--critic-role "...": explicitly set the Critic agent's role description.--executor-role "...": explicitly set the Executor agent's role description. Defaults to the
Creator role. If provided alongside --plan-only, warn the user: "Note: --executor-role has
no effect in --plan-only mode."Session artifacts are written to:
.scratch/jarrettmeyer/gan/gan-session-<timestamp>.md
Ensure .scratch/ is listed in .gitignore to prevent session files from appearing in git status.
Prerequisites: Use the Bash tool to run:
PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
mkdir -p "$PROJECT_ROOT/.scratch/jarrettmeyer/gan"
echo "PROJECT_ROOT=$PROJECT_ROOT"
echo "TIMESTAMP=$TIMESTAMP"
Record the PROJECT_ROOT and TIMESTAMP values from the bash output above. Use them verbatim in all subsequent file paths throughout this skill. Do not re-run date or git rev-parse.
Parse flags and request from the invocation (see Invocation section). If the request string is
empty after flag parsing, stop immediately and tell the user: "No request provided. Usage:
/jarrettmeyer:gan [flags] ".
If --executor-role is provided alongside --plan-only, warn the user:
"Note: --executor-role has no effect in --plan-only mode." then continue.
Clarify goal and audience before proceeding. Before inferring roles or writing any session file, identify two things from the request:
If either is ambiguous or absent, stop and ask the user — do not infer or invent them. Present what you understood and what is unclear, e.g.:
I want to make sure I have the right framing before starting.
- Goal: [what I think you want — or "unclear"]
- Audience: [who I think the output is for — or "unclear"]
Can you confirm or correct this?
Only proceed once goal and audience are confirmed. Record both in the session file.
Determine role assignments using the confirmed goal, audience, and domain (e.g., a coding
request → Creator: "software engineer", Critic: "senior code reviewer"; a build-vs-buy
request for senior leadership → Creator: "business analyst", Critic: "CFO"). Roles can also
be set explicitly via --creator-role "...", --critic-role "...", and --executor-role "..."
flags. The Executor role defaults to the same as Creator.
Create $PROJECT_ROOT/.scratch/jarrettmeyer/gan/gan-session-$TIMESTAMP.md:
# GAN Session
## Date
[TIMESTAMP]
## Request
[verbatim request]
## Goal
[confirmed goal]
## Audience
[confirmed audience]
## Mode
FULL | PLAN_ONLY
## Max Rounds
[N]
## Roles
- **Creator:** [role]
- **Critic:** [role]
- **Executor:** [role]
Repeat up to max rounds.
Subagent error handling: If a subagent returns no output or errors, log
**Warning:** [agent type] agent failed on round N — [error or "no output returned"] to the
session file and stop. Tell the user which agent failed and at what round.
Spawn a general-purpose subagent:
Append to session file. Under ### Round N, write **Artifact:** as a bold inline label on its
own line, followed by the artifact text. Do not use #### sub-headings.
## Creation Phase
### Round N
**Artifact:**
[artifact text]
Context isolation: pass ONLY the artifact text, goal, and audience — never the session file or prior reasoning.
Spawn a general-purpose subagent:
You are a [CRITIC ROLE] performing an adversarial review. You have no knowledge of how this artifact was produced.
Goal: [CONFIRMED GOAL]
Audience: [CONFIRMED AUDIENCE]
Artifact: [ARTIFACT TEXT ONLY]
Identify issues. Classify each as critical, major, or minor.
Your response MUST begin with one of these exact signals on its own line:
APPROVEDCHANGES_REQUESTEDNote: This phase intentionally uses
APPROVED/CHANGES_REQUESTED(notACCEPTED/REJECTED). The Execution Phase uses different signals because execution review differs semantically from plan review. Do not unify these signals.
If CHANGES_REQUESTED: follow with a rank-ordered issue list using this format:
[critical] Issue description
[major] Issue description
[minor] Issue description
If APPROVED: follow with a brief rationale.
Signal parsing: Trim whitespace and normalise to uppercase. If the first non-blank line does
not exactly match APPROVED or CHANGES_REQUESTED, treat it as CHANGES_REQUESTED and log:
**Warning:** Unrecognised signal "[raw value]" — defaulting to CHANGES_REQUESTED.
Append to session file:
**Review:**
[review text]
**Status:** APPROVED | CHANGES_REQUESTED
**Issues:**
- [rank-ordered list if CHANGES_REQUESTED]
CHANGES_REQUESTED with at least one critical or major issue, and round < max rounds → iterate.CHANGES_REQUESTED with only minor issues → treat as done; proceed with the current artifact.APPROVED → record final status and proceed with this artifact as [FINAL APPROVED ARTIFACT].APPROVED) → record final status as MAX_ROUNDS_REACHED and proceed with the artifact from this last round as [FINAL APPROVED ARTIFACT].Skip entirely if mode is PLAN_ONLY.
Before spawning any agent, derive a one-sentence acceptance criterion from the original request.
Record it in the session file as **Acceptance Criterion:** [criterion]. Use this string verbatim
in every Critic prompt for this phase.
Repeat up to max rounds.
Subagent error handling: If a subagent returns no output or errors, log
**Warning:** [agent type] agent failed on round N — [error or "no output returned"] to the
session file and stop. Tell the user which agent failed and at what round.
Spawn a general-purpose subagent:
Append to session file. Under ### Round N, write **Output:** as a bold inline label on its
own line, followed by the executor output. Do not use #### sub-headings.
## Execution Phase
### Round N
**Output:**
[executor full output, summary, and deviations]
Context isolation: pass ONLY the full executor output and the acceptance criterion — never the session file or prior reasoning.
Spawn a general-purpose subagent:
You are a [CRITIC ROLE] reviewing a completed execution. You have no knowledge of how it was done.
Acceptance criterion: [ONE-SENTENCE ACCEPTANCE CRITERION]
Full executor output: [FULL EXECUTOR OUTPUT]
Classify issues as critical, major, or minor.
Your response MUST begin with:
ACCEPTEDREJECTEDNote: This phase intentionally uses
ACCEPTED/REJECTED(notAPPROVED/CHANGES_REQUESTED). The Creation Phase uses different signals because execution review differs semantically from plan review. Do not unify these signals.
If REJECTED: rank-ordered issue list. If ACCEPTED: brief summary.
Signal parsing: Trim whitespace and normalise to uppercase. If the first non-blank line does
not exactly match ACCEPTED or REJECTED, treat it as REJECTED and log:
**Warning:** Unrecognised signal "[raw value]" — defaulting to REJECTED.
Append to session file:
**Review:**
[review text]
**Status:** ACCEPTED | REJECTED
**Issues:**
- [rank-ordered list if REJECTED]
REJECTED with at least one critical or major issue, and round < max rounds → iterate.REJECTED with only minor issues → treat as done; accept the current output.ACCEPTED or round = max rounds → record final status and stop.Tell the user:
APPROVED or MAX_ROUNDS_REACHED)ACCEPTED or MAX_ROUNDS_REACHED), or SKIPPED| Invocation | Behavior |
|---|---|
/jarrettmeyer:gan refactor the auth module | Creation + execution, max 3 rounds |
/jarrettmeyer:gan --plan-only draft a migration strategy | Creation only, max 3 rounds |
/jarrettmeyer:gan --max-rounds 2 write a blog post outline | Creation + execution, max 2 rounds |
/jarrettmeyer:gan --plan-only --max-rounds 1 review this API design | Creation only, 1 round |
/jarrettmeyer:gan --creator-role "novelist" --critic-role "literary editor" write a short story | Custom roles, creation + execution |
/jarrettmeyer:gan --executor-role "technical writer" design a REST API | Custom executor role, creation + execution |
npx claudepluginhub jarrettmeyer/skills --plugin jarrettmeyerRuns iterative refinement loops to improve artifacts like codebases, documents, prompts, pipelines using evidence-based judges, optional evaluators, and auto-selected single/multi-judge modes based on complexity.
Runs autonomous optimization loops to iteratively improve prompts, templates, configs, or code using four-way separation of main agent, eval agent, test runner, and deterministic eval.py judge. Invoke via /autoresearch or 'optimize this prompt'.
Separates generation and evaluation into an adversarial feedback loop for building high-quality applications autonomously. Uses Planner, Generator, and Evaluator agents with Playwright testing to iterate beyond single-agent quality.