# Pi vs OMP Extensions in package.json: Understanding the Runtime Configuration Distinction

> Understand the pi vs omp extensions in package.json. Learn how pi loads ADHD friendly commands and omp offers a lightweight entry point for your project.

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

---

**The `pi` and `omp` extensions in the i-have-adhd [`package.json`](https://github.com/ayghri/i-have-adhd/blob/main/package.json) both load the same TypeScript file, but the `pi` configuration additionally declares a `skills` directory that auto-loads ADHD-friendly commands, while `omp` provides a lightweight extension-only entry point.**

The `ayghri/i-have-adhd` repository uses a dual-runtime configuration strategy defined in [`package.json`](https://github.com/ayghri/i-have-adhd/blob/main/package.json) to support two distinct execution environments. Understanding the distinction between the **`pi`** and **`omp`** extension configurations is essential for developers integrating ADHD-friendly coding assistance into different agent frameworks.

## Configuration Structure in package.json

In [`package.json`](https://github.com/ayghri/i-have-adhd/blob/main/package.json) lines 9-15, two top-level configuration objects define how different runtimes load the extension code. Both configurations point to the same implementation file but differ in their resource loading behavior.

```json
{
  "omp": {
    "extensions": ["./extensions/i-have-adhd.ts"]
  },
  "pi": {
    "extensions": ["./extensions/i-have-adhd.ts"],
    "skills": ["./skills"]
  }
}

```

The **`pi`** object includes both an `extensions` array and a `skills` array, while the **`omp`** object contains only the `extensions` declaration. This structural difference determines whether the runtime automatically discovers and registers skill definitions alongside the core extension logic.

## Pi Runtime Extension Handling

The **Pi coding-agent runtime** processes the `pi` configuration to load both extension logic and skill resources. When this runtime initializes, it executes two distinct loading operations:

- **Extension loading**: Imports [`./extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/./extensions/i-have-adhd.ts) to register the core ADHD-friendly functionality
- **Skill discovery**: Scans the `./skills` directory to auto-load canonical skill definitions, including [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) files that expose commands such as `/i-have-adhd`

This dual-loading approach enables Pi-based agents to immediately recognize and execute high-level commands without manual skill registration. The runtime automatically bridges the extension implementation with the conversational command interface defined in the skill documentation.

## OMP Runtime Extension Handling

The **OMP (Open-Code) runtime** processes the `omp` configuration as a lightweight entry point that loads only the extension implementation. This runtime performs a single loading operation:

- **Extension loading**: Imports [`./extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/./extensions/i-have-adhd.ts) (lines 13-40) to register session event handlers and extension logic

Because the `omp` configuration omits the `skills` field, the OMP runtime does not auto-discover or register skill files. Developers must manually invoke extension methods through the runtime's API rather than using natural language commands. This design provides a minimal footprint for environments where explicit programmatic control is preferred over conversational agent interfaces.

## Technical Implementation Details

The shared extension implementation resides in [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts), which both runtimes import during initialization. This TypeScript file registers the `i-have-adhd` command and handles session events according to the logic defined between lines 13-40.

The distinction emerges at the runtime adapter level:

- **Pi adapter**: Reads the `skills` array from [`package.json`](https://github.com/ayghri/i-have-adhd/blob/main/package.json) and loads [`./skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/./skills/i-have-adhd/SKILL.md) to create the mapping between natural language commands and extension functions
- **OMP adapter**: Ignores skill directories and exposes the extension through direct method calls, requiring developers to use `callExtension("i-have-adhd", "on")` rather than conversational syntax

## Practical Integration Examples

### Using the Pi Runtime with Auto-Loaded Skills

When integrating with the Pi coding-agent runtime, the skill directory loads automatically, enabling conversational command syntax:

```typescript
import { PiAgent } from "@earendil-works/pi-coding-agent";

const pi = new PiAgent({
  // Pi reads the "pi" section of package.json automatically
});

await pi.runCommand("/i-have-adhd on");   // Enables ADHD mode via skill interface

```

### Using the OMP Runtime with Manual Invocation

When integrating with the Open-Code runtime, you interact directly with the extension API:

```typescript
import { OpenCodeAgent } from "@earendil-works/open-code";

const omp = new OpenCodeAgent({
  // OMP reads the "omp" section of package.json
});

await omp.callExtension("i-have-adhd", "on"); // Direct extension method call

```

Both approaches execute the same underlying logic from [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts), but the Pi runtime provides the additional abstraction layer of skill-based natural language interaction.

## Summary

- **Both configurations** reference [`./extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/./extensions/i-have-adhd.ts) as the shared implementation source
- **Pi extensions** include a `skills` field that auto-loads `./skills` directory contents, enabling conversational command interfaces like `/i-have-adhd`
- **OMP extensions** load only the TypeScript implementation, requiring manual API invocation via `callExtension`
- **File-specific behavior** is defined in [`package.json`](https://github.com/ayghri/i-have-adhd/blob/main/package.json) lines 9-15, while the extension logic lives in [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts) lines 13-40
- **Runtime selection** determines whether the ADHD-friendly functionality is accessed through natural language commands or programmatic method calls

## Frequently Asked Questions

### Do both runtimes use the same extension implementation?

Yes, both the Pi and OMP runtimes import identical code from [`./extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/./extensions/i-have-adhd.ts). The runtime distinction affects how that code is exposed to the user, not the underlying implementation logic.

### Why does the Pi configuration require a skills directory?

The `skills` field in the Pi configuration enables the runtime to auto-discover and register skill definitions, specifically [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) files. This allows Pi-based agents to recognize natural language commands like `/i-have-adhd` without explicit programmatic mapping.

### How do I access ADHD mode functionality in the OMP runtime?

Invoke the extension directly through the Open-Code agent's API using `await omp.callExtension("i-have-adhd", "on")`. Unlike the Pi runtime, there are no auto-loaded conversational commands, so you must call methods explicitly.

### Where are the skill definitions located when using the Pi extension?

When the Pi runtime processes the `pi` configuration, it loads skill definitions from the `./skills` directory, particularly [`./skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/./skills/i-have-adhd/SKILL.md). This file contains the canonical skill definition that maps conversational inputs to extension functionality.