What Is the Pre-Send Check in i-have-ADHD Rules?

The pre-send check is a final sanitization filter that removes fluff, hedging, and figurative language to ensure every response immediately tells the reader what to do next and what just happened.

The i-have-adhd skill enforces an ADHD-friendly communication style by applying strict output rules right before a message is emitted. According to the ayghri/i-have-adhd repository, the pre-send check in i-have-adhd rules serves as the final gatekeeper that guarantees every response contains actionable, literal instructions without cognitive overhead. This check is defined in skills/i-have-adhd/SKILL.md and implemented within the extension logic in extensions/i-have-adhd.ts.

How the Pre-Send Check Filters Content

The pre-send check executes five concrete deletions followed by a verification step. This process ensures the output complies with the ADHD-friendly style: the reader must immediately see what to do next and what just happened, without any fluff, hedging, or figurative language.

The Five Deletion Rules

  1. Remove announcing openers. Delete the opening sentence if it merely announces an upcoming action rather than stating it directly. This prevents preambles that force the reader to sift through unnecessary context.

  2. Remove closing pleasantries. Delete the closing sentence if it asks "anything else?" or recaps the previous turn. This eliminates distractions from the core action.

  3. Delete sidebars. Remove any "by the way" asides that break the flow of a single, actionable message.

  4. Strip hedging adverbs. Remove adverbs that add no information, such as perhaps, might, or could possibly. The system keeps only genuine uncertainty, ensuring statements remain confident and information-dense.

  5. Replace idioms. Eliminate figurative phrases like circle back, get the ball rolling, or on the same page, replacing them with literal actions to avoid cognitive overhead.

The Verification Step

After stripping these elements, the system verifies that the first line states the immediate next action and the last line summarizes the completed step. If both elements are present, the message passes and is sent; otherwise, the writer must revise the content.

Implementation in the Source Code

The skill definition in skills/i-have-adhd/SKILL.md documents the pre-send check requirements, while extensions/i-have-adhd.ts contains the core extension logic that loads these rules. The following TypeScript utility demonstrates how to implement the five deletion rules programmatically:

// Utility that implements the pre-send check described in the skill
function preSendCheck(text: string): string {
  const lines = text.split("\n").filter(l => l.trim().length > 0);

  // 1. Remove announcing first sentence
  if (/^(run|execute|open|do|let's|start)/i.test(lines[0])) {
    // keep the line – it's already an action; otherwise drop it
  } else {
    lines.shift();
  }

  // 2. Remove closing question/recap
  const last = lines[lines.length - 1];
  if (/anything else\?|recap|summary/i.test(last)) lines.pop();

  // 3. Remove “by the way” sidebars
  const filtered = lines.filter(l => !/^by the way/i.test(l));

  // 4. Strip hedging adverbs
  const hedgeRegex = /\b(perhaps|might|could possibly)\b/gi;
  const noHedges = filtered.map(l => l.replace(hedgeRegex, "").trim());

  // 5. Replace idioms with literal phrasing
  const idiomMap: Record<string, string> = {
    "circle back": "return to this point",
    "get the ball rolling": "start the process",
    "on the same page": "agree on the current status",
  };
  const literal = noHedges.map(l => {
    let out = l;
    for (const [idiom, repl] of Object.entries(idiomMap)) {
      out = out.replace(new RegExp(`\\b${idiom}\\b`, "gi"), repl);
    }
    return out;
  });

  // Verify that first and last lines convey next action & completed state
  if (literal.length < 2) return literal.join("\n"); // nothing to verify
  const first = literal[0];
  const lastLine = literal[literal.length - 1];
  // simple sanity check – in real code you’d be stricter
  if (first && lastLine) return literal.join("\n");
  return ""; // indicate failure; caller should revise
}

Integration Pattern

While the current extensions/i-have-adhd.ts does not expose a native pre_send hook, developers can integrate the check by intercepting messages before they are rendered. The following pattern demonstrates how to wire the preSendCheck utility into the extension lifecycle:

pi.on("pre_send", async (msg, ctx) => {
  const cleaned = preSendCheck(msg.content);
  if (!cleaned) {
    ctx.ui.notify("Message did not pass pre-send check; please revise.", "warning");
    return { action: "handled" };
  }
  msg.content = cleaned;
  return { action: "continue" };
});

This ensures every outgoing message conforms to the ADHD-friendly style defined in the skill documentation.

Summary

  • The pre-send check is a mandatory filtering step defined in skills/i-have-adhd/SKILL.md that executes immediately before a response is emitted.
  • It performs five specific deletions: removing announcing openers, closing pleasantries, "by the way" sidebars, hedging adverbs, and figurative idioms.
  • The check verifies that the first line provides the next action and the last line summarizes what just happened.
  • The extension logic in extensions/i-have-adhd.ts loads these rules, and developers can implement the filter using a preSendCheck utility function.

Frequently Asked Questions

What happens if a message fails the pre-send check?

If the verification step detects that the first or last line is missing after deletions, the check returns an empty string or failure signal. The system should notify the user to revise the content, ensuring no non-compliant message reaches the reader.

Where are the pre-send check rules documented?

The rules are documented in the Pre-send check section of skills/i-have-adhd/SKILL.md within the ayghri/i-have-adhd repository. This file defines the ADHD-friendly output style and the specific deletion rules.

Does the extension automatically enforce the pre-send check?

The extensions/i-have-adhd.ts file loads the skill rules and manages the ADHD mode state, but the actual repository does not currently implement a pre_send hook. Developers must manually integrate the preSendCheck logic into their message handling pipeline to enforce the rules at runtime.

Why remove hedging adverbs like "might" or "perhaps"?

These adverbs add no actionable information and create uncertainty. The pre-send check removes them to keep statements confident and information-dense, unless the uncertainty is genuine and relevant to the instruction.

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 →