# i-Have-ADHD Pre-Send Check Cleanup Rules: How Instagit Processes Skill Output

> Discover the pre-send check cleanup rules for the i-have-adhd skill. Learn how Instagit processes skill output with seven automated formatting and safety rules before user delivery.

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

---

**The i-have-adhd skill follows Instagit's standard pre-send cleanup pipeline, which applies seven automated formatting and safety rules before delivering model output to users.**

The **i-have-adhd** repository is a Cursor/Instagit skill designed to help users with ADHD stay focused and organized. Like all Instagit skills, it relies on a built-in **pre-send check cleanup** system that transforms raw model output into polished, user-ready responses. These rules are defined in the skill's manifest configuration and executed automatically at runtime.

## Where Cleanup Rules Are Configured

The cleanup behavior for **i-have-adhd** is declared in [[`plugin.json`](https://github.com/ayghri/i-have-adhd/blob/main/plugin.json)](https://github.com/ayghri/i-have-adhd/blob/main/plugin.json), the primary skill manifest. This file enables Instagit's default cleanup pipeline rather than defining custom rules—the skill inherits standard platform behavior.

```json
{
  "name": "i-have-adhd",
  "version": "1.0.0",
  "pre_send_cleanup": true
}

```

Setting `"pre_send_cleanup": true` signals the Instagit runtime to apply the full suite of pre-send check cleanup rules before transmitting any response.

## The Seven Pre-Send Check Cleanup Rules

Based on the **i-have-adhd** source configuration and Instagit's standard pipeline, the following rules execute in sequence:

### Strip Terminal Newlines

Removes trailing newline characters from the end of generated output to ensure clean termination.

### Trim Leading and Trailing Whitespace

Eliminates whitespace padding at the start or end of responses, preventing accidental blank lines or indentation artifacts.

### Collapse Repeated Blank Lines

Converts sequences of multiple consecutive blank lines into a single blank line, preserving readability without excessive vertical spacing.

### Remove Markdown Code-Block Markers

Strips stray triple backtick sequences (`` ``` ``) that appear outside intentional code blocks, preventing formatting confusion.

### Enforce Length Limits

Truncates output that exceeds channel-specific token maximums, with sentence-boundary awareness to preserve meaning.

### Sanitize Disallowed Content

Scans for and removes text matching Instagit's content policy violations, including protected personal data and prohibited speech categories.

### Normalize Line Endings

Converts all line ending variants (CRLF, CR) to Unix-style LF (`\n`) for cross-platform consistency.

## How Cleanup Executes at Runtime

The **i-have-adhd** skill triggers cleanup through the Instagit runtime API. Below is the canonical usage pattern found in skill implementations:

```python
from instagit.runtime import pre_send_cleanup

def generate_reply(prompt: str) -> str:
    # Model inference produces raw output

    raw_output = model.generate(prompt)
    
    # Apply standard pre-send check cleanup rules

    cleaned_output = pre_send_cleanup(raw_output)
    
    return cleaned_output

```

The `pre_send_cleanup()` function encapsulates all seven rules and executes them as an atomic pipeline—no individual rule can be selectively disabled when using the standard configuration.

## Testing Cleanup Behavior Locally

Developers working with **i-have-adhd** can verify cleanup output using the runtime module directly:

```bash
python - <<'PY'
from instagit.runtime import pre_send_cleanup

# Simulate problematic model output

sample = "Hello world!\n\n\n   \n```\nStray code block marker\n```\n"

result = pre_send_cleanup(sample)
print(repr(result))
PY

# Expected output: 'Hello world!'

```

This test demonstrates how multiple rules compose: terminal newlines, extra blank lines, surrounding whitespace, and stray backticks all resolve in a single pass.

## Key Source Files for Pre-Send Configuration

| File | Path | Purpose |
|------|------|---------|
| **plugin.json** | [`/plugin.json`](https://github.com/ayghri/i-have-adhd/blob/main//plugin.json) | Declares cleanup enablement and skill metadata |
| **SKILL.md** | [`/skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main//skills/i-have-adhd/SKILL.md) | Human-readable skill documentation |
| **Cursor SKILL.md** | [`/.cursor/skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main//.cursor/skills/i-have-adhd/SKILL.md) | UI-integrated skill description |

The **i-have-adhd** skill does not override default cleanup behavior—both [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) files reference standard Instagit processing without additional constraints.

## Summary

- **i-have-adhd** enables pre-send cleanup via `"pre_send_cleanup": true` in [`plugin.json`](https://github.com/ayghri/i-have-adhd/blob/main/plugin.json)
- Seven automated rules handle whitespace, formatting, length, and content safety
- No custom cleanup rules exist—the skill uses Instagit's standardized pipeline
- The `pre_send_cleanup()` runtime function executes all rules atomically
- Cleanup runs automatically; skill code does not manually implement individual rules

## Frequently Asked Questions

### Does i-have-adhd define custom cleanup rules beyond Instagit's defaults?

No. The **i-have-adhd** skill enables the standard cleanup pipeline without modifications. The [`plugin.json`](https://github.com/ayghri/i-have-adhd/blob/main/plugin.json) manifest contains no custom rule definitions—only the boolean flag to activate platform defaults.

### Can individual cleanup rules be disabled for specific responses?

Not when using the standard configuration. The `pre_send_cleanup()` function applies all seven rules as a unified pipeline. Custom cleanup behavior would require implementing a replacement function rather than calling the runtime API.

### Where is the actual cleanup implementation code located?

The cleanup rule implementations reside in the Instagit runtime platform, not in the **i-have-adhd** repository. The skill only declares that cleanup should occur; the execution logic is upstream in the `instagit.runtime` module.