# Purpose of the Pre‑Send Check in i‑have‑adhd SKILL.md: 3 Safety Mechanisms Explained

> Discover the purpose of the pre-send check in i-have-adhd SKILL.md. Learn about 3 safety mechanisms that ensure ADHD-friendly replies before they are sent.

- Repository: [Ayoub Ghriss/i-have-adhd](https://github.com/ayghri/i-have-adhd)
- Tags: deep-dive
- Published: 2026-08-19

---

**The pre‑send check defined in [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) is a final sanitising step that guarantees every reply conforms to the ADHD‑friendly output style before it is sent to the user.**

The `ayghri/i-have-adhd` repository uses [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) to define strict formatting rules that turn verbose assistant replies into concise, actionable messages. The **pre‑send check** in the SKILL.md rules acts as a mandatory safety gate that evaluates and trims every response immediately before delivery. This mechanism ensures that users with ADHD receive only the task‑critical information they need to act without wading through introductory fluff or ambiguous hedging.

## Three Core Purposes of the Pre‑Send Check

The pre‑send check defined in [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) (lines 28‑40) serves three distinct functions that collectively keep output usable.

### Enforce Action‑First Messaging

The check strips introductory sentences and closing recaps so that the **first line** always tells the reader *what to do next* and the **last line** tells them *what just happened*. This aligns with the skill’s central rule “Lead with the next action” documented in lines 33‑41 of the skill file. By hard‑coding this sequence, the check prevents the model from opening with throat‑clearing phrases like “Let’s start by…” and closing with open‑ended questions.

### Eliminate Distractions and Redundancy

According to the source rules (Rule 1‑5, lines 25‑30), the check removes “by‑the‑way” sidebars, unnecessary hedging adverbs, and idiomatic phrases that do not convey concrete information. These deletions directly reduce cognitive load for users with small working memory. The result is a concise, focused response that contains only actionable facts.

### Validate Completion Before Sending

After deletions, the check verifies that a reader who only scans the first and last lines can still identify the next concrete step and understand what was just accomplished (lines 38‑40). This validation enforces the skill’s requirement that every reply be **actionable and self‑contained**, preventing vague estimations or dangling tasks that could stall progress.

## Implementing the Pre‑Send Check in Code

While [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) defines the policy, the logic can be expressed in a simple Python function that mirrors the rule set.

### Manual Application of the Pre‑Send Check

The following `pre_send_check` function applies the exact transformations described in [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md):

```python
def pre_send_check(message: str) -> str:
    # 1️⃣ Remove opening announcement

    lines = message.splitlines()
    if lines[0].lower().startswith("let's"):
        lines = lines[1:]

    # 2️⃣ Remove closing question/recap

    if lines[-1].strip().endswith("?"):
        lines = lines[:-1]

    # 3️⃣ Strip “by the way” sidebars

    lines = [ln for ln in lines if "by the way" not in ln.lower()]

    # 4️⃣ Remove empty hedging adverbs

    hedges = {"perhaps", "might", "could possibly"}
    lines = [
        " ".join(w for w in ln.split() if w.lower() not in hedges)
        for ln in lines
    ]

    # 5️⃣ Replace idioms with literal wording

    idiom_map = {
        "circle back": "return to this point",
        "get the ball rolling": "start the process",
        "on the same page": "agree on the current status",
    }
    for i, (idiom, literal) in enumerate(idiom_map.items()):
        lines = [ln.replace(idiom, literal) for ln in lines]

    # 6️⃣ Verify first/last line contain actionable info

    assert lines[0].strip().startswith("Run") or lines[0].strip().startswith("Open")
    assert lines[-1].strip().endswith(".")
    return "\n".join(lines)

```

### Integrating the Check into a Response Pipeline

In practice, the raw model output passes through the check immediately before delivery:

```python
raw_reply = generate_reply(user_prompt)          # full assistant output

final_reply = pre_send_check(raw_reply)          # enforce the SKILL rules

send(final_reply)                                # only the trimmed version is delivered

```

This pattern reflects how the runtime implementation in [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts) consumes the skill rules and applies them to the model’s output.

## Source Files and Architecture

The pre‑send check is not merely documentation; it is backed by concrete source files in the `ayghri/i-have-adhd` repository.

- **[`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md)** – Defines all i‑have‑adhd rules, including the pre‑send check specification on lines 28‑40.
- **[`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts)** – The runtime implementation that reads the skill file and applies its rules to the model’s output.
- **[`tests/test_opencode_plugin.py`](https://github.com/ayghri/i-have-adhd/blob/main/tests/test_opencode_plugin.py)** – Contains tests that verify the pre‑send check behavior when the plugin runs.

Together, these files turn the [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) policy into an enforceable contract.

## Summary

- The **pre‑send check** is the final sanitising gate in [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) that runs before any reply reaches the user.
- It **enforces action‑first messaging** by locking the first line to the next step and the last line to the result.
- It **eliminates cognitive overhead** by removing hedging, sidebars, idioms, and redundant phrases.
- It **validates structural completeness** so that even a quick scan of the first and last lines yields an actionable instruction and a clear outcome.
- The logic is implemented and tested across [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md), [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts), and [`tests/test_opencode_plugin.py`](https://github.com/ayghri/i-have-adhd/blob/main/tests/test_opencode_plugin.py).

## Frequently Asked Questions

### What is the pre‑send check in i‑have‑adhd SKILL.md?

The pre‑send check is a final sanitising step defined in [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) (lines 28‑40) that guarantees every assistant reply conforms to an ADHD‑friendly output style before it is sent to the user. It strips fluff, removes hedging language, and validates that the response is actionable.

### How does the pre‑send check reduce cognitive load?

By eliminating “by‑the‑way” sidebars, hedging adverbs such as “perhaps” and “might,” and non‑literal idioms, the check prevents the user from parsing unnecessary information. This aligns with Rule 1‑5 in [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) (lines 25‑30), which targets readers with small working memory.

### Which files implement the pre‑send check?

The rules live in **[`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md)**, the runtime logic resides in **[`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts)**, and the behavior is verified by **[`tests/test_opencode_plugin.py`](https://github.com/ayghri/i-have-adhd/blob/main/tests/test_opencode_plugin.py)**. Together, these files define the policy, execute the transformations, and validate the results.

### Does the pre‑send check modify the model itself or just the output?

The check modifies only the **output** text, not the underlying model. As shown in the pipeline example, the raw reply is generated first, then `pre_send_check()` trims and validates it, and only the sanitised version is delivered to the user.