# How to Set Up the OpenCode Plugin for i-have-adhd: Complete Installation Guide

> Learn how to set up the OpenCode plugin for i-have-adhd. Follow our guide to clone the repo, configure opencode.json, and activate the plugin easily.

- Repository: [Ayoub Ghriss/i-have-adhd](https://github.com/ayghri/i-have-adhd)
- Tags: how-to-guide
- Published: 2026-09-01

---

**To set up the OpenCode plugin for i-have-adhd, clone the repository to your OpenCode vendor directory, add the plugin path to your [`opencode.json`](https://github.com/ayghri/i-have-adhd/blob/main/opencode.json) configuration, and activate it with the `/i-have-adhd` command.**

The **i-have-adhd** repository provides an OpenCode plugin that integrates ADHD-friendly response formatting directly into your AI coding assistant. This plugin, located at `.opencode/plugins/i-have-adhd.mjs`, registers a skill that shapes OpenCode's output to be more accessible for neurodivergent users. The setup process involves repository placement, configuration file updates, and optional persistent activation.

## Install the i-have-adhd Plugin

The plugin requires cloning the repository to a location where OpenCode can reference it across all projects. The recommended location is within your OpenCode configuration directory.

### Step 1: Clone the Repository

Use `git clone` to download the plugin to your OpenCode vendor directory:

```bash
git clone https://github.com/ayghri/i-have-adhd \
    ~/.config/opencode/vendor/i-have-adhd

```

This places the plugin source and associated files in a centralized location that survives individual project changes.

### Step 2: Configure OpenCode to Load the Plugin

OpenCode loads plugins through the `plugin` array in your configuration file. Edit your global [`opencode.json`](https://github.com/ayghri/i-have-adhd/blob/main/opencode.json) at `~/.config/opencode/opencode.json` to include the absolute path to the plugin module:

```json
{
  "plugin": [
    "/home/you/.config/opencode/vendor/i-have-adhd/.opencode/plugins/i-have-adhd.mjs"
  ]
}

```

Replace `/home/you` with your actual home directory path. The plugin file `.opencode/plugins/i-have-adhd.mjs` handles three responsibilities:
- Registers `skills/i-have-adhd/` as a skill path in `config.skills.paths`
- Adds the `/i-have-adhd` command for session-level activation
- Implements an always-on transform that conditionally injects the ruleset

Alternatively, the repository root contains an [`opencode.json`](https://github.com/ayghri/i-have-adhd/blob/main/opencode.json) file pre-configured with the plugin reference. You can launch OpenCode directly from the checkout if you prefer not to modify your global configuration.

## Activate and Use the i-have-adhd Skill

Once configured, start a fresh OpenCode session to load the new plugin.

### Session-Level Activation

Type the command to enable ADHD-friendly formatting for the current session:

```text
/i-have-adhd

```

The skill remains active until you enter **"stop adhd mode"** or **"normal mode"**. During active sessions, OpenCode processes your prompts according to the rules defined in [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md), which the plugin reads and injects into the system prompt.

### Enable Always-On Mode

To automatically apply ADHD-friendly formatting at the start of every OpenCode session, create a flag file in your configuration directory:

```bash
touch ~/.config/opencode/.i-have-adhd-always

```

The plugin checks for this flag on initialization. When present, it appends the full ruleset from [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) to the system prompt on every turn, functioning similarly to Claude Code's `SessionStart` hook. The flag location follows XDG Base Directory standards:

- `$XDG_CONFIG_HOME/opencode/.i-have-adhd-always` (if set)
- `~/.config/opencode/.i-have-adhd-always` (default)

Disable always-on mode by removing the flag:

```bash
rm ~/.config/opencode/.i-have-adhd-always

```

## Verify Your i-have-adhd Plugin Setup

Confirm successful installation through OpenCode's command interface:

1. Start a new OpenCode session
2. Type `/` to trigger command autocomplete
3. Verify `i-have-adhd` appears in the command list
4. Execute `/i-have-adhd` and observe formatting changes in subsequent responses

If the command appears but produces no effect, verify the [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) file exists at [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) relative to your plugin installation path.

## Key Files and Their Functions

Understanding the plugin architecture helps with troubleshooting and customization:

- **`.opencode/plugins/i-have-adhd.mjs`** — Core plugin implementing skill registration, command binding, and the always-on transform system
- **[`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md)** — Ruleset source file containing the ADHD-friendly output guidelines that get injected into prompts
- **[`.opencode/command/i-have-adhd.md`](https://github.com/ayghri/i-have-adhd/blob/main/.opencode/command/i-have-adhd.md)** — Command documentation displayed in OpenCode's autocomplete interface
- **[`opencode.json`](https://github.com/ayghri/i-have-adhd/blob/main/opencode.json)** (repository root) — Example configuration demonstrating proper plugin path structure
- **[`INSTALL.md`](https://github.com/ayghri/i-have-adhd/blob/main/INSTALL.md)** — Complete maintenance instructions including update and uninstall procedures

The plugin's transform logic in `i-have-adhd.mjs` specifically handles two activation paths: the explicit `/i-have-adhd` command for temporary sessions and the file-system flag check for persistent behavior.

## Summary

- **Install** the i-have-adhd OpenCode plugin by cloning to `~/.config/opencode/vendor/i-have-adhd`
- **Configure** by adding the absolute path to `.opencode/plugins/i-have-adhd.mjs` in your [`opencode.json`](https://github.com/ayghri/i-have-adhd/blob/main/opencode.json) `plugin` array
- **Activate** per-session with `/i-have-adhd` or permanently with `touch ~/.config/opencode/.i-have-adhd-always`
- **Deactivate** session mode with "stop adhd mode" or always-on mode by deleting the flag file
- **Verify** through command autocomplete (`/`) and observable response formatting changes

## Frequently Asked Questions

### Where does the i-have-adhd plugin store its configuration?

The plugin uses OpenCode's standard configuration directory at `~/.config/opencode/`. The always-on flag lives directly in this directory as `.i-have-adhd-always`, while the skill definition is read from [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) relative to the plugin installation path. No additional configuration files are required.

### Can I use the i-have-adhd plugin without modifying my global OpenCode config?

Yes. The repository includes a root-level [`opencode.json`](https://github.com/ayghri/i-have-adhd/blob/main/opencode.json) that already references the plugin using a relative path. Navigate to the cloned directory and launch OpenCode from there to use the pre-configured setup without touching your global configuration.

### What happens if both the flag file and the session command are active?

The plugin deduplicates ruleset injection. If the always-on flag exists when you run `/i-have-adhd`, the skill activates normally without duplicate content. Disabling via "stop adhd mode" only affects the session override—the flag file persists for future sessions.

### How do I update the i-have-adhd plugin to the latest version?

Run `git pull` in your installation directory (typically `~/.config/opencode/vendor/i-have-adhd`). The plugin loads fresh from source on each OpenCode start, so no restart or rebuild is required. Check [`INSTALL.md`](https://github.com/ayghri/i-have-adhd/blob/main/INSTALL.md) in the repository for version-specific migration notes.