---
description: Guided setup for this actor-critic workspace
---

# Customize Workspace

You are helping the user set up an actor-critic workspace. This workspace uses
a refinement loop where an **actor** produces output and **critics** review it,
iterating until all critics pass or max rounds are reached.

## Workspace Structure

The workspace has already been scaffolded with this structure:

```
./                          # Workspace root (your cwd)
├── actor-critic.yaml       # Configuration (actor, critics, orchestrator, stop condition)
├── input/
│   └── prompt.md           # Task prompt given to the actor each round
├── output/                 # Final output copied here after the loop
├── actor/
│   ├── CLAUDE.md           # Actor's system instructions (CUSTOMIZE THIS)
│   ├── output/             # Actor writes files here
│   └── .claude/
│       ├── settings.json   # Model and permissions
│       └── rules/
│           └── output.md   # Output directory rule
└── critics/
    └── <name>/
        ├── CLAUDE.md       # Critic's evaluation instructions (CUSTOMIZE THIS)
        ├── input/
        │   └── prompt.md   # Jinja2 template rendered with actor output context
        ├── output/
        └── .claude/
            └── settings.json
```

## Your Job

Guide the user through customizing this workspace for their specific task.
Follow these steps, but be conversational — adapt to what the user tells you.

### Step 1: Understand the Task

Ask the user to describe their task. Extract:
- What the actor should produce (code, documentation, analysis, etc.)
- Programming language(s) and frameworks
- Domain context (web API, CLI tool, data pipeline, etc.)
- Quality concerns (correctness, security, performance, style, etc.)

### Step 2: Configure the Actor

Based on the task, write a tailored `actor/CLAUDE.md` that replaces the
TODO placeholder. A good actor CLAUDE.md includes:
- Clear description of what to produce
- Constraints and requirements
- Output format and location instructions
- Domain-specific guidance

Read the current `actor/CLAUDE.md` to see the scaffold structure, then
replace the TODO placeholder with task-specific instructions. The actor
must write output to `./output/` using relative paths.

### Step 3: Design Critics

Ask how many critics the user wants and what each should evaluate.
Common patterns:
- **Single critic** — general quality review
- **Two critics** — correctness + style, or correctness + security
- **Three critics** — correctness + security + style/performance

For each critic:
1. Create the critic directory if it doesn't exist
   (scaffold may have created a default "quality" critic)
2. Write `critics/<name>/CLAUDE.md` following this section structure:
   - **Purpose** — What this critic evaluates and why
   - **Access** — What directories the critic can read (actor output, input)
   - **Review Method** — Numbered steps the critic must follow every time
   - **Thoroughness** — "If you can describe a specific way to improve the output, it fails"
   - **Pass Criteria** — Binary pass/fail rules with explicit conditions for each
   - **Output** — JSON format (required: `review`, `passed`, `verdict_explanation`):
     ```json
     {"review": "...", "passed": true/false, "verdict_explanation": "..."}
     ```
3. Write `critics/<name>/input/prompt.md` as a Jinja2 template:
   - Use the standard XML section structure:
     ```xml
     <actor_task>{{ actor_prompt }}</actor_task>
     <actor_output>{% for f in actor_output_files %}- {{ f }}{% endfor %}</actor_output>
     <actor_commentary>{{ actor_output_text }}</actor_commentary>
     <review_instructions>Critic-specific evaluation criteria here</review_instructions>
     <reminder>Hard pass or fail only — provide a clear verdict_explanation.</reminder>
     ```
   - Available template variables:
     `actor_output_files`, `actor_prompt_file`, `actor_prompt`,
     `actor_output_text`, `critic_output_dirs`, `round_num`,
     `previous_actor_outputs`, `previous_output_dirs`
4. Copy `.claude/settings.json` from the default critic if creating new ones.

### Step 4: Update Configuration

Edit `actor-critic.yaml` to reflect the actual critics. Each critic needs
`name` and `impl` (use `actor_critic.critics.basic`). `max_rounds` lives
under `stop_condition.config`.

### Step 5: Research and Write Rules

Write concise rule files to `.claude/rules/` for the actor and critics.

### Step 6: Install Plugins

Recommend and install relevant plugins via `claude plugin install`.

### Step 7: Write the Task Prompt

Help the user write (or refine) `input/prompt.md`.

### Step 8: Review

Verify all files are complete and consistent, then tell the user how to run:
```
uv run actor-critic run --workspace . --verbose
```

## Important Notes

- The actor's output directory is `actor/output/` — CLAUDE.md must instruct
  the actor to write there using relative paths
- Critic prompt templates are Jinja2 — use `{{ variable }}` syntax
- The `passed` field in critic output is boolean — hard pass or fail only
- Each critic runs as a separate Claude Code subprocess
- Use `verdict_explanation` in every critic's JSON output spec
