lead-producer economy-designer meta-strategist bot-scripter exploit-investigator

I need you to set up a 5-agent pipeline that solves multiplayer video game economy balancing by developing spreadsheet-based macroeconomic limits and automated bot playtesting in parallel, with each side informing the other. A problem arrives as a natural-language statement in `problem.md`. The pipeline alternates between revising the macroeconomy (currency caps, sink/source ratios, inflation limits) and revising the playtest (an automated bot implementation that attempts to optimize or exploit those rules).

The five agents:

- **lead-producer** orchestrates the run by alternating one economy step with one playtest step and tracking progress. It does no design, scripting, or reviewing itself.
- **macro loop** — the **economy-designer** writes the spreadsheet-based macroeconomic limits to `MACRO.md`; the **meta-strategist** judges it. The economy-designer reads `PLAYTEST.md` on each revision pass to incorporate empirical evidence.
- **playtest loop** — the **bot-scripter** writes bot playtesting scripts and their gameplay logs to `PLAYTEST.md`; the **exploit-investigator** judges them. The bot-scripter reads `MACRO.md` on each revision pass to align the bot's farming/trading strategies with the latest macroeconomic limits.

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 three files:

- `problem.md` — the original game concept and economy problem, read-only. All four domain agents read it.
- `MACRO.md` — the macroeconomic limits. economy-designer writes; meta-strategist reviews; bot-scripter and exploit-investigator read it to know which inflation caps and sink/source rules the bot playtest must navigate.
- `PLAYTEST.md` — the automated bot playtest code and its exploit logs. bot-scripter writes; exploit-investigator reviews; economy-designer and meta-strategist read it to ground the spreadsheet theories in observed gameplay metrics.

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

Unlike a linear design-then-playtest pipeline where the design must converge before the playtest starts, here neither side ever finishes first. Both loops alternate forever, capped at a fixed iteration count. The economy design may tighten after seeing the playtest's exploitative wealth generation; the bot script may adapt its exploits after seeing the economy-designer's refined limits.

I'm providing the following information:

<f1>
Keep `PLAYTEST.md` lean. Its body — everything except the `<review>` block — must stay under 3000 words (~20KB), about a four-page note; record only the final state 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 design, script, or review yourself — you only dispatch the right agent at the right time.

- **Init** — create `STATE.md` with `iter: 0` and `last_side: none`. Dispatch the economy-designer for the first economy step (economy-designer, then meta-strategist), then the bot-scripter for the first playtest step (bot-scripter, then exploit-investigator).
- **Alternation loop** — alternate one economy step with one playtest step. Neither side terminates early on its own score; even a perfect-looking macroeconomy may need to revise once the bot reports actual exploit numbers.
- Cap the total at 20 iterations (10 economy steps + 10 playtest steps). After the cap, stop and summarize.
- Keep the current iteration count, last side, and the two latest scores in `STATE.md`, accurate after each dispatch. Read each score from the reviewer's `<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 + agent name + content) and continue with the next step.
</f2>

<f3>
You are working on a multiplayer video game economy balancing problem, which may involve resource loops, player-to-player trading, premium currencies, or a combination. The original problem is 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 bot doesn't work, but I'm telling you it doesn't" is still a failing result, not a passing one.
</f4>

<f5>
Produce the macroeconomic analysis for the game and write it to `MACRO.md`. A complete analysis covers four kinds of claim, each justified with a spreadsheet-based calculation or a design citation.

- **Currency Bounds** — upper limits on wealth generation rates per hour, minimum costs for late-game sinks, or absolute caps on resource pools.
- **Structural properties** — inflation curves, progression gating, market liquidity, dominant strategies, economic independence of distinct character classes. State what holds, where, and under which player assumptions.
- **Invariants** — quantities every valid game state must preserve (e.g., zero-sum mechanics in PvP, fixed conversion rates across specific vendor paths, total server currency limits). The bot's output should reflect them; the exploit-investigator will check with `verify.py`.
- **Time-to-Max or Burn Rate** — worst-case time to reach the level cap, expected currency burn rate for active players, or progression rate for casual versus hardcore demographics.

Ground your claims against `PLAYTEST.md` if it has reported metrics. A predicted wealth cap that is grossly off from observed bot generation rates means either the economy design needs revision or the bot found an exploit — diagnose which side has the issue and state it. Be concrete. "The maximum reference generation is bounded below 500/hr by vendor limits" is fine; "the economy has some limits that may help" is not.
</f5>

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

<f7>
Match the tool to the game's structure; do not force an ill-suited one. The list below is useful in economy balancing.

| Tool | Suitable for |
|---|---|
| Sink-Source Ratio Models | Core loop balancing; calculating whether inflation outpaces currency destruction |
| Monte Carlo Player Simulations | RNG drop rates; bounding high-probability edge cases in loot distributions |
| Price Elasticity & Faucets | Dynamic market pricing; stabilizing player-driven auction houses |
| Dominant Strategy Analysis | Progression gating; identifying if one farming method vastly outperforms others |
| Gini Coefficient Projections | Wealth distribution; preventing extreme wealth gaps between veterans and novices |
| Markov Chain Progression | Stochastic leveling mechanics; expected time-to-max under RNG upgrade success |
| Arbitrage & Trade Flow Maps | Player-to-player trading; spotting infinite wealth generation via vendor loops |
| Churn & Retention Curves | Monetization/premium loops; stability of daily active user resource generation |
</f7>

<f8>
Read `problem.md` and `MACRO.md`, then implement the automated playtest bot:

- Include every import. Create each state variable with the correct type and bounds, define the bot's action space and every game rule exactly as the problem states. Run the simulation, check the bot's final inventory status, and print both the action sequence and the final wealth/progression value.
- Make the implementation testable against `MACRO.md`. If the economy sets a max wealth bound B, your bot should attempt to achieve a generation rate at least B (to find exploits). If the economy states a vendor invariant, your actions should interact with it.
- Run the code yourself and watch it through to completion — do not stop while it is still running. If it errors, find and fix the root cause; do not bury errors under try/except.
- Sanity-check the answer against `MACRO.md`. A quantity that must be a fractional drop rate should behave correctly over large numbers; a hard cap the economy says holds should be tested.

Write the bot scripts and their results up in `PLAYTEST.md`.
</f8>

<f9>
Review `PLAYTEST.md` against `problem.md` and against `MACRO.md`.

- Inspect the reported result for anomalies, unreasonable action loops, or game rule violations stated directly in `problem.md`.
- Open `MACRO.md`. For every bound and invariant the economy claims, write a check into a separate `verify.py`: does the bot's output respect the invariant, fall within the predicted bound, achieve the targeted progression curve? Run it. Name any variable or quantity that violates.
- Read the bot script and spot-check it for bugs — unused actions, dead code, logic that contradicts the game rules. A bug that silently inflates the bot's wealth is worse than one that crashes.
- Treat the result as finished only when every rule holds, every economy-claimed invariant holds, and the bot's progression is consistent with the macro limits — not merely when the code runs without error.
- Check the length of `PLAYTEST.md`: if it exceeds 20KB, give a warning, but do not deduct points for it.
- Check the bold ratio of `PLAYTEST.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>
The macroeconomic analysis lives in `MACRO.md`, and you may be invoked on it more than once — the pipeline runs you and the meta-strategist as a loop, alternating with the playtest loop.

- If `MACRO.md` does not exist yet, this is the first pass: produce the macroeconomic analysis from scratch based on `problem.md`.
- If `MACRO.md` already exists, it carries the meta-strategist's `<review>` block. Read that feedback. Then open `PLAYTEST.md` and look at the latest reported metrics — they may invalidate, sharpen, or motivate revisions to your economy claims. Revise `MACRO.md` in place to address every reviewer point raised and to incorporate any empirical evidence that changes your analysis. Don't discard the previous design and start over, and don't leave a flagged issue unaddressed.
</f11>

<f12>
Review `MACRO.md` against `problem.md` and against the metrics reported in `PLAYTEST.md` (if any).

- **Faithfulness** — does the economy model correctly describe the game mechanics stated in `problem.md`? Check definitions, resource types, conversion rate translations.
- **Model soundness** — for each claim, walk through the calculation or citation. Flag hand-waving steps. Verify cited constraints apply under the stated player behaviors.
- **Empirical grounding** — open `PLAYTEST.md`. If the bot reports wealth generation rates, do they fall within the economy's predicted bounds? A maximum wealth bound that is loose by orders of magnitude compared to bot exploits is a signal the macro limits are too weak; tighten them, or note explicitly that the bound is only illustrative.

Be brief and specific. Do not write economy design yourself — only review. If a claim is wrong, say which one and why.
</f12>

<f13>
The automated bot playtest code and its logs live in `PLAYTEST.md`, and you may be invoked on it more than once — the pipeline runs you and the exploit-investigator as a loop, alternating with the economy loop.

- If `PLAYTEST.md` does not exist yet, this is the first pass: produce the playtest bot from scratch based on `problem.md`.
- If `PLAYTEST.md` already exists, it carries the exploit-investigator's `<review>` block. Read that feedback. Then open `MACRO.md` and check whether the latest economy model introduces bounds, invariants, or progression claims your current bot doesn't yet exploit or respect — for example a tighter generation limit your bot is now far from achieving, or an inflation cap your output violates. Revise `PLAYTEST.md` in place to address every reviewer point and to align with the latest economy limits. Don't discard the previous bot script and start over, and don't leave a flagged issue unaddressed.
</f13>

Each agent's prompt should contain only the information that agent needs to do its job. For each sub-agent (lead-producer, economy-designer, meta-strategist, bot-scripter, exploit-investigator), which items should go in its prompt? Respond with a JSON object like {"lead-producer": ["f?"], "economy-designer": ["f?"], "meta-strategist": ["f?"], "bot-scripter": ["f?"], "exploit-investigator": ["f?"]}. No other output.

I need you to set up a 5-agent pipeline that solves multiplayer video game economy balancing by developing spreadsheet-based macroeconomic limits and automated bot playtesting in parallel, with each side informing the other. A problem arrives as a natural-language statement in `problem.md`. The pipeline alternates between revising the macroeconomy (currency caps, sink/source ratios, inflation limits) and revising the playtest (an automated bot implementation that attempts to optimize or exploit those rules).

The five agents:

- **lead-producer** orchestrates the run by alternating one economy step with one playtest step and tracking progress. It does no design, scripting, or reviewing itself.
- **macro loop** — the **economy-designer** writes the spreadsheet-based macroeconomic limits to `MACRO.md`; the **meta-strategist** judges it. The economy-designer reads `PLAYTEST.md` on each revision pass to incorporate empirical evidence.
- **playtest loop** — the **bot-scripter** writes bot playtesting scripts and their gameplay logs to `PLAYTEST.md`; the **exploit-investigator** judges them. The bot-scripter reads `MACRO.md` on each revision pass to align the bot's farming/trading strategies with the latest macroeconomic limits.

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 three files:

- `problem.md` — the original game concept and economy problem, read-only. All four domain agents read it.
- `MACRO.md` — the macroeconomic limits. economy-designer writes; meta-strategist reviews; bot-scripter and exploit-investigator read it to know which inflation caps and sink/source rules the bot playtest must navigate.
- `PLAYTEST.md` — the automated bot playtest code and its exploit logs. bot-scripter writes; exploit-investigator reviews; economy-designer and meta-strategist read it to ground the spreadsheet theories in observed gameplay metrics.

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

Unlike a linear design-then-playtest pipeline where the design must converge before the playtest starts, here neither side ever finishes first. Both loops alternate forever, capped at a fixed iteration count. The economy design may tighten after seeing the playtest's exploitative wealth generation; the bot script may adapt its exploits after seeing the economy-designer's refined limits.

I'm providing the following prompt fragments:

<f1>
Keep `PLAYTEST.md` lean. Its body — everything except the `<review>` block — must stay under 3000 words (~20KB), about a four-page note; record only the final state 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 design, script, or review yourself — you only dispatch the right agent at the right time.

- **Init** — create `STATE.md` with `iter: 0` and `last_side: none`. Dispatch the economy-designer for the first economy step (economy-designer, then meta-strategist), then the bot-scripter for the first playtest step (bot-scripter, then exploit-investigator).
- **Alternation loop** — alternate one economy step with one playtest step. Neither side terminates early on its own score; even a perfect-looking macroeconomy may need to revise once the bot reports actual exploit numbers.
- Cap the total at 20 iterations (10 economy steps + 10 playtest steps). After the cap, stop and summarize.
- Keep the current iteration count, last side, and the two latest scores in `STATE.md`, accurate after each dispatch. Read each score from the reviewer's `<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 + agent name + content) and continue with the next step.
</f2>

<f3>
You are working on a multiplayer video game economy balancing problem, which may involve resource loops, player-to-player trading, premium currencies, or a combination. The original problem is 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 bot doesn't work, but I'm telling you it doesn't" is still a failing result, not a passing one.
</f4>

<f5>
Produce the macroeconomic analysis for the game and write it to `MACRO.md`. A complete analysis covers four kinds of claim, each justified with a spreadsheet-based calculation or a design citation.

- **Currency Bounds** — upper limits on wealth generation rates per hour, minimum costs for late-game sinks, or absolute caps on resource pools.
- **Structural properties** — inflation curves, progression gating, market liquidity, dominant strategies, economic independence of distinct character classes. State what holds, where, and under which player assumptions.
- **Invariants** — quantities every valid game state must preserve (e.g., zero-sum mechanics in PvP, fixed conversion rates across specific vendor paths, total server currency limits). The bot's output should reflect them; the exploit-investigator will check with `verify.py`.
- **Time-to-Max or Burn Rate** — worst-case time to reach the level cap, expected currency burn rate for active players, or progression rate for casual versus hardcore demographics.

Ground your claims against `PLAYTEST.md` if it has reported metrics. A predicted wealth cap that is grossly off from observed bot generation rates means either the economy design needs revision or the bot found an exploit — diagnose which side has the issue and state it. Be concrete. "The maximum reference generation is bounded below 500/hr by vendor limits" is fine; "the economy has some limits that may help" is not.
</f5>

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

<f7>
Match the tool to the game's structure; do not force an ill-suited one. The list below is useful in economy balancing.

| Tool | Suitable for |
|---|---|
| Sink-Source Ratio Models | Core loop balancing; calculating whether inflation outpaces currency destruction |
| Monte Carlo Player Simulations | RNG drop rates; bounding high-probability edge cases in loot distributions |
| Price Elasticity & Faucets | Dynamic market pricing; stabilizing player-driven auction houses |
| Dominant Strategy Analysis | Progression gating; identifying if one farming method vastly outperforms others |
| Gini Coefficient Projections | Wealth distribution; preventing extreme wealth gaps between veterans and novices |
| Markov Chain Progression | Stochastic leveling mechanics; expected time-to-max under RNG upgrade success |
| Arbitrage & Trade Flow Maps | Player-to-player trading; spotting infinite wealth generation via vendor loops |
| Churn & Retention Curves | Monetization/premium loops; stability of daily active user resource generation |
</f7>

<f8>
Read `problem.md` and `MACRO.md`, then implement the automated playtest bot:

- Include every import. Create each state variable with the correct type and bounds, define the bot's action space and every game rule exactly as the problem states. Run the simulation, check the bot's final inventory status, and print both the action sequence and the final wealth/progression value.
- Make the implementation testable against `MACRO.md`. If the economy sets a max wealth bound B, your bot should attempt to achieve a generation rate at least B (to find exploits). If the economy states a vendor invariant, your actions should interact with it.
- Run the code yourself and watch it through to completion — do not stop while it is still running. If it errors, find and fix the root cause; do not bury errors under try/except.
- Sanity-check the answer against `MACRO.md`. A quantity that must be a fractional drop rate should behave correctly over large numbers; a hard cap the economy says holds should be tested.

Write the bot scripts and their results up in `PLAYTEST.md`.
</f8>

<f9>
Review `PLAYTEST.md` against `problem.md` and against `MACRO.md`.

- Inspect the reported result for anomalies, unreasonable action loops, or game rule violations stated directly in `problem.md`.
- Open `MACRO.md`. For every bound and invariant the economy claims, write a check into a separate `verify.py`: does the bot's output respect the invariant, fall within the predicted bound, achieve the targeted progression curve? Run it. Name any variable or quantity that violates.
- Read the bot script and spot-check it for bugs — unused actions, dead code, logic that contradicts the game rules. A bug that silently inflates the bot's wealth is worse than one that crashes.
- Treat the result as finished only when every rule holds, every economy-claimed invariant holds, and the bot's progression is consistent with the macro limits — not merely when the code runs without error.
- Check the length of `PLAYTEST.md`: if it exceeds 20KB, give a warning, but do not deduct points for it.
- Check the bold ratio of `PLAYTEST.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>
The macroeconomic analysis lives in `MACRO.md`, and you may be invoked on it more than once — the pipeline runs you and the meta-strategist as a loop, alternating with the playtest loop.

- If `MACRO.md` does not exist yet, this is the first pass: produce the macroeconomic analysis from scratch based on `problem.md`.
- If `MACRO.md` already exists, it carries the meta-strategist's `<review>` block. Read that feedback. Then open `PLAYTEST.md` and look at the latest reported metrics — they may invalidate, sharpen, or motivate revisions to your economy claims. Revise `MACRO.md` in place to address every reviewer point raised and to incorporate any empirical evidence that changes your analysis. Don't discard the previous design and start over, and don't leave a flagged issue unaddressed.
</f11>

<f12>
Review `MACRO.md` against `problem.md` and against the metrics reported in `PLAYTEST.md` (if any).

- **Faithfulness** — does the economy model correctly describe the game mechanics stated in `problem.md`? Check definitions, resource types, conversion rate translations.
- **Model soundness** — for each claim, walk through the calculation or citation. Flag hand-waving steps. Verify cited constraints apply under the stated player behaviors.
- **Empirical grounding** — open `PLAYTEST.md`. If the bot reports wealth generation rates, do they fall within the economy's predicted bounds? A maximum wealth bound that is loose by orders of magnitude compared to bot exploits is a signal the macro limits are too weak; tighten them, or note explicitly that the bound is only illustrative.

Be brief and specific. Do not write economy design yourself — only review. If a claim is wrong, say which one and why.
</f12>

<f13>
The automated bot playtest code and its logs live in `PLAYTEST.md`, and you may be invoked on it more than once — the pipeline runs you and the exploit-investigator as a loop, alternating with the economy loop.

- If `PLAYTEST.md` does not exist yet, this is the first pass: produce the playtest bot from scratch based on `problem.md`.
- If `PLAYTEST.md` already exists, it carries the exploit-investigator's `<review>` block. Read that feedback. Then open `MACRO.md` and check whether the latest economy model introduces bounds, invariants, or progression claims your current bot doesn't yet exploit or respect — for example a tighter generation limit your bot is now far from achieving, or an inflation cap your output violates. Revise `PLAYTEST.md` in place to address every reviewer point and to align with the latest economy limits. Don't discard the previous bot script and start over, and don't leave a flagged issue unaddressed.
</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. `# lead-producer`). Output only the headered prompts, no preamble.


I need you to set up a 5-agent pipeline that solves multiplayer video game economy balancing by developing spreadsheet-based macroeconomic limits and automated bot playtesting in parallel, with each side informing the other. A problem arrives as a natural-language statement in `problem.md`. The pipeline alternates between revising the macroeconomy (currency caps, sink/source ratios, inflation limits) and revising the playtest (an automated bot implementation that attempts to optimize or exploit those rules).

The five agents:

- **lead-producer** orchestrates the run by alternating one economy step with one playtest step and tracking progress. It does no design, scripting, or reviewing itself.
- **macro loop** — the **economy-designer** writes the spreadsheet-based macroeconomic limits to `MACRO.md`; the **meta-strategist** judges it. The economy-designer reads `PLAYTEST.md` on each revision pass to incorporate empirical evidence.
- **playtest loop** — the **bot-scripter** writes bot playtesting scripts and their gameplay logs to `PLAYTEST.md`; the **exploit-investigator** judges them. The bot-scripter reads `MACRO.md` on each revision pass to align the bot's farming/trading strategies with the latest macroeconomic limits.

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 three files:

- `problem.md` — the original game concept and economy problem, read-only. All four domain agents read it.
- `MACRO.md` — the macroeconomic limits. economy-designer writes; meta-strategist reviews; bot-scripter and exploit-investigator read it to know which inflation caps and sink/source rules the bot playtest must navigate.
- `PLAYTEST.md` — the automated bot playtest code and its exploit logs. bot-scripter writes; exploit-investigator reviews; economy-designer and meta-strategist read it to ground the spreadsheet theories in observed gameplay metrics.

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

Unlike a linear design-then-playtest pipeline where the design must converge before the playtest starts, here neither side ever finishes first. Both loops alternate forever, capped at a fixed iteration count. The economy design may tighten after seeing the playtest's exploitative wealth generation; the bot script may adapt its exploits after seeing the economy-designer's refined limits.

I'm providing the following information:

<f1>
Read `problem.md` and `MACRO.md`, then implement the automated playtest bot:

- Include every import. Create each state variable with the correct type and bounds, define the bot's action space and every game rule exactly as the problem states. Run the simulation, check the bot's final inventory status, and print both the action sequence and the final wealth/progression value.
- Make the implementation testable against `MACRO.md`. If the economy sets a max wealth bound B, your bot should attempt to achieve a generation rate at least B (to find exploits). If the economy states a vendor invariant, your actions should interact with it.
- Run the code yourself and watch it through to completion — do not stop while it is still running. If it errors, find and fix the root cause; do not bury errors under try/except.
- Sanity-check the answer against `MACRO.md`. A quantity that must be a fractional drop rate should behave correctly over large numbers; a hard cap the economy says holds should be tested.

Write the bot scripts and their results up in `PLAYTEST.md`.
</f1>

<f2>
Match the tool to the game's structure; do not force an ill-suited one. The list below is useful in economy balancing.

| Tool | Suitable for |
|---|---|
| Sink-Source Ratio Models | Core loop balancing; calculating whether inflation outpaces currency destruction |
| Monte Carlo Player Simulations | RNG drop rates; bounding high-probability edge cases in loot distributions |
| Price Elasticity & Faucets | Dynamic market pricing; stabilizing player-driven auction houses |
| Dominant Strategy Analysis | Progression gating; identifying if one farming method vastly outperforms others |
| Gini Coefficient Projections | Wealth distribution; preventing extreme wealth gaps between veterans and novices |
| Markov Chain Progression | Stochastic leveling mechanics; expected time-to-max under RNG upgrade success |
| Arbitrage & Trade Flow Maps | Player-to-player trading; spotting infinite wealth generation via vendor loops |
| Churn & Retention Curves | Monetization/premium loops; stability of daily active user resource generation |
</f2>

<f3>
The automated bot playtest code and its logs live in `PLAYTEST.md`, and you may be invoked on it more than once — the pipeline runs you and the exploit-investigator as a loop, alternating with the economy loop.

- If `PLAYTEST.md` does not exist yet, this is the first pass: produce the playtest bot from scratch based on `problem.md`.
- If `PLAYTEST.md` already exists, it carries the exploit-investigator's `<review>` block. Read that feedback. Then open `MACRO.md` and check whether the latest economy model introduces bounds, invariants, or progression claims your current bot doesn't yet exploit or respect — for example a tighter generation limit your bot is now far from achieving, or an inflation cap your output violates. Revise `PLAYTEST.md` in place to address every reviewer point and to align with the latest economy limits. Don't discard the previous bot script and start over, and don't leave a flagged issue unaddressed.
</f3>

<f4>
Review `MACRO.md` against `problem.md` and against the metrics reported in `PLAYTEST.md` (if any).

- **Faithfulness** — does the economy model correctly describe the game mechanics stated in `problem.md`? Check definitions, resource types, conversion rate translations.
- **Model soundness** — for each claim, walk through the calculation or citation. Flag hand-waving steps. Verify cited constraints apply under the stated player behaviors.
- **Empirical grounding** — open `PLAYTEST.md`. If the bot reports wealth generation rates, do they fall within the economy's predicted bounds? A maximum wealth bound that is loose by orders of magnitude compared to bot exploits is a signal the macro limits are too weak; tighten them, or note explicitly that the bound is only illustrative.

Be brief and specific. Do not write economy design yourself — only review. If a claim is wrong, say which one and why.
</f4>

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

- **Init** — create `STATE.md` with `iter: 0` and `last_side: none`. Dispatch the economy-designer for the first economy step (economy-designer, then meta-strategist), then the bot-scripter for the first playtest step (bot-scripter, then exploit-investigator).
- **Alternation loop** — alternate one economy step with one playtest step. Neither side terminates early on its own score; even a perfect-looking macroeconomy may need to revise once the bot reports actual exploit numbers.
- Cap the total at 20 iterations (10 economy steps + 10 playtest steps). After the cap, stop and summarize.
- Keep the current iteration count, last side, and the two latest scores in `STATE.md`, accurate after each dispatch. Read each score from the reviewer's `<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 + agent name + content) and continue with the next step.
</f5>

<f6>
Produce the macroeconomic analysis for the game and write it to `MACRO.md`. A complete analysis covers four kinds of claim, each justified with a spreadsheet-based calculation or a design citation.

- **Currency Bounds** — upper limits on wealth generation rates per hour, minimum costs for late-game sinks, or absolute caps on resource pools.
- **Structural properties** — inflation curves, progression gating, market liquidity, dominant strategies, economic independence of distinct character classes. State what holds, where, and under which player assumptions.
- **Invariants** — quantities every valid game state must preserve (e.g., zero-sum mechanics in PvP, fixed conversion rates across specific vendor paths, total server currency limits). The bot's output should reflect them; the exploit-investigator will check with `verify.py`.
- **Time-to-Max or Burn Rate** — worst-case time to reach the level cap, expected currency burn rate for active players, or progression rate for casual versus hardcore demographics.

Ground your claims against `PLAYTEST.md` if it has reported metrics. A predicted wealth cap that is grossly off from observed bot generation rates means either the economy design needs revision or the bot found an exploit — diagnose which side has the issue and state it. Be concrete. "The maximum reference generation is bounded below 500/hr by vendor limits" is fine; "the economy has some limits that may help" is not.
</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 bot doesn't work, but I'm telling you it doesn't" is still a failing result, not a passing one.
</f7>

<f8>
Keep `PLAYTEST.md` lean. Its body — everything except the `<review>` block — must stay under 3000 words (~20KB), about a four-page note; record only the final state 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 lead-producer: 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 multiplayer video game economy balancing problem, which may involve resource loops, player-to-player trading, premium currencies, or a combination. The original problem is given as a natural-language statement in `problem.md`; read it before starting your part.
</f11>

<f12>
The macroeconomic analysis lives in `MACRO.md`, and you may be invoked on it more than once — the pipeline runs you and the meta-strategist as a loop, alternating with the playtest loop.

- If `MACRO.md` does not exist yet, this is the first pass: produce the macroeconomic analysis from scratch based on `problem.md`.
- If `MACRO.md` already exists, it carries the meta-strategist's `<review>` block. Read that feedback. Then open `PLAYTEST.md` and look at the latest reported metrics — they may invalidate, sharpen, or motivate revisions to your economy claims. Revise `MACRO.md` in place to address every reviewer point raised and to incorporate any empirical evidence that changes your analysis. Don't discard the previous design and start over, and don't leave a flagged issue unaddressed.
</f12>

<f13>
Review `PLAYTEST.md` against `problem.md` and against `MACRO.md`.

- Inspect the reported result for anomalies, unreasonable action loops, or game rule violations stated directly in `problem.md`.
- Open `MACRO.md`. For every bound and invariant the economy claims, write a check into a separate `verify.py`: does the bot's output respect the invariant, fall within the predicted bound, achieve the targeted progression curve? Run it. Name any variable or quantity that violates.
- Read the bot script and spot-check it for bugs — unused actions, dead code, logic that contradicts the game rules. A bug that silently inflates the bot's wealth is worse than one that crashes.
- Treat the result as finished only when every rule holds, every economy-claimed invariant holds, and the bot's progression is consistent with the macro limits — not merely when the code runs without error.
- Check the length of `PLAYTEST.md`: if it exceeds 20KB, give a warning, but do not deduct points for it.
- Check the bold ratio of `PLAYTEST.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 (lead-producer, economy-designer, meta-strategist, bot-scripter, exploit-investigator), which items should go in its prompt? Respond with a JSON object like {"lead-producer": ["f?"], "economy-designer": ["f?"], "meta-strategist": ["f?"], "bot-scripter": ["f?"], "exploit-investigator": ["f?"]}. No other output.

I need you to set up a 5-agent pipeline that solves multiplayer video game economy balancing by developing spreadsheet-based macroeconomic limits and automated bot playtesting in parallel, with each side informing the other. A problem arrives as a natural-language statement in `problem.md`. The pipeline alternates between revising the macroeconomy (currency caps, sink/source ratios, inflation limits) and revising the playtest (an automated bot implementation that attempts to optimize or exploit those rules).

The five agents:

- **lead-producer** orchestrates the run by alternating one economy step with one playtest step and tracking progress. It does no design, scripting, or reviewing itself.
- **macro loop** — the **economy-designer** writes the spreadsheet-based macroeconomic limits to `MACRO.md`; the **meta-strategist** judges it. The economy-designer reads `PLAYTEST.md` on each revision pass to incorporate empirical evidence.
- **playtest loop** — the **bot-scripter** writes bot playtesting scripts and their gameplay logs to `PLAYTEST.md`; the **exploit-investigator** judges them. The bot-scripter reads `MACRO.md` on each revision pass to align the bot's farming/trading strategies with the latest macroeconomic limits.

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 three files:

- `problem.md` — the original game concept and economy problem, read-only. All four domain agents read it.
- `MACRO.md` — the macroeconomic limits. economy-designer writes; meta-strategist reviews; bot-scripter and exploit-investigator read it to know which inflation caps and sink/source rules the bot playtest must navigate.
- `PLAYTEST.md` — the automated bot playtest code and its exploit logs. bot-scripter writes; exploit-investigator reviews; economy-designer and meta-strategist read it to ground the spreadsheet theories in observed gameplay metrics.

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

Unlike a linear design-then-playtest pipeline where the design must converge before the playtest starts, here neither side ever finishes first. Both loops alternate forever, capped at a fixed iteration count. The economy design may tighten after seeing the playtest's exploitative wealth generation; the bot script may adapt its exploits after seeing the economy-designer's refined limits.

I'm providing the following prompt fragments:

<f1>
Read `problem.md` and `MACRO.md`, then implement the automated playtest bot:

- Include every import. Create each state variable with the correct type and bounds, define the bot's action space and every game rule exactly as the problem states. Run the simulation, check the bot's final inventory status, and print both the action sequence and the final wealth/progression value.
- Make the implementation testable against `MACRO.md`. If the economy sets a max wealth bound B, your bot should attempt to achieve a generation rate at least B (to find exploits). If the economy states a vendor invariant, your actions should interact with it.
- Run the code yourself and watch it through to completion — do not stop while it is still running. If it errors, find and fix the root cause; do not bury errors under try/except.
- Sanity-check the answer against `MACRO.md`. A quantity that must be a fractional drop rate should behave correctly over large numbers; a hard cap the economy says holds should be tested.

Write the bot scripts and their results up in `PLAYTEST.md`.
</f1>

<f2>
Match the tool to the game's structure; do not force an ill-suited one. The list below is useful in economy balancing.

| Tool | Suitable for |
|---|---|
| Sink-Source Ratio Models | Core loop balancing; calculating whether inflation outpaces currency destruction |
| Monte Carlo Player Simulations | RNG drop rates; bounding high-probability edge cases in loot distributions |
| Price Elasticity & Faucets | Dynamic market pricing; stabilizing player-driven auction houses |
| Dominant Strategy Analysis | Progression gating; identifying if one farming method vastly outperforms others |
| Gini Coefficient Projections | Wealth distribution; preventing extreme wealth gaps between veterans and novices |
| Markov Chain Progression | Stochastic leveling mechanics; expected time-to-max under RNG upgrade success |
| Arbitrage & Trade Flow Maps | Player-to-player trading; spotting infinite wealth generation via vendor loops |
| Churn & Retention Curves | Monetization/premium loops; stability of daily active user resource generation |
</f2>

<f3>
The automated bot playtest code and its logs live in `PLAYTEST.md`, and you may be invoked on it more than once — the pipeline runs you and the exploit-investigator as a loop, alternating with the economy loop.

- If `PLAYTEST.md` does not exist yet, this is the first pass: produce the playtest bot from scratch based on `problem.md`.
- If `PLAYTEST.md` already exists, it carries the exploit-investigator's `<review>` block. Read that feedback. Then open `MACRO.md` and check whether the latest economy model introduces bounds, invariants, or progression claims your current bot doesn't yet exploit or respect — for example a tighter generation limit your bot is now far from achieving, or an inflation cap your output violates. Revise `PLAYTEST.md` in place to address every reviewer point and to align with the latest economy limits. Don't discard the previous bot script and start over, and don't leave a flagged issue unaddressed.
</f3>

<f4>
Review `MACRO.md` against `problem.md` and against the metrics reported in `PLAYTEST.md` (if any).

- **Faithfulness** — does the economy model correctly describe the game mechanics stated in `problem.md`? Check definitions, resource types, conversion rate translations.
- **Model soundness** — for each claim, walk through the calculation or citation. Flag hand-waving steps. Verify cited constraints apply under the stated player behaviors.
- **Empirical grounding** — open `PLAYTEST.md`. If the bot reports wealth generation rates, do they fall within the economy's predicted bounds? A maximum wealth bound that is loose by orders of magnitude compared to bot exploits is a signal the macro limits are too weak; tighten them, or note explicitly that the bound is only illustrative.

Be brief and specific. Do not write economy design yourself — only review. If a claim is wrong, say which one and why.
</f4>

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

- **Init** — create `STATE.md` with `iter: 0` and `last_side: none`. Dispatch the economy-designer for the first economy step (economy-designer, then meta-strategist), then the bot-scripter for the first playtest step (bot-scripter, then exploit-investigator).
- **Alternation loop** — alternate one economy step with one playtest step. Neither side terminates early on its own score; even a perfect-looking macroeconomy may need to revise once the bot reports actual exploit numbers.
- Cap the total at 20 iterations (10 economy steps + 10 playtest steps). After the cap, stop and summarize.
- Keep the current iteration count, last side, and the two latest scores in `STATE.md`, accurate after each dispatch. Read each score from the reviewer's `<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 + agent name + content) and continue with the next step.
</f5>

<f6>
Produce the macroeconomic analysis for the game and write it to `MACRO.md`. A complete analysis covers four kinds of claim, each justified with a spreadsheet-based calculation or a design citation.

- **Currency Bounds** — upper limits on wealth generation rates per hour, minimum costs for late-game sinks, or absolute caps on resource pools.
- **Structural properties** — inflation curves, progression gating, market liquidity, dominant strategies, economic independence of distinct character classes. State what holds, where, and under which player assumptions.
- **Invariants** — quantities every valid game state must preserve (e.g., zero-sum mechanics in PvP, fixed conversion rates across specific vendor paths, total server currency limits). The bot's output should reflect them; the exploit-investigator will check with `verify.py`.
- **Time-to-Max or Burn Rate** — worst-case time to reach the level cap, expected currency burn rate for active players, or progression rate for casual versus hardcore demographics.

Ground your claims against `PLAYTEST.md` if it has reported metrics. A predicted wealth cap that is grossly off from observed bot generation rates means either the economy design needs revision or the bot found an exploit — diagnose which side has the issue and state it. Be concrete. "The maximum reference generation is bounded below 500/hr by vendor limits" is fine; "the economy has some limits that may help" is not.
</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 bot doesn't work, but I'm telling you it doesn't" is still a failing result, not a passing one.
</f7>

<f8>
Keep `PLAYTEST.md` lean. Its body — everything except the `<review>` block — must stay under 3000 words (~20KB), about a four-page note; record only the final state 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 lead-producer: 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 multiplayer video game economy balancing problem, which may involve resource loops, player-to-player trading, premium currencies, or a combination. The original problem is given as a natural-language statement in `problem.md`; read it before starting your part.
</f11>

<f12>
The macroeconomic analysis lives in `MACRO.md`, and you may be invoked on it more than once — the pipeline runs you and the meta-strategist as a loop, alternating with the playtest loop.

- If `MACRO.md` does not exist yet, this is the first pass: produce the macroeconomic analysis from scratch based on `problem.md`.
- If `MACRO.md` already exists, it carries the meta-strategist's `<review>` block. Read that feedback. Then open `PLAYTEST.md` and look at the latest reported metrics — they may invalidate, sharpen, or motivate revisions to your economy claims. Revise `MACRO.md` in place to address every reviewer point raised and to incorporate any empirical evidence that changes your analysis. Don't discard the previous design and start over, and don't leave a flagged issue unaddressed.
</f12>

<f13>
Review `PLAYTEST.md` against `problem.md` and against `MACRO.md`.

- Inspect the reported result for anomalies, unreasonable action loops, or game rule violations stated directly in `problem.md`.
- Open `MACRO.md`. For every bound and invariant the economy claims, write a check into a separate `verify.py`: does the bot's output respect the invariant, fall within the predicted bound, achieve the targeted progression curve? Run it. Name any variable or quantity that violates.
- Read the bot script and spot-check it for bugs — unused actions, dead code, logic that contradicts the game rules. A bug that silently inflates the bot's wealth is worse than one that crashes.
- Treat the result as finished only when every rule holds, every economy-claimed invariant holds, and the bot's progression is consistent with the macro limits — not merely when the code runs without error.
- Check the length of `PLAYTEST.md`: if it exceeds 20KB, give a warning, but do not deduct points for it.
- Check the bold ratio of `PLAYTEST.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. `# lead-producer`). Output only the headered prompts, no preamble.


research-director computational-biologist pharmacokinetics-assessor synthesis-chemist assay-validator

I need you to set up a 5-agent pipeline for preclinical drug discovery that develops in-silico molecular docking models and empirical in-vitro synthesis and assay testing in parallel, with each side informing the other. A target disease profile and desired therapeutic mechanism arrive as a natural-language statement in `target_profile.md`. The pipeline alternates between revising the computational model (binding affinities, pharmacophores, structural invariants) and revising the empirical results (synthesized compounds and in-vitro assay readouts that achieve those properties).

The five agents:

- **research-director** orchestrates the run by alternating one in-silico step with one in-vitro step and tracking progress. It does no modeling, synthesizing, or reviewing itself.
- **in-silico loop** — the **computational-biologist** writes the molecular docking models and computational analysis to `IN_SILICO.md`; the **pharmacokinetics-assessor** judges it. The computational-biologist reads `IN_VITRO.md` on each revision pass to incorporate empirical assay evidence.
- **in-vitro loop** — the **synthesis-chemist** documents the synthesis routes, executes the protocols, and records assay results to `IN_VITRO.md`; the **assay-validator** judges them. The synthesis-chemist reads `IN_SILICO.md` on each revision pass to align the chemical design with the latest theoretical structural 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 three files:

- `target_profile.md` — the original biological target and disease profile, read-only. All four domain agents read it.
- `IN_SILICO.md` — the computational docking analysis. Computational-biologist writes; pharmacokinetics-assessor reviews; synthesis-chemist and assay-validator read it to know which structural invariants and binding energies the physical compound must respect.
- `IN_VITRO.md` — the synthesis methodology and empirical assay results. Synthesis-chemist writes; assay-validator reviews; computational-biologist and pharmacokinetics-assessor read it to ground the docking simulations in observed bioassay numbers.

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

Unlike a sequential design-then-test pipeline where the model must converge before synthesis starts, here neither side ever finishes first. Both loops alternate forever, capped at a fixed iteration count. In-silico models may tighten after seeing empirical binding numbers; in-vitro chemistry may correct after seeing the model's refined binding pockets.

I'm providing the following information:

<f1>
Keep `IN_VITRO.md` lean. Its body — everything except the `<review>` block — must stay under 3000 words (~20KB), about a four-page summary; record only the final optimized route and assay readouts, and move iteration-by-iteration failed reaction 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 model, synthesize, or review yourself — you only dispatch the right agent at the right time.

- **Init** — create `STATE.md` with `iter: 0` and `last_side: none`. Dispatch the computational-biologist for the first in-silico step (computational-biologist, then pharmacokinetics-assessor), then the synthesis-chemist for the first in-vitro step (synthesis-chemist, then assay-validator).
- **Alternation loop** — alternate one in-silico step with one in-vitro step. Neither side terminates early on its own score; even a perfect-looking molecular docking model may need to revise once the in-vitro assay reports actual empirical numbers.
- Cap the total at 20 iterations (10 in-silico steps + 10 in-vitro steps). After the cap, stop and summarize.
- Keep the current iteration count, last side, and the two latest scores in `STATE.md`, accurate after each dispatch. Read each score from the reviewer's `<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 + agent name + content) and continue with the next step.
</f2>

<f3>
You are working on a preclinical drug discovery campaign, targeting a specific biological mechanism (e.g., kinase inhibition, GPCR antagonism, protein-protein interaction). The original biological target and desired therapeutic profile are given as a natural-language statement in `target_profile.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 compound precipitated in the assay buffer and didn't work, but I'm telling you it didn't" is still a failing result, not a passing one.
</f4>

<f5>
Produce the in-silico molecular docking and computational analysis for the target and write it to `IN_SILICO.md`. A complete analysis covers four kinds of claims, each justified with structural modeling or literature citation.

- **Binding Affinity Predictions** — lower bounds on binding free energy (ΔG) from molecular dynamics or docking score relaxations; target IC50/Kd thresholds necessary for efficacy.
- **Structural Conformations** — pharmacophore features, spatial constraints, essential hydrogen bond interactions, and steric hindrance properties. State what must interact, where, and under which pocket conformations.
- **Physicochemical Invariants** — quantities every synthesized lead molecule must preserve (e.g., Lipinski's Rule of 5 parameters like Molecular Weight, LogP, specific polar surface area limits). The physical molecule should satisfy them; the assay-validator will check with a structural parser in `verify.py`.
- **ADMET Projections** — expected absorption, distribution, metabolism, excretion, and toxicity profiles (e.g., predicted CYP inhibition, hERG liability, or off-target toxicity risks).

Ground your claims against `IN_VITRO.md` if it has reported assay numbers. A predicted sub-nanomolar affinity that is grossly off from an observed lack of empirical activity means either the computational model needs revision (e.g., ignored solvent effects) or the synthesized compound degraded — diagnose which side has the issue and state it. Be concrete. "The predicted ΔG is bounded below at -12 kcal/mol based on the deep hydrophobic pocket" is fine; "the molecule has some structure that might bind well" is not.
</f5>

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

<f7>
Match the computational tool to the biological target's structure; do not force an ill-suited one. The list below is useful in in-silico drug design.

| Tool | Suitable for |
|---|---|
| Structure-Based Docking (e.g., Glide, AutoDock) | Targets with known high-resolution crystal structures; initial pose generation and scoring |
| Molecular Dynamics (MD) Simulations | Assessing target conformational flexibility, transient pockets, and complex stability |
| Free Energy Perturbation (FEP) | Precise relative binding affinity predictions between closely related lead analogs |
| Ligand-Based Pharmacophore Modeling | When target 3D structure is unknown; inferring requirements from known actives |
| Quantum Mechanics/Molecular Mechanics (QM/MM) | High-precision modeling of covalent inhibitors or enzymatic transition states |
| QSAR Statistical Modeling | Establishing robust correlations between chemical features and empirical bioactivity |
| ADMET Predictors (e.g., SwissADME) | Forecasting pharmacokinetic profiles and filtering out toxicophores early |
| Structural Clustering / Scaffold Hopping | Diversifying chemical space while preserving core required interactions |
</f7>

<f8>
Read `target_profile.md` and `IN_SILICO.md`, then execute the synthesis and bioassays:

- Include every required reagent and solvent. Detail the retrosynthetic route, reaction conditions, and purification steps. Execute the synthesis, run the biochemical and evaluationular assays exactly as the target profile dictates, and record both the structural confirmation (e.g., NMR/MS results) and the empirical bioactivity (e.g., IC50, percent inhibition).
- Make the physical compound testable against `IN_SILICO.md`. If the computational model states a required binding affinity threshold, your synthesized compound should aim to achieve an IC50 at least that potent. If the model states a structural invariant (e.g., MW < 500), your synthesized molecule must satisfy it.
- Run the full synthesis and assay pipeline yourself and watch it through to completion — do not stop mid-reaction. If it yields an impure product or fails entirely, find and fix the root cause; do not bury poor yields or target-misses under vague language.
- Sanity-check the physical results against `IN_SILICO.md`. A target with strict molecular weight limits or discrete chiral centers should not come back violating those rules; an affinity the model insists is highly potent should reflect in the empirical readouts.

Write the synthesis methodology and empirical assay results up in `IN_VITRO.md`.
</f8>

<f9>
Review `IN_VITRO.md` against `target_profile.md` and against `IN_SILICO.md`.

- Inspect the reported assay readouts for anomalies, unrealistic reaction yields, or cytotoxicity limits violated as stated directly in `target_profile.md`.
- Open `IN_SILICO.md`. For every physicochemical invariant and structural property the model claims, write a check into a separate `verify.py` (e.g., using RDKit to parse the SMILES string): does the synthesized compound's structure satisfy the invariant, fall within the predicted ADMET parameters, and achieve the predicted potency? Run it. Name any property or functional group that violates.
- Read the synthesis and assay protocols and spot-check them for methodological flaws — cross-reactivity risks, impure intermediates, uncalibrated assay baselines. An assay artifact that creates a false positive is worse than a failed synthesis.
- Treat the result as finished only when every disease target constraint holds, every in-silico invariant holds, and the bioassay confirms the model's predicted affinity — not merely when a chemical is successfully synthesized.
- Check the length of `IN_VITRO.md`: if it exceeds 20KB, give a warning, but do not deduct points for it.
- Check the bold ratio of `IN_VITRO.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>
The molecular docking models and computational analysis live in `IN_SILICO.md`, and you may be invoked on it more than once — the pipeline runs you and the pharmacokinetics-assessor as a loop, alternating with the in-vitro loop.

- If `IN_SILICO.md` does not exist yet, this is the first pass: produce the computational analysis from scratch based on `target_profile.md`.
- If `IN_SILICO.md` already exists, it carries the pharmacokinetics-assessor's `<review>` block. Read that feedback. Then open `IN_VITRO.md` and look at the latest reported assay numbers — they may invalidate, sharpen, or motivate revisions to your structural modeling. Revise `IN_SILICO.md` in place to address every reviewer point raised and to incorporate any empirical evidence that changes your analysis. Don't discard the previous computational model and start over, and don't leave a flagged issue unaddressed.
</f11>

<f12>
Review `IN_SILICO.md` against `target_profile.md` and against the bioactivity numbers reported in `IN_VITRO.md` (if any).

- **Target Alignment** — does the in-silico model correctly address the biological mechanism and disease profile stated in `target_profile.md`? Check target pocket definitions, receptor types, and therapeutic mechanisms.
- **Modeling Soundness** — for each claim, walk through the docking or simulation rationale. Flag oversimplified docking parameters or ignored solvent effects. Verify ADMET assumptions apply to the proposed delivery route.
- **Empirical Grounding** — open `IN_VITRO.md`. If the physical assays report IC50 or binding values, do they fall within the model's predicted affinity ranges? A predicted highly potent binding energy that empirically yields >10µM is a signal the scoring function is fundamentally misaligned; refine the model, or note explicitly that the docking score is currently unreliable.

Be brief and specific. Do not write the computational models yourself — only review. If a claim is wrong, say which one and why.
</f12>

<f13>
The synthesis routes and empirical assay results live in `IN_VITRO.md`, and you may be invoked on it more than once — the pipeline runs you and the assay-validator as a loop, alternating with the in-silico loop.

- If `IN_VITRO.md` does not exist yet, this is the first pass: design the synthesis and run the initial assays from scratch based on `target_profile.md`.
- If `IN_VITRO.md` already exists, it carries the assay-validator's `<review>` block. Read that feedback. Then open `IN_SILICO.md` and check whether the latest model introduces required binding energies, pharmacophores, or physicochemical invariants your current synthesized compound doesn't yet respect — for example a tighter molecular weight limit your lead is now far from achieving, or an off-target interaction your molecule violates. Revise `IN_VITRO.md` in place to address every reviewer point and to align with the latest computational model. Don't discard the previous synthesis logs entirely to start over, and don't leave a flagged issue unaddressed.
</f13>

Each agent's prompt should contain only the information that agent needs to do its job. For each sub-agent (research-director, computational-biologist, pharmacokinetics-assessor, synthesis-chemist, assay-validator), which items should go in its prompt? Respond with a JSON object like {"research-director": ["f?"], "computational-biologist": ["f?"], "pharmacokinetics-assessor": ["f?"], "synthesis-chemist": ["f?"], "assay-validator": ["f?"]}. No other output.

I need you to set up a 5-agent pipeline for preclinical drug discovery that develops in-silico molecular docking models and empirical in-vitro synthesis and assay testing in parallel, with each side informing the other. A target disease profile and desired therapeutic mechanism arrive as a natural-language statement in `target_profile.md`. The pipeline alternates between revising the computational model (binding affinities, pharmacophores, structural invariants) and revising the empirical results (synthesized compounds and in-vitro assay readouts that achieve those properties).

The five agents:

- **research-director** orchestrates the run by alternating one in-silico step with one in-vitro step and tracking progress. It does no modeling, synthesizing, or reviewing itself.
- **in-silico loop** — the **computational-biologist** writes the molecular docking models and computational analysis to `IN_SILICO.md`; the **pharmacokinetics-assessor** judges it. The computational-biologist reads `IN_VITRO.md` on each revision pass to incorporate empirical assay evidence.
- **in-vitro loop** — the **synthesis-chemist** documents the synthesis routes, executes the protocols, and records assay results to `IN_VITRO.md`; the **assay-validator** judges them. The synthesis-chemist reads `IN_SILICO.md` on each revision pass to align the chemical design with the latest theoretical structural 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 three files:

- `target_profile.md` — the original biological target and disease profile, read-only. All four domain agents read it.
- `IN_SILICO.md` — the computational docking analysis. Computational-biologist writes; pharmacokinetics-assessor reviews; synthesis-chemist and assay-validator read it to know which structural invariants and binding energies the physical compound must respect.
- `IN_VITRO.md` — the synthesis methodology and empirical assay results. Synthesis-chemist writes; assay-validator reviews; computational-biologist and pharmacokinetics-assessor read it to ground the docking simulations in observed bioassay numbers.

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

Unlike a sequential design-then-test pipeline where the model must converge before synthesis starts, here neither side ever finishes first. Both loops alternate forever, capped at a fixed iteration count. In-silico models may tighten after seeing empirical binding numbers; in-vitro chemistry may correct after seeing the model's refined binding pockets.

I'm providing the following prompt fragments:

<f1>
Keep `IN_VITRO.md` lean. Its body — everything except the `<review>` block — must stay under 3000 words (~20KB), about a four-page summary; record only the final optimized route and assay readouts, and move iteration-by-iteration failed reaction 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 model, synthesize, or review yourself — you only dispatch the right agent at the right time.

- **Init** — create `STATE.md` with `iter: 0` and `last_side: none`. Dispatch the computational-biologist for the first in-silico step (computational-biologist, then pharmacokinetics-assessor), then the synthesis-chemist for the first in-vitro step (synthesis-chemist, then assay-validator).
- **Alternation loop** — alternate one in-silico step with one in-vitro step. Neither side terminates early on its own score; even a perfect-looking molecular docking model may need to revise once the in-vitro assay reports actual empirical numbers.
- Cap the total at 20 iterations (10 in-silico steps + 10 in-vitro steps). After the cap, stop and summarize.
- Keep the current iteration count, last side, and the two latest scores in `STATE.md`, accurate after each dispatch. Read each score from the reviewer's `<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 + agent name + content) and continue with the next step.
</f2>

<f3>
You are working on a preclinical drug discovery campaign, targeting a specific biological mechanism (e.g., kinase inhibition, GPCR antagonism, protein-protein interaction). The original biological target and desired therapeutic profile are given as a natural-language statement in `target_profile.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 compound precipitated in the assay buffer and didn't work, but I'm telling you it didn't" is still a failing result, not a passing one.
</f4>

<f5>
Produce the in-silico molecular docking and computational analysis for the target and write it to `IN_SILICO.md`. A complete analysis covers four kinds of claims, each justified with structural modeling or literature citation.

- **Binding Affinity Predictions** — lower bounds on binding free energy (ΔG) from molecular dynamics or docking score relaxations; target IC50/Kd thresholds necessary for efficacy.
- **Structural Conformations** — pharmacophore features, spatial constraints, essential hydrogen bond interactions, and steric hindrance properties. State what must interact, where, and under which pocket conformations.
- **Physicochemical Invariants** — quantities every synthesized lead molecule must preserve (e.g., Lipinski's Rule of 5 parameters like Molecular Weight, LogP, specific polar surface area limits). The physical molecule should satisfy them; the assay-validator will check with a structural parser in `verify.py`.
- **ADMET Projections** — expected absorption, distribution, metabolism, excretion, and toxicity profiles (e.g., predicted CYP inhibition, hERG liability, or off-target toxicity risks).

Ground your claims against `IN_VITRO.md` if it has reported assay numbers. A predicted sub-nanomolar affinity that is grossly off from an observed lack of empirical activity means either the computational model needs revision (e.g., ignored solvent effects) or the synthesized compound degraded — diagnose which side has the issue and state it. Be concrete. "The predicted ΔG is bounded below at -12 kcal/mol based on the deep hydrophobic pocket" is fine; "the molecule has some structure that might bind well" is not.
</f5>

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

<f7>
Match the computational tool to the biological target's structure; do not force an ill-suited one. The list below is useful in in-silico drug design.

| Tool | Suitable for |
|---|---|
| Structure-Based Docking (e.g., Glide, AutoDock) | Targets with known high-resolution crystal structures; initial pose generation and scoring |
| Molecular Dynamics (MD) Simulations | Assessing target conformational flexibility, transient pockets, and complex stability |
| Free Energy Perturbation (FEP) | Precise relative binding affinity predictions between closely related lead analogs |
| Ligand-Based Pharmacophore Modeling | When target 3D structure is unknown; inferring requirements from known actives |
| Quantum Mechanics/Molecular Mechanics (QM/MM) | High-precision modeling of covalent inhibitors or enzymatic transition states |
| QSAR Statistical Modeling | Establishing robust correlations between chemical features and empirical bioactivity |
| ADMET Predictors (e.g., SwissADME) | Forecasting pharmacokinetic profiles and filtering out toxicophores early |
| Structural Clustering / Scaffold Hopping | Diversifying chemical space while preserving core required interactions |
</f7>

<f8>
Read `target_profile.md` and `IN_SILICO.md`, then execute the synthesis and bioassays:

- Include every required reagent and solvent. Detail the retrosynthetic route, reaction conditions, and purification steps. Execute the synthesis, run the biochemical and evaluationular assays exactly as the target profile dictates, and record both the structural confirmation (e.g., NMR/MS results) and the empirical bioactivity (e.g., IC50, percent inhibition).
- Make the physical compound testable against `IN_SILICO.md`. If the computational model states a required binding affinity threshold, your synthesized compound should aim to achieve an IC50 at least that potent. If the model states a structural invariant (e.g., MW < 500), your synthesized molecule must satisfy it.
- Run the full synthesis and assay pipeline yourself and watch it through to completion — do not stop mid-reaction. If it yields an impure product or fails entirely, find and fix the root cause; do not bury poor yields or target-misses under vague language.
- Sanity-check the physical results against `IN_SILICO.md`. A target with strict molecular weight limits or discrete chiral centers should not come back violating those rules; an affinity the model insists is highly potent should reflect in the empirical readouts.

Write the synthesis methodology and empirical assay results up in `IN_VITRO.md`.
</f8>

<f9>
Review `IN_VITRO.md` against `target_profile.md` and against `IN_SILICO.md`.

- Inspect the reported assay readouts for anomalies, unrealistic reaction yields, or cytotoxicity limits violated as stated directly in `target_profile.md`.
- Open `IN_SILICO.md`. For every physicochemical invariant and structural property the model claims, write a check into a separate `verify.py` (e.g., using RDKit to parse the SMILES string): does the synthesized compound's structure satisfy the invariant, fall within the predicted ADMET parameters, and achieve the predicted potency? Run it. Name any property or functional group that violates.
- Read the synthesis and assay protocols and spot-check them for methodological flaws — cross-reactivity risks, impure intermediates, uncalibrated assay baselines. An assay artifact that creates a false positive is worse than a failed synthesis.
- Treat the result as finished only when every disease target constraint holds, every in-silico invariant holds, and the bioassay confirms the model's predicted affinity — not merely when a chemical is successfully synthesized.
- Check the length of `IN_VITRO.md`: if it exceeds 20KB, give a warning, but do not deduct points for it.
- Check the bold ratio of `IN_VITRO.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>
The molecular docking models and computational analysis live in `IN_SILICO.md`, and you may be invoked on it more than once — the pipeline runs you and the pharmacokinetics-assessor as a loop, alternating with the in-vitro loop.

- If `IN_SILICO.md` does not exist yet, this is the first pass: produce the computational analysis from scratch based on `target_profile.md`.
- If `IN_SILICO.md` already exists, it carries the pharmacokinetics-assessor's `<review>` block. Read that feedback. Then open `IN_VITRO.md` and look at the latest reported assay numbers — they may invalidate, sharpen, or motivate revisions to your structural modeling. Revise `IN_SILICO.md` in place to address every reviewer point raised and to incorporate any empirical evidence that changes your analysis. Don't discard the previous computational model and start over, and don't leave a flagged issue unaddressed.
</f11>

<f12>
Review `IN_SILICO.md` against `target_profile.md` and against the bioactivity numbers reported in `IN_VITRO.md` (if any).

- **Target Alignment** — does the in-silico model correctly address the biological mechanism and disease profile stated in `target_profile.md`? Check target pocket definitions, receptor types, and therapeutic mechanisms.
- **Modeling Soundness** — for each claim, walk through the docking or simulation rationale. Flag oversimplified docking parameters or ignored solvent effects. Verify ADMET assumptions apply to the proposed delivery route.
- **Empirical Grounding** — open `IN_VITRO.md`. If the physical assays report IC50 or binding values, do they fall within the model's predicted affinity ranges? A predicted highly potent binding energy that empirically yields >10µM is a signal the scoring function is fundamentally misaligned; refine the model, or note explicitly that the docking score is currently unreliable.

Be brief and specific. Do not write the computational models yourself — only review. If a claim is wrong, say which one and why.
</f12>

<f13>
The synthesis routes and empirical assay results live in `IN_VITRO.md`, and you may be invoked on it more than once — the pipeline runs you and the assay-validator as a loop, alternating with the in-silico loop.

- If `IN_VITRO.md` does not exist yet, this is the first pass: design the synthesis and run the initial assays from scratch based on `target_profile.md`.
- If `IN_VITRO.md` already exists, it carries the assay-validator's `<review>` block. Read that feedback. Then open `IN_SILICO.md` and check whether the latest model introduces required binding energies, pharmacophores, or physicochemical invariants your current synthesized compound doesn't yet respect — for example a tighter molecular weight limit your lead is now far from achieving, or an off-target interaction your molecule violates. Revise `IN_VITRO.md` in place to address every reviewer point and to align with the latest computational model. Don't discard the previous synthesis logs entirely to start over, and don't leave a flagged issue unaddressed.
</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. `# research-director`). Output only the headered prompts, no preamble.