> ## Documentation Index
> Fetch the complete documentation index at: https://adhd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Run your first ADHD loop in under two minutes — as an agent skill, from the CLI, or in TypeScript.

Choose the **agent skill** for interactive use, the **CLI** for terminal runs, or the **library** inside an application. Node.js 18+ is required for the CLI and library.

## Use ADHD as an agent skill

<Steps>
  <Step title="Install the skill">
    One command, auto-detects your agent (Claude Code, Cursor, Antigravity, Codex, Cline, Gemini CLI, Windsurf, and \~50 more):

    ```bash theme={null}
    npx skills add UditAkhourii/adhd
    ```
  </Step>

  <Step title="Restart your agent">
    Restart so the skill is discovered.
  </Step>

  <Step title="Invoke it">
    Invoke explicitly:

    ```text theme={null}
    /adhd "design a rate limiter that survives a leader election"
    ```

    The skill may also auto-trigger on open-ended design, naming, refactoring, and brainstorming prompts. It deliberately stays out of the way for lookups and known-root-cause bugs — see [the pre-flight gate](/usage/skill#the-pre-flight-gate).
  </Step>
</Steps>

## Use the CLI

<Steps>
  <Step title="Authenticate">
    Set `ANTHROPIC_API_KEY`, or — if Claude Code is installed locally — the CLI inherits its auth automatically.

    ```bash theme={null}
    export ANTHROPIC_API_KEY="your-api-key"
    ```
  </Step>

  <Step title="Install and run">
    ```bash theme={null}
    npm install -g adhd-agent
    adhd "design a retry strategy for an LLM request that sometimes hangs"
    ```
  </Step>
</Steps>

Common variations:

```bash theme={null}
# Change breadth and the number of ideas deepened.
adhd "name this feature-flag service" --frames 3 --ideas 8 --top 2

# Add relevant source or constraints.
adhd "find migration strategies" --context ./architecture.md

# Write structured output for another program.
adhd "design a queue" --json --quiet > result.json
```

Expect several LLM calls per run. The default flow returns clusters, a shortlist, traps, three deepened ideas, and a provocation.

## Use the TypeScript library

```bash theme={null}
npm install adhd-agent
```

```ts theme={null}
import { renderText, run } from "adhd-agent";

const result = await run({
  problem: "How should we shard this queue under bursty load?",
  topK: 3,
});

console.log(renderText(result));
// or operate on the structured result:
//   result.shortlist · result.nonObviousPick · result.traps
//   result.deepened  · result.clusters
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="adhd: command not found">
    Reopen your shell and make sure npm's global binary directory is on `PATH`.
  </Accordion>

  <Accordion title="My agent doesn't discover the skill">
    Follow the per-platform paths in [Installation](/installation) — some agents (notably certain Codex builds) need a forced target or a manual copy into their skills directory.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/installation">
    Every install path — skill, CLI, library, Agent SDK, per-platform.
  </Card>

  <Card title="CLI & Library reference" icon="book" href="/usage/cli">
    Every flag and result type.
  </Card>
</CardGroup>
