How the i-have-adhd Skill Modifies Coding Assistant Output: A Technical Deep Dive
The i-have-adhd skill is a persistent output-shaping layer that rewrites every response the assistant emits by injecting a rule set into the model's context and enforcing those constraints at runtime through Pi extensions and OpenCode plugins.
The ayghri/i-have-adhd repository implements a novel approach to modifying coding assistant output for neurodivergent users. Unlike simple prompt prefixes, this skill creates a session-wide transformation that persists across turns until explicitly disabled. The system operates by embedding strict stylistic constraints directly into the model's generation context, ensuring every reply follows ADHD-friendly formatting rules.
Architecture of the Output-Shaping Layer
The skill employs a dual-runtime architecture that adapts to different coding assistant environments. Whether running in Pi-based extensions or OpenCode plugins, the core mechanism remains consistent: rule injection followed by persistent enforcement.
Rule Injection via Context Messages
When a user activates the mode with the /i-have-adhd command, the extension located at extensions/i-have-adhd.ts (lines 13-44) executes a context synchronization routine. The syncContext helper loads the canonical rule set from skills/i-have-adhd/SKILL.md, strips the YAML frontmatter, and transmits the remaining markdown as a custom message of type RULES_MESSAGE_TYPE.
This injection occurs only while the enabled state evaluates to true. The extension monitors for deactivation triggers such as "stop adhd mode" or "normal mode," immediately removing the rules from context to restore standard assistant behavior.
Session Persistence Mechanisms
The skill respects its own Persistence contract defined in lines 15-21 of SKILL.md, which mandates that rules remain active for the entire session until explicitly turned off. The extension honors this by storing the mode state in the session tree under the key i-have-adhd-state and checking latestMarkerIsActive (lines 101-110) to determine whether the rules should remain injected.
Runtime Enforcement Strategies
Beyond initial injection, the skill employs runtime-specific strategies to ensure continuous output modification across different platforms.
Pi Extension Implementation
In Pi-based environments, the TypeScript extension maintains a live reference to the enabled state. The syncContext function dynamically adds or removes the rule messages based on the current toggle state, ensuring the model receives the constraints only when ADHD mode is active.
OpenCode Plugin and Always-On Mode
For OpenCode runtimes, the plugin at .opencode/plugins/i-have-adhd.mjs provides enhanced persistence through system-prompt transformation. When the flag file ~/.config/opencode/.i-have-adhd-always exists, the plugin triggers experimental.chat.system.transform (lines 74-96) to prepend the rule body to the system prompt on every turn, creating an immutable always-on state that survives individual message boundaries.
Specific Output Modifications
The SKILL.md file prescribes ten concrete constraints that reshape how the coding assistant constructs responses. These rules modify everything from structural organization to tonal delivery:
- Lead with the next action (Rule 1, lines 33-41): The first line of every response must contain an immediately executable step.
- Number multi-step tasks (Rule 2, lines 42-55): Complex workflows require sequential numbering for cognitive chunking.
- End with a single concrete next action (Rule 3, lines 57-63): Every response terminates with a clear, solitary instruction.
- Suppress tangents (Rule 4): Eliminate explanatory digressions that distract from the primary task flow.
- No restated state (Rule 5): Prevent redundant summaries of previously established context.
- Specific time estimates (Rule 6): Include precise duration predictions (e.g., "≈2 min") to support time-blindness management.
- Visible wins (Rule 7): Explicitly highlight task completion to provide dopamine feedback.
- Matter-of-fact error tone (Rule 8): Deliver error messages without emotional valence or excessive apology.
- List caps (Rule 9): Restrict the number of items in any list to prevent overwhelm.
- No preamble/recap/closing (Rule 10, lines 64-117): Eliminate introductory fluff and concluding summaries.
Because these rules reside within the model's active prompt context, the assistant's generation logic naturally adheres to them without requiring additional post-processing code.
Usage Examples
Enabling the skill requires a simple slash command:
/user: /i-have-adhd
Once activated, the assistant automatically restyles its output according to the injected constraints:
Run `npm install jsonwebtoken`, then edit `src/auth.ts:42`.
For multi-step workflows, the numbering and terminal action rules create predictable, scannable structures:
1. Open `src/auth.ts`.
2. Replace `verifyToken` (lines 42-58) with the snippet below.
3. Run `npm test -- auth.spec.ts`.
Next: run `npm test` and paste the first failing line. (≈2 min)
Summary
- The i-have-adhd skill modifies coding assistant output by injecting
SKILL.mdrules into the model's context window via custom message types. - Pi extensions handle basic toggle functionality through
extensions/i-have-adhd.ts, while OpenCode plugins provide always-on capabilities through.opencode/plugins/i-have-adhd.mjs. - The skill enforces ten specific stylistic constraints including action-first formatting, numbered steps, time estimates, and tangent suppression.
- Session persistence is maintained through state tracking in the session tree and optional flag-file configuration for permanent activation.
- The architecture allows the rules to shape output without additional code execution, relying entirely on prompt-based behavior modification.
Frequently Asked Questions
What file contains the i-have-adhd rules?
The canonical rule set lives in skills/i-have-adhd/SKILL.md at the repository root. This markdown file contains the YAML frontmatter defining metadata and the constraint body that shapes assistant output. The extension strips the frontmatter before injection, sending only the behavioral rules to the model context.
How does the skill persist across conversation turns?
Persistence is achieved through multiple mechanisms depending on the runtime. The Pi extension stores mode state in the session tree under i-have-adhd-state and checks latestMarkerIsActive (lines 101-110) on each turn. OpenCode environments can use the hooks/always-on.mjs hook or the .i-have-adhd-always flag file to trigger system-prompt prepending via experimental.chat.system.transform.
Can I enable i-have-adhd mode permanently?
Yes. For OpenCode users, creating the file ~/.config/opencode/.i-have-adhd-always triggers the plugin to automatically prepend the rules to every system prompt. This implements an always-on configuration that persists across sessions without requiring the /i-have-adhd command. Pi-based users must toggle the mode per session unless using a custom persistent configuration.
Which runtimes support the i-have-adhd skill?
The repository provides implementations for multiple runtimes: the Pi extension (extensions/i-have-adhd.ts), the OpenCode plugin (.opencode/plugins/i-have-adhd.mjs), and a generic hook for Claude Code (hooks/always-on.mjs). Each runtime-specific file adapts the core rule-injection logic to its respective API while maintaining consistent output-shaping behavior.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →