# How i-have-adhd IO Rules Interact with Agent Harness System Prompts

> Discover how i-have-adhd IO rules interact with agent harness system prompts. Learn how harness directives outrank IO rules while preserving ADHD-friendly patterns.

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

---

**When the i-have-adhd skill operates inside an agent harness, the harness's system prompt outranks the skill's IO rules according to Rule 6, requiring the model to obey harness directives while maintaining ADHD-friendly structural patterns where possible.**

The ayghri/i-have-adhd repository provides a specialized skill that enforces ADHD-friendly output formatting through ten strict IO rules. When integrated into agent harnesses like Claude Code, Codex, or OpenCode, these rules collide with the harness's own agent harness system prompts, creating a specific hierarchy of control that determines which instructions take precedence during execution.

## The Control Hierarchy: Layers of Prompt Authority

The interaction between the skill and the runtime environment operates across three distinct layers. Understanding this stack is critical for predicting behavior when conflicts arise.

**Skill rules** define the ADHD-friendly output style and are stored in [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md). These rules govern formatting, action prioritization, and time estimation presentation.

**Harness system prompt** supplies the runtime's own constraints through mechanisms like OpenCode's `experimental.chat.system.transform` hook or Claude Code's session initialization. These prompts can impose content restrictions, formatting bans, or tool-use protocols.

**Always-on flag** triggers the injection mechanism. When the flag file exists at `~/.config/opencode/.i-have-adhd-always`, the plugin appends the full ruleset to the system prompt on every turn.

When conflicts occur between these layers, **the system prompt outranks the skill**. This hierarchy is explicitly codified in Rule 6 of the skill definition.

## Rule 6: The Arbitration Mechanism

Rule 6 is the only rule in the skill file that explicitly addresses agent harness integration. Located at lines 126-127 in [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md), it states:

> "Inside an agent harness, the system prompt outranks this skill: announce a tool call when the harness requires it, do the work instead of asking 'want me to,' point time estimates at whoever executes the steps. Same principle as 5: the constraint wins, the shape stays."

This rule establishes that when a harness system prompt issues a directive—such as requiring immediate tool call announcements without conversational wrappers—the model must comply with the harness instruction even if it violates other skill preferences. The skill maintains its structural integrity ("the shape stays") only where it does not conflict with the harness's requirements ("the constraint wins").

## How the Always-On Mechanism Injects Rules

The skill uses different injection strategies depending on the agent harness, but both ultimately embed the rules into the system prompt where they remain subject to override.

### Claude Code and Codex Implementation

For Claude Code and Codex environments, the `hooks/always-on.mjs` script executes at session start. It reads [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md), strips the YAML frontmatter, and writes the processed ruleset to stdout, allowing the harness to prepend it to the system prompt:

```javascript
// hooks/always-on.mjs conceptual flow
const skillContent = readFileSync('skills/i-have-adhd/SKILL.md', 'utf8');
const rulesOnly = skillContent.replace(/^---[\s\S]*?---/, '');
console.log(rulesOnly); // Injected into system prompt

```

### OpenCode Implementation

The OpenCode plugin at `.opencode/plugins/i-have-adhd.mjs` implements the `experimental.chat.system.transform` hook. When the flag file exists, it appends the ruleset to the current system prompt on every turn:

```javascript
// .opencode/plugins/i-have-adhd.mjs
if (existsSync(join(homedir(), '.config/opencode/.i-have-adhd-always'))) {
  const skill = readFileSync('./SKILL.md', 'utf8');
  const content = skill.replace(/^---[\s\S]*?---/, '');
  // Appended to system prompt via experimental.chat.system.transform
}

```

In both implementations, the rules become part of the system prompt, but any subsequent system prompt updates from the harness can replace or supersede them, consistent with Rule 6's hierarchy.

## Practical Consequences of System Prompt Overrides

When running inside an agent harness with conflicting directives, the model must resolve conflicts in favor of the harness. Here are specific scenarios:

**Content Restrictions:** If the harness system prompt includes "Never mention the word 'ADHD'," that directive overrides the skill's identity-based phrasing, even if the skill would normally reference ADHD in its output style.

**Formatting Bans:** A harness directive stating "NEVER USE MARKDOWN IN YOUR REPLIES" takes precedence over the skill's rule to use numbered lists. The model must output plain text lists rather than markdown formatting.

**Tool Call Protocols:** When the harness requires direct tool invocation with "When you need to search the web, call the tool directly without asking first," the model must immediately emit:

```json
{
  "tool_calls": [
    {
      "name": "websearch",
      "arguments": {"query": "latest OpenAI SDK"}
    }
  ]
}

```

Instead of wrapping the call in a conversational suggestion like "Would you like me to search for that?"

## Enabling and Disabling the Integration

To activate the always-on mode where rules are injected into the agent harness system prompt:

```bash

# Create the flag file for OpenCode

touch ~/.config/opencode/.i-have-adhd-always

```

To disable the integration:

```bash

# Remove the flag to stop automatic injection

rm ~/.config/opencode/.i-have-adhd-always

```

Alternatively, you can issue the command "stop adhd mode" during a session to disable the skill temporarily according to the Persistence rule.

## Summary

- **Agent harness system prompts** outrank i-have-adhd skill rules according to Rule 6 at lines 126-127 of [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md).
- Rule 6 mandates that constraints from the harness win, while the skill's structural shape persists only where non-conflicting.
- The **always-on mechanism** injects rules via `hooks/always-on.mjs` (Claude Code/Codex) or `.opencode/plugins/i-have-adhd.mjs` (OpenCode).
- When enabled, the ruleset is appended to the system prompt on every turn, but subsequent harness updates can override these rules.
- **Tool calls** must be announced immediately when required by the harness, not wrapped in conversational suggestions.
- Users control activation via the flag file at `~/.config/opencode/.i-have-adhd-always`.

## Frequently Asked Questions

### What happens when a harness system prompt contradicts the i-have-adhd rules?

The harness system prompt takes precedence. According to Rule 6, when a conflict exists between the skill's style requirements and the harness's constraints, the model must obey the harness directive. For example, if the harness bans markdown but the skill requests numbered lists, the model outputs plain text lists or follows the specific format required by the harness.

### How do I enable always-on mode in OpenCode?

Create the flag file at `~/.config/opencode/.i-have-adhd-always`. The OpenCode plugin checks for this file's existence and uses the `experimental.chat.system.transform` hook to append the skill rules to the system prompt on every turn. Remove the file to disable automatic injection.

### Why does Rule 6 specifically mention agent harnesses?

Rule 6 addresses agent harnesses because these environments inject their own system prompts that may include tool-use protocols, content policies, or formatting requirements incompatible with the skill's default ADHD-friendly style. Lines 126-127 of [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) explicitly acknowledge that the harness's runtime instructions outrank the skill's static rules to ensure compliance with the execution environment's operational requirements.

### Can the skill override a harness directive to use markdown?

No. If the agent harness system prompt explicitly forbids markdown, the skill cannot override this restriction. Rule 6 establishes that "the constraint wins," meaning the model must produce plain text output even when the skill's other rules suggest markdown formatting. The skill maintains its structural approach (clear steps, time estimates) but adapts the syntax to comply with the harness directive.