How the i-have-adhd Skill Ensures Every First Line Is Actionable

The i-have-adhd skill guarantees the first line of every response is an action the reader can perform immediately by embedding this requirement in a persistent rule set that is automatically injected into the model's context.

The ayghri/i-have-adhd repository implements an AI assistant skill designed for ADHD users who need clear, immediate next steps rather than lengthy explanations. Unlike generic prompting, this skill enforces a strict structural rule through runtime context injection. This article examines the exact mechanism that ensures every response opens with a concrete, actionable instruction.

Rule Definition in SKILL.md

The actionable-first-line requirement originates in the skill's central rule definition file.

In skills/i-have-adhd/SKILL.md, lines 33-40 contain the verbatim rule:


### 1. Lead with the next action

The first line is something the reader can do. Not context. Not a plan. The action.

This phrasing is intentionally imperative. The rule prohibits context-setting or planning language, mandating that the very first output must be executable. The triple constraint ("Not context. Not a plan. The action.") eliminates ambiguity that simpler prompts might leave room for.

Runtime Loading and Processing

The extension loads these rules at startup through the loadRules() function in extensions/i-have-adhd.ts, lines 61-78:

const rules = loadRules();                // ← loads SKILL.md
function loadRules(): string {
    const content = readFileSync(SKILL_PATH, "utf8");
    const rules = stripFrontmatter(content);
    return rules;
}

The stripFrontmatter helper removes YAML metadata while preserving the plain-text rules. This processed string becomes the payload injected into model context.

Context Injection via syncContext

The core enforcement mechanism lives in syncContext at lines 34-48 of extensions/i-have-adhd.ts:

if (enabled && !injected) {
    pi.sendMessage(
        {
            customType: RULES_MESSAGE_TYPE,
            content: `${RULES_HEADER}\n\n${rules}`,
            display: false,
        },
        { triggerTurn: false },
    );
}

Key implementation details:

  • display: false — The rule message is hidden from the user but fully visible to the model
  • triggerTurn: false — Injection happens without generating a new assistant response
  • RULES_MESSAGE_TYPE — A constant identifier that allows the extension to track whether rules are already present

The rulesAreInContext check (using latestMarkerIsActive from extensions/context-compat.ts) prevents duplicate injection, avoiding context bloat.

Session Persistence and State Management

The skill maintains enforcement across conversation turns through state persistence. Lines 81-95 implement getSavedState and restoreState (referenced at lines 61-71), which:

  1. Store the enabled/disabled marker as STATE_ENTRY_TYPE
  2. Re-inject rules only when ADHD mode is toggled on and rules are missing
  3. Preserve the rule set's presence for the entire active session

This persistence model ensures the actionable-first-line rule survives topic changes, user corrections, and multi-turn exchanges. The model cannot "forget" the constraint because the rules remain in its working context.

Model Compliance Through Prompting

Notably, the skill does not programmatically parse or validate the first line. Instead, it relies on prompt-based enforcement: the explicit rule wording guides the model's generative behavior. The rule's clarity ("The first line is something the reader can do") provides strong conditioning that the model consistently follows when the rule set is present.

Practical Usage Examples

Enforcing the Rule

/i-have-adhd on

After execution, the extension injects the full rule set. Subsequent responses begin with executable instructions:

Run `npm install jsonwebtoken`, then edit `src/auth.ts:42`.

The command above updates your authentication flow…

The first line delivers a concrete command sequence. The second paragraph (and beyond) may provide context, but the opening satisfies the actionable requirement.

Disabling Enforcement

/i-have-adhd off

The extension sends a hidden disabled marker, removing the rule set from active context and allowing standard conversational responses.

Summary

  • Rule source: skills/i-have-adhd/SKILL.md lines 33-40 define the actionable-first-line requirement in explicit, unambiguous language
  • Loading mechanism: loadRules() in extensions/i-have-adhd.ts strips frontmatter and prepares the rule text for injection
  • Context injection: syncContext sends rules as a hidden message when ADHD mode is enabled and rules are absent
  • Persistence: State tracking across getSavedState/restoreState ensures rules remain active for the session duration
  • Compliance method: Prompt-based conditioning rather than programmatic validation, leveraging clear rule phrasing to guide model output

Frequently Asked Questions

What exactly counts as an "actionable" first line?

According to the SKILL.md rule definition, an actionable first line is "something the reader can do"—specifically excluding context or planning language. In practice, this means direct commands like "Run npm install" or "Open config.json and delete line 12" rather than "To install dependencies, you should consider running npm install" or "Here's a plan for fixing your code."

Can the rule be bypassed or ignored by the model?

The skill relies on prompt-based enforcement; there is no programmatic validator that rejects non-compliant responses. However, the rule's explicit positioning at the top of the injected rule set, combined with its clear negative constraints ("Not context. Not a plan."), provides strong behavioral conditioning. The persistence mechanism ensures this conditioning remains active throughout the session.

Why hide the rules from the user with display: false?

Hidden injection prevents the rules from cluttering the conversation interface while ensuring the model processes them as part of its context window. This technique, implemented via pi.sendMessage with display: false, maintains the user experience aesthetic while preserving functional enforcement—critical for ADHD accessibility where visual noise reduction matters.

Where does the extension check if rules are already injected?

The rulesAreInContext check uses latestMarkerIsActive from extensions/context-compat.ts to examine conversation history for the RULES_MESSAGE_TYPE marker. This prevents redundant injection that would waste context window space and potentially confuse the model with duplicate rule statements.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →