Skip to content

feat: add Oh My Pi (omp) tool support - #1313

Closed
MattJColes wants to merge 2 commits into
Fission-AI:mainfrom
MattJColes:feat/add-oh-my-pi-tool
Closed

feat: add Oh My Pi (omp) tool support#1313
MattJColes wants to merge 2 commits into
Fission-AI:mainfrom
MattJColes:feat/add-oh-my-pi-tool

Conversation

@MattJColes

@MattJColes MattJColes commented Jul 6, 2026

Copy link
Copy Markdown

Summary

  • Adds Oh My Pi (omp, https://github.com/oh-my-pi/pi-coding-agent) as a supported tool. Oh My Pi is a distinct agent from the existing pi (pi.dev): it discovers Agent Skills from .omp/skills (invoked as /skill:<name>) and file-based slash commands from .omp/commands (invoked as /opsx-<name>).
  • Registers omp with skillsDir: '.omp' and adds an omp command adapter (mirrors the Pi adapter, writing .omp/commands/opsx-<id>.md), so it ships a full skills + slash-command integration like Claude/Codex/OpenCode. (Note: unlike the recent Mistral Vibe addition, which was skills-only, omp has a native slash-command surface, so a command adapter is included.)
  • Updates docs/supported-tools.md and adds tool-detection + adapter test coverage.

Validation

  • openspec init --tools omp writes 5 skills under .omp/skills/ and 5 command templates under .omp/commands/; verified in Oh My Pi they load as /skill:openspec-* and /opsx-* (confirmed via real invocation).
  • pnpm run build
  • pnpm test — 1815 passing
  • pnpm run lint — clean (0 errors)

Summary by CodeRabbit

  • New Features
    • Added support for the Oh My Pi tool (omp) in the available tool list and built-in command generation.
    • Generated slash-command markdown files follow the expected .omp/commands/opsx-<id>.md pattern, including proper command reference formatting and optional argument injection.
  • Documentation
    • Updated the supported tools guide and non-interactive setup “Available tool IDs” to include Oh My Pi.
  • Bug Fixes
    • Improved generated command output to reliably preserve formatting and include provided arguments in the input section when required.
  • Tests
    • Added coverage for detecting the omp tool and validating command generation behavior.

@MattJColes
MattJColes requested a review from TabishB as a code owner July 6, 2026 06:29
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b6fc4a05-ac0b-410d-bf6d-6023d4aa6a4e

📥 Commits

Reviewing files that changed from the base of the PR and between e5f4be4 and c98ed03.

📒 Files selected for processing (8)
  • .changeset/add-oh-my-pi-tool.md
  • docs/supported-tools.md
  • src/core/command-generation/adapters/index.ts
  • src/core/command-generation/adapters/omp.ts
  • src/core/command-generation/registry.ts
  • src/core/config.ts
  • test/core/available-tools.test.ts
  • test/core/command-generation/adapters.test.ts
✅ Files skipped from review due to trivial changes (3)
  • .changeset/add-oh-my-pi-tool.md
  • src/core/command-generation/registry.ts
  • docs/supported-tools.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/core/command-generation/adapters/index.ts
  • src/core/command-generation/adapters/omp.ts
  • test/core/available-tools.test.ts
  • src/core/config.ts
  • test/core/command-generation/adapters.test.ts

📝 Walkthrough

Walkthrough

This PR adds support for the Oh My Pi (omp) tool by registering it in configuration and the command adapter registry, implementing command-file formatting for .omp/commands, and updating tests, docs, and release metadata.

Changes

Oh My Pi tool integration

Layer / File(s) Summary
Tool registration and adapter wiring
src/core/config.ts, src/core/command-generation/adapters/index.ts, src/core/command-generation/registry.ts
Adds omp to AI_TOOLS, re-exports ompAdapter, and registers it in CommandAdapterRegistry.
Omp command adapter implementation
src/core/command-generation/adapters/omp.ts
Implements ompAdapter for .omp/commands/opsx-<id>.md, including YAML frontmatter formatting, /opsx: to /opsx- transformation, and conditional **Provided arguments**: $@ insertion.
Tests, docs, and release note
test/core/available-tools.test.ts, test/core/command-generation/adapters.test.ts, docs/supported-tools.md, .changeset/add-oh-my-pi-tool.md
Adds coverage for omp tool detection and adapter output, documents omp in supported tools, and adds a patch changeset entry.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • Fission-AI/OpenSpec#853: Adds a new tool adapter and wires it through config, registry, docs, and tests in the same command-generation area.
  • Fission-AI/OpenSpec#886: Extends the adapter registry with another tool-specific adapter and matching test coverage.
  • Fission-AI/OpenSpec#950: Shares the same adapter-side command transformation pattern for slash-command formatting.

Suggested reviewers: TabishB

🚥 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 clearly summarizes the main change: adding Oh My Pi (omp) tool support.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
test/core/command-generation/adapters.test.ts (1)

594-639: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding YAML-escaping coverage for ompAdapter.

piAdapter and bobAdapter test suites cover escapeYamlValue edge cases (special chars, newlines, empty description), but the new ompAdapter suite doesn't, despite using the same escapeYamlValue helper for its description field.

✅ Suggested additional test cases
     it('should inject template arguments into the input section', () => {
       const contentWithInput: CommandContent = {
         ...sampleContent,
         body: '**Input**: The argument after `/opsx:explore` is the topic.\n\n**Steps**\n1. Think.',
       };

       const output = ompAdapter.formatFile(contentWithInput);
       expect(output).toContain('**Provided arguments**: $@');
     });
+
+    it('should escape YAML special characters in description', () => {
+      const contentWithSpecialChars: CommandContent = {
+        ...sampleContent,
+        description: 'Fix: regression in "auth" feature',
+      };
+      const output = ompAdapter.formatFile(contentWithSpecialChars);
+      expect(output).toContain('description: "Fix: regression in \\"auth\\" feature"');
+    });
+
+    it('should escape newlines in description', () => {
+      const contentWithNewline: CommandContent = {
+        ...sampleContent,
+        description: 'Line 1\nLine 2',
+      };
+      const output = ompAdapter.formatFile(contentWithNewline);
+      expect(output).toContain('description: "Line 1\\nLine 2"');
+    });
   });
🤖 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 `@test/core/command-generation/adapters.test.ts` around lines 594 - 639, The
ompAdapter test suite is missing coverage for the shared escapeYamlValue
behavior used when writing the description frontmatter. Add a few focused
assertions in adapters.test.ts around ompAdapter.formatFile and/or
escapeYamlValue to cover special characters, multiline descriptions, and empty
descriptions, using ompAdapter and sampleContent so the new adapter matches the
existing piAdapter and bobAdapter YAML-escaping coverage.
🤖 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 `@test/core/command-generation/adapters.test.ts`:
- Around line 594-639: The ompAdapter test suite is missing coverage for the
shared escapeYamlValue behavior used when writing the description frontmatter.
Add a few focused assertions in adapters.test.ts around ompAdapter.formatFile
and/or escapeYamlValue to cover special characters, multiline descriptions, and
empty descriptions, using ompAdapter and sampleContent so the new adapter
matches the existing piAdapter and bobAdapter YAML-escaping coverage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 24e5c826-5312-446e-a1dd-8fb0a76df0f3

📥 Commits

Reviewing files that changed from the base of the PR and between 65a7233 and e5f4be4.

📒 Files selected for processing (8)
  • .changeset/add-oh-my-pi-tool.md
  • docs/supported-tools.md
  • src/core/command-generation/adapters/index.ts
  • src/core/command-generation/adapters/omp.ts
  • src/core/command-generation/registry.ts
  • src/core/config.ts
  • test/core/available-tools.test.ts
  • test/core/command-generation/adapters.test.ts

Oh My Pi (omp) is a distinct agent from the existing `pi` (pi.dev). It
discovers Agent Skills from `.omp/skills` (invoked as `/skill:<name>`) and
file-based slash commands from `.omp/commands` (invoked as `/opsx-<name>`).

Register `omp` with `skillsDir: '.omp'` plus an `omp` command adapter (mirrors
the Pi adapter, writing `.omp/commands/opsx-<id>.md`), so it ships a full
skills + slash-command integration. Adds docs, a tool-detection test, and
adapter coverage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MattJColes
MattJColes force-pushed the feat/add-oh-my-pi-tool branch from e5f4be4 to c98ed03 Compare July 6, 2026 06:35

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the OMP integration against OMP's actual discovery semantics. The and layouts match native OMP behavior, and the adapter/tests cover the important command reference, args, and YAML cases. Looks good to me.

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the OMP integration against OMP actual discovery semantics. The .omp/skills//SKILL.md and .omp/commands/opsx-.md layouts match native OMP behavior, and the adapter/tests cover the important command reference, args, and YAML cases. Looks good to me.

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed against OpenSpec command-generation patterns and the current Oh My Pi docs surface. The implementation matches the existing adapter strategy: project skills under .omp/skills, project slash commands under .omp/commands/opsx-.md, hyphen command references, and argument injection. I also verified the focused available-tools and command-adapter tests pass locally in a temp checkout. Looks good to merge.

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the OMP command/skill paths against current Oh My Pi docs. The layout, description frontmatter, filename-derived invocation, argument handling, and skill layout all line up with OMP's native discovery model. I don't see a blocking adapter issue.

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-ran the OMP adapter review against the current diff. I still don't see a blocker: the .omp/skills/openspec-*/SKILL.md and .omp/commands/opsx-<id>.md outputs match OMP's documented discovery shape, command references are converted to /opsx-*, and argument plus YAML escaping coverage is present. Safe to merge from my side.

@alfred-openspec

Copy link
Copy Markdown
Collaborator

Thanks for putting this together and helping get Oh My Pi support across the line.

We just merged Oh My Pi support in #1276, which adds the oh-my-pi tool ID, .omp/skills, .omp/commands/opsx-<id>.md, docs, and tests. I’m closing this PR as superseded by the merged implementation so the contributor queue stays clean. Really appreciate the help here, and if the merged version missed something from your testing, please open a focused follow-up.

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.

2 participants