# I-Have-ADHD Skill Pre-Send Check Process: How Response Validation Works

> Understand the I-Have-ADHD skill's pre-send check process. Learn how response validation ensures ADHD-friendly outputs and prevents non-compliant responses before they are sent.

- Repository: [Ayoub Ghriss/i-have-adhd](https://github.com/ayghri/i-have-adhd)
- Tags: how-to-guide
- Published: 2026-08-27

---

**The I-Have-ADHD skill performs a mandatory pre-send validation step before every response is emitted, running a chain of validators that enforce ADHD-friendly guidelines and abort non-compliant outputs for regeneration.**

The **I-Have-ADHD skill** is an open-source project by `ayghri/i-have-adhd` designed to generate responses optimized for users with ADHD. Central to its operation is a rigorous **pre-send check process** that acts as a gatekeeper, ensuring every output follows ten core communication rules before reaching the user. This article explains how that validation pipeline works, where it's implemented, and how it integrates with multiple model runtimes.

## How the Pre-Send Check Process Works

The pre-send check is triggered by a **skill-level hook** defined in [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md). This hook executes immediately before the final payload is handed to the underlying runtime—whether Open-Code, Claude, Codex, Pi, OMP, or another supported platform.

The process follows five distinct stages:

1. **Hook invocation** – The runtime calls the pre-send hook automatically.
2. **Validator execution** – A sequence of predicates inspects the generated text.
3. **Failure detection** – Any failed validator triggers a regeneration loop.
4. **Platform-specific safety checks** – Runtime adapters verify contextual markers.
5. **Response delivery** – All checks must pass before the user receives the output.

## Core Validators in the Pre-Send Pipeline

Each validator enforces a specific rule from the skill's ten **ADHD-friendly guidelines**. According to [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md), these validators include:

- **Sentence length limits** – Caps response length for readability
- **Bullet and list prohibition** – Prevents numbered or bulleted formatting
- **Simple language enforcement** – Restricts vocabulary complexity
- **Topic boundary guards** – Blocks unrelated or triggering content
- **Token budget compliance** – Enforces configurable maximum token counts
- **Profanity and disallowed word filtering** – Maintains safe, appropriate tone

These validators are declared in [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) as a YAML list:

```yaml

# In skills/i-have-adhd/SKILL.md (excerpt)

pre-send:
  - validate-length
  - no-bullets
  - simple-language
  - profanity-filter
  - token-budget

```

## Validator Implementation Details

The core validator functions live in [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts). For example, the length validator is a simple predicate:

```ts
// In extensions/i-have-adhd.ts
export function validateLength(text: string, maxChars = 200): boolean {
  return text.length <= maxChars;
}

```

The orchestration layer in [`extensions/context-compat.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/context-compat.ts) chains these validators together:

```ts
// In extensions/context-compat.ts (simplified)
export async function runPreSendChecks(response: string): Promise<string> {
  const checks = [
    validateLength,
    noBullets,
    simpleLanguage,
    profanityFilter,
    tokenBudget,
  ];

  for (const check of checks) {
    if (!check(response)) {
      // Trigger a regeneration loop in the host runtime
      throw new Error('Pre-send validation failed');
    }
  }

  return response; // All checks passed
}

```

When any check returns **false**, the function throws, signaling the runtime to regenerate a compliant response. This loop continues until all validators pass.

## Platform-Specific Safety Checks

Beyond the skill-defined validators, **runtime adapters** inject additional checks. These are implemented in [`scripts/check_context_compat.ts`](https://github.com/ayghri/i-have-adhd/blob/main/scripts/check_context_compat.ts) and TypeScript helpers under `extensions/`.

One critical check verifies **marker ordering** for specific platforms:

```ts
// In scripts/check_context_compat.ts
if (!orderedMarkers(response, 'OMP')) {
  throw new Error('OMP marker ordering was not preserved');
}

```

This ensures that contextual markers required by OMP (and similarly for Pi) appear in the correct sequence before transmission. These platform-specific guards prevent runtime errors and preserve response structure across different model providers.

## Integration with Model Runtimes

The pre-send hook is automatically invoked by the runtime before final payload delivery. In [`agents/openai.yaml`](https://github.com/ayghri/i-have-adhd/blob/main/agents/openai.yaml), the skill is wired into the OpenAI provider with the pre-send stage as part of the execution contract:

- **Open-Code**: Native hook support
- **Claude / Codex**: Adapter-mediated invocation
- **Pi / OMP**: Marker-ordering verification added

The [`plugin.json`](https://github.com/ayghri/i-have-adhd/blob/main/plugin.json) file declares the plugin entry point and formally includes the pre-send stage in the overall plugin contract, ensuring consistent behavior across all supported runtimes.

## Key Files in the Pre-Send Architecture

| File | Role |
|------|------|
| [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) | Defines pre-send validators and ADHD-friendly response rules |
| [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts) | Implements core validator functions |
| [`extensions/context-compat.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/context-compat.ts) | Orchestrates pre-send check execution |
| [`scripts/check_context_compat.ts`](https://github.com/ayghri/i-have-adhd/blob/main/scripts/check_context_compat.ts) | Runtime-specific checks (OMP/Pi marker ordering) |
| [`agents/openai.yaml`](https://github.com/ayghri/i-have-adhd/blob/main/agents/openai.yaml) | Runtime integration configuration |
| [`plugin.json`](https://github.com/ayghri/i-have-adhd/blob/main/plugin.json) | Plugin contract and entry point declaration |

## Summary

- The **I-Have-ADHD skill pre-send check process** is a mandatory validation pipeline that runs before every response is emitted.
- **Ten core validators** enforce ADHD-friendly guidelines including length limits, simple language, and prohibited formatting.
- **Failed checks trigger regeneration loops** until compliant output is produced.
- **Platform-specific adapters** add runtime safety checks like marker ordering verification.
- All logic is centralized 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 [`context-compat.ts`](https://github.com/ayghri/i-have-adhd/blob/main/context-compat.ts) with additional runtime glue in [`scripts/check_context_compat.ts`](https://github.com/ayghri/i-have-adhd/blob/main/scripts/check_context_compat.ts).

## Frequently Asked Questions

### What happens if a response fails the pre-send check?

The skill throws a validation error that signals the host runtime to **regenerate** the response. This loop continues until all validators pass—there is no partial or non-compliant output delivered to users.

### Where are the validator rules defined?

The validator **names and sequence** are declared in [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) under the `pre-send` key. The **implementation** of each validator function resides in [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts).

### Does the pre-send check work across all AI platforms?

Yes. The skill uses **runtime adapters** that invoke the pre-send hook uniformly across Open-Code, Claude, Codex, Pi, OMP, and other platforms. Platform-specific safety checks (like marker ordering) are added only where required by the target runtime.

### How is the pre-send hook triggered automatically?

The hook is declared in [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) and registered through [`plugin.json`](https://github.com/ayghri/i-have-adhd/blob/main/plugin.json). Each model runtime parses this contract and invokes the pre-send stage at the appropriate point in its execution pipeline, as shown in [`agents/openai.yaml`](https://github.com/ayghri/i-have-adhd/blob/main/agents/openai.yaml) for the OpenAI provider.