Pi vs OMP Extensions in package.json: Understanding the Runtime Configuration Distinction
The pi and omp extensions in the i-have-adhd 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 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 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.
{
"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.tsto register the core ADHD-friendly functionality - Skill discovery: Scans the
./skillsdirectory to auto-load canonical skill definitions, includingSKILL.mdfiles 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(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, 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
skillsarray frompackage.jsonand loads./skills/i-have-adhd/SKILL.mdto 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:
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:
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, but the Pi runtime provides the additional abstraction layer of skill-based natural language interaction.
Summary
- Both configurations reference
./extensions/i-have-adhd.tsas the shared implementation source - Pi extensions include a
skillsfield that auto-loads./skillsdirectory 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.jsonlines 9-15, while the extension logic lives inextensions/i-have-adhd.tslines 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. 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 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. This file contains the canonical skill definition that maps conversational inputs to extension functionality.
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 →