Understanding the Pre‑Send Check Mechanism in i‑have‑adhd: How It Ensures ADHD‑Friendly Responses
The pre‑send check is a final sanitizing step that strips superfluous content and verifies that the first line tells the user what to do next and the last line states what just happened.
This operational flow sits at the core of i‑have‑adhd, an open‑source skill system designed for neurodivergent users who need clear, action‑oriented communication. The mechanism is documented in SKILL.md at lines 128‑139 and enforces a strict output format that minimizes cognitive load.
What the Pre‑Send Check Mechanism Does
The pre‑send check runs immediately before any response reaches the user. Its purpose is to guarantee that every message conforms to two non‑negotiable readability criteria: the first line must contain an actionable instruction, and the last line must declare the outcome of that action.
According to the source code in skills/i-have-adhd/SKILL.md under the "## Pre‑send check" heading, the mechanism operates through a six‑step transformation pipeline:
- Remove first‑sentence announcements — Strip lead‑ins like "I'm going to..." or "I will..." that delay the actual instruction.
- Remove last‑sentence prompts — Delete closing questions such as "Anything else?" or recap sentences that add visual clutter.
- Drop "by the way" sidebars — Eliminate optional tangents that fragment attention.
- Filter hedging adverbs — Remove "perhaps," "might," "maybe" unless they convey genuine uncertainty.
- Replace idioms with literal language — Convert figurative phrases like "circle back" into concrete actions.
- Validate first/last line clarity — Confirm the trimmed message satisfies the actionable‑first, outcome‑last structure.
If validation fails, the agent must iterate until the criteria are met.
Operational Flow: From Draft to Final Output
The pre‑send check integrates into the agent's response pipeline as a terminal hook. This placement ensures no downstream process can reintroduce fluff after sanitization.
Stage 1: Content Stripping
The mechanism first performs destructive edits on the draft message. In the reference implementation shown in hooks/always-on.mjs, this stage applies regex‑based and heuristic rules to excise patterns known to impede working‑memory processing.
Consider this before example that violates multiple rules:
I’ll now run the tests. Run `npm test`. By the way, you might want to lint later. If it fails, we’ll debug.
The check removes:
- "I’ll now run the tests." (announcement)
- "By the way, you might want to lint later." (sidebar + hedge)
- "If it fails, we’ll debug." (conditional hedge)
Stage 2: Structural Verification
After stripping, the mechanism validates the remaining structure:
def pre_send_check(message: str) -> str:
lines = [ln.strip() for ln in message.splitlines() if ln.strip()]
# Remove first sentence if it announces the action
if lines[0].lower().startswith(("i will", "i'm going to", "let's")):
lines.pop(0)
# Remove last sentence if it asks for more or recaps
if lines[-1].lower().endswith(("anything else?", "let me know if you need anything else.")):
lines.pop(-1)
# Strip "by the way" sidebars
lines = [ln for ln in lines if not ln.lower().startswith("by the way")]
# Delete hedging adverbs with no real uncertainty
hedges = {"perhaps", "might", "could possibly", "maybe"}
lines = [ln for ln in lines if not any(h in ln.lower() for h in hedges)]
# Replace idioms with literal phrasing
idiom_map = {
"circle back": "return to this later",
"get the ball rolling": "start the process",
"on the same page": "agree on the same point",
}
for i, ln in enumerate(lines):
for idiom, literal in idiom_map.items():
if idiom in ln.lower():
lines[i] = ln.lower().replace(idiom, literal)
# Verify first/last line clarity
first, last = lines[0], lines[-1]
if not is_actionable(first) or not describes_outcome(last):
raise ValueError("Pre‑send check failed – adjust wording.")
return "\n".join(lines)
def is_actionable(line: str) -> bool:
# Simple heuristic: contains a command or code snippet
return bool(re.search(r"`\w+`|run |open |edit ", line.lower()))
def describes_outcome(line: str) -> bool:
# Heuristic: mentions what just changed or succeeded
return "now works" in line.lower() or "updated" in line.lower()
Stage 3: Output Emission
The after state demonstrates the target format:
Run `npm test`.
Tests completed; now works.
First line: explicit action (Run npm test``). Last line: explicit outcome (Tests completed; now works). No intermediate processing is required by the reader.
Key Files in the Pre‑Send Check Architecture
| File | Purpose | Location |
|---|---|---|
skills/i-have-adhd/SKILL.md |
Canonical definition of the pre‑send check rules (lines 128‑139) | skills/i-have-adhd/SKILL.md |
.cursor/skills/i-have-adhd/SKILL.md |
Runtime mirror used by Cursor IDE integration | .cursor/skills/i-have-adhd/SKILL.md |
hooks/always-on.mjs |
Hook implementation that executes the check as a terminal pipeline stage | hooks/always-on.mjs |
The dual SKILL.md structure ensures consistency: the canonical file in skills/ serves as documentation and source of truth, while the .cursor/ copy enables IDE‑native skill loading without path manipulation.
Why First‑and‑Last Line Structure Matters for ADHD Users
Working memory limitations characterize ADHD information processing. Users benefit from self‑contained messages that do not require retaining context across conversational turns.
The pre‑send check enforces this by contract:
- First line = next action eliminates ambiguity about immediate priorities.
- Last line = what happened provides closure and confirms state change.
- Elimination of mid‑message noise prevents attention fragmentation.
This design pattern appears throughout neurodivergent‑accessible UX research, but i‑have‑adhd implements it as enforceable code rather than advisory guideline.
Summary
- The pre‑send check mechanism in i‑have‑adhd is a terminal sanitization hook defined in
SKILL.mdlines 128‑139. - It executes a six‑step transformation: strip announcements, sidebars, hedges, and idioms, then validate structural clarity.
- The operational flow requires first‑line actionability and last‑line outcome declaration; failure triggers iteration.
- Implementation spans three files: canonical
SKILL.md, Cursor mirror, andhooks/always-on.mjsruntime hook. - The mechanism serves ADHD‑specific cognitive needs by eliminating working‑memory load through self‑contained, edge‑weighted messaging.
Frequently Asked Questions
What happens if the pre‑send check fails validation?
The agent must revise the response and resubmit it to the check. The mechanism raises an explicit failure condition—illustrated in the pseudocode by ValueError("Pre‑send check failed – adjust wording.")—that prevents emission until both first‑line actionability and last‑line outcome clarity are satisfied. As implemented in hooks/always-on.mjs, this creates a blocking loop within the terminal hook stage.
Why remove "anything else?" if it seems polite?
Polite closings impose cognitive overhead on users with limited working memory by introducing unresolved decision branches. The i‑have‑adhd skill prioritizes closure over conversational convention. The last line must state what occurred, not solicit additional interaction. Users who need more help can always re‑engage; the check prevents forcing that assessment mid‑flow.
Can the pre‑send check be disabled or customized?
The canonical SKILL.md defines the check as non‑optional for ADHD‑friendly output. However, the hook architecture in hooks/always-on.mjs permits runtime modification. Developers could fork the skill, adjust the heuristic functions in the validation stage, or bypass the hook entirely—though this would forfeit the working‑memory optimizations the mechanism provides.
How does "literal phrasing" differ from plain language?
Literal phrasing specifically targets figurative idioms that require abstraction to interpret. "Circle back" demands mental translation to "return to this later"; the pre‑send check executes that translation automatically. Plain language is broader, addressing vocabulary complexity and sentence length. The i‑have‑adhd skill applies both: it enforces literalness for idioms and concision for all phrasing, as codified in the transformation pipeline.
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 →