Skip to content

feat: add oh-my-pi (OMP) support#1069

Open
tsubus wants to merge 1 commit intoFission-AI:mainfrom
tsubus:omp-support
Open

feat: add oh-my-pi (OMP) support#1069
tsubus wants to merge 1 commit intoFission-AI:mainfrom
tsubus:omp-support

Conversation

@tsubus
Copy link
Copy Markdown

@tsubus tsubus commented May 7, 2026

Add ToolCommandAdapter for oh-my-pi terminal AI coding agent. Commands generate to .omp/commands/opsx-.md with description frontmatter and hyphen-based command references.
Skills generate to .omp/skills/ via transformToHyphenCommands.

  • New adapter: src/core/command-generation/adapters/oh-my-pi.ts
  • Register in CommandAdapterRegistry and index
  • Add to AI_TOOLS with skillsDir: '.omp'
  • Add to hyphen command transformer whitelist in init.ts and update.ts
  • Full test coverage following OMP patterns

takes care of: #713

Summary by CodeRabbit

  • New Features

    • Added Oh My Pi as a supported tool with tailored command generation, Markdown output, and dedicated skill directory handling.
  • Improvements

    • Tool-picker now sorts entries case-insensitively for more predictable ordering.
    • Command-reference transformation updated to include Oh My Pi for consistent formatting.
  • Tests

    • Added tests validating Oh My Pi command generation, file formatting, and reference conversions.

@tsubus tsubus requested a review from TabishB as a code owner May 7, 2026 17:07
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds support for oh-my-pi as a new tool in the command-generation system. It defines an adapter that maps commands to .omp/commands/opsx-<id>.md markdown files with YAML frontmatter, registers it in the adapter registry and configuration, applies hyphen-based command reference transformation during skill generation, and includes tests.

Changes

Add oh-my-pi Tool Support

Layer / File(s) Summary
Configuration & Tool Definition
src/core/config.ts
AI_TOOLS adds oh-my-pi entry with value, successLabel, and skillsDir (.omp).
Adapter Implementation
src/core/command-generation/adapters/oh-my-pi.ts
ohMyPiAdapter implements ToolCommandAdapter with toolId oh-my-pi, getFilePath mapping to .omp/commands/opsx-<commandId>.md, and formatFile wrapping content with YAML frontmatter and hyphen command transformation.
Adapter Export & Registry
src/core/command-generation/adapters/index.ts, src/core/command-generation/registry.ts
ohMyPiAdapter is re-exported from adapters index and registered in CommandAdapterRegistry static initializer.
Command Transformer Application
src/core/init.ts, src/core/update.ts
InitCommand and UpdateCommand now apply transformToHyphenCommands for oh-my-pi alongside opencode and pi. Interactive tool selection sorting uses locale-aware alphabetical comparison instead of default tie-breaking.
Testing & Validation
test/core/command-generation/adapters.test.ts
ohMyPiAdapter test suite validates toolId, file path generation, YAML frontmatter, colon-to-hyphen command reference transformation (single and multiple occurrences), and cross-platform path handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Fission-AI/OpenSpec#853: Adds a new ToolCommandAdapter with adapter file, re-export, registry registration, AI_TOOLS update, and tests (pattern similar to this PR).
  • Fission-AI/OpenSpec#886: Adds a tool adapter following the same adapter/index/registry/tests pattern and hyphenized command references.
  • Fission-AI/OpenSpec#864: Introduces another tool adapter and updates adapters index, registry, and AI_TOOLS in the same code areas.

Suggested reviewers

  • TabishB
  • alfred-openspec

Poem

🐰 I hopped through code to add a new tool,
Oh‑my‑pi now follows the hyphen rule.
From colon to dash the commands transform,
Markdown and frontmatter neatly perform.
Hooray — new adapter, cozy and cool!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add oh-my-pi (OMP) support' clearly and concisely summarizes the main change: introducing Oh My Pi support to the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/core/update.ts (1)

200-200: ⚡ Quick win

Consider centralizing the hyphen-transformer tool list instead of repeating it in three places.

The condition tool.value === 'opencode' || tool.value === 'pi' || tool.value === 'oh-my-pi' now appears verbatim in three locations:

  • src/core/init.ts line 541
  • src/core/update.ts line 200 (here)
  • src/core/update.ts line 694

Every time a new tool requires the hyphen transformer, all three files must be updated in sync. A field on AIToolOption (e.g. useHyphenTransformer?: boolean) would make config.ts the single source of truth.

♻️ Suggested refactor sketch

In src/core/config.ts, extend the interface and tag the affected tools:

 export interface AIToolOption {
   name: string;
   value: string;
   available: boolean;
   successLabel?: string;
   skillsDir?: string;
   detectionPaths?: string[];
+  useHyphenTransformer?: boolean; // skill files use /opsx-<cmd> references
 }

-  { name: 'oh-my-pi', value: 'oh-my-pi', available: true, successLabel: 'oh-my-pi', skillsDir: '.omp' },
+  { name: 'oh-my-pi', value: 'oh-my-pi', available: true, successLabel: 'oh-my-pi', skillsDir: '.omp', useHyphenTransformer: true },
-  { name: 'OpenCode', value: 'opencode', ...},
+  { name: 'OpenCode', value: 'opencode', ..., useHyphenTransformer: true },
-  { name: 'Pi', value: 'pi', ...},
+  { name: 'Pi', value: 'pi', ..., useHyphenTransformer: true },

Then in all three call sites:

-const transformer = (tool.value === 'opencode' || tool.value === 'pi' || tool.value === 'oh-my-pi') ? transformToHyphenCommands : undefined;
+const transformer = tool.useHyphenTransformer ? transformToHyphenCommands : undefined;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/update.ts` at line 200, Centralize the hyphen-transformer flag by
adding a boolean field (e.g. useHyphenTransformer?: boolean) to the AIToolOption
type in src/core/config.ts and mark the affected tool entries (opencode, pi,
oh-my-pi); then replace the repeated literal checks in the transformer
assignment sites (the transformer variable in update.ts, the call site in
init.ts, and the other occurrence in update.ts) to read
tool.useHyphenTransformer and set transformer = tool.useHyphenTransformer ?
transformToHyphenCommands : undefined so the transformer decision comes from the
config single source of truth.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/core/update.ts`:
- Line 200: Centralize the hyphen-transformer flag by adding a boolean field
(e.g. useHyphenTransformer?: boolean) to the AIToolOption type in
src/core/config.ts and mark the affected tool entries (opencode, pi, oh-my-pi);
then replace the repeated literal checks in the transformer assignment sites
(the transformer variable in update.ts, the call site in init.ts, and the other
occurrence in update.ts) to read tool.useHyphenTransformer and set transformer =
tool.useHyphenTransformer ? transformToHyphenCommands : undefined so the
transformer decision comes from the config single source of truth.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 051aa0c1-3309-4dc9-810c-8532113d829e

📥 Commits

Reviewing files that changed from the base of the PR and between 053d8a5 and 61dcbf1.

📒 Files selected for processing (7)
  • src/core/command-generation/adapters/index.ts
  • src/core/command-generation/adapters/oh-my-pi.ts
  • src/core/command-generation/registry.ts
  • src/core/config.ts
  • src/core/init.ts
  • src/core/update.ts
  • test/core/command-generation/adapters.test.ts

Add ToolCommandAdapter for Oh My Pi terminal AI coding agent.
Commands generate to .omp/commands/opsx-<id>.md with description
frontmatter and hyphen-based command references.
Skills generate to .omp/skills/ via transformToHyphenCommands.

- New adapter: src/core/command-generation/adapters/oh-my-pi.ts
- Register in CommandAdapterRegistry and index
- Add to AI_TOOLS with skillsDir: '.omp'
- Add to hyphen command transformer whitelist in init.ts and update.ts
- Full test coverage following OMP patterns
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/core/init.ts (1)

541-542: ⚡ Quick win

Centralize the hyphen-command whitelist in the tool config rather than inline string comparisons.

The same tool.value === 'opencode' || tool.value === 'pi' || tool.value === 'oh-my-pi' guard now lives in both init.ts and update.ts. Every future tool that needs hyphen-based command references requires two manual edits in separate files — easy to miss and already a DRY violation after just one PR.

A better approach: add a useHyphenCommands (or similar) boolean to AIToolOption / AI_TOOLS, then derive the transformer from the tool config itself. This makes the check self-contained and removes the scattered whitelist.

♻️ Proposed refactor

In config.ts (or wherever AIToolOption is defined), extend the type and set the flag for the relevant tools:

 type AIToolOption = {
   value: string;
   name: string;
   skillsDir?: string;
+  useHyphenCommands?: boolean;
 };

 // ...
 { value: 'opencode', name: 'OpenCode', skillsDir: '.opencode', useHyphenCommands: true },
 { value: 'pi',       name: 'Pi',       skillsDir: '.pi',       useHyphenCommands: true },
 { value: 'oh-my-pi', name: 'Oh My Pi', skillsDir: '.omp',      useHyphenCommands: true },

Then in init.ts (and update.ts) replace the inline condition:

-const transformer = (tool.value === 'opencode' || tool.value === 'pi' || tool.value === 'oh-my-pi')
-  ? transformToHyphenCommands
-  : undefined;
+const toolConfig = AI_TOOLS.find((t) => t.value === tool.value);
+const transformer = toolConfig?.useHyphenCommands ? transformToHyphenCommands : undefined;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/init.ts` around lines 541 - 542, Centralize the hyphen-command
whitelist by adding a boolean flag (e.g., useHyphenCommands) to the AIToolOption
type and set it on relevant entries in AI_TOOLS, then replace the inline checks
in init.ts and update.ts (the expressions comparing tool.value to
'opencode'|'pi'|'oh-my-pi') with a lookup of that flag on the tool object and
derive the transformer via transformToHyphenCommands when tool.useHyphenCommands
is true before calling generateSkillContent; update AIToolOption/AI_TOOLS, and
change the transformer assignment in the blocks that currently reference
tool.value to use tool.useHyphenCommands instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/core/init.ts`:
- Around line 541-542: Centralize the hyphen-command whitelist by adding a
boolean flag (e.g., useHyphenCommands) to the AIToolOption type and set it on
relevant entries in AI_TOOLS, then replace the inline checks in init.ts and
update.ts (the expressions comparing tool.value to 'opencode'|'pi'|'oh-my-pi')
with a lookup of that flag on the tool object and derive the transformer via
transformToHyphenCommands when tool.useHyphenCommands is true before calling
generateSkillContent; update AIToolOption/AI_TOOLS, and change the transformer
assignment in the blocks that currently reference tool.value to use
tool.useHyphenCommands instead.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dde55a09-31d4-4bed-89f9-76ee1c09797e

📥 Commits

Reviewing files that changed from the base of the PR and between 61dcbf1 and d6af318.

📒 Files selected for processing (7)
  • src/core/command-generation/adapters/index.ts
  • src/core/command-generation/adapters/oh-my-pi.ts
  • src/core/command-generation/registry.ts
  • src/core/config.ts
  • src/core/init.ts
  • src/core/update.ts
  • test/core/command-generation/adapters.test.ts
✅ Files skipped from review due to trivial changes (3)
  • src/core/command-generation/registry.ts
  • src/core/config.ts
  • src/core/command-generation/adapters/index.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/core/command-generation/adapters/oh-my-pi.ts
  • test/core/command-generation/adapters.test.ts
  • src/core/update.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant