Cognitive Frames in ADHD: 15 Built-In Perspective Operators for Divergent Ideation

ADHD (Parallel Divergent Ideation) uses 15 built-in cognitive frames—system prompts that force parallel perspective shifts—to generate unconventional ideas and prevent premature convergence.

The ADHD codebase implements a novel approach to creative problem-solving by running multiple cognitive frames in parallel. Each frame acts as a "vantage operator," constraining an LLM to adopt a specific, often unconventional viewpoint. This article explores every shipped frame, how they're selected, and how to use them programmatically.

What Are Cognitive Frames in ADHD?

In ADHD, a cognitive frame is a system prompt that rewires how a language model approaches a problem. Unlike standard brainstorming, frames deliberately introduce constraints—viewing a problem as a speedrun, a biological system, or through the eyes of a ten-year-old.

The frame definitions live in [src/frames.ts](https://github.com/UditAkhourii/adhd/blob/main/src/frames.ts), with detailed documentation in [documentation/frames.md](https://github.com/UditAkhourii/adhd/blob/main/documentation/frames.md). Each frame has:

  • A unique id (e.g., hardware-eyes, speedrunner)
  • A human-readable label
  • A prompt that establishes the persona
  • Optional tags for filtering (e.g., code, design, wild)

The 15 Built-In Cognitive Frames

Hardware and Engineering Frames

hardware-eyes — Hardware engineer

  • Forces consideration of latency, memory layout, physical constraints, and electrical metaphors
  • Prompt excerpt: "You think in latency, memory layout, and physical constraints…"

speedrunner — Speedrunner

  • Treats problems as games to be broken, seeking glitches, skips, and frame-perfect shortcuts

ops-3am — 3 am on-call

  • Designs from the perspective of exhausted infrastructure engineers who never want to be paged again

Constraint and Inversion Frames

extreme-zero — $0 budget / extreme constraint

  • Assumes no money, no team, one hour—what's the crudest working version?

extreme-infinite — Infinite budget, 10 years, best team

  • The maximalist mirror: infinite compute, infinite engineers, no legacy constraints

inversion — Inversion

  • Asks the opposite question, then negates answers back into viable ideas

remove-assumption — Remove the load-bearing assumption

  • Identifies what "everyone treats as fixed" and imagines it gone

Perspective and Persona Frames

ten-year-old — 10-year-old child

  • Curious, convention-ignorant, first-principles thinking

regulator — Regulator / auditor

  • Audits systems for compliance, failure modes, and attack surfaces

adversary — Competitor trying to break it

  • Hostile competitor perspective, with findings inverted into defensive ideas

Cross-Domain Analogy Frames

biology — Cross-domain: biology

  • Transplants biological mechanisms (ecosystems, evolution, homeostasis) onto engineering problems

logistics — Cross-domain: logistics / supply chain

  • Steals from queues, batching, just-in-time delivery, and routing algorithms

game-design — Cross-domain: game design

  • Applies loops, rewards, friction, and progression systems to non-game problems

markets — Cross-domain: markets

  • Treats problems as auctions, futures contracts, or prediction markets

Emergence and Distributed Frames

ant-colony — Ant colony / swarm

  • No central planner: many dumb agents, local rules, pheromone trails, stigmergy

How Frames Are Selected: The selectFrames Algorithm

The orchestrator calls selectFrames in src/frames.ts to choose which frames run for each problem. The selection logic (lines 34-46) follows three rules:

  1. Code mode filtering — When codeMode = true (default), prefer frames tagged code or design
  2. Wildcard injection — At least one wild-tagged frame is always included to maintain divergence
  3. Determinism — Selection is seeded, guaranteeing reproducible results across runs
import { selectFrames } from "./src/frames";

// Get 5 frames for a coding problem (codeMode defaults true)
const frames = selectFrames(5);
console.log(frames.map(f => f.label));
// Example output: ['Hardware engineer', 'Cross-domain: logistics', 
//                  '10-year-old', 'Speedrunner', 'Ant colony / swarm']

Running Cognitive Frames in Practice

The run() function executes parallel frame calls with isolated contexts—no shared memory between divergent passes. Here's a complete example:

import { run, renderText } from "adhd-agent";

const result = await run({
  problem: "Design a rate-limiter that survives leader election",
  framesPerRun: 5,    // how many parallel perspectives
  topK: 2,            // how many ideas survive to critic pass
});

console.log(renderText(result));
// Renders ranked ideas with provenance (which frame generated each)

Each frame spawns an isolated LLM call. After divergence, a critic pass scores, clusters, and deepens the surviving ideas. This two-phase loop—diverge via frames, then focus via critique—is the architectural fix for premature convergence.

Customizing and Extending Frames

To author new cognitive frames, follow the interface in src/frames.ts:

interface Frame {
  id: string;
  label: string;
  prompt: string;
  tags: string[];      // 'code', 'design', 'wild', etc.
}

Key principles from documentation/frames.md:

  • Specificity beats generic — "You are a skeptical security auditor" outperforms "be creative"
  • Constraint liberates — Tight personas produce more diverse outputs than open-ended prompts
  • Invert tensions — Pair frames deliberately (e.g., extreme-zero vs. extreme-infinite)

Summary

  • ADHD provides 15 built-in cognitive frames ranging from hardware engineering to ant colony swarm intelligence
  • Frames are defined in src/frames.ts and selected via selectFrames(), which guarantees at least one wild perspective and respects codeMode filtering
  • Each frame runs in isolated parallel, with zero shared context during the divergent phase
  • The critic pass then scores and clusters outputs, completing the divergence→focus loop
  • Frame selection is seeded and deterministic, enabling reproducible ideation pipelines

Frequently Asked Questions

What makes a cognitive frame different from a regular system prompt?

A cognitive frame in ADHD is purpose-built for forced perspective shift. Where generic prompts ask for "creative ideas," frames constrain the model to a specific vantage—viewing a database as a biological ecosystem, or a web app as a speedrun route. This constraint, enforced in parallel across multiple frames, systematically breaks anchoring bias.

How does ADHD prevent frames from converging on similar ideas?

Zero shared context. Each frame runs in an isolated LLM call with no awareness of other frames' outputs. Only after all frames complete does the critic pass see the full set. This architecture guarantees that a hardware engineer frame and a ten-year-old frame genuinely diverge before any synthesis occurs.

Can I use my own custom cognitive frames with ADHD?

Yes. The frames parameter in run() accepts custom frame objects matching the {id, label, prompt, tags} interface. Tag them appropriately—code, design, wild—to integrate with the existing selectFrames selection logic. See documentation/frames.md for authoring guidelines.

Why is at least one 'wild' frame always included?

The wild tag ensures the ideation pool contains genuinely unconventional perspectives. Without this forced injection, the codeMode filter would over-select conventional engineering frames, undermining ADHD's core purpose: preventing premature convergence through guaranteed cognitive diversity.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →