MIT License

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

深度技术分析:ADHD — 一款为编码代理设计的技能

项目背景与痛点

在人工智能快速发展,特别是涉及复杂编程任务与创造工作的场景下,我们需要一种更高效、更具创意的解决方案。ADHD 就是这样一个基于 Claude & Codex Agent SDK 的技能,专为编码代理提供强健的思维能力。通过生成和管理多个并发的思维流程,ADHD 能对各种思考路径进行评分、修剪和深化,从而捕获那些可能会被传统单一思维模式忽视的解决方案。

项目解决了在复杂的编程任务中,仅靠孤立的线性思维难以产生创新解决方案的问题。它引入了更加灵活和深度的思维模型,能够更好地支持创新性和交叉学科的研发工作。

核心技术揭秘

ADHD 的核心技术在于其独特的思维树模型及其剪枝机制。系统在多条平行的思考路径上并行工作,并在每一步评分和修剪低价值的思维分支,保留那些展现潜力的新思路。这不仅提高了工作效率,还确保了全过程的高度创造性。以下为 ADHD 的数据流图:

graph TD A[用户请求] --> B[并发思维树生成] B --> C{"分支评分"} C -->|"高评分"| D[深入展开] C -->|"低评分"| E[修剪] D --> F[最终方案] F --> G[逻辑验证] G --> H[结果反馈]

可见,ADHD 通过并发思维树建立起一个动态、高效的思考环境,通过不断的自我优化,构建出既创新又可靠的解决方案。

功能亮点与差异

相较于同类产品,ADHD 真正突出了其在创造性思维及交叉学科领域内的应用潜力。它不仅可以并行处理多条思维路径,还能够根据评分和权重重新优化这些路径。这一特性使得它非常适合于那些需要突破传统思路,探索新知的场景。

此外,ADHD 的设计还确保了高度的灵活性和可配置性,用户可以根据不同的项目需求调整参数,从而保证最佳的工作效能。

应用场景与落地建议

在生产环境中使用 ADHD 时,开发者需要关注系统配置及参数优化,以确保最佳性能。ADHD 适用于多种复杂领域,如人工智能研发、交叉学科创新项目等。另外,项目团队还需提供足够的初始数据和反馈机制以支持其长久运行。

综合评价

ADHD 在创造性思维和交叉学科项目方面的表现尤为突出,其核心算法有效实现了思维路径的并发生成与管理,促进创新方案的产生。但与此同时,它对计算资源的需求较高,适用于资源较多且有明确性能优化需求的实际场景。总体而言,ADHD 不仅是一项优秀的工具,更是推动创造性工作向前发展的强大引擎。

关于

GitHub 原始描述(英文)

ADHD — a skill for coding agents. Tree-of-thought with pruning, built on the Claude & Codex Agent SDK. Fans out parallel divergent thoughts under different cognitive frames, scores, prunes traps, deepens the survivors. The no-brainer skill for creative and interdisciplinary work.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

TypeScript

README

ADHD for Claude Code

ADHD — a skill for agents

CI npm Docs license Node Paper Featured: The New Stack Discord

UditAkhourii%2Fadhd | Trendshift

🎮 Join the Discord → for frame design, eval problems, and trap-hunting in real time · 👉 Join the community → as a contributor, maintainer, or early adopter (one short form).

An architectural fix for premature convergence in autoregressive reasoning.

Linear Chain-of-Thought anchors on whatever it says first. Tree-of-Thought widens the search but still walks a single shared context, so the anchoring persists across branches. ADHD treats this as an architectural problem, not a prompting one — it spawns N isolated reasoning processes under deliberately distorted cognitive frames, with zero shared context during divergence, then runs a separate critic pass to score, cluster, prune traps, and deepen the survivors.

Reach for it on design decisions, fuzzy debugging, naming, API surface design, strategy, and any prompt of the shape “give me a few ways to…”.

📚 Official docs: adhd.mintlify.site · 📄 Preprint: ADHD: Parallel Divergent Ideation for Coding Agents · 👤 Author: Udit Akhouri — @akhouriudit · LinkedIn


Side-by-side: baseline vs ADHD

One eval problem, same model, two strategies. Full transcripts in bench/results.json.

Problem. “We have a CLI that calls an LLM and it sometimes hangs for 90 seconds. Design the right retry/timeout/UX strategy.”

Baseline gives the sensible textbook hybrid (staged timeouts + one auto-retry) — the answer a senior engineer gives in 30 seconds, with no traps named. ADHD spawns 6 isolated frames, surfaces 30+ ideas, flags 20 traps with reasons, and lands the non-obvious pick baseline never considers: the slow model might just be the wrong model for this prompt — instant abort + branch to a cheaper/faster one.

Expand the full side-by-side
🟦 Baseline (single-shot) 🟧 ADHD

Walks through four textbook patterns:

  1. Progressive timeout with staged UI (10s / 30s / 60s)
  2. Fast-fail + exponential backoff retry
  3. Hedged parallel requests
  4. Streaming with keepalive

Lands on a hybrid recommendation — 15s first-token timeout, 30s between-token timeout, 90s absolute, one auto-retry. Sensible. Google SRE Book ch. 22. The answer a senior engineer gives in 30 seconds.

What’s missing: no traps named, no acknowledgement that the user might want to bail out of a slow request, no questioning of the “wait then retry the same model” frame.

Spawns 6 isolated frames, surfaces a wide set of 30+ ideas across economic-incentive, async-control-surface, gamification, perceptual-distortion, collective-intelligence, redundancy-race clusters, then:

  • ★ Non-obvious pick: “rage-quit = instant abort + branch to cheaper/faster model” — a button that pulses hotter the longer you wait. One click cancels and re-submits to Haiku-class. The thing baseline never considers: the slow model might just be the wrong model for this prompt.
  • Plus shortlist: scout-fork to alternate endpoints at 30s; daemonize the CLI with ticket IDs; race 3 LLM replicas, cache the winner.
  • 20 traps flagged with one-line reasons — including the cute “stream tokens in reverse” and “patience-token billing” ideas before they cost engineering time.

Independent LLM judge on this problem: breadth 9 vs 6, novelty 8 vs 3, trap detection ~8 vs ~2. Methodology in documentation/evals.md.


  • 🔌 Adopted by repowire — the first OSS project to officially ship ADHD, ported onto its mesh-orchestrator primitives in PR #313 (merged).
  • 📰 The New Stack ran a feature story on ADHD for Claude Code.
  • 💬 OpenClaw / multi-agent community is independently testing it across agents. One tester: “I read it, installed it on two different agents… I actually love it. This is great. I thought this was gonna be another useless post. But no, it wasn’t.”
  • 🔬 An independent evidence-based research review (11 sources, 8 validation rounds) was published against the method — findings tracked openly as issues #16–#18.

Early adopters

17+ projects ship or integrate ADHD — including repowire, mstack, zk-flow-oss, han, wtfismyrepo, and awesome-prompts. The full table of who shipped what lives in ADOPTERS.md.

Shipping ADHD in your project? Open a PR adding yourself to ADOPTERS.md, or open an issue and we’ll add you.


Install

One command, auto-detects your agent (Claude Code, Cursor, Antigravity, Codex, Cline, Gemini CLI, Windsurf, and ~50 more):

npx skills add UditAkhourii/adhd

Then invoke explicitly with /adhd "your problem", or let it auto-trigger on ideation intents.

npm install -g adhd-agent     # CLI
npm install adhd-agent        # library

CLI and library installs, the Codex quick path, manual curl for other agents, and per-platform paths are in documentation/install.md.


Quickstart

adhd "design a rate limiter that survives a leader election"
adhd "name this function" --frames 3 --ideas 8 --top 2
import { run, renderText } from "adhd-agent";

const result = await run({ problem: "How should we shard this queue under bursty load?", framesPerRun: 5, topK: 3 });
console.log(renderText(result));
// result.shortlist · result.nonObviousPick · result.traps · result.deepened · result.clusters

Full reference: documentation/api.md.


How it works

A two-phase loop with a hard wall between the phases.

  1. Diverge. Pick N cognitive frames. Spawn N parallel, isolated Agent calls — each sees the problem plus one frame’s vantage prompt, and a system prompt that forbids evaluation. Branches never see each other, so no anchoring.
  2. Focus. A separate critic call scores every idea (novelty / viability / fit), flags traps with reasons, clusters by underlying angle, and deepens the top-K survivors into sketches with risks and first steps.

The generator-critic split is mechanical — separate LLM calls with opposite system prompts — not promised in one prompt. Deep dive: documentation/how-it-works.md. How it differs from CoT and ToT: documentation/vs-cot-and-tot.md.


Results

Mean scores across 6 open-ended engineering problems (0–10), ADHD vs a single-shot baseline at the same model, judged by an independent LLM with a skeptical-staff-engineer prompt, A/B order randomized.

Dimension ADHD Baseline Δ Ratio
breadth 9.00 4.83 +4.17 1.9×
novelty 7.83 2.67 +5.17 2.9×
trap detection 9.50 1.83 +7.67 5.2×
actionability 9.50 6.50 +3.00 1.5×
builder usefulness 7.67 6.83 +0.83 1.1×

ADHD wins 5 of 6 problems. Biggest gap is trap detection — baselines rarely name the seductive-but-broken ideas. Methodology, limitations, and how to reproduce: documentation/evals.md.


Documentation

📚 Official docs: adhd.mintlify.site — the full, browsable documentation site.

In-repo pages:

Page What’s in it
Quickstart First skill, CLI, and TypeScript runs with practical commands
Install Every install path — skill, CLI, library, Agent SDK, per-platform
How it works The two-phase loop + architecture (context, pruning, orchestration)
vs CoT & ToT Structural comparison, the three load-bearing differences, frames vs personas
Frames The 15 cognitive frames, how selection works, how to author your own
When to use Use / don’t use, why it shines on creative work, cost & speed
CLI & API CLI flags, library types, using ADHD inside your own agent
Evals Methodology, headline numbers, limitations, roadmap

Also: SKILL.md (the runnable skill) · SOURCE-SPEC.md (original spec) · CONTRIBUTING.md · the preprint.


Star History

Star History Chart

External reviews


License

MIT License.

ADHD operationalizes the Divergent Ideation source spec (SOURCE-SPEC.md). The runnable skill is at skills/adhd/SKILL.md.


Contact

Udit Akhouri — author of the preprint and maintainer.

adhdstack.github.io · @akhouriudit · LinkedIn · [email protected] · @UditAkhourii

Open to collaboration with research labs and applied-AI teams working on reasoning, planning, and agentic systems.

评论

暂无评论