What System Prompts Are Used for the Generator and Critic in ADHD?
ADHD uses two specialized system prompts—DIVERGE_SYSTEM for generation and SCORE_SYSTEM for critique—to enforce a strict separation between divergent idea creation and convergent evaluation.
The ADHD repository implements a Tree-of-Thought architecture that alternates between two distinct cognitive modes: a generator that produces raw ideas without judgment, and a critic that rigorously evaluates them. This separation is achieved entirely through system prompt engineering, with both prompts defined in src/engine.ts.
The Generator System Prompt (DIVERGE_SYSTEM)
The generator phase relies on DIVERGE_SYSTEM to put the LLM into pure divergent mode. Located at lines 61-70 of src/engine.ts, this prompt explicitly forbids evaluation and encourages unconventional thinking.
const DIVERGE_SYSTEM = `You are in DIVERGENT mode. You are a generator, not a critic.
Rules:
- Output a JSON array only. No prose before/after.
- Generate the requested number of distinct ideas.
- Each idea is a SHORT phrase or single sentence. No paragraphs.
- Push past the obvious. The first 3 ideas you'd think of are banned —
assume the reader already had those. Aim for the awkward middle.
- Bad, weird, and absurd ideas are welcome; they seed better ones.
- Do not evaluate, hedge, or rank. Just generate.`;
Key constraints in this prompt include:
- JSON-only output — eliminates parsing errors from conversational fluff
- Banned obvious ideas — forces the model past surface-level suggestions
- Explicit permission for absurdity — lowers inhibition and increases idea variance
The prompt is invoked in the divergeBranch function:
await callLLM({
model,
systemPrompt: DIVERGE_SYSTEM,
userPrompt: `PROBLEM: …\nFRAME — ${frame.label}:\n${frame.prompt}\nGenerate 6 ideas.`,
});
The Critic System Prompt (SCORE_SYSTEM)
After generation, ADHD switches to convergent mode using SCORE_SYSTEM (lines 71-89 of src/engine.ts). This prompt transforms the same model into a structured evaluator.
const SCORE_SYSTEM = `You are in CONVERGENT mode. You are now the critic.
Score each idea on three axes 0‑10:
- novelty: distance from the obvious default solution
- viability: could this actually ship / work in practice
- fit: how directly it addresses the stated problem
Tell the truth about weaknesses — don't soften the substance. But the
critic's job is to produce two symmetric signals, not just one:
- "strength": required for every idea, even weak ones. The single most
concrete thing this idea gets right that a competing idea doesn't.
- "trap" (optional): if the idea looks attractive but has a hidden cost
(false economy, won't scale, premature abstraction), name it as a
specific, actionable heads‑up — e.g. "solid for a prototype, breaks
past 10k concurrent users".`;
The critic prompt enforces balanced evaluation through:
- Three numerical scores (0-10) for objective comparison
- Mandatory strength identification — prevents pure negativity bias
- Optional "trap" detection — surfaces hidden failure modes
This prompt is used in the scoreIdeas function:
await callLLM({
model,
systemPrompt: SCORE_SYSTEM,
userPrompt: `PROBLEM: …\nIDEAS (id → text):\n${ideas.map(i => `${i.id} :: ${i.text}`).join("\n")}\nScore each.`,
});
How the Prompts Enable the Tree-of-Thought Architecture
The system prompts for the generator and critic in ADHD embody a deliberate cognitive role separation:
| Mode | Prompt Constant | Output Schema | Goal |
|---|---|---|---|
| Diverge | DIVERGE_SYSTEM |
DivergeRowSchema |
Maximize idea quantity and variance |
| Converge | SCORE_SYSTEM |
ScoreRowSchema |
Select and refine high-value candidates |
According to the ADHD source code, this architecture prevents premature convergence—the common failure where generation and evaluation interfere with each other. By locking the model into one mode per call, each phase optimizes for its specific objective without compromise.
Key Implementation Files
Understanding these system prompts requires examining three files in the repository:
src/engine.ts— definesDIVERGE_SYSTEMandSCORE_SYSTEM; containsdivergeBranchandscoreIdeasfunctionssrc/llm.ts— provides thecallLLMwrapper that acceptssystemPromptas a parametersrc/types.ts— specifiesDivergeRowSchemaandScoreRowSchemato validate LLM outputs against the prompt instructions
Summary
- Generator prompt (
DIVERGE_SYSTEM) — forces pure ideation without evaluation, located insrc/engine.tslines 61-70 - Critic prompt (
SCORE_SYSTEM) — enforces structured scoring with mandatory strengths and optional traps, lines 71-89 - Architectural purpose — separates divergent and convergent thinking into discrete LLM calls
- Implementation — both prompts feed through
callLLMinsrc/llm.tswith schema validation insrc/types.ts
Frequently Asked Questions
Where are the ADHD system prompts defined?
Both the generator and critic system prompts are defined as constants in src/engine.ts: DIVERGE_SYSTEM at lines 61-70 and SCORE_SYSTEM at lines 71-89.
Why does ADHD use separate prompts instead of a single prompt?
The separation enforces cognitive role specialization. The generator prompt explicitly forbids evaluation ("do not evaluate, hedge, or rank"), while the critic prompt requires structured judgment. Mixing these goals in one prompt would degrade performance in both phases.
What output format does each prompt expect?
The generator must return a JSON array of short idea strings. The critic must return scored items with novelty, viability, fit (all 0-10), a required strength string, and an optional trap string. These formats are enforced by DivergeRowSchema and ScoreRowSchema in src/types.ts.
Can these prompts be modified for other use cases?
Yes. The prompt structure is domain-agnostic—the "problem" and "frame" are injected via the user prompt. You could adapt DIVERGE_SYSTEM for any brainstorming task and SCORE_SYSTEM for any multi-criteria evaluation by adjusting the scoring axes in the critic prompt.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →