How i-have-adhd Transforms Verbose LLM Responses into a Structured Format
The i-have-adhd plugin transforms verbose LLM responses into a structured format by combining a declarative skill definition that guides generation with a runtime interceptor that detects non-compliant output and forces a "transform" action to regenerate the response as a concise, numbered checklist.
The open-source project ayghri/i-have-adhd solves cognitive overload from chatty AI assistants by enforcing a rigid, action-oriented output style. It intercepts the LLM's response stream, evaluates whether the text follows predefined readability rules, and automatically triggers a rewrite loop when the model drifts into lengthy prose. This ensures every final output is a scannable, ADHD-friendly task list rather than a dense paragraph.
The Two-Component Architecture
Skill Definition: Guiding Generation via SKILL.md
The transformation begins with declarative rules defined in skills/i-have-adhd/SKILL.md. This file enumerates ten concrete formatting constraints—such as "Lead with the next action," "Number multi-step tasks," and "Give specific time estimates"—that dictate exactly how the LLM must structure its answers.
These rules are injected into the LLM's system prompt whenever the skill is active. By embedding these constraints at the generation layer, the model is primed to produce concise output that aligns with the desired format. However, because models occasionally hallucinate or revert to verbose defaults, the skill definition alone is not sufficient; it requires runtime enforcement.
Runtime Enforcement: The Pi Plugin in i-have-adhd.ts
The runtime plugin lives in extensions/i-have-adhd.ts and registers a handler for the Pi event stream. When a user activates the skill via /i-have-adhd on, the plugin sets an internal enabled flag to true and begins monitoring every incoming LLM message.
For each response, the plugin evaluates whether the content satisfies the skill's constraints. If the text is too verbose or lacks the required structure, the plugin intercepts the message before it reaches the user and initiates a correction loop.
How the Transform Loop Works
Detecting Non-Compliance
When the plugin receives an LLM response, it checks the content against the rules defined in SKILL.md. If the response fails to start with an immediate action, lacks numbered steps, or includes unnecessary prose, the plugin classifies it as verbose and triggers a rewrite.
Issuing the Transform Action
Upon detecting non-compliant output, the plugin returns a specific payload object back to the LLM. According to the source code in extensions/i-have-adhd.ts (lines 229–231), the plugin sends:
return {
action: "transform",
text: `Reply with exactly: ${DISABLE_CONFIRMATION}`,
};
The "transform" action instructs the LLM to discard its previous response and regenerate the answer exactly as instructed—this time adhering to the concise, numbered, action-first format dictated by the skill rules.
The Feedback Cycle
The LLM receives the transform request and re-emits a new response that follows the structured format. This refined output is then forwarded to the user. This feedback loop guarantees that even if the initial generation drifts into long-form explanations, the final delivered message is always a structured checklist that an ADHD-focused reader can act on immediately.
Practical Implementation: Enabling Structured Output
You can toggle the transformation behavior using simple slash commands. When active, the plugin automatically reformats any verbose replies without requiring manual intervention.
// Enable the skill to activate structured formatting
/pi.send("/i-have-adhd on");
// Example of a verbose LLM reply that triggers transformation
const verboseReply = `
Great question! Let me think about this. First we need to check the config,
then run the build, and finally deploy. It might take a while...`;
// The plugin detects the verbosity and issues the transform payload
// The LLM then regenerates the response as:
const transformedReply = `
1. Open \`config.yml\`
2. Run \`npm run build\`
3. Deploy with \`npm run deploy\`
🕒 About 15 minutes total.
`;
// Disable the skill to return to default LLM behavior
/pi.send("/i-have-adhd off"); // or say "stop adhd mode"
Key Source Files
skills/i-have-adhd/SKILL.md– Declares the ten ADHD-friendly output rules that guide the LLM's generation behavior.extensions/i-have-adhd.ts– Implements the runtime plugin that toggles the skill via the Pi event stream and issues"transform"actions when responses violate formatting constraints.README.md– Provides user-facing installation instructions and usage examples.INSTALL.md– Contains detailed setup steps for various runtime environments.
Summary
- Declarative guidance in
SKILL.mdprimes the LLM to generate action-first, numbered responses by injecting formatting rules into the system prompt. - Runtime enforcement via
extensions/i-have-adhd.tsmonitors the Pi event stream and sets anenabledflag when users run/i-have-adhd on. - Automatic correction uses a
"transform"action payload (lines 229–231) to force the LLM to rewrite verbose output into a structured checklist. - Cooperative filtering ensures the final user-facing message is always a concise, time-estimated task list suitable for ADHD workflow management.
Frequently Asked Questions
How does the plugin know when a response is too verbose?
The plugin evaluates each incoming LLM message against the ten formatting rules defined in SKILL.md. If the response lacks a leading action, omits step numbering, or contains excessive prose, the plugin treats it as non-compliant and triggers the transform action to request a rewrite.
What specific rules does the skill enforce?
According to the source analysis, the rules include leading with the immediate next action, numbering multi-step tasks, and providing specific time estimates (e.g., "🕒 About 15 minutes"). These constraints are defined in skills/i-have-adhd/SKILL.md and injected into the LLM's system prompt.
Can I disable the transformation after enabling it?
Yes. You can deactivate the plugin by sending /i-have-adhd off or saying "stop adhd mode" in the chat. This sets the internal enabled flag to false, causing the plugin to pass through LLM responses without issuing transform actions.
What happens if the LLM ignores the transform request?
The plugin implements a feedback loop that persists until the output matches the required format. If the regenerated response still violates the rules, the plugin will issue another transform action, ensuring the user never receives verbose, unstructured text while the skill is active.
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 →