# What Cognitive Frames Are Available in ADHD and How They Influence Ideation

> Discover the 15 cognitive frames in the ADHD repository that re-pose problems from new angles, expanding solution spaces and enhancing ideation for language models.

- Repository: [Udit Akhouri/adhd](https://github.com/UditAkhourii/adhd)
- Tags: deep-dive
- Published: 2026-07-30

---

**The ADHD repository provides 15 built-in cognitive frames—defined in [`src/frames.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/frames.ts) and documented in [`documentation/frames.md`](https://github.com/UditAkhourii/adhd/blob/main/documentation/frames.md)—that act as vantage operators to re-pose problems from distinct mental angles, forcing the language model to explore solution spaces it would not normally visit.**

The ADHD project treats brainstorming as a lens-switching exercise. By implementing **cognitive frames** as modular system-prompt fragments, the engine forces language models to re-examine engineering problems through specific conceptual vantage points. These frames transform generic ideation into structured divergence by prefixing the generator's context with targeted perspective shifts, ensuring the LLM visits semantic territories ranging from hardware constraints to biological analogies.

## The Complete Set of Cognitive Frames in ADHD

The cognitive frames are hardcoded in [[`src/frames.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/frames.ts)](https://github.com/UditAkhourii/adhd/blob/main/src/frames.ts) and categorized by their influence on ideation. Each frame consists of an `id`, a `prompt` string that re-poses the problem, and `tags` that govern selection logic.

**Performance and Infrastructure Frames**

- **hardware-eyes**: Forces consideration of latency, memory layout, and physical bus topology. The prompt instructs the model to think in terms of cache timing budgets and resource-centric trade-offs rarely surfaced in pure software thinking.
- **speedrunner**: Emphasizes performance hacks, frame-perfect shortcuts, and out-of-bounds tricks by adopting the mindset of a speedrunner seeking glitches and skips.
- **ops-3am**: Drives reliability-first design by simulating the on-call engineer woken at 3 AM, encouraging observability, alert suppression, and graceful degradation.

**Adversarial and Security Frames**

- **adversary**: Generates approaches that exploit, fail, or sabotage the obvious solution, then inverts them into robust designs by adopting a hostile competitor's mindset.
- **regulator**: Surfaces audit trails, safety checks, and verifiability requirements by auditing systems for compliance and failure modes.
- **inversion**: Generates contrarian ideas by asking the opposite question—brainstorming how to guarantee failure, then negating each answer back into innovative solutions.

**Biological and Decentralized Systems**

- **biology**: Inspires self-healing and evolutionary patterns by transplanting mechanisms from immune systems, neural plasticity, and cell signaling.
- **ant-colony**: Promotes decentralized, emergent solutions such as swarm algorithms by eliminating central planners and relying on many dumb agents with local rules.

**Economic and Logistics Frames**

- **logistics**: Brings supply-chain thinking to software, prompting queue-based architectures, batching strategies, and hub-and-spoke distribution models.
- **markets**: Introduces economic perspectives including auction mechanisms, futures contracts, and incentive alignment by treating the problem as a marketplace.
- **game-design**: Highlights user-experience loops, reward structures, and friction points by approaching the problem as a game designer analyzing speedrun tricks and save-states.

**Constraint-Based Creativity**

- **extreme-zero**: Forces extreme minimalism by limiting resources to no money, no team, and one hour, surfacing hack-ish shortcuts and core-essential functionality.
- **extreme-infinite**: Explores upper-bound architectural visions by providing infinite compute, engineers, and a decade to envision the maximalist version.
- **remove-assumption**: Breaks implicit dependencies by naming fixed assumptions and imagining them gone, yielding ideas impossible under default constraints.
- **ten-year-old**: Strips away legacy assumptions by adopting a curious child's naive but unencumbered perspective, ignoring convention to yield wildly creative simplicity.

## How Cognitive Frames Influence Ideation

The influence of cognitive frames follows a four-phase pipeline implemented in the engine's core files.

### Frame Selection via `selectFrames`

The engine calls `selectFrames(n, codeMode)` from [[`src/frames.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/frames.ts)](https://github.com/UditAkhourii/adhd/blob/main/src/frames.ts#L34-L47) to build the frame pool. When `codeMode` is true, the function biases selection toward frames tagged `code` and `design`, while always guaranteeing at least one `wild` tagged frame to ensure novelty. The shuffle logic uses a seeded random number generator to maintain determinism.

### Prompt Injection as Vantage Operators

Each selected frame's `prompt` string is concatenated to the system prompt sent to the LLM in [[`src/engine.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/engine.ts)](https://github.com/UditAkhourii/adhd/blob/main/src/engine.ts). This injection acts as a "vantage operator" that reframes the original engineering question, steering the model toward the specific semantic space encoded by the frame's perspective.

### Divergence Through Semantic Shifting

Because frames vary from concrete hardware constraints to abstract biological analogies, the LLM generates a richer, more diverse set of ideas than a single static prompt would produce. The guaranteed `wild` frame ensures the ideation process escapes local optima and conventional thinking patterns.

### Reproducibility via Seeded Selection

Frame selection is deterministic per seed passed to the shuffle utility, allowing repeatable runs while still guaranteeing novelty through the mandatory `wild` slot. This balance enables consistent experimentation across different problem domains.

## Practical Implementation: Using Cognitive Frames

To leverage these frames in your own ideation pipeline, import the selector and engine modules as implemented in the repository:

```ts
import { selectFrames } from "./frames";
import { Engine } from "./engine";

// Choose three frames for a run (default codeMode = true)
const frames = selectFrames(3);

// Create an engine instance that will inject the chosen frames
const engine = new Engine({
  frames,               // array of Frame objects
  seed: 42,             // deterministic selection
  codeMode: true,
});

// Run the ideation pipeline on a sample problem
const problem = "How can we reduce latency for our API endpoint?";
engine.run(problem).then((ideas) => {
  console.log("Generated ideas:", ideas);
});

```

The snippet demonstrates importing the frame selector from [`src/frames.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/frames.ts), configuring the engine with a deterministic seed, and executing an ideation run that automatically prefixes the problem with the selected frame prompts. The CLI entry point in [[`src/cli.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/cli.ts)](https://github.com/UditAkhourii/adhd/blob/main/src/cli.ts) wires this frame selection into the user-facing command interface.

## Summary

- **15 built-in cognitive frames** in [`src/frames.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/frames.ts) provide distinct vantage operators ranging from hardware constraints to biological analogies.
- **`selectFrames(n, codeMode)`** biases toward `code` and `design` tags while guaranteeing one `wild` frame for guaranteed divergence.
- **Prompt injection** in [`src/engine.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/engine.ts) reframes problems by concatenating frame prompts to the LLM system context.
- **Deterministic seeds** enable reproducible brainstorming sessions while maintaining novelty through mandatory wildcard perspectives.
- **Frame tags** (`code`, `design`, `wild`, `general`) categorize how each vantage operator influences the solution space.

## Frequently Asked Questions

### What is a cognitive frame in the ADHD project?

A cognitive frame is a system-prompt fragment defined in [`src/frames.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/frames.ts) that acts as a "vantage operator." It re-poses an engineering problem from a specific mental angle—such as hardware constraints or biological systems—forcing the language model to explore solution spaces it would not normally visit during standard ideation.

### How does the `selectFrames` function ensure variety in ideation?

The `selectFrames` function implemented at lines 34-47 of [`src/frames.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/frames.ts) biases the selection pool toward `code` and `design` tagged frames when `codeMode` is enabled, but strictly guarantees at least one frame tagged `wild`. This ensures every ideation run includes at least one unconventional perspective while maintaining relevance to engineering contexts.

### Can I create custom cognitive frames for specific domains?

Yes. The `Frame` type defined in [`src/frames.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/frames.ts) accepts an `id`, `prompt` string, and `tags` array. You can extend the built-in array with domain-specific frames following the existing schema, and the `selectFrames` logic will automatically include them in the selection pool based on their assigned tags.

### How do cognitive frames differ from simple prompt prefixes?

Unlike static prompt prefixes, cognitive frames are modular, selectable, and semantically distinct vantage operators that undergo a shuffle-and-pick algorithm. They enforce structured divergence by guaranteeing specific tags (like `wild`) appear in every run, whereas simple prefixes would provide the same context regardless of the ideation phase or desired outcome.