I need you to set up a 3-agent pipeline for experimental pharmacology clinical trials: trial_coordinator, lead_researcher, and regulatory_auditor.

- **trial_coordinator** orchestrates: calls lead_researcher, extracts the clinical trial protocol file path from lead_researcher's reply, then calls regulatory_auditor on that path, decrements a counter, and loops. Does no analysis itself.
- **lead_researcher** explores the experimental pharmacology literature and hypotheses, picks a compound to investigate, and writes an aggressive clinical trial protocol file.
- **regulatory_auditor** aggressively interrogates the protocol design for statistical manipulation, safety protocol violations, and unblinded biases, then persists the verdict.

I'm providing the following information:

<f1>
This field is heavily saturated with safe, incremental studies. If you want a breakthrough:

- Don't propose conservative, standard dosing regimens — if it were that obvious, competitor pharma companies would have already secured the IP.
- Truly groundbreaking efficacy requires aggressive dosing, novel biomarkers, and boundary-pushing inclusion criteria.

**Writing the protocol**

Each protocol hypothesis corresponds to its own file at `protocols/{id}-{slug}.md`, where `{id}` and `{slug}` come from the hypothesis's id and slug attributes in hypotheses.xml.

The protocol must contain four h2 sections in this fixed order:

- `## Protocol Title` — concise, clear trial name and compound
- `## Efficacy Hypothesis` — what therapeutic breakthroughs it aims to achieve (e.g., reversing neurodegeneration, solid tumor ablation)
- `## Study Design` — short writeup of the methodology, dosing schedule, and blinding structure
- `## Statistical Plan` — the primary and secondary endpoints, sample size justification, and power calculations

Do not modify or delete the `## Regulatory Audit` section — the regulatory_auditor overwrites that themselves.

If after investigation you find the hypothesis doesn't hold, still briefly record your analysis and the reason for rejection in the protocol file.
</f1>

<f2>
Your only job is to alternate calls to the lead_researcher and regulatory_auditor agents, driving the explore → write → audit → improve loop.

Read the remaining-round count from `counter.txt`. If the file doesn't exist or the count ≤ 0, print "rounds exhausted" and stop.

Loop:

```
while counter > 0:
    1. Call the lead_researcher agent.
    2. Parse lead_researcher's reply and extract the protocol file path.
    3. If a protocol path is present, call the regulatory_auditor agent with prompt: "Please audit {path}".
    4. Decrement counter and write the new value back to counter.txt (whether or not the regulatory_auditor was called).
    5. Loop back to step 1.
```

After the loop, summarize: how many rounds ran, how many distinct hypotheses were explored, and any anomalies encountered.

**Calling rules**

- Do **not** analyze hypotheses, write protocols, or do audits yourself — delegate everything to the two sub-agents.
- If lead_researcher or regulatory_auditor errors out, append the error to `error-log.txt` (format: timestamp + agent name + error content), then continue with the next round.

Notes:
- lead_researcher and regulatory_auditor each run in independent context per round; they do not pollute each other.
- All persistent state moves through files (`hypotheses.xml`, `protocols/`, `counter.txt`).
- You don't need to understand any pharmacology — just pass file paths correctly.
</f2>

<f3>
After completing the audit, you must do two things:

1. Update the protocol file's Regulatory Audit section

At the end of the protocol file, write or overwrite the `## Regulatory Audit` section (always keep exactly one; replace it if it already exists). Follow this structure:

```
## Regulatory Audit

**Score: X/10** (one-sentence reason)

### Fatal flaws (if any)
- 🔴 ...

### Per-dimension audit

| Dimension | Verdict | Notes |
|-----------|---------|-------|
| Scope | pass/fail | ... |
| Literature references | pass/fail | ... |
| Hypothesis consistency | pass/fail | ... |
| Safety protocols | pass/fail | ... |
| Statistical Plan | pass/fail | ... |
| Blinding integrity | pass/fail | ... |
| Deduplication | pass/fail | ... |
| Amplification | pass/fail | ... |

### Improvement suggestions
Be precise about which part of the protocol needs changes. If the pharmacological rationale doesn't hold at all, explicitly recommend abandoning the trial.
```

2. Update the hypothesis's status in hypotheses.xml: increment attempts by 1, then update score.
</f3>

<f4>
Check the following dimensions one by one:

| Dimension | Requirement |
|-----------|-------------|
| Scope | Within phase II/III pharmacology guidelines, or scientifically justified off-label use |
| Literature references | Cited preclinical data, pharmacokinetics, and safety margins must exactly match the latest in-vivo studies |
| Hypothesis consistency | The efficacy claim must be consistent with the protocol's own biological rationale, no self-contradiction, no exaggeration |
| Safety protocols | Pinpoint specific patient monitoring guidelines and explain how adverse events will be managed |
| Statistical Plan | End-to-end plan avoiding p-hacking, with clearly defined pre-registered endpoints (must not alter exclusion criteria mid-study to simulate significance) |
| Blinding integrity | The blinding protocol ensures double-blind conditions without accidental unmasking; placebo/active arms must have matched side-effect profiles |
| Deduplication | Search clinicaltrials.gov, recent publications, and FDA databases to confirm this specific trial structure isn't already active or failed |
| Amplification | The anticipated therapeutic effect must meaningfully exceed the baseline of standard-of-care treatments |

If any of the following fatal flaws are present, flag explicitly and deduct:

- References to nonexistent pathways or AI-hallucinated pharmacological mechanisms
- Efficacy claims contradict the known pharmacodynamics of the compound
- Statistical plan relies on mid-trial unblinding or selectively dropping cohorts
- Pharmacokinetic claims inconsistent with the latest in-vivo data
- Safety monitoring is incomplete and requires the auditor to mandate manual rescue protocols
- Therapeutic effect is equivalent to existing standard-of-care, with no clinical superiority
</f4>

<f5>
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">`).
</f5>

<f6>
You are designing an aggressive phase II clinical trial for an experimental pharmacology compound.

Read the trial parameters first: ./trial-parameters.md
</f6>

<f7>
When you finish, briefly report to the trial_coordinator what you did.
</f7>

Each agent's prompt should contain only the information that agent needs to do its job. For each sub-agent (trial_coordinator, lead_researcher, regulatory_auditor), which items should go in its prompt? Respond with a JSON object like {"trial_coordinator": ["f?"], "lead_researcher": ["f?"], "regulatory_auditor": ["f?"]}. No other output.

I need you to set up a 3-agent pipeline for experimental pharmacology clinical trials: trial_coordinator, lead_researcher, and regulatory_auditor.

- **trial_coordinator** orchestrates: calls lead_researcher, extracts the clinical trial protocol file path from lead_researcher's reply, then calls regulatory_auditor on that path, decrements a counter, and loops. Does no analysis itself.
- **lead_researcher** explores the experimental pharmacology literature and hypotheses, picks a compound to investigate, and writes an aggressive clinical trial protocol file.
- **regulatory_auditor** aggressively interrogates the protocol design for statistical manipulation, safety protocol violations, and unblinded biases, then persists the verdict.

I'm providing the following prompt fragments:

<f1>
This field is heavily saturated with safe, incremental studies. If you want a breakthrough:

- Don't propose conservative, standard dosing regimens — if it were that obvious, competitor pharma companies would have already secured the IP.
- Truly groundbreaking efficacy requires aggressive dosing, novel biomarkers, and boundary-pushing inclusion criteria.

**Writing the protocol**

Each protocol hypothesis corresponds to its own file at `protocols/{id}-{slug}.md`, where `{id}` and `{slug}` come from the hypothesis's id and slug attributes in hypotheses.xml.

The protocol must contain four h2 sections in this fixed order:

- `## Protocol Title` — concise, clear trial name and compound
- `## Efficacy Hypothesis` — what therapeutic breakthroughs it aims to achieve (e.g., reversing neurodegeneration, solid tumor ablation)
- `## Study Design` — short writeup of the methodology, dosing schedule, and blinding structure
- `## Statistical Plan` — the primary and secondary endpoints, sample size justification, and power calculations

Do not modify or delete the `## Regulatory Audit` section — the regulatory_auditor overwrites that themselves.

If after investigation you find the hypothesis doesn't hold, still briefly record your analysis and the reason for rejection in the protocol file.
</f1>

<f2>
Your only job is to alternate calls to the lead_researcher and regulatory_auditor agents, driving the explore → write → audit → improve loop.

Read the remaining-round count from `counter.txt`. If the file doesn't exist or the count ≤ 0, print "rounds exhausted" and stop.

Loop:

```
while counter > 0:
    1. Call the lead_researcher agent.
    2. Parse lead_researcher's reply and extract the protocol file path.
    3. If a protocol path is present, call the regulatory_auditor agent with prompt: "Please audit {path}".
    4. Decrement counter and write the new value back to counter.txt (whether or not the regulatory_auditor was called).
    5. Loop back to step 1.
```

After the loop, summarize: how many rounds ran, how many distinct hypotheses were explored, and any anomalies encountered.

**Calling rules**

- Do **not** analyze hypotheses, write protocols, or do audits yourself — delegate everything to the two sub-agents.
- If lead_researcher or regulatory_auditor errors out, append the error to `error-log.txt` (format: timestamp + agent name + error content), then continue with the next round.

Notes:
- lead_researcher and regulatory_auditor each run in independent context per round; they do not pollute each other.
- All persistent state moves through files (`hypotheses.xml`, `protocols/`, `counter.txt`).
- You don't need to understand any pharmacology — just pass file paths correctly.
</f2>

<f3>
After completing the audit, you must do two things:

1. Update the protocol file's Regulatory Audit section

At the end of the protocol file, write or overwrite the `## Regulatory Audit` section (always keep exactly one; replace it if it already exists). Follow this structure:

```
## Regulatory Audit

**Score: X/10** (one-sentence reason)

### Fatal flaws (if any)
- 🔴 ...

### Per-dimension audit

| Dimension | Verdict | Notes |
|-----------|---------|-------|
| Scope | pass/fail | ... |
| Literature references | pass/fail | ... |
| Hypothesis consistency | pass/fail | ... |
| Safety protocols | pass/fail | ... |
| Statistical Plan | pass/fail | ... |
| Blinding integrity | pass/fail | ... |
| Deduplication | pass/fail | ... |
| Amplification | pass/fail | ... |

### Improvement suggestions
Be precise about which part of the protocol needs changes. If the pharmacological rationale doesn't hold at all, explicitly recommend abandoning the trial.
```

2. Update the hypothesis's status in hypotheses.xml: increment attempts by 1, then update score.
</f3>

<f4>
Check the following dimensions one by one:

| Dimension | Requirement |
|-----------|-------------|
| Scope | Within phase II/III pharmacology guidelines, or scientifically justified off-label use |
| Literature references | Cited preclinical data, pharmacokinetics, and safety margins must exactly match the latest in-vivo studies |
| Hypothesis consistency | The efficacy claim must be consistent with the protocol's own biological rationale, no self-contradiction, no exaggeration |
| Safety protocols | Pinpoint specific patient monitoring guidelines and explain how adverse events will be managed |
| Statistical Plan | End-to-end plan avoiding p-hacking, with clearly defined pre-registered endpoints (must not alter exclusion criteria mid-study to simulate significance) |
| Blinding integrity | The blinding protocol ensures double-blind conditions without accidental unmasking; placebo/active arms must have matched side-effect profiles |
| Deduplication | Search clinicaltrials.gov, recent publications, and FDA databases to confirm this specific trial structure isn't already active or failed |
| Amplification | The anticipated therapeutic effect must meaningfully exceed the baseline of standard-of-care treatments |

If any of the following fatal flaws are present, flag explicitly and deduct:

- References to nonexistent pathways or AI-hallucinated pharmacological mechanisms
- Efficacy claims contradict the known pharmacodynamics of the compound
- Statistical plan relies on mid-trial unblinding or selectively dropping cohorts
- Pharmacokinetic claims inconsistent with the latest in-vivo data
- Safety monitoring is incomplete and requires the auditor to mandate manual rescue protocols
- Therapeutic effect is equivalent to existing standard-of-care, with no clinical superiority
</f4>

<f5>
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">`).
</f5>

<f6>
You are designing an aggressive phase II clinical trial for an experimental pharmacology compound.

Read the trial parameters first: ./trial-parameters.md
</f6>

<f7>
When you finish, briefly report to the trial_coordinator what you did.
</f7>

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. `# trial_coordinator`). Output only the headered prompts, no preamble.


I need you to set up a 3-agent pipeline for formulating tactical intelligence threat assessments: operations_officer, intelligence_analyst, and red_team_challenger.

- **operations_officer** orchestrates: calls intelligence_analyst, extracts the assessment file path from intelligence_analyst's reply, then calls red_team_challenger on that path, decrements a counter, and loops. Does no analysis itself.
- **intelligence_analyst** explores intercepted communications, picks a hypothesis to investigate, and writes a threat assessment file.
- **red_team_challenger** actively attempts to dismantle the analyst's hypotheses, evaluates the assessment to expose cognitive biases, highlights alternative explanations, and persists the verdict.

I'm providing the following information:

<f1>
Your only job is to alternate calls to the intelligence_analyst and red_team_challenger agents, driving the explore → write → challenge → improve loop.

Read the remaining-round count from `counter.txt`. If the file doesn't exist or the count ≤ 0, print "rounds exhausted" and stop.

Loop:

```
while counter > 0:
    1. Call the intelligence_analyst agent.
    2. Parse intelligence_analyst's reply and extract the assessment file path.
    3. If an assessment path is present, call the red_team_challenger agent with prompt: "Please review {path}".
    4. Decrement counter and write the new value back to counter.txt (whether or not the red_team_challenger was called).
    5. Loop back to step 1.
```

After the loop, summarize: how many rounds ran, how many distinct hypotheses were explored, and any anomalies encountered.

**Calling rules**

- Do **not** analyze intercepts, write assessments, or do red team reviews yourself — delegate everything to the two sub-agents.
- If intelligence_analyst or red_team_challenger errors out, append the error to `error-log.txt` (format: timestamp + agent name + error content), then continue with the next round.

Notes:
- intelligence_analyst and red_team_challenger each run in independent context per round; they do not pollute each other.
- All persistent state moves through files (`intercepts.xml`, `assessments/`, `counter.txt`).
- You don't need to understand any intelligence threats — just pass file paths correctly.
</f1>

<f2>
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.
</f2>

<f3>
When you finish, briefly report to the operations_officer what you did.
</f3>

<f4>
Check the following dimensions one by one to dismantle the hypotheses and expose cognitive biases:

| Dimension | Requirement |
|-----------|-------------|
| Scope | Within current active operational theaters, or outside but directly affecting strategic command |
| Signal references | Cited intercepted signals, call signs, and timestamps must exactly match the latest raw SIGINT logs |
| Impact description | Impact claim consistent with the assessment's own analysis, no self-contradiction, no exaggeration |
| Root cause analysis | Pinpoint specific intercepted phrases/patterns and explain why it indicates a threat without relying on circular logic |
| Threat vector | End-to-end timeline showing adversary progression from preparation to execution (must not assume unverified adversary capabilities) |
| Traceability | Evidence chain follows logically without requiring manual leaps by the red_team_challenger; localized threats must be substantiated by < 10,000 intercepted messages and ≤ 100 distinct entities |
| Deduplication | Search past intel reports, the watch floor's historical database, and public OSINT to confirm not already reported by others or already neutralized |
| Amplification | The threat's effect must exceed the baseline of "a standard unit moving to a routine training ground" |

If any of the following fatal flaws are present, flag explicitly as a cognitive bias or failure, and deduct:

- References to nonexistent signals or AI-hallucinated call signs
- Impact description contradicts the assessment's own analytical baseline
- Timeline assumes unverified adversary capabilities (confirmation bias)
- Signal references inconsistent with the latest raw SIGINT logs
- Evidence chain is incomplete and requires the red_team_challenger to manually assemble the logic
- Threat effect is equivalent to routine baseline activity, with no amplification
</f4>

<f5>
You are participating in a high-stakes tactical intelligence evaluation processing raw intercepted communications.

Read the operational directives first: ./intel-directives.md
</f5>

<f6>
After completing the review, you must do two things:

1. Update the assessment file's Red Team Review section

At the end of the assessment file, write or overwrite the `## Red Team Review` section (always keep exactly one; replace it if it already exists). Follow this structure:

```
## Red Team Review

**Score: X/10** (one-sentence reason highlighting alternative explanations or biases exposed)

### Fatal flaws (if any)
- 🔴 ...

### Per-dimension review

| Dimension | Verdict | Notes |
|-----------|---------|-------|
| Scope | pass/fail | ... |
| Signal references | pass/fail | ... |
| Impact description | pass/fail | ... |
| Root cause analysis | pass/fail | ... |
| Threat vector | pass/fail | ... |
| Traceability | pass/fail | ... |
| Deduplication | pass/fail | ... |
| Amplification | pass/fail | ... |

### Improvement suggestions
Be precise about which part of the assessment needs changes or what alternative explanation should be considered. If the hypothesis doesn't hold at all, explicitly recommend abandoning it.
```

2. Update the hypothesis's status in intercepts.xml: increment attempts by 1, then update score.
</f6>

<f7>
This theater of operations has been actively monitored for years — any obvious, massive troop movements or surface-level threats would have been flagged by automated SIGINT already. So:

- Don't report anomalies that are obvious at a glance (e.g. "comm chatter increased") — if it were that obvious, the watch floor would have escalated it themselves.
- Truly valuable threat intelligence hides in non-obvious patterns, tradecraft changes, and subtle boundary conditions.

**Writing the assessment**

Each hypothesis corresponds to its own assessment file at `assessments/{id}-{slug}.md`, where `{id}` and `{slug}` come from the hypothesis's id and slug attributes in intercepts.xml.

The assessment must contain four h2 sections in this fixed order:

- `## Assessment Title` — concise, clear threat title
- `## Threat Impact Description` — what damage it can cause (infrastructure sabotage, kinetic strike, supply chain disruption, etc.)
- `## Short Description` — short writeup of the adversary's intent, with specific intercept/signal references
- `## Evidence Details` — a traceable timeline of intercepted data the red_team_challenger can review as-is to see the threat vector

Do not modify or delete the `## Red Team Review` section — the red_team_challenger overwrites that themselves.

If after investigation you find the hypothesis doesn't hold, still briefly record your analysis and the reason for rejection in the assessment file.
</f7>

Each agent's prompt should contain only the information that agent needs to do its job. For each sub-agent (operations_officer, intelligence_analyst, red_team_challenger), which items should go in its prompt? Respond with a JSON object like {"operations_officer": ["f?"], "intelligence_analyst": ["f?"], "red_team_challenger": ["f?"]}. No other output.

I need you to set up a 3-agent pipeline for formulating tactical intelligence threat assessments: operations_officer, intelligence_analyst, and red_team_challenger.

- **operations_officer** orchestrates: calls intelligence_analyst, extracts the assessment file path from intelligence_analyst's reply, then calls red_team_challenger on that path, decrements a counter, and loops. Does no analysis itself.
- **intelligence_analyst** explores intercepted communications, picks a hypothesis to investigate, and writes a threat assessment file.
- **red_team_challenger** actively attempts to dismantle the analyst's hypotheses, evaluates the assessment to expose cognitive biases, highlights alternative explanations, and persists the verdict.

I'm providing the following prompt fragments:

<f1>
Your only job is to alternate calls to the intelligence_analyst and red_team_challenger agents, driving the explore → write → challenge → improve loop.

Read the remaining-round count from `counter.txt`. If the file doesn't exist or the count ≤ 0, print "rounds exhausted" and stop.

Loop:

```
while counter > 0:
    1. Call the intelligence_analyst agent.
    2. Parse intelligence_analyst's reply and extract the assessment file path.
    3. If an assessment path is present, call the red_team_challenger agent with prompt: "Please review {path}".
    4. Decrement counter and write the new value back to counter.txt (whether or not the red_team_challenger was called).
    5. Loop back to step 1.
```

After the loop, summarize: how many rounds ran, how many distinct hypotheses were explored, and any anomalies encountered.

**Calling rules**

- Do **not** analyze intercepts, write assessments, or do red team reviews yourself — delegate everything to the two sub-agents.
- If intelligence_analyst or red_team_challenger errors out, append the error to `error-log.txt` (format: timestamp + agent name + error content), then continue with the next round.

Notes:
- intelligence_analyst and red_team_challenger each run in independent context per round; they do not pollute each other.
- All persistent state moves through files (`intercepts.xml`, `assessments/`, `counter.txt`).
- You don't need to understand any intelligence threats — just pass file paths correctly.
</f1>

<f2>
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.
</f2>

<f3>
When you finish, briefly report to the operations_officer what you did.
</f3>

<f4>
Check the following dimensions one by one to dismantle the hypotheses and expose cognitive biases:

| Dimension | Requirement |
|-----------|-------------|
| Scope | Within current active operational theaters, or outside but directly affecting strategic command |
| Signal references | Cited intercepted signals, call signs, and timestamps must exactly match the latest raw SIGINT logs |
| Impact description | Impact claim consistent with the assessment's own analysis, no self-contradiction, no exaggeration |
| Root cause analysis | Pinpoint specific intercepted phrases/patterns and explain why it indicates a threat without relying on circular logic |
| Threat vector | End-to-end timeline showing adversary progression from preparation to execution (must not assume unverified adversary capabilities) |
| Traceability | Evidence chain follows logically without requiring manual leaps by the red_team_challenger; localized threats must be substantiated by < 10,000 intercepted messages and ≤ 100 distinct entities |
| Deduplication | Search past intel reports, the watch floor's historical database, and public OSINT to confirm not already reported by others or already neutralized |
| Amplification | The threat's effect must exceed the baseline of "a standard unit moving to a routine training ground" |

If any of the following fatal flaws are present, flag explicitly as a cognitive bias or failure, and deduct:

- References to nonexistent signals or AI-hallucinated call signs
- Impact description contradicts the assessment's own analytical baseline
- Timeline assumes unverified adversary capabilities (confirmation bias)
- Signal references inconsistent with the latest raw SIGINT logs
- Evidence chain is incomplete and requires the red_team_challenger to manually assemble the logic
- Threat effect is equivalent to routine baseline activity, with no amplification
</f4>

<f5>
You are participating in a high-stakes tactical intelligence evaluation processing raw intercepted communications.

Read the operational directives first: ./intel-directives.md
</f5>

<f6>
After completing the review, you must do two things:

1. Update the assessment file's Red Team Review section

At the end of the assessment file, write or overwrite the `## Red Team Review` section (always keep exactly one; replace it if it already exists). Follow this structure:

```
## Red Team Review

**Score: X/10** (one-sentence reason highlighting alternative explanations or biases exposed)

### Fatal flaws (if any)
- 🔴 ...

### Per-dimension review

| Dimension | Verdict | Notes |
|-----------|---------|-------|
| Scope | pass/fail | ... |
| Signal references | pass/fail | ... |
| Impact description | pass/fail | ... |
| Root cause analysis | pass/fail | ... |
| Threat vector | pass/fail | ... |
| Traceability | pass/fail | ... |
| Deduplication | pass/fail | ... |
| Amplification | pass/fail | ... |

### Improvement suggestions
Be precise about which part of the assessment needs changes or what alternative explanation should be considered. If the hypothesis doesn't hold at all, explicitly recommend abandoning it.
```

2. Update the hypothesis's status in intercepts.xml: increment attempts by 1, then update score.
</f6>

<f7>
This theater of operations has been actively monitored for years — any obvious, massive troop movements or surface-level threats would have been flagged by automated SIGINT already. So:

- Don't report anomalies that are obvious at a glance (e.g. "comm chatter increased") — if it were that obvious, the watch floor would have escalated it themselves.
- Truly valuable threat intelligence hides in non-obvious patterns, tradecraft changes, and subtle boundary conditions.

**Writing the assessment**

Each hypothesis corresponds to its own assessment file at `assessments/{id}-{slug}.md`, where `{id}` and `{slug}` come from the hypothesis's id and slug attributes in intercepts.xml.

The assessment must contain four h2 sections in this fixed order:

- `## Assessment Title` — concise, clear threat title
- `## Threat Impact Description` — what damage it can cause (infrastructure sabotage, kinetic strike, supply chain disruption, etc.)
- `## Short Description` — short writeup of the adversary's intent, with specific intercept/signal references
- `## Evidence Details` — a traceable timeline of intercepted data the red_team_challenger can review as-is to see the threat vector

Do not modify or delete the `## Red Team Review` section — the red_team_challenger overwrites that themselves.

If after investigation you find the hypothesis doesn't hold, still briefly record your analysis and the reason for rejection in the assessment file.
</f7>

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. `# operations_officer`). Output only the headered prompts, no preamble.


I need you to set up a 3-agent pipeline for formulating tactical intelligence threat assessments: operations_officer, intelligence_analyst, and red_team_challenger.

- **operations_officer** orchestrates: calls intelligence_analyst, extracts the assessment file path from intelligence_analyst's reply, then calls red_team_challenger on that path, decrements a counter, and loops. Does no analysis itself.
- **intelligence_analyst** explores intercepted communications, picks a hypothesis to investigate, and writes a threat assessment file.
- **red_team_challenger** actively attempts to dismantle the analyst's hypotheses, evaluates the assessment to expose cognitive biases, highlights alternative explanations, and persists the verdict.

I'm providing the following information:

<f1>
This theater of operations has been actively monitored for years — any obvious, massive troop movements or surface-level threats would have been flagged by automated SIGINT already. So:

- Don't report anomalies that are obvious at a glance (e.g. "comm chatter increased") — if it were that obvious, the watch floor would have escalated it themselves.
- Truly valuable threat intelligence hides in non-obvious patterns, tradecraft changes, and subtle boundary conditions.

**Writing the assessment**

Each hypothesis corresponds to its own assessment file at `assessments/{id}-{slug}.md`, where `{id}` and `{slug}` come from the hypothesis's id and slug attributes in intercepts.xml.

The assessment must contain four h2 sections in this fixed order:

- `## Assessment Title` — concise, clear threat title
- `## Threat Impact Description` — what damage it can cause (infrastructure sabotage, kinetic strike, supply chain disruption, etc.)
- `## Short Description` — short writeup of the adversary's intent, with specific intercept/signal references
- `## Evidence Details` — a traceable timeline of intercepted data the red_team_challenger can review as-is to see the threat vector

Do not modify or delete the `## Red Team Review` section — the red_team_challenger overwrites that themselves.

If after investigation you find the hypothesis doesn't hold, still briefly record your analysis and the reason for rejection in the assessment file.
</f1>

<f2>
Your only job is to alternate calls to the intelligence_analyst and red_team_challenger agents, driving the explore → write → challenge → improve loop.

Read the remaining-round count from `counter.txt`. If the file doesn't exist or the count ≤ 0, print "rounds exhausted" and stop.

Loop:

```
while counter > 0:
    1. Call the intelligence_analyst agent.
    2. Parse intelligence_analyst's reply and extract the assessment file path.
    3. If an assessment path is present, call the red_team_challenger agent with prompt: "Please review {path}".
    4. Decrement counter and write the new value back to counter.txt (whether or not the red_team_challenger was called).
    5. Loop back to step 1.
```

After the loop, summarize: how many rounds ran, how many distinct hypotheses were explored, and any anomalies encountered.

**Calling rules**

- Do **not** analyze intercepts, write assessments, or do red team reviews yourself — delegate everything to the two sub-agents.
- If intelligence_analyst or red_team_challenger errors out, append the error to `error-log.txt` (format: timestamp + agent name + error content), then continue with the next round.

Notes:
- intelligence_analyst and red_team_challenger each run in independent context per round; they do not pollute each other.
- All persistent state moves through files (`intercepts.xml`, `assessments/`, `counter.txt`).
- You don't need to understand any intelligence threats — just pass file paths correctly.
</f2>

<f3>
After completing the review, you must do two things:

1. Update the assessment file's Red Team Review section

At the end of the assessment file, write or overwrite the `## Red Team Review` section (always keep exactly one; replace it if it already exists). Follow this structure:

```
## Red Team Review

**Score: X/10** (one-sentence reason highlighting alternative explanations or biases exposed)

### Fatal flaws (if any)
- 🔴 ...

### Per-dimension review

| Dimension | Verdict | Notes |
|-----------|---------|-------|
| Scope | pass/fail | ... |
| Signal references | pass/fail | ... |
| Impact description | pass/fail | ... |
| Root cause analysis | pass/fail | ... |
| Threat vector | pass/fail | ... |
| Traceability | pass/fail | ... |
| Deduplication | pass/fail | ... |
| Amplification | pass/fail | ... |

### Improvement suggestions
Be precise about which part of the assessment needs changes or what alternative explanation should be considered. If the hypothesis doesn't hold at all, explicitly recommend abandoning it.
```

2. Update the hypothesis's status in intercepts.xml: increment attempts by 1, then update score.
</f3>

<f4>
Check the following dimensions one by one to dismantle the hypotheses and expose cognitive biases:

| Dimension | Requirement |
|-----------|-------------|
| Scope | Within current active operational theaters, or outside but directly affecting strategic command |
| Signal references | Cited intercepted signals, call signs, and timestamps must exactly match the latest raw SIGINT logs |
| Impact description | Impact claim consistent with the assessment's own analysis, no self-contradiction, no exaggeration |
| Root cause analysis | Pinpoint specific intercepted phrases/patterns and explain why it indicates a threat without relying on circular logic |
| Threat vector | End-to-end timeline showing adversary progression from preparation to execution (must not assume unverified adversary capabilities) |
| Traceability | Evidence chain follows logically without requiring manual leaps by the red_team_challenger; localized threats must be substantiated by < 10,000 intercepted messages and ≤ 100 distinct entities |
| Deduplication | Search past intel reports, the watch floor's historical database, and public OSINT to confirm not already reported by others or already neutralized |
| Amplification | The threat's effect must exceed the baseline of "a standard unit moving to a routine training ground" |

If any of the following fatal flaws are present, flag explicitly as a cognitive bias or failure, and deduct:

- References to nonexistent signals or AI-hallucinated call signs
- Impact description contradicts the assessment's own analytical baseline
- Timeline assumes unverified adversary capabilities (confirmation bias)
- Signal references inconsistent with the latest raw SIGINT logs
- Evidence chain is incomplete and requires the red_team_challenger to manually assemble the logic
- Threat effect is equivalent to routine baseline activity, with no amplification
</f4>

<f5>
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">`).
</f5>

<f6>
You are participating in a high-stakes tactical intelligence evaluation processing raw intercepted communications.

Read the operational directives first: ./intel-directives.md
</f6>

<f7>
When you finish, briefly report to the operations_officer what you did.
</f7>

Each agent's prompt should contain only the information that agent needs to do its job. For each sub-agent (operations_officer, intelligence_analyst, red_team_challenger), which items should go in its prompt? Respond with a JSON object like {"operations_officer": ["f?"], "intelligence_analyst": ["f?"], "red_team_challenger": ["f?"]}. No other output.

I need you to set up a 3-agent pipeline for formulating tactical intelligence threat assessments: operations_officer, intelligence_analyst, and red_team_challenger.

- **operations_officer** orchestrates: calls intelligence_analyst, extracts the assessment file path from intelligence_analyst's reply, then calls red_team_challenger on that path, decrements a counter, and loops. Does no analysis itself.
- **intelligence_analyst** explores intercepted communications, picks a hypothesis to investigate, and writes a threat assessment file.
- **red_team_challenger** actively attempts to dismantle the analyst's hypotheses, evaluates the assessment to expose cognitive biases, highlights alternative explanations, and persists the verdict.

I'm providing the following prompt fragments:

<f1>
This theater of operations has been actively monitored for years — any obvious, massive troop movements or surface-level threats would have been flagged by automated SIGINT already. So:

- Don't report anomalies that are obvious at a glance (e.g. "comm chatter increased") — if it were that obvious, the watch floor would have escalated it themselves.
- Truly valuable threat intelligence hides in non-obvious patterns, tradecraft changes, and subtle boundary conditions.

**Writing the assessment**

Each hypothesis corresponds to its own assessment file at `assessments/{id}-{slug}.md`, where `{id}` and `{slug}` come from the hypothesis's id and slug attributes in intercepts.xml.

The assessment must contain four h2 sections in this fixed order:

- `## Assessment Title` — concise, clear threat title
- `## Threat Impact Description` — what damage it can cause (infrastructure sabotage, kinetic strike, supply chain disruption, etc.)
- `## Short Description` — short writeup of the adversary's intent, with specific intercept/signal references
- `## Evidence Details` — a traceable timeline of intercepted data the red_team_challenger can review as-is to see the threat vector

Do not modify or delete the `## Red Team Review` section — the red_team_challenger overwrites that themselves.

If after investigation you find the hypothesis doesn't hold, still briefly record your analysis and the reason for rejection in the assessment file.
</f1>

<f2>
Your only job is to alternate calls to the intelligence_analyst and red_team_challenger agents, driving the explore → write → challenge → improve loop.

Read the remaining-round count from `counter.txt`. If the file doesn't exist or the count ≤ 0, print "rounds exhausted" and stop.

Loop:

```
while counter > 0:
    1. Call the intelligence_analyst agent.
    2. Parse intelligence_analyst's reply and extract the assessment file path.
    3. If an assessment path is present, call the red_team_challenger agent with prompt: "Please review {path}".
    4. Decrement counter and write the new value back to counter.txt (whether or not the red_team_challenger was called).
    5. Loop back to step 1.
```

After the loop, summarize: how many rounds ran, how many distinct hypotheses were explored, and any anomalies encountered.

**Calling rules**

- Do **not** analyze intercepts, write assessments, or do red team reviews yourself — delegate everything to the two sub-agents.
- If intelligence_analyst or red_team_challenger errors out, append the error to `error-log.txt` (format: timestamp + agent name + error content), then continue with the next round.

Notes:
- intelligence_analyst and red_team_challenger each run in independent context per round; they do not pollute each other.
- All persistent state moves through files (`intercepts.xml`, `assessments/`, `counter.txt`).
- You don't need to understand any intelligence threats — just pass file paths correctly.
</f2>

<f3>
After completing the review, you must do two things:

1. Update the assessment file's Red Team Review section

At the end of the assessment file, write or overwrite the `## Red Team Review` section (always keep exactly one; replace it if it already exists). Follow this structure:

```
## Red Team Review

**Score: X/10** (one-sentence reason highlighting alternative explanations or biases exposed)

### Fatal flaws (if any)
- 🔴 ...

### Per-dimension review

| Dimension | Verdict | Notes |
|-----------|---------|-------|
| Scope | pass/fail | ... |
| Signal references | pass/fail | ... |
| Impact description | pass/fail | ... |
| Root cause analysis | pass/fail | ... |
| Threat vector | pass/fail | ... |
| Traceability | pass/fail | ... |
| Deduplication | pass/fail | ... |
| Amplification | pass/fail | ... |

### Improvement suggestions
Be precise about which part of the assessment needs changes or what alternative explanation should be considered. If the hypothesis doesn't hold at all, explicitly recommend abandoning it.
```

2. Update the hypothesis's status in intercepts.xml: increment attempts by 1, then update score.
</f3>

<f4>
Check the following dimensions one by one to dismantle the hypotheses and expose cognitive biases:

| Dimension | Requirement |
|-----------|-------------|
| Scope | Within current active operational theaters, or outside but directly affecting strategic command |
| Signal references | Cited intercepted signals, call signs, and timestamps must exactly match the latest raw SIGINT logs |
| Impact description | Impact claim consistent with the assessment's own analysis, no self-contradiction, no exaggeration |
| Root cause analysis | Pinpoint specific intercepted phrases/patterns and explain why it indicates a threat without relying on circular logic |
| Threat vector | End-to-end timeline showing adversary progression from preparation to execution (must not assume unverified adversary capabilities) |
| Traceability | Evidence chain follows logically without requiring manual leaps by the red_team_challenger; localized threats must be substantiated by < 10,000 intercepted messages and ≤ 100 distinct entities |
| Deduplication | Search past intel reports, the watch floor's historical database, and public OSINT to confirm not already reported by others or already neutralized |
| Amplification | The threat's effect must exceed the baseline of "a standard unit moving to a routine training ground" |

If any of the following fatal flaws are present, flag explicitly as a cognitive bias or failure, and deduct:

- References to nonexistent signals or AI-hallucinated call signs
- Impact description contradicts the assessment's own analytical baseline
- Timeline assumes unverified adversary capabilities (confirmation bias)
- Signal references inconsistent with the latest raw SIGINT logs
- Evidence chain is incomplete and requires the red_team_challenger to manually assemble the logic
- Threat effect is equivalent to routine baseline activity, with no amplification
</f4>

<f5>
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">`).
</f5>

<f6>
You are participating in a high-stakes tactical intelligence evaluation processing raw intercepted communications.

Read the operational directives first: ./intel-directives.md
</f6>

<f7>
When you finish, briefly report to the operations_officer what you did.
</f7>

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. `# operations_officer`). Output only the headered prompts, no preamble.


I need you to set up a 3-agent pipeline for a hedge fund desk: desk_manager, portfolio_manager, and risk_auditor.

- **desk_manager** orchestrates: calls portfolio_manager, extracts the pitch document path from portfolio_manager's reply, then calls risk_auditor on that path, decrements a counter, and loops. Does no analysis itself.
- **portfolio_manager** explores the market data, picks an idea to investigate, writes an exotic arbitrage or distressed asset pitch document.
- **risk_auditor** evaluates the pitch against stringent risk, liquidity, and regulatory criteria and persists the verdict.

I'm providing the following information:

<f1>
Your only job is to alternate calls to the portfolio_manager and risk_auditor agents, driving the explore → write → audit → improve loop.

Read the remaining-round count from `counter.txt`. If the file doesn't exist or the count ≤ 0, print "rounds exhausted" and stop.

Loop:

```
while counter > 0:
    1. Call the portfolio_manager agent.
    2. Parse portfolio_manager's reply and extract the pitch document path.
    3. If a pitch path is present, call the risk_auditor agent with prompt: "Please audit {path}".
    4. Decrement counter and write the new value back to counter.txt (whether or not the risk_auditor was called).
    5. Loop back to step 1.
```

After the loop, summarize: how many rounds ran, how many distinct ideas were explored, and any anomalies encountered.

**Calling rules**

- Do **not** analyze markets, write pitches, or do risk audits yourself — delegate everything to the two sub-agents.
- If portfolio_manager or risk_auditor errors out, append the error to `error-log.txt` (format: timestamp + agent name + error content), then continue with the next round.

Notes:
- portfolio_manager and risk_auditor each run in independent context per round; they do not pollute each other.
- All persistent state moves through files (`ideas.xml`, `pitches/`, `counter.txt`).
- You don't need to understand any trades — just pass file paths correctly.
</f1>

<f2>
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.
</f2>

<f3>
When you finish, briefly report to the desk_manager what you did.
</f3>

<f4>
Check the following dimensions one by one:

| Dimension | Requirement |
|-----------|-------------|
| Scope | Within approved exotic/distressed asset classes, or outside but directly hedging a mandated exposure |
| Market references | Cited tickers, ISINs, covenants, and regulatory clauses must exactly match the latest terminal data |
| Tail risk assessment | Loss claim consistent with the model's own analysis, no self-contradiction, no underestimating black swans |
| Structural analysis | Pinpoint specific liquidity traps or regulatory hurdles and explain why they hold |
| Execution Model | End-to-end pricing script triggering the trade simulation from execution to settlement (must not curve-fit historical data to force profitability) |
| Reproducibility | Model runs end-to-end without manual assembly by the risk_auditor; simulations must resolve within < 10,000 Monte Carlo paths and ≤ 100 simulated trading days |
| Deduplication | Search SEC filings, prime broker memos, and dealer quotes to confirm the spread isn't already closed or red-flagged by regulators |
| Alpha Generation | The expected return profile must meaningfully exceed the baseline of "simply buying a high-yield index ETF" |

If any of the following fatal flaws are present, flag explicitly and deduct:

- References to nonexistent instruments or AI-hallucinated covenant clauses
- Tail risk assessment contradicts the model's own stress-test
- Execution model curve-fits historical data to force profitability
- Market references inconsistent with the latest terminal data
- Execution model is incomplete and requires the risk_auditor to manually assemble it
- Return profile is equivalent to a basic high-yield ETF, with no genuine alpha generation
</f4>

<f5>
You are participating in a special situations and exotic arbitrage sprint for our flagship fund.

Read the fund's mandate and constraints first: ./fund-mandate.md
</f5>

<f6>
After completing the audit, you must do two things:

1. Update the pitch document's Risk Audit section

At the end of the pitch document, write or overwrite the `## Risk Audit` section (always keep exactly one; replace it if it already exists). Follow this structure:

```
## Risk Audit

**Score: X/10** (one-sentence reason)

### Fatal flaws (if any)
- 🔴 ...

### Per-dimension audit

| Dimension | Verdict | Notes |
|-----------|---------|-------|
| Scope | pass/fail | ... |
| Market references | pass/fail | ... |
| Tail risk assessment | pass/fail | ... |
| Structural analysis | pass/fail | ... |
| Execution Model | pass/fail | ... |
| Reproducibility | pass/fail | ... |
| Deduplication | pass/fail | ... |
| Alpha Generation | pass/fail | ... |

### Improvement suggestions
Be precise about which part of the pitch needs changes. If the trade doesn't hold at all due to ruinous tail risks, explicitly recommend abandoning it.
```

2. Update the idea's status in ideas.xml: increment attempts by 1, then update score.
</f6>

<f7>
This fund has been trading stably for many years — any obvious arbitrage opportunity would have been priced out by the market long ago. So:

- Don't pitch trades that are obvious at a glance (e.g., "the spot price and futures price diverge slightly") — if it were that obvious, high-frequency desks would have closed it already
- Truly valuable alpha hides in complex cross-asset interactions, distressed debt covenants, liquidity traps, and regulatory boundary conditions

**Writing the pitch**

Each idea corresponds to its own pitch document at `pitches/{id}-{slug}.md`, where `{id}` and `{slug}` come from the idea's id and slug attributes in ideas.xml.

The pitch must contain four h2 sections in this fixed order:

- `## Trade Title` — concise, clear strategy title
- `## PnL and Tail Risk` — what the expected upside is vs maximum ruinous downside (margin calls, liquidity freezes, regulatory breaches, etc.)
- `## Structural Mechanics` — short writeup of how the trade works, with specific instrument, entity, and covenant references
- `## Execution Model` — a runnable quantitative script the risk_auditor can execute as-is to simulate the trade

Do not modify or delete the `## Risk Audit` section — the risk_auditor overwrites that themselves.

If after investigation you find the trade doesn't hold up, still briefly record your analysis and the reason for rejection in the pitch document.
</f7>

Each agent's prompt should contain only the information that agent needs to do its job. For each sub-agent (desk_manager, portfolio_manager, risk_auditor), which items should go in its prompt? Respond with a JSON object like {"desk_manager": ["f?"], "portfolio_manager": ["f?"], "risk_auditor": ["f?"]}. No other output.

I need you to set up a 3-agent pipeline for a hedge fund desk: desk_manager, portfolio_manager, and risk_auditor.

- **desk_manager** orchestrates: calls portfolio_manager, extracts the pitch document path from portfolio_manager's reply, then calls risk_auditor on that path, decrements a counter, and loops. Does no analysis itself.
- **portfolio_manager** explores the market data, picks an idea to investigate, writes an exotic arbitrage or distressed asset pitch document.
- **risk_auditor** evaluates the pitch against stringent risk, liquidity, and regulatory criteria and persists the verdict.

I'm providing the following prompt fragments:

<f1>
Your only job is to alternate calls to the portfolio_manager and risk_auditor agents, driving the explore → write → audit → improve loop.

Read the remaining-round count from `counter.txt`. If the file doesn't exist or the count ≤ 0, print "rounds exhausted" and stop.

Loop:

```
while counter > 0:
    1. Call the portfolio_manager agent.
    2. Parse portfolio_manager's reply and extract the pitch document path.
    3. If a pitch path is present, call the risk_auditor agent with prompt: "Please audit {path}".
    4. Decrement counter and write the new value back to counter.txt (whether or not the risk_auditor was called).
    5. Loop back to step 1.
```

After the loop, summarize: how many rounds ran, how many distinct ideas were explored, and any anomalies encountered.

**Calling rules**

- Do **not** analyze markets, write pitches, or do risk audits yourself — delegate everything to the two sub-agents.
- If portfolio_manager or risk_auditor errors out, append the error to `error-log.txt` (format: timestamp + agent name + error content), then continue with the next round.

Notes:
- portfolio_manager and risk_auditor each run in independent context per round; they do not pollute each other.
- All persistent state moves through files (`ideas.xml`, `pitches/`, `counter.txt`).
- You don't need to understand any trades — just pass file paths correctly.
</f1>

<f2>
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.
</f2>

<f3>
When you finish, briefly report to the desk_manager what you did.
</f3>

<f4>
Check the following dimensions one by one:

| Dimension | Requirement |
|-----------|-------------|
| Scope | Within approved exotic/distressed asset classes, or outside but directly hedging a mandated exposure |
| Market references | Cited tickers, ISINs, covenants, and regulatory clauses must exactly match the latest terminal data |
| Tail risk assessment | Loss claim consistent with the model's own analysis, no self-contradiction, no underestimating black swans |
| Structural analysis | Pinpoint specific liquidity traps or regulatory hurdles and explain why they hold |
| Execution Model | End-to-end pricing script triggering the trade simulation from execution to settlement (must not curve-fit historical data to force profitability) |
| Reproducibility | Model runs end-to-end without manual assembly by the risk_auditor; simulations must resolve within < 10,000 Monte Carlo paths and ≤ 100 simulated trading days |
| Deduplication | Search SEC filings, prime broker memos, and dealer quotes to confirm the spread isn't already closed or red-flagged by regulators |
| Alpha Generation | The expected return profile must meaningfully exceed the baseline of "simply buying a high-yield index ETF" |

If any of the following fatal flaws are present, flag explicitly and deduct:

- References to nonexistent instruments or AI-hallucinated covenant clauses
- Tail risk assessment contradicts the model's own stress-test
- Execution model curve-fits historical data to force profitability
- Market references inconsistent with the latest terminal data
- Execution model is incomplete and requires the risk_auditor to manually assemble it
- Return profile is equivalent to a basic high-yield ETF, with no genuine alpha generation
</f4>

<f5>
You are participating in a special situations and exotic arbitrage sprint for our flagship fund.

Read the fund's mandate and constraints first: ./fund-mandate.md
</f5>

<f6>
After completing the audit, you must do two things:

1. Update the pitch document's Risk Audit section

At the end of the pitch document, write or overwrite the `## Risk Audit` section (always keep exactly one; replace it if it already exists). Follow this structure:

```
## Risk Audit

**Score: X/10** (one-sentence reason)

### Fatal flaws (if any)
- 🔴 ...

### Per-dimension audit

| Dimension | Verdict | Notes |
|-----------|---------|-------|
| Scope | pass/fail | ... |
| Market references | pass/fail | ... |
| Tail risk assessment | pass/fail | ... |
| Structural analysis | pass/fail | ... |
| Execution Model | pass/fail | ... |
| Reproducibility | pass/fail | ... |
| Deduplication | pass/fail | ... |
| Alpha Generation | pass/fail | ... |

### Improvement suggestions
Be precise about which part of the pitch needs changes. If the trade doesn't hold at all due to ruinous tail risks, explicitly recommend abandoning it.
```

2. Update the idea's status in ideas.xml: increment attempts by 1, then update score.
</f6>

<f7>
This fund has been trading stably for many years — any obvious arbitrage opportunity would have been priced out by the market long ago. So:

- Don't pitch trades that are obvious at a glance (e.g., "the spot price and futures price diverge slightly") — if it were that obvious, high-frequency desks would have closed it already
- Truly valuable alpha hides in complex cross-asset interactions, distressed debt covenants, liquidity traps, and regulatory boundary conditions

**Writing the pitch**

Each idea corresponds to its own pitch document at `pitches/{id}-{slug}.md`, where `{id}` and `{slug}` come from the idea's id and slug attributes in ideas.xml.

The pitch must contain four h2 sections in this fixed order:

- `## Trade Title` — concise, clear strategy title
- `## PnL and Tail Risk` — what the expected upside is vs maximum ruinous downside (margin calls, liquidity freezes, regulatory breaches, etc.)
- `## Structural Mechanics` — short writeup of how the trade works, with specific instrument, entity, and covenant references
- `## Execution Model` — a runnable quantitative script the risk_auditor can execute as-is to simulate the trade

Do not modify or delete the `## Risk Audit` section — the risk_auditor overwrites that themselves.

If after investigation you find the trade doesn't hold up, still briefly record your analysis and the reason for rejection in the pitch document.
</f7>

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. `# desk_manager`). Output only the headered prompts, no preamble.


I need you to set up a 3-agent pipeline for a hedge fund desk: desk_manager, portfolio_manager, and risk_auditor.

- **desk_manager** orchestrates: calls portfolio_manager, extracts the pitch document path from portfolio_manager's reply, then calls risk_auditor on that path, decrements a counter, and loops. Does no analysis itself.
- **portfolio_manager** explores the market data, picks an idea to investigate, writes an exotic arbitrage or distressed asset pitch document.
- **risk_auditor** evaluates the pitch against stringent risk, liquidity, and regulatory criteria and persists the verdict.

I'm providing the following information:

<f1>
This fund has been trading stably for many years — any obvious arbitrage opportunity would have been priced out by the market long ago. So:

- Don't pitch trades that are obvious at a glance (e.g., "the spot price and futures price diverge slightly") — if it were that obvious, high-frequency desks would have closed it already
- Truly valuable alpha hides in complex cross-asset interactions, distressed debt covenants, liquidity traps, and regulatory boundary conditions

**Writing the pitch**

Each idea corresponds to its own pitch document at `pitches/{id}-{slug}.md`, where `{id}` and `{slug}` come from the idea's id and slug attributes in ideas.xml.

The pitch must contain four h2 sections in this fixed order:

- `## Trade Title` — concise, clear strategy title
- `## PnL and Tail Risk` — what the expected upside is vs maximum ruinous downside (margin calls, liquidity freezes, regulatory breaches, etc.)
- `## Structural Mechanics` — short writeup of how the trade works, with specific instrument, entity, and covenant references
- `## Execution Model` — a runnable quantitative script the risk_auditor can execute as-is to simulate the trade

Do not modify or delete the `## Risk Audit` section — the risk_auditor overwrites that themselves.

If after investigation you find the trade doesn't hold up, still briefly record your analysis and the reason for rejection in the pitch document.
</f1>

<f2>
Your only job is to alternate calls to the portfolio_manager and risk_auditor agents, driving the explore → write → audit → improve loop.

Read the remaining-round count from `counter.txt`. If the file doesn't exist or the count ≤ 0, print "rounds exhausted" and stop.

Loop:

```
while counter > 0:
    1. Call the portfolio_manager agent.
    2. Parse portfolio_manager's reply and extract the pitch document path.
    3. If a pitch path is present, call the risk_auditor agent with prompt: "Please audit {path}".
    4. Decrement counter and write the new value back to counter.txt (whether or not the risk_auditor was called).
    5. Loop back to step 1.
```

After the loop, summarize: how many rounds ran, how many distinct ideas were explored, and any anomalies encountered.

**Calling rules**

- Do **not** analyze markets, write pitches, or do risk audits yourself — delegate everything to the two sub-agents.
- If portfolio_manager or risk_auditor errors out, append the error to `error-log.txt` (format: timestamp + agent name + error content), then continue with the next round.

Notes:
- portfolio_manager and risk_auditor each run in independent context per round; they do not pollute each other.
- All persistent state moves through files (`ideas.xml`, `pitches/`, `counter.txt`).
- You don't need to understand any trades — just pass file paths correctly.
</f2>

<f3>
After completing the audit, you must do two things:

1. Update the pitch document's Risk Audit section

At the end of the pitch document, write or overwrite the `## Risk Audit` section (always keep exactly one; replace it if it already exists). Follow this structure:

```
## Risk Audit

**Score: X/10** (one-sentence reason)

### Fatal flaws (if any)
- 🔴 ...

### Per-dimension audit

| Dimension | Verdict | Notes |
|-----------|---------|-------|
| Scope | pass/fail | ... |
| Market references | pass/fail | ... |
| Tail risk assessment | pass/fail | ... |
| Structural analysis | pass/fail | ... |
| Execution Model | pass/fail | ... |
| Reproducibility | pass/fail | ... |
| Deduplication | pass/fail | ... |
| Alpha Generation | pass/fail | ... |

### Improvement suggestions
Be precise about which part of the pitch needs changes. If the trade doesn't hold at all due to ruinous tail risks, explicitly recommend abandoning it.
```

2. Update the idea's status in ideas.xml: increment attempts by 1, then update score.
</f3>

<f4>
Check the following dimensions one by one:

| Dimension | Requirement |
|-----------|-------------|
| Scope | Within approved exotic/distressed asset classes, or outside but directly hedging a mandated exposure |
| Market references | Cited tickers, ISINs, covenants, and regulatory clauses must exactly match the latest terminal data |
| Tail risk assessment | Loss claim consistent with the model's own analysis, no self-contradiction, no underestimating black swans |
| Structural analysis | Pinpoint specific liquidity traps or regulatory hurdles and explain why they hold |
| Execution Model | End-to-end pricing script triggering the trade simulation from execution to settlement (must not curve-fit historical data to force profitability) |
| Reproducibility | Model runs end-to-end without manual assembly by the risk_auditor; simulations must resolve within < 10,000 Monte Carlo paths and ≤ 100 simulated trading days |
| Deduplication | Search SEC filings, prime broker memos, and dealer quotes to confirm the spread isn't already closed or red-flagged by regulators |
| Alpha Generation | The expected return profile must meaningfully exceed the baseline of "simply buying a high-yield index ETF" |

If any of the following fatal flaws are present, flag explicitly and deduct:

- References to nonexistent instruments or AI-hallucinated covenant clauses
- Tail risk assessment contradicts the model's own stress-test
- Execution model curve-fits historical data to force profitability
- Market references inconsistent with the latest terminal data
- Execution model is incomplete and requires the risk_auditor to manually assemble it
- Return profile is equivalent to a basic high-yield ETF, with no genuine alpha generation
</f4>

<f5>
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">`).
</f5>

<f6>
You are participating in a special situations and exotic arbitrage sprint for our flagship fund.

Read the fund's mandate and constraints first: ./fund-mandate.md
</f6>

<f7>
When you finish, briefly report to the desk_manager what you did.
</f7>

Each agent's prompt should contain only the information that agent needs to do its job. For each sub-agent (desk_manager, portfolio_manager, risk_auditor), which items should go in its prompt? Respond with a JSON object like {"desk_manager": ["f?"], "portfolio_manager": ["f?"], "risk_auditor": ["f?"]}. No other output.

I need you to set up a 3-agent pipeline for a hedge fund desk: desk_manager, portfolio_manager, and risk_auditor.

- **desk_manager** orchestrates: calls portfolio_manager, extracts the pitch document path from portfolio_manager's reply, then calls risk_auditor on that path, decrements a counter, and loops. Does no analysis itself.
- **portfolio_manager** explores the market data, picks an idea to investigate, writes an exotic arbitrage or distressed asset pitch document.
- **risk_auditor** evaluates the pitch against stringent risk, liquidity, and regulatory criteria and persists the verdict.

I'm providing the following prompt fragments:

<f1>
This fund has been trading stably for many years — any obvious arbitrage opportunity would have been priced out by the market long ago. So:

- Don't pitch trades that are obvious at a glance (e.g., "the spot price and futures price diverge slightly") — if it were that obvious, high-frequency desks would have closed it already
- Truly valuable alpha hides in complex cross-asset interactions, distressed debt covenants, liquidity traps, and regulatory boundary conditions

**Writing the pitch**

Each idea corresponds to its own pitch document at `pitches/{id}-{slug}.md`, where `{id}` and `{slug}` come from the idea's id and slug attributes in ideas.xml.

The pitch must contain four h2 sections in this fixed order:

- `## Trade Title` — concise, clear strategy title
- `## PnL and Tail Risk` — what the expected upside is vs maximum ruinous downside (margin calls, liquidity freezes, regulatory breaches, etc.)
- `## Structural Mechanics` — short writeup of how the trade works, with specific instrument, entity, and covenant references
- `## Execution Model` — a runnable quantitative script the risk_auditor can execute as-is to simulate the trade

Do not modify or delete the `## Risk Audit` section — the risk_auditor overwrites that themselves.

If after investigation you find the trade doesn't hold up, still briefly record your analysis and the reason for rejection in the pitch document.
</f1>

<f2>
Your only job is to alternate calls to the portfolio_manager and risk_auditor agents, driving the explore → write → audit → improve loop.

Read the remaining-round count from `counter.txt`. If the file doesn't exist or the count ≤ 0, print "rounds exhausted" and stop.

Loop:

```
while counter > 0:
    1. Call the portfolio_manager agent.
    2. Parse portfolio_manager's reply and extract the pitch document path.
    3. If a pitch path is present, call the risk_auditor agent with prompt: "Please audit {path}".
    4. Decrement counter and write the new value back to counter.txt (whether or not the risk_auditor was called).
    5. Loop back to step 1.
```

After the loop, summarize: how many rounds ran, how many distinct ideas were explored, and any anomalies encountered.

**Calling rules**

- Do **not** analyze markets, write pitches, or do risk audits yourself — delegate everything to the two sub-agents.
- If portfolio_manager or risk_auditor errors out, append the error to `error-log.txt` (format: timestamp + agent name + error content), then continue with the next round.

Notes:
- portfolio_manager and risk_auditor each run in independent context per round; they do not pollute each other.
- All persistent state moves through files (`ideas.xml`, `pitches/`, `counter.txt`).
- You don't need to understand any trades — just pass file paths correctly.
</f2>

<f3>
After completing the audit, you must do two things:

1. Update the pitch document's Risk Audit section

At the end of the pitch document, write or overwrite the `## Risk Audit` section (always keep exactly one; replace it if it already exists). Follow this structure:

```
## Risk Audit

**Score: X/10** (one-sentence reason)

### Fatal flaws (if any)
- 🔴 ...

### Per-dimension audit

| Dimension | Verdict | Notes |
|-----------|---------|-------|
| Scope | pass/fail | ... |
| Market references | pass/fail | ... |
| Tail risk assessment | pass/fail | ... |
| Structural analysis | pass/fail | ... |
| Execution Model | pass/fail | ... |
| Reproducibility | pass/fail | ... |
| Deduplication | pass/fail | ... |
| Alpha Generation | pass/fail | ... |

### Improvement suggestions
Be precise about which part of the pitch needs changes. If the trade doesn't hold at all due to ruinous tail risks, explicitly recommend abandoning it.
```

2. Update the idea's status in ideas.xml: increment attempts by 1, then update score.
</f3>

<f4>
Check the following dimensions one by one:

| Dimension | Requirement |
|-----------|-------------|
| Scope | Within approved exotic/distressed asset classes, or outside but directly hedging a mandated exposure |
| Market references | Cited tickers, ISINs, covenants, and regulatory clauses must exactly match the latest terminal data |
| Tail risk assessment | Loss claim consistent with the model's own analysis, no self-contradiction, no underestimating black swans |
| Structural analysis | Pinpoint specific liquidity traps or regulatory hurdles and explain why they hold |
| Execution Model | End-to-end pricing script triggering the trade simulation from execution to settlement (must not curve-fit historical data to force profitability) |
| Reproducibility | Model runs end-to-end without manual assembly by the risk_auditor; simulations must resolve within < 10,000 Monte Carlo paths and ≤ 100 simulated trading days |
| Deduplication | Search SEC filings, prime broker memos, and dealer quotes to confirm the spread isn't already closed or red-flagged by regulators |
| Alpha Generation | The expected return profile must meaningfully exceed the baseline of "simply buying a high-yield index ETF" |

If any of the following fatal flaws are present, flag explicitly and deduct:

- References to nonexistent instruments or AI-hallucinated covenant clauses
- Tail risk assessment contradicts the model's own stress-test
- Execution model curve-fits historical data to force profitability
- Market references inconsistent with the latest terminal data
- Execution model is incomplete and requires the risk_auditor to manually assemble it
- Return profile is equivalent to a basic high-yield ETF, with no genuine alpha generation
</f4>

<f5>
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">`).
</f5>

<f6>
You are participating in a special situations and exotic arbitrage sprint for our flagship fund.

Read the fund's mandate and constraints first: ./fund-mandate.md
</f6>

<f7>
When you finish, briefly report to the desk_manager what you did.
</f7>

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. `# desk_manager`). Output only the headered prompts, no preamble.


case coordinator
safety signal analyst
medical safety reviewer

I need you to set up a 3-agent pipeline for pharmacovigilance signal assessment: case coordinator, safety signal analyst, and medical safety reviewer.

- **case coordinator** orchestrates: calls safety signal analyst, extracts the dossier file path from safety signal analyst's reply, then calls medical safety reviewer on that path, decrements a counter, and loops. Does no analysis itself.
- **safety signal analyst** explores the safety data package, picks a candidate adverse-drug-reaction signal to investigate, writes a signal dossier file.
- **medical safety reviewer** evaluates the dossier against pharmacovigilance criteria and persists the verdict.

I'm providing the following information:

<f1>
Your only job is to alternate calls to the safety signal analyst and medical safety reviewer agents, driving the investigate → write → review → improve loop.

Read the remaining-round count from `counter.txt`. If the file doesn't exist or the count ≤ 0, print "rounds exhausted" and stop.

Loop:

```
while counter > 0:
    1. Call the safety signal analyst agent.
    2. Parse safety signal analyst's reply and extract the dossier file path.
    3. If a dossier path is present, call the medical safety reviewer agent with prompt: "Please review {path}".
    4. Decrement counter and write the new value back to counter.txt (whether or not the medical safety reviewer was called).
    5. Loop back to step 1.
```

After the loop, summarize: how many rounds ran, how many distinct candidate signals were explored, and any anomalies encountered.

**Calling rules**

- Do **not** analyze safety data, write dossiers, or do reviews yourself — delegate everything to the two sub-agents.
- If safety signal analyst or medical safety reviewer errors out, append the error to `error-log.txt` (format: timestamp + agent name + error content), then continue with the next round.

Notes:
- safety signal analyst and medical safety reviewer each run in independent context per round; they do not pollute each other.
- All persistent state moves through files (`signal-candidates.xml`, `dossiers/`, `counter.txt`).
- You don't need to understand any adverse-drug-reaction signals — just pass file paths correctly.
</f1>

<f2>
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.
</f2>

<f3>
When you finish, briefly report to the case coordinator what you did.
</f3>

<f4>
Check the following dimensions one by one:

| Dimension | Requirement |
|-----------|-------------|
| Scope | Within post-marketing pharmacovigilance for the assigned product or product class, or outside it but directly affecting the product's safety profile |
| Source references | Cited case IDs, MedDRA preferred terms, data-lock point, query definitions, and table numbers must exactly match the latest safety data package |
| Public health impact description | Impact claim consistent with the dossier's own analysis, no self-contradiction, no exaggeration beyond seriousness, frequency, preventability, or exposed-population evidence |
| Causality analysis | Pinpoint the specific clinical and temporal evidence supporting or weakening causality, including alternative etiologies, confounding by indication, concomitant medicines, dechallenge, and rechallenge where available |
| Evidence package | End-to-end traceable case series or quantitative signal output from the reporter's perspective; must not rely on invented cases, untraceable summaries, or post hoc recoding to create the signal |
| Reproducibility | Evidence can be followed end-to-end without manual reconstruction by the medical safety reviewer; database queries must specify data source, data-lock date, product terms, event terms, seriousness filters, and deduplication logic |
| Deduplication | Search labeling, periodic safety reports, risk management plans, health-authority requests, literature, and prior internal signal logs to confirm the signal is not already characterized or closed with adequate rationale |
| Regulatory significance | The proposed signal must exceed the baseline of isolated expected background reports and plausibly warrant additional pharmacovigilance action, labeling consideration, targeted follow-up, or risk minimization discussion |

If any of the following fatal flaws are present, flag explicitly and deduct:

- References to nonexistent cases, invented database fields, or AI-hallucinated MedDRA terms
- Public health impact description contradicts the dossier's own analysis
- Evidence package creates the signal by recoding, excluding, or editing source cases without justification
- Source references inconsistent with the latest safety data package
- Evidence is incomplete and requires the medical safety reviewer to manually assemble the case series or query
- Proposed effect is equivalent to isolated expected background reporting, with no added regulatory or clinical significance
</f4>

<f5>
You are participating in a pharmacovigilance signal assessment workflow for marketed medicines.

Read the signal assessment charter first: ./signal-assessment-charter.md
</f5>

<f6>
After completing the review, you must do two things:

1. Update the dossier file's Review section

At the end of the dossier file, write or overwrite the `## Review` section (always keep exactly one; replace it if it already exists). Follow this structure:

```
## Review

**Score: X/10** (one-sentence reason)

### Fatal flaws (if any)
- 🔴 ...

### Per-dimension review

| Dimension | Verdict | Notes |
|-----------|---------|-------|
| Scope | pass/fail | ... |
| Source references | pass/fail | ... |
| Public health impact description | pass/fail | ... |
| Causality analysis | pass/fail | ... |
| Evidence package | pass/fail | ... |
| Reproducibility | pass/fail | ... |
| Deduplication | pass/fail | ... |
| Regulatory significance | pass/fail | ... |

### Improvement suggestions
Be precise about which part of the dossier needs changes. If the candidate signal doesn't hold at all, explicitly recommend abandoning it.
```

2. Update the candidate signal's status in signal-candidates.xml: increment attempts by 1, then update score.
</f6>

<f7>
This product portfolio has been monitored for many years — any obvious labeled adverse reaction or well-known class effect should already be documented. So:

- Don't escalate observations that are obvious at a glance (e.g. "nausea is reported with the drug") — if it were that obvious, it would likely already be in labeling, aggregate reports, or routine safety surveillance
- Truly valuable safety signals hide in non-obvious patterns: unusual time-to-onset, plausible dechallenge/rechallenge clusters, high-quality serious cases, vulnerable subpopulations, medication-error pathways, or shifts across data sources

**Writing the dossier**

Each candidate corresponds to its own dossier file at `dossiers/{id}-{slug}.md`, where `{id}` and `{slug}` come from the candidate's id and slug attributes in signal-candidates.xml.

The dossier must contain four h2 sections in this fixed order:

- `## Signal Title` — concise, clear adverse-drug-reaction signal title
- `## Public Health Impact Description` — what harm it can cause, including seriousness, reversibility, preventability, and potential exposed population
- `## Short Description` — short writeup of the suspected association, with references to source tables, case narratives, MedDRA terms, and relevant product history
- `## Evidence Details` — traceable evidence the medical safety reviewer can inspect as-is, including case identifiers, query definitions, observed/expected counts if applicable, and narrative summaries

Do not modify or delete the `## Review` section — the medical safety reviewer overwrites that themselves.

If after investigation you find the candidate signal doesn't hold, still briefly record your analysis and the reason for rejection in the dossier file.
</f7>

Each agent's prompt should contain only the information that agent needs to do its job. For each sub-agent (case coordinator, safety signal analyst, medical safety reviewer), which items should go in its prompt? Respond with a JSON object like {"case coordinator": ["f?"], "safety signal analyst": ["f?"], "medical safety reviewer": ["f?"]}. No other output.

I need you to set up a 3-agent pipeline for pharmacovigilance signal assessment: case coordinator, safety signal analyst, and medical safety reviewer.

- **case coordinator** orchestrates: calls safety signal analyst, extracts the dossier file path from safety signal analyst's reply, then calls medical safety reviewer on that path, decrements a counter, and loops. Does no analysis itself.
- **safety signal analyst** explores the safety data package, picks a candidate adverse-drug-reaction signal to investigate, writes a signal dossier file.
- **medical safety reviewer** evaluates the dossier against pharmacovigilance criteria and persists the verdict.

I'm providing the following prompt fragments:

<f1>
Your only job is to alternate calls to the safety signal analyst and medical safety reviewer agents, driving the investigate → write → review → improve loop.

Read the remaining-round count from `counter.txt`. If the file doesn't exist or the count ≤ 0, print "rounds exhausted" and stop.

Loop:

```
while counter > 0:
    1. Call the safety signal analyst agent.
    2. Parse safety signal analyst's reply and extract the dossier file path.
    3. If a dossier path is present, call the medical safety reviewer agent with prompt: "Please review {path}".
    4. Decrement counter and write the new value back to counter.txt (whether or not the medical safety reviewer was called).
    5. Loop back to step 1.
```

After the loop, summarize: how many rounds ran, how many distinct candidate signals were explored, and any anomalies encountered.

**Calling rules**

- Do **not** analyze safety data, write dossiers, or do reviews yourself — delegate everything to the two sub-agents.
- If safety signal analyst or medical safety reviewer errors out, append the error to `error-log.txt` (format: timestamp + agent name + error content), then continue with the next round.

Notes:
- safety signal analyst and medical safety reviewer each run in independent context per round; they do not pollute each other.
- All persistent state moves through files (`signal-candidates.xml`, `dossiers/`, `counter.txt`).
- You don't need to understand any adverse-drug-reaction signals — just pass file paths correctly.
</f1>

<f2>
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.
</f2>

<f3>
When you finish, briefly report to the case coordinator what you did.
</f3>

<f4>
Check the following dimensions one by one:

| Dimension | Requirement |
|-----------|-------------|
| Scope | Within post-marketing pharmacovigilance for the assigned product or product class, or outside it but directly affecting the product's safety profile |
| Source references | Cited case IDs, MedDRA preferred terms, data-lock point, query definitions, and table numbers must exactly match the latest safety data package |
| Public health impact description | Impact claim consistent with the dossier's own analysis, no self-contradiction, no exaggeration beyond seriousness, frequency, preventability, or exposed-population evidence |
| Causality analysis | Pinpoint the specific clinical and temporal evidence supporting or weakening causality, including alternative etiologies, confounding by indication, concomitant medicines, dechallenge, and rechallenge where available |
| Evidence package | End-to-end traceable case series or quantitative signal output from the reporter's perspective; must not rely on invented cases, untraceable summaries, or post hoc recoding to create the signal |
| Reproducibility | Evidence can be followed end-to-end without manual reconstruction by the medical safety reviewer; database queries must specify data source, data-lock date, product terms, event terms, seriousness filters, and deduplication logic |
| Deduplication | Search labeling, periodic safety reports, risk management plans, health-authority requests, literature, and prior internal signal logs to confirm the signal is not already characterized or closed with adequate rationale |
| Regulatory significance | The proposed signal must exceed the baseline of isolated expected background reports and plausibly warrant additional pharmacovigilance action, labeling consideration, targeted follow-up, or risk minimization discussion |

If any of the following fatal flaws are present, flag explicitly and deduct:

- References to nonexistent cases, invented database fields, or AI-hallucinated MedDRA terms
- Public health impact description contradicts the dossier's own analysis
- Evidence package creates the signal by recoding, excluding, or editing source cases without justification
- Source references inconsistent with the latest safety data package
- Evidence is incomplete and requires the medical safety reviewer to manually assemble the case series or query
- Proposed effect is equivalent to isolated expected background reporting, with no added regulatory or clinical significance
</f4>

<f5>
You are participating in a pharmacovigilance signal assessment workflow for marketed medicines.

Read the signal assessment charter first: ./signal-assessment-charter.md
</f5>

<f6>
After completing the review, you must do two things:

1. Update the dossier file's Review section

At the end of the dossier file, write or overwrite the `## Review` section (always keep exactly one; replace it if it already exists). Follow this structure:

```
## Review

**Score: X/10** (one-sentence reason)

### Fatal flaws (if any)
- 🔴 ...

### Per-dimension review

| Dimension | Verdict | Notes |
|-----------|---------|-------|
| Scope | pass/fail | ... |
| Source references | pass/fail | ... |
| Public health impact description | pass/fail | ... |
| Causality analysis | pass/fail | ... |
| Evidence package | pass/fail | ... |
| Reproducibility | pass/fail | ... |
| Deduplication | pass/fail | ... |
| Regulatory significance | pass/fail | ... |

### Improvement suggestions
Be precise about which part of the dossier needs changes. If the candidate signal doesn't hold at all, explicitly recommend abandoning it.
```

2. Update the candidate signal's status in signal-candidates.xml: increment attempts by 1, then update score.
</f6>

<f7>
This product portfolio has been monitored for many years — any obvious labeled adverse reaction or well-known class effect should already be documented. So:

- Don't escalate observations that are obvious at a glance (e.g. "nausea is reported with the drug") — if it were that obvious, it would likely already be in labeling, aggregate reports, or routine safety surveillance
- Truly valuable safety signals hide in non-obvious patterns: unusual time-to-onset, plausible dechallenge/rechallenge clusters, high-quality serious cases, vulnerable subpopulations, medication-error pathways, or shifts across data sources

**Writing the dossier**

Each candidate corresponds to its own dossier file at `dossiers/{id}-{slug}.md`, where `{id}` and `{slug}` come from the candidate's id and slug attributes in signal-candidates.xml.

The dossier must contain four h2 sections in this fixed order:

- `## Signal Title` — concise, clear adverse-drug-reaction signal title
- `## Public Health Impact Description` — what harm it can cause, including seriousness, reversibility, preventability, and potential exposed population
- `## Short Description` — short writeup of the suspected association, with references to source tables, case narratives, MedDRA terms, and relevant product history
- `## Evidence Details` — traceable evidence the medical safety reviewer can inspect as-is, including case identifiers, query definitions, observed/expected counts if applicable, and narrative summaries

Do not modify or delete the `## Review` section — the medical safety reviewer overwrites that themselves.

If after investigation you find the candidate signal doesn't hold, still briefly record your analysis and the reason for rejection in the dossier file.
</f7>

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. `# case coordinator`). Output only the headered prompts, no preamble.