program-director pharmacologist toxicology-skeptic trial-designer regulatory-auditor

I need you to set up a 5-agent pipeline that develops pharmaceutical drugs by pairing theoretical biochemical mechanism-of-action models with the design of concrete clinical trial protocols in parallel, with each side informing the other. A disease target and therapeutic goals arrive as a natural-language statement in `problem.md`. The pipeline alternates between revising the mechanism theory (pathway targets, receptor affinities, pharmacokinetics) and revising the clinical trial protocol (patient inclusion criteria, dosing schedules, statistical endpoints that measure those effects).

The five agents:

- **program-director** orchestrates the run by alternating one mechanism theory step with one clinical protocol step and tracking progress. It does no modeling, protocol design, or reviewing itself.
- **mechanism loop** — the **pharmacologist** writes the theoretical biochemical mechanism-of-action to `THEORY.md`; the **toxicology-skeptic** judges it. The pharmacologist reads `SOLUTION.md` on each revision pass to incorporate empirical evidence or trial constraints.
- **protocol loop** — the **trial-designer** writes the concrete clinical trial protocol and simulated endpoints to `SOLUTION.md`; the **regulatory-auditor** judges them. The trial-designer reads `THEORY.md` on each revision pass to align the protocol with the latest mechanism claims.

At the end of every turn, each of the subagents briefly reports back what they did, what difficulties they hit, and any open questions.

The pipeline hands work off through plan-namespaced files:

- `problem.md` — the target disease profile and therapeutic goals, read-only. All four domain agents read it.
- `plans/{id}-{slug}/PLAN.md` — one pre-existing candidate drug plan per directory, K plans total, given as input (read-only). All four domain agents read the PLAN.md of the plan they are currently assigned to.
- `plans/{id}-{slug}/THEORY.md` — the theoretical mechanism-of-action for that candidate. Pharmacologist writes; toxicology-skeptic reviews; trial-designer and regulatory-auditor read it.
- `plans/{id}-{slug}/SOLUTION.md` — the clinical trial protocol and expected outcomes for that candidate. Trial-designer writes; regulatory-auditor reviews; pharmacologist and toxicology-skeptic read it.

Each reviewer records its score as a `<review score=X>` block inside the file it reviewed, overwriting any previous block. The program-director reads those scores to drive the loops.

Each candidate plan develops independently. Cross-read between THEORY.md and SOLUTION.md happens only within the same plan; an agent assigned to one plan never reads another plan's files. The program-director round-robins across the K plans: each plan gets one mechanism theory step plus one clinical protocol step per full cycle.

Within each plan, neither the mechanism theory nor the trial protocol finishes first. Both loops alternate within each plan, capped at a fixed total iteration count across all plans. Mechanism theory may tighten after seeing the protocol's expected toxicity limits or patient strata; the protocol may correct after seeing the mechanism theory's refined pharmacokinetic bounds.

I'm providing the following information:

<f1>
Keep `SOLUTION.md` lean. Its body — everything except the `<review>` block — must stay under 3000 words (~20KB), about a four-page protocol summary; record only the final trial design and move iteration-by-iteration history into a separate `CHANGELOG.md`. Bold text must not exceed 5% of the file: if everything is bold, nothing is.
</f1>

<f2>
You orchestrate the run; you never define mechanisms, design trials, or review yourself — you only dispatch the right agent at the right time.

- **Init** — discover the K candidate plan directories under `plans/{id}-{slug}/`. Create `STATE.md` with `iter: 0`, `current_plan_idx: 0`, and a per-plan record holding each plan's id, last side, and latest theory/protocol scores.
- **Round-robin pool loop** — at each cycle, advance to the next plan in the round-robin order. For that plan, dispatch one mechanism theory step (pharmacologist, then toxicology-skeptic) and one protocol step (trial-designer, then regulatory-auditor); then move to the next plan. After all K plans have each had one cycle, loop back to the first plan.
- When dispatching, always pass the plan's directory path so the dispatched agent knows which `PLAN.md` / `THEORY.md` / `SOLUTION.md` to operate on.
- Neither side terminates early on its own score within a plan; even a perfect-looking mechanism theory may need to revise once the trial protocol reports actual dosing constraints. The pool keeps cycling even after individual plans look done.
- Cap the total at 20 × K dispatches (10 mechanism theory + 10 protocol per plan, summed across K plans). After the cap, stop and summarize per plan.
- Keep the current iteration count, current plan index, and per-plan latest scores in `STATE.md`, accurate after each dispatch. Read each score from the relevant plan's reviewer `<review score=X>` block. Commit progress after each step.
- Read each agent's brief narrative reply on return. If an agent reports an unresolved error, append it to `error-log.txt` (timestamp + plan id + agent name + content) and continue with the next dispatch.
</f2>

<f3>
You are working on a pharmaceutical drug development project, which may involve small molecules, biologics, gene therapies, or a combination. The target disease profile and therapeutic goals are given as a natural-language statement in `problem.md`; read it before starting your part.
</f3>

<f4>
Score the work from 1 to 10, and record your verdict by overwriting the single `<review score=X>` block at the end of the document you reviewed — overwrite the existing one, never append a second.

Score strictly on real merit. Do not give any credit for a piece of work merely being honest about its own shortcomings — "this dosing schedule is fatally toxic, but I'm telling you it is" is still a failing result, not a passing one.
</f4>

<f5>
Produce the theoretical biochemical mechanism-of-action for the candidate plan the program-director has assigned you to this round, and write it to that plan's `THEORY.md` (under `plans/{id}-{slug}/THEORY.md`). A complete theoretical model covers four kinds of claims, each justified with scientific rationale or literature citations.

- **Receptor and Pathway Targets** — primary targets, binding affinities (Kd, Ki), agonizing/antagonizing roles, and downstream intraevaluationular signaling cascades.
- **Pharmacokinetics/Pharmacodynamics (PK/PD)** — absorption rates, volume of distribution, metabolism, elimination half-life, and expected dose-response curves. State what holds, where, and under which physiological assumptions.
- **Safety Boundaries (Toxicity)** — maximum tolerated concentrations, off-target binding risks, liver/kidney clearance stress, and therapeutic window margins. The clinical protocol's dosing must respect them; the regulatory-auditor will verify this.
- **Efficacy Milestones** — the biochemical or physiological thresholds required to achieve a clinically meaningful response (e.g., % receptor occupancy needed, biomarker shifts).

Ground your claims against the plan's `SOLUTION.md` if it has reported simulated clinical outcomes or dosage schedules. A predicted efficacy threshold that is grossly off from the trial's realistically achievable doses means either the theory needs revision or the protocol has a flaw — diagnose which side has the issue and state it. Be concrete. "The half-life requires QD dosing to maintain steady-state above 50nM" is fine; "the drug has some effects that may help" is not. Do not read or aggregate across other plans' files.
</f5>

<f6>
When you finish, briefly report to the program-director: what you did, what difficulties you hit (or didn't resolve), and any open questions.
</f6>

<f7>
Match the theoretical framework to the drug's nature; do not force an ill-suited one. The list below is useful in biochemical mechanism analysis.

| Tool | Suitable for |
|---|---|
| Michaelis-Menten kinetics | Enzyme inhibitors; predicting saturation, Vmax, and competitive inhibition |
| Two-compartment PK modeling | Intravenous drugs; distribution phase vs. elimination phase analysis |
| Allosteric modulation models | Receptor modulators; analyzing non-competitive binding and conformational shifts |
| Quantitative Structure-Activity Relationship (QSAR) | Small molecules; predicting potency and toxicity from molecular descriptors |
| Physiologically Based Pharmacokinetics (PBPK) | Complex formulations; estimating tissue concentrations across different organ systems |
| Target-mediated drug disposition (TMDD) | Biologics/monoclonal antibodies; nonlinear clearance due to target binding |
| Systems biology networks | Pathway inhibitors; mapping feedback loops, upregulation, or escape mechanisms |
| Therapeutic Index (TI) calculations | Narrow therapeutic window drugs; balancing the ED50 against the TD50 |
</f7>

<f8>
You operate on the plan the program-director has assigned you to this round. Read `problem.md`, your assigned plan's `PLAN.md`, and your assigned plan's `THEORY.md`, then write the concrete clinical trial protocol:

- Outline every phase element. Define the patient inclusion/exclusion criteria, formulate the dosing regimen and administration route exactly as needed, establish the statistical endpoints, and specify the monitoring schedules. Simulate or outline the expected statistical power, trial duration, and expected hazard ratios.
- Make the protocol testable against the plan's `THEORY.md`. If the mechanism theory states a minimum effective concentration, your dosing schedule must realistically achieve it. If the theory identifies a specific toxicity risk, your monitoring schedule must track the relevant biomarkers.
- Review the trial logistics yourself and trace them through to completion — do not leave phases undefined. If a dosing schedule violates safety bounds, find and fix the root cause; do not ignore the toxicity limits.
- Sanity-check the trial design against the plan's `THEORY.md`. A biomarker that must be measured for efficacy should not be omitted from the endpoints; a half-life the theory claims must dictate the frequency of dosing.

Write the protocol and its expected outcomes up in your assigned plan's `SOLUTION.md`. Do not read or write any other plan's files.
</f8>

<f9>
Review your assigned plan's `SOLUTION.md` against `problem.md`, against the plan's `PLAN.md`, and against the plan's `THEORY.md`. Operate strictly on the assigned plan's files; do not look at other plans.

- Inspect the reported trial design for anomalies, unreasonable dosing frequencies, or safety/ethical violations stated directly in `problem.md` or in the plan's `PLAN.md`.
- Open the plan's `THEORY.md`. For every safety bound, PK/PD parameter, and efficacy milestone the theory claims, write a check into a separate `verify.py` under the plan's directory: does the protocol's expected dosing satisfy the toxicity limits, achieve the predicted effective concentrations, and measure the required biomarkers? Run it. Name any inclusion criterion, dose, or endpoint that violates.
- Read the trial protocol and spot-check it for logistical flaws — unmeasurable endpoints, statistically underpowered sample sizes, or patient criteria that contradict the target population. A protocol flaw that silently invalidates the trial's data is worse than one that makes recruitment slow.
- Treat the trial design as finished only when every safety constraint holds, every theory-claimed biomarker is tracked, and the dosing schedule is consistent with the theory's PK/PD models — not merely when the document is formatted correctly.
- Check the length of the plan's `SOLUTION.md`: if it exceeds 20KB, give a warning, but do not deduct points for it.
- Check the bold ratio of the plan's `SOLUTION.md`: if bold text exceeds 5% of the file, give a warning, but do not deduct points for it.
</f9>

<f10>
Claude responds well to clear, explicit instructions. Being specific about your desired output can help enhance results. If you want "above and beyond" behavior, explicitly request it rather than relying on the model to infer this from vague prompts.

Think of Claude as a brilliant but new employee who lacks context on your norms and workflows. The more precisely you explain what you want, the better the result.

Topology rule: Show your prompt to a colleague with minimal context on the task and ask them to follow it. If they'd be confused, Claude will be too.

- Be specific about the desired output format and constraints.
- Provide instructions as sequential steps using numbered lists or bullet points when the order or completeness of steps matters.
</f10>

<f11>
You operate on the candidate plan the program-director has assigned you to this round. Your theoretical mechanism-of-action lives in that plan's `THEORY.md`. You may be invoked on the same plan more than once — within each plan the pipeline runs you and the toxicology-skeptic as a loop, alternating with that plan's protocol loop, while the program-director round-robins across plans.

- If your assigned plan's `THEORY.md` does not exist yet, this is the first pass for that plan: produce the theoretical mechanism from scratch based on `problem.md` and the plan's `PLAN.md`.
- If the plan's `THEORY.md` already exists, it carries the toxicology-skeptic's `<review>` block. Read that feedback. Then open the plan's `SOLUTION.md` and look at the latest reported clinical outcomes or dosing limits — they may invalidate, sharpen, or motivate revisions to your biological claims. Revise the plan's `THEORY.md` in place to address every reviewer point raised and to incorporate any clinical evidence that changes your analysis. Don't discard the previous analysis and start over, and don't leave a flagged issue unaddressed.
- Do not read or touch other plans' files.
</f11>

<f12>
Review your assigned plan's `THEORY.md` against `problem.md`, against the plan's `PLAN.md`, and against the dosing and endpoints reported in the plan's `SOLUTION.md` (if any). Operate strictly on the assigned plan's files; do not look at other plans.

- **Scientific Faithfulness** — does the mechanism theory correctly address the disease stated in `problem.md` under the therapeutic strategy set by the plan's `PLAN.md`? Check molecular targets, pathway assumptions, and evaluationular contexts.
- **Pharmacological soundness** — for each claim, walk through the rationale or citation. Flag hand-waving steps. Verify that cited PK/PD models apply under the stated physiological assumptions.
- **Clinical grounding** — open the plan's `SOLUTION.md`. If the protocol reports a dosing schedule and patient criteria, do they fall within the theory's safety and efficacy boundaries? A maximum tolerated dose that is exceeded by the trial design by orders of magnitude is a signal the therapeutic window is too narrow; adjust the theory's risk profile, or note explicitly that the current safety bounds are being violated.

Be brief and specific. Do not write the theory yourself — only review. If a claim is biologically unsound or toxically unviable, say which one and why.
</f12>

<f13>
You operate on the candidate plan the program-director has assigned you to this round. Your clinical trial protocol and simulated outcomes live in that plan's `SOLUTION.md`. You may be invoked on the same plan more than once — within each plan the pipeline runs you and the regulatory-auditor as a loop, alternating with that plan's mechanism loop, while the program-director round-robins across plans.

- If your assigned plan's `SOLUTION.md` does not exist yet, this is the first pass for that plan: produce the trial protocol from scratch based on `problem.md` and the plan's `PLAN.md`.
- If the plan's `SOLUTION.md` already exists, it carries the regulatory-auditor's `<review>` block. Read that feedback. Then open the plan's `THEORY.md` and check whether the latest mechanism introduces safety boundaries, PK/PD targets, or efficacy markers your current protocol doesn't yet respect — for example a tighter toxicity limit your dosing schedule is now violating, or an essential biomarker your endpoints ignore. Revise the plan's `SOLUTION.md` in place to address every reviewer point and to align with the latest theoretical mechanism. Don't discard the previous protocol and start over, and don't leave a flagged issue unaddressed.
- Do not read or touch other plans' files.
</f13>

Each agent's prompt should contain only the information that agent needs to do its job. For each sub-agent (program-director, pharmacologist, toxicology-skeptic, trial-designer, regulatory-auditor), which items should go in its prompt? Respond with a JSON object like {"program-director": ["f?"], "pharmacologist": ["f?"], "toxicology-skeptic": ["f?"], "trial-designer": ["f?"], "regulatory-auditor": ["f?"]}. No other output.

I need you to set up a 5-agent pipeline that develops pharmaceutical drugs by pairing theoretical biochemical mechanism-of-action models with the design of concrete clinical trial protocols in parallel, with each side informing the other. A disease target and therapeutic goals arrive as a natural-language statement in `problem.md`. The pipeline alternates between revising the mechanism theory (pathway targets, receptor affinities, pharmacokinetics) and revising the clinical trial protocol (patient inclusion criteria, dosing schedules, statistical endpoints that measure those effects).

The five agents:

- **program-director** orchestrates the run by alternating one mechanism theory step with one clinical protocol step and tracking progress. It does no modeling, protocol design, or reviewing itself.
- **mechanism loop** — the **pharmacologist** writes the theoretical biochemical mechanism-of-action to `THEORY.md`; the **toxicology-skeptic** judges it. The pharmacologist reads `SOLUTION.md` on each revision pass to incorporate empirical evidence or trial constraints.
- **protocol loop** — the **trial-designer** writes the concrete clinical trial protocol and simulated endpoints to `SOLUTION.md`; the **regulatory-auditor** judges them. The trial-designer reads `THEORY.md` on each revision pass to align the protocol with the latest mechanism claims.

At the end of every turn, each of the subagents briefly reports back what they did, what difficulties they hit, and any open questions.

The pipeline hands work off through plan-namespaced files:

- `problem.md` — the target disease profile and therapeutic goals, read-only. All four domain agents read it.
- `plans/{id}-{slug}/PLAN.md` — one pre-existing candidate drug plan per directory, K plans total, given as input (read-only). All four domain agents read the PLAN.md of the plan they are currently assigned to.
- `plans/{id}-{slug}/THEORY.md` — the theoretical mechanism-of-action for that candidate. Pharmacologist writes; toxicology-skeptic reviews; trial-designer and regulatory-auditor read it.
- `plans/{id}-{slug}/SOLUTION.md` — the clinical trial protocol and expected outcomes for that candidate. Trial-designer writes; regulatory-auditor reviews; pharmacologist and toxicology-skeptic read it.

Each reviewer records its score as a `<review score=X>` block inside the file it reviewed, overwriting any previous block. The program-director reads those scores to drive the loops.

Each candidate plan develops independently. Cross-read between THEORY.md and SOLUTION.md happens only within the same plan; an agent assigned to one plan never reads another plan's files. The program-director round-robins across the K plans: each plan gets one mechanism theory step plus one clinical protocol step per full cycle.

Within each plan, neither the mechanism theory nor the trial protocol finishes first. Both loops alternate within each plan, capped at a fixed total iteration count across all plans. Mechanism theory may tighten after seeing the protocol's expected toxicity limits or patient strata; the protocol may correct after seeing the mechanism theory's refined pharmacokinetic bounds.

I'm providing the following prompt fragments:

<f1>
Keep `SOLUTION.md` lean. Its body — everything except the `<review>` block — must stay under 3000 words (~20KB), about a four-page protocol summary; record only the final trial design and move iteration-by-iteration history into a separate `CHANGELOG.md`. Bold text must not exceed 5% of the file: if everything is bold, nothing is.
</f1>

<f2>
You orchestrate the run; you never define mechanisms, design trials, or review yourself — you only dispatch the right agent at the right time.

- **Init** — discover the K candidate plan directories under `plans/{id}-{slug}/`. Create `STATE.md` with `iter: 0`, `current_plan_idx: 0`, and a per-plan record holding each plan's id, last side, and latest theory/protocol scores.
- **Round-robin pool loop** — at each cycle, advance to the next plan in the round-robin order. For that plan, dispatch one mechanism theory step (pharmacologist, then toxicology-skeptic) and one protocol step (trial-designer, then regulatory-auditor); then move to the next plan. After all K plans have each had one cycle, loop back to the first plan.
- When dispatching, always pass the plan's directory path so the dispatched agent knows which `PLAN.md` / `THEORY.md` / `SOLUTION.md` to operate on.
- Neither side terminates early on its own score within a plan; even a perfect-looking mechanism theory may need to revise once the trial protocol reports actual dosing constraints. The pool keeps cycling even after individual plans look done.
- Cap the total at 20 × K dispatches (10 mechanism theory + 10 protocol per plan, summed across K plans). After the cap, stop and summarize per plan.
- Keep the current iteration count, current plan index, and per-plan latest scores in `STATE.md`, accurate after each dispatch. Read each score from the relevant plan's reviewer `<review score=X>` block. Commit progress after each step.
- Read each agent's brief narrative reply on return. If an agent reports an unresolved error, append it to `error-log.txt` (timestamp + plan id + agent name + content) and continue with the next dispatch.
</f2>

<f3>
You are working on a pharmaceutical drug development project, which may involve small molecules, biologics, gene therapies, or a combination. The target disease profile and therapeutic goals are given as a natural-language statement in `problem.md`; read it before starting your part.
</f3>

<f4>
Score the work from 1 to 10, and record your verdict by overwriting the single `<review score=X>` block at the end of the document you reviewed — overwrite the existing one, never append a second.

Score strictly on real merit. Do not give any credit for a piece of work merely being honest about its own shortcomings — "this dosing schedule is fatally toxic, but I'm telling you it is" is still a failing result, not a passing one.
</f4>

<f5>
Produce the theoretical biochemical mechanism-of-action for the candidate plan the program-director has assigned you to this round, and write it to that plan's `THEORY.md` (under `plans/{id}-{slug}/THEORY.md`). A complete theoretical model covers four kinds of claims, each justified with scientific rationale or literature citations.

- **Receptor and Pathway Targets** — primary targets, binding affinities (Kd, Ki), agonizing/antagonizing roles, and downstream intraevaluationular signaling cascades.
- **Pharmacokinetics/Pharmacodynamics (PK/PD)** — absorption rates, volume of distribution, metabolism, elimination half-life, and expected dose-response curves. State what holds, where, and under which physiological assumptions.
- **Safety Boundaries (Toxicity)** — maximum tolerated concentrations, off-target binding risks, liver/kidney clearance stress, and therapeutic window margins. The clinical protocol's dosing must respect them; the regulatory-auditor will verify this.
- **Efficacy Milestones** — the biochemical or physiological thresholds required to achieve a clinically meaningful response (e.g., % receptor occupancy needed, biomarker shifts).

Ground your claims against the plan's `SOLUTION.md` if it has reported simulated clinical outcomes or dosage schedules. A predicted efficacy threshold that is grossly off from the trial's realistically achievable doses means either the theory needs revision or the protocol has a flaw — diagnose which side has the issue and state it. Be concrete. "The half-life requires QD dosing to maintain steady-state above 50nM" is fine; "the drug has some effects that may help" is not. Do not read or aggregate across other plans' files.
</f5>

<f6>
When you finish, briefly report to the program-director: what you did, what difficulties you hit (or didn't resolve), and any open questions.
</f6>

<f7>
Match the theoretical framework to the drug's nature; do not force an ill-suited one. The list below is useful in biochemical mechanism analysis.

| Tool | Suitable for |
|---|---|
| Michaelis-Menten kinetics | Enzyme inhibitors; predicting saturation, Vmax, and competitive inhibition |
| Two-compartment PK modeling | Intravenous drugs; distribution phase vs. elimination phase analysis |
| Allosteric modulation models | Receptor modulators; analyzing non-competitive binding and conformational shifts |
| Quantitative Structure-Activity Relationship (QSAR) | Small molecules; predicting potency and toxicity from molecular descriptors |
| Physiologically Based Pharmacokinetics (PBPK) | Complex formulations; estimating tissue concentrations across different organ systems |
| Target-mediated drug disposition (TMDD) | Biologics/monoclonal antibodies; nonlinear clearance due to target binding |
| Systems biology networks | Pathway inhibitors; mapping feedback loops, upregulation, or escape mechanisms |
| Therapeutic Index (TI) calculations | Narrow therapeutic window drugs; balancing the ED50 against the TD50 |
</f7>

<f8>
You operate on the plan the program-director has assigned you to this round. Read `problem.md`, your assigned plan's `PLAN.md`, and your assigned plan's `THEORY.md`, then write the concrete clinical trial protocol:

- Outline every phase element. Define the patient inclusion/exclusion criteria, formulate the dosing regimen and administration route exactly as needed, establish the statistical endpoints, and specify the monitoring schedules. Simulate or outline the expected statistical power, trial duration, and expected hazard ratios.
- Make the protocol testable against the plan's `THEORY.md`. If the mechanism theory states a minimum effective concentration, your dosing schedule must realistically achieve it. If the theory identifies a specific toxicity risk, your monitoring schedule must track the relevant biomarkers.
- Review the trial logistics yourself and trace them through to completion — do not leave phases undefined. If a dosing schedule violates safety bounds, find and fix the root cause; do not ignore the toxicity limits.
- Sanity-check the trial design against the plan's `THEORY.md`. A biomarker that must be measured for efficacy should not be omitted from the endpoints; a half-life the theory claims must dictate the frequency of dosing.

Write the protocol and its expected outcomes up in your assigned plan's `SOLUTION.md`. Do not read or write any other plan's files.
</f8>

<f9>
Review your assigned plan's `SOLUTION.md` against `problem.md`, against the plan's `PLAN.md`, and against the plan's `THEORY.md`. Operate strictly on the assigned plan's files; do not look at other plans.

- Inspect the reported trial design for anomalies, unreasonable dosing frequencies, or safety/ethical violations stated directly in `problem.md` or in the plan's `PLAN.md`.
- Open the plan's `THEORY.md`. For every safety bound, PK/PD parameter, and efficacy milestone the theory claims, write a check into a separate `verify.py` under the plan's directory: does the protocol's expected dosing satisfy the toxicity limits, achieve the predicted effective concentrations, and measure the required biomarkers? Run it. Name any inclusion criterion, dose, or endpoint that violates.
- Read the trial protocol and spot-check it for logistical flaws — unmeasurable endpoints, statistically underpowered sample sizes, or patient criteria that contradict the target population. A protocol flaw that silently invalidates the trial's data is worse than one that makes recruitment slow.
- Treat the trial design as finished only when every safety constraint holds, every theory-claimed biomarker is tracked, and the dosing schedule is consistent with the theory's PK/PD models — not merely when the document is formatted correctly.
- Check the length of the plan's `SOLUTION.md`: if it exceeds 20KB, give a warning, but do not deduct points for it.
- Check the bold ratio of the plan's `SOLUTION.md`: if bold text exceeds 5% of the file, give a warning, but do not deduct points for it.
</f9>

<f10>
Claude responds well to clear, explicit instructions. Being specific about your desired output can help enhance results. If you want "above and beyond" behavior, explicitly request it rather than relying on the model to infer this from vague prompts.

Think of Claude as a brilliant but new employee who lacks context on your norms and workflows. The more precisely you explain what you want, the better the result.

Topology rule: Show your prompt to a colleague with minimal context on the task and ask them to follow it. If they'd be confused, Claude will be too.

- Be specific about the desired output format and constraints.
- Provide instructions as sequential steps using numbered lists or bullet points when the order or completeness of steps matters.
</f10>

<f11>
You operate on the candidate plan the program-director has assigned you to this round. Your theoretical mechanism-of-action lives in that plan's `THEORY.md`. You may be invoked on the same plan more than once — within each plan the pipeline runs you and the toxicology-skeptic as a loop, alternating with that plan's protocol loop, while the program-director round-robins across plans.

- If your assigned plan's `THEORY.md` does not exist yet, this is the first pass for that plan: produce the theoretical mechanism from scratch based on `problem.md` and the plan's `PLAN.md`.
- If the plan's `THEORY.md` already exists, it carries the toxicology-skeptic's `<review>` block. Read that feedback. Then open the plan's `SOLUTION.md` and look at the latest reported clinical outcomes or dosing limits — they may invalidate, sharpen, or motivate revisions to your biological claims. Revise the plan's `THEORY.md` in place to address every reviewer point raised and to incorporate any clinical evidence that changes your analysis. Don't discard the previous analysis and start over, and don't leave a flagged issue unaddressed.
- Do not read or touch other plans' files.
</f11>

<f12>
Review your assigned plan's `THEORY.md` against `problem.md`, against the plan's `PLAN.md`, and against the dosing and endpoints reported in the plan's `SOLUTION.md` (if any). Operate strictly on the assigned plan's files; do not look at other plans.

- **Scientific Faithfulness** — does the mechanism theory correctly address the disease stated in `problem.md` under the therapeutic strategy set by the plan's `PLAN.md`? Check molecular targets, pathway assumptions, and evaluationular contexts.
- **Pharmacological soundness** — for each claim, walk through the rationale or citation. Flag hand-waving steps. Verify that cited PK/PD models apply under the stated physiological assumptions.
- **Clinical grounding** — open the plan's `SOLUTION.md`. If the protocol reports a dosing schedule and patient criteria, do they fall within the theory's safety and efficacy boundaries? A maximum tolerated dose that is exceeded by the trial design by orders of magnitude is a signal the therapeutic window is too narrow; adjust the theory's risk profile, or note explicitly that the current safety bounds are being violated.

Be brief and specific. Do not write the theory yourself — only review. If a claim is biologically unsound or toxically unviable, say which one and why.
</f12>

<f13>
You operate on the candidate plan the program-director has assigned you to this round. Your clinical trial protocol and simulated outcomes live in that plan's `SOLUTION.md`. You may be invoked on the same plan more than once — within each plan the pipeline runs you and the regulatory-auditor as a loop, alternating with that plan's mechanism loop, while the program-director round-robins across plans.

- If your assigned plan's `SOLUTION.md` does not exist yet, this is the first pass for that plan: produce the trial protocol from scratch based on `problem.md` and the plan's `PLAN.md`.
- If the plan's `SOLUTION.md` already exists, it carries the regulatory-auditor's `<review>` block. Read that feedback. Then open the plan's `THEORY.md` and check whether the latest mechanism introduces safety boundaries, PK/PD targets, or efficacy markers your current protocol doesn't yet respect — for example a tighter toxicity limit your dosing schedule is now violating, or an essential biomarker your endpoints ignore. Revise the plan's `SOLUTION.md` in place to address every reviewer point and to align with the latest theoretical mechanism. Don't discard the previous protocol and start over, and don't leave a flagged issue unaddressed.
- Do not read or touch other plans' files.
</f13>

Each agent's prompt should contain only the fragments that agent needs to do its job. When you include a fragment, paste the FULL block verbatim — no paraphrasing, no partial inclusion, no rewriting of fragment content. Brief connective text between fragments (e.g., "Then: ...", "Note: ...") is fine. Format: one markdown section per role, with the role name as an h1 header (e.g. `# program-director`). Output only the headered prompts, no preamble.


I need you to set up a 5-agent pipeline that develops pharmaceutical drugs by pairing theoretical biochemical mechanism-of-action models with the design of concrete clinical trial protocols in parallel, with each side informing the other. A disease target and therapeutic goals arrive as a natural-language statement in `problem.md`. The pipeline alternates between revising the mechanism theory (pathway targets, receptor affinities, pharmacokinetics) and revising the clinical trial protocol (patient inclusion criteria, dosing schedules, statistical endpoints that measure those effects).

The five agents:

- **program-director** orchestrates the run by alternating one mechanism theory step with one clinical protocol step and tracking progress. It does no modeling, protocol design, or reviewing itself.
- **mechanism loop** — the **pharmacologist** writes the theoretical biochemical mechanism-of-action to `THEORY.md`; the **toxicology-skeptic** judges it. The pharmacologist reads `SOLUTION.md` on each revision pass to incorporate empirical evidence or trial constraints.
- **protocol loop** — the **trial-designer** writes the concrete clinical trial protocol and simulated endpoints to `SOLUTION.md`; the **regulatory-auditor** judges them. The trial-designer reads `THEORY.md` on each revision pass to align the protocol with the latest mechanism claims.

At the end of every turn, each of the subagents briefly reports back what they did, what difficulties they hit, and any open questions.

The pipeline hands work off through plan-namespaced files:

- `problem.md` — the target disease profile and therapeutic goals, read-only. All four domain agents read it.
- `plans/{id}-{slug}/PLAN.md` — one pre-existing candidate drug plan per directory, K plans total, given as input (read-only). All four domain agents read the PLAN.md of the plan they are currently assigned to.
- `plans/{id}-{slug}/THEORY.md` — the theoretical mechanism-of-action for that candidate. Pharmacologist writes; toxicology-skeptic reviews; trial-designer and regulatory-auditor read it.
- `plans/{id}-{slug}/SOLUTION.md` — the clinical trial protocol and expected outcomes for that candidate. Trial-designer writes; regulatory-auditor reviews; pharmacologist and toxicology-skeptic read it.

Each reviewer records its score as a `<review score=X>` block inside the file it reviewed, overwriting any previous block. The program-director reads those scores to drive the loops.

Each candidate plan develops independently. Cross-read between THEORY.md and SOLUTION.md happens only within the same plan; an agent assigned to one plan never reads another plan's files. The program-director round-robins across the K plans: each plan gets one mechanism theory step plus one clinical protocol step per full cycle.

Within each plan, neither the mechanism theory nor the trial protocol finishes first. Both loops alternate within each plan, capped at a fixed total iteration count across all plans. Mechanism theory may tighten after seeing the protocol's expected toxicity limits or patient strata; the protocol may correct after seeing the mechanism theory's refined pharmacokinetic bounds.

I'm providing the following information:

<f1>
You operate on the plan the program-director has assigned you to this round. Read `problem.md`, your assigned plan's `PLAN.md`, and your assigned plan's `THEORY.md`, then write the concrete clinical trial protocol:

- Outline every phase element. Define the patient inclusion/exclusion criteria, formulate the dosing regimen and administration route exactly as needed, establish the statistical endpoints, and specify the monitoring schedules. Simulate or outline the expected statistical power, trial duration, and expected hazard ratios.
- Make the protocol testable against the plan's `THEORY.md`. If the mechanism theory states a minimum effective concentration, your dosing schedule must realistically achieve it. If the theory identifies a specific toxicity risk, your monitoring schedule must track the relevant biomarkers.
- Review the trial logistics yourself and trace them through to completion — do not leave phases undefined. If a dosing schedule violates safety bounds, find and fix the root cause; do not ignore the toxicity limits.
- Sanity-check the trial design against the plan's `THEORY.md`. A biomarker that must be measured for efficacy should not be omitted from the endpoints; a half-life the theory claims must dictate the frequency of dosing.

Write the protocol and its expected outcomes up in your assigned plan's `SOLUTION.md`. Do not read or write any other plan's files.
</f1>

<f2>
Match the theoretical framework to the drug's nature; do not force an ill-suited one. The list below is useful in biochemical mechanism analysis.

| Tool | Suitable for |
|---|---|
| Michaelis-Menten kinetics | Enzyme inhibitors; predicting saturation, Vmax, and competitive inhibition |
| Two-compartment PK modeling | Intravenous drugs; distribution phase vs. elimination phase analysis |
| Allosteric modulation models | Receptor modulators; analyzing non-competitive binding and conformational shifts |
| Quantitative Structure-Activity Relationship (QSAR) | Small molecules; predicting potency and toxicity from molecular descriptors |
| Physiologically Based Pharmacokinetics (PBPK) | Complex formulations; estimating tissue concentrations across different organ systems |
| Target-mediated drug disposition (TMDD) | Biologics/monoclonal antibodies; nonlinear clearance due to target binding |
| Systems biology networks | Pathway inhibitors; mapping feedback loops, upregulation, or escape mechanisms |
| Therapeutic Index (TI) calculations | Narrow therapeutic window drugs; balancing the ED50 against the TD50 |
</f2>

<f3>
You operate on the candidate plan the program-director has assigned you to this round. Your clinical trial protocol and simulated outcomes live in that plan's `SOLUTION.md`. You may be invoked on the same plan more than once — within each plan the pipeline runs you and the regulatory-auditor as a loop, alternating with that plan's mechanism loop, while the program-director round-robins across plans.

- If your assigned plan's `SOLUTION.md` does not exist yet, this is the first pass for that plan: produce the trial protocol from scratch based on `problem.md` and the plan's `PLAN.md`.
- If the plan's `SOLUTION.md` already exists, it carries the regulatory-auditor's `<review>` block. Read that feedback. Then open the plan's `THEORY.md` and check whether the latest mechanism introduces safety boundaries, PK/PD targets, or efficacy markers your current protocol doesn't yet respect — for example a tighter toxicity limit your dosing schedule is now violating, or an essential biomarker your endpoints ignore. Revise the plan's `SOLUTION.md` in place to address every reviewer point and to align with the latest theoretical mechanism. Don't discard the previous protocol and start over, and don't leave a flagged issue unaddressed.
- Do not read or touch other plans' files.
</f3>

<f4>
Review your assigned plan's `THEORY.md` against `problem.md`, against the plan's `PLAN.md`, and against the dosing and endpoints reported in the plan's `SOLUTION.md` (if any). Operate strictly on the assigned plan's files; do not look at other plans.

- **Scientific Faithfulness** — does the mechanism theory correctly address the disease stated in `problem.md` under the therapeutic strategy set by the plan's `PLAN.md`? Check molecular targets, pathway assumptions, and evaluationular contexts.
- **Pharmacological soundness** — for each claim, walk through the rationale or citation. Flag hand-waving steps. Verify that cited PK/PD models apply under the stated physiological assumptions.
- **Clinical grounding** — open the plan's `SOLUTION.md`. If the protocol reports a dosing schedule and patient criteria, do they fall within the theory's safety and efficacy boundaries? A maximum tolerated dose that is exceeded by the trial design by orders of magnitude is a signal the therapeutic window is too narrow; adjust the theory's risk profile, or note explicitly that the current safety bounds are being violated.

Be brief and specific. Do not write the theory yourself — only review. If a claim is biologically unsound or toxically unviable, say which one and why.
</f4>

<f5>
You orchestrate the run; you never define mechanisms, design trials, or review yourself — you only dispatch the right agent at the right time.

- **Init** — discover the K candidate plan directories under `plans/{id}-{slug}/`. Create `STATE.md` with `iter: 0`, `current_plan_idx: 0`, and a per-plan record holding each plan's id, last side, and latest theory/protocol scores.
- **Round-robin pool loop** — at each cycle, advance to the next plan in the round-robin order. For that plan, dispatch one mechanism theory step (pharmacologist, then toxicology-skeptic) and one protocol step (trial-designer, then regulatory-auditor); then move to the next plan. After all K plans have each had one cycle, loop back to the first plan.
- When dispatching, always pass the plan's directory path so the dispatched agent knows which `PLAN.md` / `THEORY.md` / `SOLUTION.md` to operate on.
- Neither side terminates early on its own score within a plan; even a perfect-looking mechanism theory may need to revise once the trial protocol reports actual dosing constraints. The pool keeps cycling even after individual plans look done.
- Cap the total at 20 × K dispatches (10 mechanism theory + 10 protocol per plan, summed across K plans). After the cap, stop and summarize per plan.
- Keep the current iteration count, current plan index, and per-plan latest scores in `STATE.md`, accurate after each dispatch. Read each score from the relevant plan's reviewer `<review score=X>` block. Commit progress after each step.
- Read each agent's brief narrative reply on return. If an agent reports an unresolved error, append it to `error-log.txt` (timestamp + plan id + agent name + content) and continue with the next dispatch.
</f5>

<f6>
Produce the theoretical biochemical mechanism-of-action for the candidate plan the program-director has assigned you to this round, and write it to that plan's `THEORY.md` (under `plans/{id}-{slug}/THEORY.md`). A complete theoretical model covers four kinds of claims, each justified with scientific rationale or literature citations.

- **Receptor and Pathway Targets** — primary targets, binding affinities (Kd, Ki), agonizing/antagonizing roles, and downstream intraevaluationular signaling cascades.
- **Pharmacokinetics/Pharmacodynamics (PK/PD)** — absorption rates, volume of distribution, metabolism, elimination half-life, and expected dose-response curves. State what holds, where, and under which physiological assumptions.
- **Safety Boundaries (Toxicity)** — maximum tolerated concentrations, off-target binding risks, liver/kidney clearance stress, and therapeutic window margins. The clinical protocol's dosing must respect them; the regulatory-auditor will verify this.
- **Efficacy Milestones** — the biochemical or physiological thresholds required to achieve a clinically meaningful response (e.g., % receptor occupancy needed, biomarker shifts).

Ground your claims against the plan's `SOLUTION.md` if it has reported simulated clinical outcomes or dosage schedules. A predicted efficacy threshold that is grossly off from the trial's realistically achievable doses means either the theory needs revision or the protocol has a flaw — diagnose which side has the issue and state it. Be concrete. "The half-life requires QD dosing to maintain steady-state above 50nM" is fine; "the drug has some effects that may help" is not. Do not read or aggregate across other plans' files.
</f6>

<f7>
Score the work from 1 to 10, and record your verdict by overwriting the single `<review score=X>` block at the end of the document you reviewed — overwrite the existing one, never append a second.

Score strictly on real merit. Do not give any credit for a piece of work merely being honest about its own shortcomings — "this dosing schedule is fatally toxic, but I'm telling you it is" is still a failing result, not a passing one.
</f7>

<f8>
Keep `SOLUTION.md` lean. Its body — everything except the `<review>` block — must stay under 3000 words (~20KB), about a four-page protocol summary; record only the final trial design and move iteration-by-iteration history into a separate `CHANGELOG.md`. Bold text must not exceed 5% of the file: if everything is bold, nothing is.
</f8>

<f9>
When you finish, briefly report to the program-director: what you did, what difficulties you hit (or didn't resolve), and any open questions.
</f9>

<f10>
XML tags help Claude parse complex prompts unambiguously, especially when your prompt mixes instructions, context, examples, and variable inputs. Wrapping each type of content in its own tag (e.g. `<instructions>`, `<context>`, `<input>`) reduces misinterpretation.

Best practices:
- Use consistent, descriptive tag names across your prompts.
- Nest tags when content has a natural hierarchy (documents inside `<documents>`, each inside `<document index="n">`).
</f10>

<f11>
You are working on a pharmaceutical drug development project, which may involve small molecules, biologics, gene therapies, or a combination. The target disease profile and therapeutic goals are given as a natural-language statement in `problem.md`; read it before starting your part.
</f11>

<f12>
You operate on the candidate plan the program-director has assigned you to this round. Your theoretical mechanism-of-action lives in that plan's `THEORY.md`. You may be invoked on the same plan more than once — within each plan the pipeline runs you and the toxicology-skeptic as a loop, alternating with that plan's protocol loop, while the program-director round-robins across plans.

- If your assigned plan's `THEORY.md` does not exist yet, this is the first pass for that plan: produce the theoretical mechanism from scratch based on `problem.md` and the plan's `PLAN.md`.
- If the plan's `THEORY.md` already exists, it carries the toxicology-skeptic's `<review>` block. Read that feedback. Then open the plan's `SOLUTION.md` and look at the latest reported clinical outcomes or dosing limits — they may invalidate, sharpen, or motivate revisions to your biological claims. Revise the plan's `THEORY.md` in place to address every reviewer point raised and to incorporate any clinical evidence that changes your analysis. Don't discard the previous analysis and start over, and don't leave a flagged issue unaddressed.
- Do not read or touch other plans' files.
</f12>

<f13>
Review your assigned plan's `SOLUTION.md` against `problem.md`, against the plan's `PLAN.md`, and against the plan's `THEORY.md`. Operate strictly on the assigned plan's files; do not look at other plans.

- Inspect the reported trial design for anomalies, unreasonable dosing frequencies, or safety/ethical violations stated directly in `problem.md` or in the plan's `PLAN.md`.
- Open the plan's `THEORY.md`. For every safety bound, PK/PD parameter, and efficacy milestone the theory claims, write a check into a separate `verify.py` under the plan's directory: does the protocol's expected dosing satisfy the toxicity limits, achieve the predicted effective concentrations, and measure the required biomarkers? Run it. Name any inclusion criterion, dose, or endpoint that violates.
- Read the trial protocol and spot-check it for logistical flaws — unmeasurable endpoints, statistically underpowered sample sizes, or patient criteria that contradict the target population. A protocol flaw that silently invalidates the trial's data is worse than one that makes recruitment slow.
- Treat the trial design as finished only when every safety constraint holds, every theory-claimed biomarker is tracked, and the dosing schedule is consistent with the theory's PK/PD models — not merely when the document is formatted correctly.
- Check the length of the plan's `SOLUTION.md`: if it exceeds 20KB, give a warning, but do not deduct points for it.
- Check the bold ratio of the plan's `SOLUTION.md`: if bold text exceeds 5% of the file, give a warning, but do not deduct points for it.
</f13>

Each agent's prompt should contain only the information that agent needs to do its job. For each sub-agent (program-director, pharmacologist, toxicology-skeptic, trial-designer, regulatory-auditor), which items should go in its prompt? Respond with a JSON object like {"program-director": ["f?"], "pharmacologist": ["f?"], "toxicology-skeptic": ["f?"], "trial-designer": ["f?"], "regulatory-auditor": ["f?"]}. No other output.

I need you to set up a 5-agent pipeline that develops pharmaceutical drugs by pairing theoretical biochemical mechanism-of-action models with the design of concrete clinical trial protocols in parallel, with each side informing the other. A disease target and therapeutic goals arrive as a natural-language statement in `problem.md`. The pipeline alternates between revising the mechanism theory (pathway targets, receptor affinities, pharmacokinetics) and revising the clinical trial protocol (patient inclusion criteria, dosing schedules, statistical endpoints that measure those effects).

The five agents:

- **program-director** orchestrates the run by alternating one mechanism theory step with one clinical protocol step and tracking progress. It does no modeling, protocol design, or reviewing itself.
- **mechanism loop** — the **pharmacologist** writes the theoretical biochemical mechanism-of-action to `THEORY.md`; the **toxicology-skeptic** judges it. The pharmacologist reads `SOLUTION.md` on each revision pass to incorporate empirical evidence or trial constraints.
- **protocol loop** — the **trial-designer** writes the concrete clinical trial protocol and simulated endpoints to `SOLUTION.md`; the **regulatory-auditor** judges them. The trial-designer reads `THEORY.md` on each revision pass to align the protocol with the latest mechanism claims.

At the end of every turn, each of the subagents briefly reports back what they did, what difficulties they hit, and any open questions.

The pipeline hands work off through plan-namespaced files:

- `problem.md` — the target disease profile and therapeutic goals, read-only. All four domain agents read it.
- `plans/{id}-{slug}/PLAN.md` — one pre-existing candidate drug plan per directory, K plans total, given as input (read-only). All four domain agents read the PLAN.md of the plan they are currently assigned to.
- `plans/{id}-{slug}/THEORY.md` — the theoretical mechanism-of-action for that candidate. Pharmacologist writes; toxicology-skeptic reviews; trial-designer and regulatory-auditor read it.
- `plans/{id}-{slug}/SOLUTION.md` — the clinical trial protocol and expected outcomes for that candidate. Trial-designer writes; regulatory-auditor reviews; pharmacologist and toxicology-skeptic read it.

Each reviewer records its score as a `<review score=X>` block inside the file it reviewed, overwriting any previous block. The program-director reads those scores to drive the loops.

Each candidate plan develops independently. Cross-read between THEORY.md and SOLUTION.md happens only within the same plan; an agent assigned to one plan never reads another plan's files. The program-director round-robins across the K plans: each plan gets one mechanism theory step plus one clinical protocol step per full cycle.

Within each plan, neither the mechanism theory nor the trial protocol finishes first. Both loops alternate within each plan, capped at a fixed total iteration count across all plans. Mechanism theory may tighten after seeing the protocol's expected toxicity limits or patient strata; the protocol may correct after seeing the mechanism theory's refined pharmacokinetic bounds.

I'm providing the following prompt fragments:

<f1>
You operate on the plan the program-director has assigned you to this round. Read `problem.md`, your assigned plan's `PLAN.md`, and your assigned plan's `THEORY.md`, then write the concrete clinical trial protocol:

- Outline every phase element. Define the patient inclusion/exclusion criteria, formulate the dosing regimen and administration route exactly as needed, establish the statistical endpoints, and specify the monitoring schedules. Simulate or outline the expected statistical power, trial duration, and expected hazard ratios.
- Make the protocol testable against the plan's `THEORY.md`. If the mechanism theory states a minimum effective concentration, your dosing schedule must realistically achieve it. If the theory identifies a specific toxicity risk, your monitoring schedule must track the relevant biomarkers.
- Review the trial logistics yourself and trace them through to completion — do not leave phases undefined. If a dosing schedule violates safety bounds, find and fix the root cause; do not ignore the toxicity limits.
- Sanity-check the trial design against the plan's `THEORY.md`. A biomarker that must be measured for efficacy should not be omitted from the endpoints; a half-life the theory claims must dictate the frequency of dosing.

Write the protocol and its expected outcomes up in your assigned plan's `SOLUTION.md`. Do not read or write any other plan's files.
</f1>

<f2>
Match the theoretical framework to the drug's nature; do not force an ill-suited one. The list below is useful in biochemical mechanism analysis.

| Tool | Suitable for |
|---|---|
| Michaelis-Menten kinetics | Enzyme inhibitors; predicting saturation, Vmax, and competitive inhibition |
| Two-compartment PK modeling | Intravenous drugs; distribution phase vs. elimination phase analysis |
| Allosteric modulation models | Receptor modulators; analyzing non-competitive binding and conformational shifts |
| Quantitative Structure-Activity Relationship (QSAR) | Small molecules; predicting potency and toxicity from molecular descriptors |
| Physiologically Based Pharmacokinetics (PBPK) | Complex formulations; estimating tissue concentrations across different organ systems |
| Target-mediated drug disposition (TMDD) | Biologics/monoclonal antibodies; nonlinear clearance due to target binding |
| Systems biology networks | Pathway inhibitors; mapping feedback loops, upregulation, or escape mechanisms |
| Therapeutic Index (TI) calculations | Narrow therapeutic window drugs; balancing the ED50 against the TD50 |
</f2>

<f3>
You operate on the candidate plan the program-director has assigned you to this round. Your clinical trial protocol and simulated outcomes live in that plan's `SOLUTION.md`. You may be invoked on the same plan more than once — within each plan the pipeline runs you and the regulatory-auditor as a loop, alternating with that plan's mechanism loop, while the program-director round-robins across plans.

- If your assigned plan's `SOLUTION.md` does not exist yet, this is the first pass for that plan: produce the trial protocol from scratch based on `problem.md` and the plan's `PLAN.md`.
- If the plan's `SOLUTION.md` already exists, it carries the regulatory-auditor's `<review>` block. Read that feedback. Then open the plan's `THEORY.md` and check whether the latest mechanism introduces safety boundaries, PK/PD targets, or efficacy markers your current protocol doesn't yet respect — for example a tighter toxicity limit your dosing schedule is now violating, or an essential biomarker your endpoints ignore. Revise the plan's `SOLUTION.md` in place to address every reviewer point and to align with the latest theoretical mechanism. Don't discard the previous protocol and start over, and don't leave a flagged issue unaddressed.
- Do not read or touch other plans' files.
</f3>

<f4>
Review your assigned plan's `THEORY.md` against `problem.md`, against the plan's `PLAN.md`, and against the dosing and endpoints reported in the plan's `SOLUTION.md` (if any). Operate strictly on the assigned plan's files; do not look at other plans.

- **Scientific Faithfulness** — does the mechanism theory correctly address the disease stated in `problem.md` under the therapeutic strategy set by the plan's `PLAN.md`? Check molecular targets, pathway assumptions, and evaluationular contexts.
- **Pharmacological soundness** — for each claim, walk through the rationale or citation. Flag hand-waving steps. Verify that cited PK/PD models apply under the stated physiological assumptions.
- **Clinical grounding** — open the plan's `SOLUTION.md`. If the protocol reports a dosing schedule and patient criteria, do they fall within the theory's safety and efficacy boundaries? A maximum tolerated dose that is exceeded by the trial design by orders of magnitude is a signal the therapeutic window is too narrow; adjust the theory's risk profile, or note explicitly that the current safety bounds are being violated.

Be brief and specific. Do not write the theory yourself — only review. If a claim is biologically unsound or toxically unviable, say which one and why.
</f4>

<f5>
You orchestrate the run; you never define mechanisms, design trials, or review yourself — you only dispatch the right agent at the right time.

- **Init** — discover the K candidate plan directories under `plans/{id}-{slug}/`. Create `STATE.md` with `iter: 0`, `current_plan_idx: 0`, and a per-plan record holding each plan's id, last side, and latest theory/protocol scores.
- **Round-robin pool loop** — at each cycle, advance to the next plan in the round-robin order. For that plan, dispatch one mechanism theory step (pharmacologist, then toxicology-skeptic) and one protocol step (trial-designer, then regulatory-auditor); then move to the next plan. After all K plans have each had one cycle, loop back to the first plan.
- When dispatching, always pass the plan's directory path so the dispatched agent knows which `PLAN.md` / `THEORY.md` / `SOLUTION.md` to operate on.
- Neither side terminates early on its own score within a plan; even a perfect-looking mechanism theory may need to revise once the trial protocol reports actual dosing constraints. The pool keeps cycling even after individual plans look done.
- Cap the total at 20 × K dispatches (10 mechanism theory + 10 protocol per plan, summed across K plans). After the cap, stop and summarize per plan.
- Keep the current iteration count, current plan index, and per-plan latest scores in `STATE.md`, accurate after each dispatch. Read each score from the relevant plan's reviewer `<review score=X>` block. Commit progress after each step.
- Read each agent's brief narrative reply on return. If an agent reports an unresolved error, append it to `error-log.txt` (timestamp + plan id + agent name + content) and continue with the next dispatch.
</f5>

<f6>
Produce the theoretical biochemical mechanism-of-action for the candidate plan the program-director has assigned you to this round, and write it to that plan's `THEORY.md` (under `plans/{id}-{slug}/THEORY.md`). A complete theoretical model covers four kinds of claims, each justified with scientific rationale or literature citations.

- **Receptor and Pathway Targets** — primary targets, binding affinities (Kd, Ki), agonizing/antagonizing roles, and downstream intraevaluationular signaling cascades.
- **Pharmacokinetics/Pharmacodynamics (PK/PD)** — absorption rates, volume of distribution, metabolism, elimination half-life, and expected dose-response curves. State what holds, where, and under which physiological assumptions.
- **Safety Boundaries (Toxicity)** — maximum tolerated concentrations, off-target binding risks, liver/kidney clearance stress, and therapeutic window margins. The clinical protocol's dosing must respect them; the regulatory-auditor will verify this.
- **Efficacy Milestones** — the biochemical or physiological thresholds required to achieve a clinically meaningful response (e.g., % receptor occupancy needed, biomarker shifts).

Ground your claims against the plan's `SOLUTION.md` if it has reported simulated clinical outcomes or dosage schedules. A predicted efficacy threshold that is grossly off from the trial's realistically achievable doses means either the theory needs revision or the protocol has a flaw — diagnose which side has the issue and state it. Be concrete. "The half-life requires QD dosing to maintain steady-state above 50nM" is fine; "the drug has some effects that may help" is not. Do not read or aggregate across other plans' files.
</f6>

<f7>
Score the work from 1 to 10, and record your verdict by overwriting the single `<review score=X>` block at the end of the document you reviewed — overwrite the existing one, never append a second.

Score strictly on real merit. Do not give any credit for a piece of work merely being honest about its own shortcomings — "this dosing schedule is fatally toxic, but I'm telling you it is" is still a failing result, not a passing one.
</f7>

<f8>
Keep `SOLUTION.md` lean. Its body — everything except the `<review>` block — must stay under 3000 words (~20KB), about a four-page protocol summary; record only the final trial design and move iteration-by-iteration history into a separate `CHANGELOG.md`. Bold text must not exceed 5% of the file: if everything is bold, nothing is.
</f8>

<f9>
When you finish, briefly report to the program-director: what you did, what difficulties you hit (or didn't resolve), and any open questions.
</f9>

<f10>
XML tags help Claude parse complex prompts unambiguously, especially when your prompt mixes instructions, context, examples, and variable inputs. Wrapping each type of content in its own tag (e.g. `<instructions>`, `<context>`, `<input>`) reduces misinterpretation.

Best practices:
- Use consistent, descriptive tag names across your prompts.
- Nest tags when content has a natural hierarchy (documents inside `<documents>`, each inside `<document index="n">`).
</f10>

<f11>
You are working on a pharmaceutical drug development project, which may involve small molecules, biologics, gene therapies, or a combination. The target disease profile and therapeutic goals are given as a natural-language statement in `problem.md`; read it before starting your part.
</f11>

<f12>
You operate on the candidate plan the program-director has assigned you to this round. Your theoretical mechanism-of-action lives in that plan's `THEORY.md`. You may be invoked on the same plan more than once — within each plan the pipeline runs you and the toxicology-skeptic as a loop, alternating with that plan's protocol loop, while the program-director round-robins across plans.

- If your assigned plan's `THEORY.md` does not exist yet, this is the first pass for that plan: produce the theoretical mechanism from scratch based on `problem.md` and the plan's `PLAN.md`.
- If the plan's `THEORY.md` already exists, it carries the toxicology-skeptic's `<review>` block. Read that feedback. Then open the plan's `SOLUTION.md` and look at the latest reported clinical outcomes or dosing limits — they may invalidate, sharpen, or motivate revisions to your biological claims. Revise the plan's `THEORY.md` in place to address every reviewer point raised and to incorporate any clinical evidence that changes your analysis. Don't discard the previous analysis and start over, and don't leave a flagged issue unaddressed.
- Do not read or touch other plans' files.
</f12>

<f13>
Review your assigned plan's `SOLUTION.md` against `problem.md`, against the plan's `PLAN.md`, and against the plan's `THEORY.md`. Operate strictly on the assigned plan's files; do not look at other plans.

- Inspect the reported trial design for anomalies, unreasonable dosing frequencies, or safety/ethical violations stated directly in `problem.md` or in the plan's `PLAN.md`.
- Open the plan's `THEORY.md`. For every safety bound, PK/PD parameter, and efficacy milestone the theory claims, write a check into a separate `verify.py` under the plan's directory: does the protocol's expected dosing satisfy the toxicity limits, achieve the predicted effective concentrations, and measure the required biomarkers? Run it. Name any inclusion criterion, dose, or endpoint that violates.
- Read the trial protocol and spot-check it for logistical flaws — unmeasurable endpoints, statistically underpowered sample sizes, or patient criteria that contradict the target population. A protocol flaw that silently invalidates the trial's data is worse than one that makes recruitment slow.
- Treat the trial design as finished only when every safety constraint holds, every theory-claimed biomarker is tracked, and the dosing schedule is consistent with the theory's PK/PD models — not merely when the document is formatted correctly.
- Check the length of the plan's `SOLUTION.md`: if it exceeds 20KB, give a warning, but do not deduct points for it.
- Check the bold ratio of the plan's `SOLUTION.md`: if bold text exceeds 5% of the file, give a warning, but do not deduct points for it.
</f13>

Each agent's prompt should contain only the fragments that agent needs to do its job. When you include a fragment, paste the FULL block verbatim — no paraphrasing, no partial inclusion, no rewriting of fragment content. Brief connective text between fragments (e.g., "Then: ...", "Note: ...") is fine. Format: one markdown section per role, with the role name as an h1 header (e.g. `# program-director`). Output only the headered prompts, no preamble.