Skip to content

feat(omp): add Oh My Pi platform support#307

Open
VinciWu557 wants to merge 16 commits into
mindfold-ai:mainfrom
VinciWu557:feat/support-oh-my-pi
Open

feat(omp): add Oh My Pi platform support#307
VinciWu557 wants to merge 16 commits into
mindfold-ai:mainfrom
VinciWu557:feat/support-oh-my-pi

Conversation

@VinciWu557

@VinciWu557 VinciWu557 commented May 25, 2026

Copy link
Copy Markdown

概述

为 Trellis 新增 Oh My Pi (omp) 平台支持。Oh My Pi 是一个 AI 编码助手,本次改动使其能够通过 trellis init 安装 Trellis 工作流文件。

改动内容

新增 Oh My Pi 平台目录 .omp/

  • agents/ — trellis-check、trellis-implement、trellis-research 子代理
  • commands/ — trellis-continue、trellis-finish-work 命令
  • skills/ — trellis-before-dev、trellis-brainstorm、trellis-check、trellis-meta、trellis-update-spec 等技能
  • extensions/trellis/index.ts — 平台扩展入口

新增配置器 packages/cli/src/configurators/omp.ts

  • 实现 collectOmpTemplates()configureOmp(),处理 agents、commands、skills、extension 的生成

新增模板 packages/cli/src/templates/omp/

  • agents/ — 三个子代理模板
  • extensions/trellis/index.ts.txt — 扩展模板
  • index.ts — 模板导出

源码改动

  • packages/cli/src/types/ai-tools.ts — 新增 omp 平台定义
  • packages/cli/src/cli/index.ts — 注册 omp 配置器
  • packages/cli/src/commands/init.ts — 同上
  • packages/cli/src/configurators/index.ts — 导出 omp 配置器

现有模板更新(添加 Oh My Pi 到支持平台列表)

  • packages/cli/src/templates/trellis/workflow.md
  • packages/cli/src/templates/trellis/scripts/common/cli_adapter.py
  • packages/cli/src/templates/trellis/scripts/common/task_store.py

测试

  • 新增 packages/cli/test/templates/omp.test.ts
  • 更新 packages/cli/test/regression.test.ts

验证

  • pnpm lint 通过(0 errors)
  • pnpm typecheck 通过(0 errors)
  • 本地 trellis init --omp 可正常生成 .omp/ 目录

@hechang27-sprt

Copy link
Copy Markdown

+1 希望能增加omp支持,省token

@VinciWu557 VinciWu557 closed this Jun 5, 2026
@VinciWu557 VinciWu557 reopened this Jun 5, 2026
taosu0216 pushed a commit to VinciWu557/Trellis that referenced this pull request Jun 7, 2026
…l name (mindfold-ai#307)

Two reviewer cleanups on top of the Oh My Pi platform work to ready the
PR for merge review:

1. Remove personal Trellis dogfooding artifacts that crept into the diff
   while the platform was being developed. None of these belong in a
   reviewable PR — they leak the author's local workspace state into
   every reader's checkout:

   - `.trellis/workspace/VinciWu557/index.md` + `journal-1.md`
   - `.trellis/tasks/archive/2026-05/05-22-add-omp-platform-support-to-trellis/*`
   - `.trellis/tasks/archive/2026-05/05-26-omp-trellis-context-injection/*`
   - `.trellis/tasks/archive/2026-06/06-03-omp-configurator-missing-command-frontmatter/*`

2. Rename the dogfooded `.omp/skills/trellis-spec-bootstarp/` → `trellis-spec-bootstrap/`
   and fix the inner `name:` frontmatter field. This anticipates the
   bundled-skills source rename in mindfold-ai#296 so that once mindfold-ai#296 merges, the
   dogfooded `.omp/` tree matches what `trellis update --omp` regenerates.
   Until mindfold-ai#296 lands, `trellis init --omp` on the PR HEAD still produces the
   typoed name because the source template hasn't been renamed yet — that
   is intentional and self-corrects on the next dogfood pass after mindfold-ai#296.

A `git merge origin/main` is still required before merge because main has
moved on since this branch was opened (PR mindfold-ai#324 + the historical-manifest
restoration in mindfold-ai#296). I left that conflict resolution to the maintainer
at merge time rather than rebasing the contributor's commit history.

Build / verification on the PR worktree:
- `pnpm typecheck` clean
- `pnpm test` 1049/1049 passing
- `trellis init --omp --skip-existing -y` smoke test produces a valid `.omp/` tree
@taosu0216

Copy link
Copy Markdown
Contributor

@VinciWu557 Thanks for the Oh My Pi work — this is a solid platform integration. I pushed one reviewer cleanup commit directly to the branch (47a28f7) to ready it for merge review.

What the cleanup commit does

1. Removed personal dogfooding files (14 files, ~700 lines).

These crept in while you were developing the platform using Trellis itself, but they leak local workspace state into every reviewer's checkout:

  • .trellis/workspace/VinciWu557/index.md and journal-1.md
  • .trellis/tasks/archive/2026-05/05-22-add-omp-platform-support-to-trellis/* (4 files)
  • .trellis/tasks/archive/2026-05/05-26-omp-trellis-context-injection/* (4 files)
  • .trellis/tasks/archive/2026-06/06-03-omp-configurator-missing-command-frontmatter/* (4 files)

The dogfooded .omp/agents/, .omp/commands/, .omp/skills/, and .omp/extensions/ trees are kept — those are the standard pattern every platform follows in this repo (every .claude/skills/, .cursor/skills/, etc. is committed as dogfood output of trellis init on Trellis itself).

2. Renamed the dogfooded .omp/skills/trellis-spec-bootstarp/trellis-spec-bootstrap/ (and fixed the inner name: frontmatter field). This anticipates the bundled-skills source rename in #296. Once #296 merges, the dogfooded .omp/ tree will line up with whatever trellis update --omp regenerates. Until #296 lands, trellis init --omp from the PR HEAD still produces the typoed directory because the source template packages/cli/src/templates/common/bundled-skills/trellis-spec-bootstarp/ hasn't been renamed yet — that's intentional and self-corrects on the next dogfood pass after #296.

Still needed before merge

mergeable: CONFLICTING. main has moved on since you opened this PR (PR #324 landed feat(cli): refresh registry-backed spec templates, and #296 will restore the historical-manifest text). You'll need to git pull --rebase origin main and resolve conflicts in roughly these files:

  • packages/cli/src/templates/trellis/scripts/common/cli_adapter.py
  • packages/cli/src/templates/trellis/scripts/common/task_store.py
  • packages/cli/src/templates/trellis/workflow.md
  • packages/cli/src/commands/init.ts (feat(cli): refresh registry-backed spec templates #324 added the registry config persistence block)
  • a couple of test files (test/regression.test.ts, test/configurators/shared.test.ts)

I didn't rebase for you because rebasing rewrites your 14 commits' history and you may want to keep the per-step trail for review (or squash them yourself in one pass). Your call.

Verification on the cleanup commit

  • pnpm typecheck clean
  • pnpm test 1049/1049 passing
  • trellis init --omp --skip-existing -y smoke test produces a valid .omp/ tree with agents/, commands/, skills/, extensions/trellis/index.ts.

Looking forward to seeing this land. Ping me when rebased and I'll do a final pass.

VinciWu557 pushed a commit to VinciWu557/Trellis that referenced this pull request Jun 8, 2026
…l name (mindfold-ai#307)

Two reviewer cleanups on top of the Oh My Pi platform work to ready the
PR for merge review:

1. Remove personal Trellis dogfooding artifacts that crept into the diff
   while the platform was being developed. None of these belong in a
   reviewable PR — they leak the author's local workspace state into
   every reader's checkout:

   - `.trellis/workspace/VinciWu557/index.md` + `journal-1.md`
   - `.trellis/tasks/archive/2026-05/05-22-add-omp-platform-support-to-trellis/*`
   - `.trellis/tasks/archive/2026-05/05-26-omp-trellis-context-injection/*`
   - `.trellis/tasks/archive/2026-06/06-03-omp-configurator-missing-command-frontmatter/*`

2. Rename the dogfooded `.omp/skills/trellis-spec-bootstarp/` → `trellis-spec-bootstrap/`
   and fix the inner `name:` frontmatter field. This anticipates the
   bundled-skills source rename in mindfold-ai#296 so that once mindfold-ai#296 merges, the
   dogfooded `.omp/` tree matches what `trellis update --omp` regenerates.
   Until mindfold-ai#296 lands, `trellis init --omp` on the PR HEAD still produces the
   typoed name because the source template hasn't been renamed yet — that
   is intentional and self-corrects on the next dogfood pass after mindfold-ai#296.

A `git merge origin/main` is still required before merge because main has
moved on since this branch was opened (PR mindfold-ai#324 + the historical-manifest
restoration in mindfold-ai#296). I left that conflict resolution to the maintainer
at merge time rather than rebasing the contributor's commit history.

Build / verification on the PR worktree:
- `pnpm typecheck` clean
- `pnpm test` 1049/1049 passing
- `trellis init --omp --skip-existing -y` smoke test produces a valid `.omp/` tree
@VinciWu557 VinciWu557 force-pushed the feat/support-oh-my-pi branch from 47a28f7 to a2a5abd Compare June 8, 2026 05:27
VinciWu557 pushed a commit to VinciWu557/Trellis that referenced this pull request Jun 8, 2026
…l name (mindfold-ai#307)

Two reviewer cleanups on top of the Oh My Pi platform work to ready the
PR for merge review:

1. Remove personal Trellis dogfooding artifacts that crept into the diff
   while the platform was being developed. None of these belong in a
   reviewable PR — they leak the author's local workspace state into
   every reader's checkout:

   - `.trellis/workspace/VinciWu557/index.md` + `journal-1.md`
   - `.trellis/tasks/archive/2026-05/05-22-add-omp-platform-support-to-trellis/*`
   - `.trellis/tasks/archive/2026-05/05-26-omp-trellis-context-injection/*`
   - `.trellis/tasks/archive/2026-06/06-03-omp-configurator-missing-command-frontmatter/*`

2. Rename the dogfooded `.omp/skills/trellis-spec-bootstarp/` → `trellis-spec-bootstrap/`
   and fix the inner `name:` frontmatter field. This anticipates the
   bundled-skills source rename in mindfold-ai#296 so that once mindfold-ai#296 merges, the
   dogfooded `.omp/` tree matches what `trellis update --omp` regenerates.
   Until mindfold-ai#296 lands, `trellis init --omp` on the PR HEAD still produces the
   typoed name because the source template hasn't been renamed yet — that
   is intentional and self-corrects on the next dogfood pass after mindfold-ai#296.

A `git merge origin/main` is still required before merge because main has
moved on since this branch was opened (PR mindfold-ai#324 + the historical-manifest
restoration in mindfold-ai#296). I left that conflict resolution to the maintainer
at merge time rather than rebasing the contributor's commit history.

Build / verification on the PR worktree:
- `pnpm typecheck` clean
- `pnpm test` 1049/1049 passing
- `trellis init --omp --skip-existing -y` smoke test produces a valid `.omp/` tree
@VinciWu557 VinciWu557 force-pushed the feat/support-oh-my-pi branch from a2a5abd to 0b32ee1 Compare June 8, 2026 05:32
@VinciWu557

Copy link
Copy Markdown
Author

@taosu0216 已更新,感谢 review

@taosu0216

Copy link
Copy Markdown
Contributor

感谢 PR!omp 配置器本身写得干净 —— 复刻了 qoder/pi 的 extension-backed 模式,omp.tswrapWithOmpFrontmatter、agents/commands/skills 生成都符合约定,omp.test.ts + regression 测试也加了。但合并前有两个 blocker 要处理:

1. [blocker] ~3900 行是纯重格式化噪声,请还原

init.tscli/index.tsconfigurators/index.ts 这三个文件被整体从 2 空格缩进改成了 3 空格(应该是编辑器配置带的)。git diff -w(忽略空白)显示这三个文件零实质改动 —— 真正的 omp 注册(configurators/index.ts 的 export、cli/index.ts--omp option、init.ts 的 InitOptions)就埋在重格式化里。

这让 PR 的 +6694/-2014 几乎全是噪声,没法 review,也会跟其他 PR 频繁冲突。请:

  • 把这三个文件 revert 成 main 的格式,只重新加 omp 那几行
  • 本地用项目的 prettier/eslint 配置(2 空格)跑一遍,避免编辑器再带 3 空格进来

2. [blocker] 缺 docs-site 平台同步

新增平台需要同步 docs(见 .trellis/spec/docs-site/docs/sync-on-change.md Trigger 2)。当前 PR 没碰 docs-site。需要:

  • advanced/multi-platform.mdx + zh/ 镜像:平台数 + 列表加上 Oh My Pi
  • start/install-and-first-task.mdx + zh/--omp flag + 平台数
  • (docs-site 是 submodule,可以单独提 docs PR,或在这个 PR 的 base 仓里补)

另外想确认一下:Oh My Pi 跟现有的 pi(Pi Agent)平台是什么关系?omp / pi / reasonix 这些小众平台在持续增加,想了解下 Oh My Pi 的用户规模 / 是否有稳定的产品形态,以便判断长期维护投入。

格式还原 + docs 补齐后就可以推进合并,再次感谢 🙏

@neostfox

neostfox commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

感谢 PR!omp 配置器本身写得干净 —— 复刻了 qoder/pi 的 extension-backed 模式,omp.tswrapWithOmpFrontmatter、agents/commands/skills 生成都符合约定,omp.test.ts + regression 测试也加了。但合并前有两个 blocker 要处理:

1. [blocker] ~3900 行是纯重格式化噪声,请还原

init.tscli/index.tsconfigurators/index.ts 这三个文件被整体从 2 空格缩进改成了 3 空格(应该是编辑器配置带的)。git diff -w(忽略空白)显示这三个文件零实质改动 —— 真正的 omp 注册(configurators/index.ts 的 export、cli/index.ts--omp option、init.ts 的 InitOptions)就埋在重格式化里。

这让 PR 的 +6694/-2014 几乎全是噪声,没法 review,也会跟其他 PR 频繁冲突。请:

  • 把这三个文件 revert 成 main 的格式,只重新加 omp 那几行
  • 本地用项目的 prettier/eslint 配置(2 空格)跑一遍,避免编辑器再带 3 空格进来

2. [blocker] 缺 docs-site 平台同步

新增平台需要同步 docs(见 .trellis/spec/docs-site/docs/sync-on-change.md Trigger 2)。当前 PR 没碰 docs-site。需要:

  • advanced/multi-platform.mdx + zh/ 镜像:平台数 + 列表加上 Oh My Pi
  • start/install-and-first-task.mdx + zh/--omp flag + 平台数
  • (docs-site 是 submodule,可以单独提 docs PR,或在这个 PR 的 base 仓里补)

另外想确认一下:Oh My Pi 跟现有的 pi(Pi Agent)平台是什么关系?omp / pi / reasonix 这些小众平台在持续增加,想了解下 Oh My Pi 的用户规模 / 是否有稳定的产品形态,以便判断长期维护投入。

格式还原 + docs 补齐后就可以推进合并,再次感谢 🙏

我在用 omp,体感比 opencode 、claude code 要好。关于多平台的维护,感觉还是要把 skill 做成硬链接,都收敛到 trellis 中去,团队协同多平台的时候要会轻松很多。

VinciWu557 and others added 16 commits June 19, 2026 17:17
- Add .omp/ dogfood directory with commands, skills, agents, and extension
- Register OMP in AI_TOOLS registry (ai-tools.ts) with extension-backed pattern
- Add --omp CLI flag and InitOptions field
- Create configurator (omp.ts) with configureOmp + collectOmpTemplates
- Add template module (templates/omp/) with agents and extension source
- Register in PLATFORM_FUNCTIONS with collectTemplates for update tracking
- Update cli_adapter.py: Platform type, detect_platform, config_dir_name, etc.
- Update task_store.py: add .omp to _SUBAGENT_CONFIG_DIRS
- Add 'Oh My Pi' to workflow.md platform blocks
- Update README.md and README_CN.md platform lists
- Add omp.test.ts (template tests) and regression.test.ts entries

Extension implements session_start, before_agent_start, and input handlers
with TurnContextCache (1.5s TTL) for workflow-state + task context injection.
No tool_call/subagent handlers needed — OMP native task tool covers both.
…ontext

- session_start: invoke get_context.py (default mode) for full project map
  (git/spec/task/developer/journal), matching Claude hook behavior
- session_start (sub-agent): inject only agent-relevant jsonl files via
  PI_BLOCKED_AGENT detection (implement→implement.jsonl, check→check.jsonl,
  research→prd+info only)
- before_agent_start: simplified to workflow-state-only (lightweight per-turn)
- Remove dead buildSessionOverview() that called non-existent script mode
- Update omp.test.ts with new feature marker assertions
…re injection

- Add context event handler as safety net for post-compaction continuations
- Add session_before_compact listener to track compaction boundaries
- Use reverse-scan with fast-path skip when no compaction occurred
- Simplify input handler to only pre-warm cache (no message injection)
- before_agent_start remains the persistent injection point
OMP commands require `description` (and optional `argument-hint`) in
YAML frontmatter for the `/` command picker. The configurator was
writing raw template body without wrapping.

Add `wrapWithOmpFrontmatter()` to shared.ts, wire it into both
`collectOmpTemplates()` and `configureOmp()`, and add unit +
integration tests.
…l name (mindfold-ai#307)

Two reviewer cleanups on top of the Oh My Pi platform work to ready the
PR for merge review:

1. Remove personal Trellis dogfooding artifacts that crept into the diff
   while the platform was being developed. None of these belong in a
   reviewable PR — they leak the author's local workspace state into
   every reader's checkout:

   - `.trellis/workspace/VinciWu557/index.md` + `journal-1.md`
   - `.trellis/tasks/archive/2026-05/05-22-add-omp-platform-support-to-trellis/*`
   - `.trellis/tasks/archive/2026-05/05-26-omp-trellis-context-injection/*`
   - `.trellis/tasks/archive/2026-06/06-03-omp-configurator-missing-command-frontmatter/*`

2. Rename the dogfooded `.omp/skills/trellis-spec-bootstarp/` → `trellis-spec-bootstrap/`
   and fix the inner `name:` frontmatter field. This anticipates the
   bundled-skills source rename in mindfold-ai#296 so that once mindfold-ai#296 merges, the
   dogfooded `.omp/` tree matches what `trellis update --omp` regenerates.
   Until mindfold-ai#296 lands, `trellis init --omp` on the PR HEAD still produces the
   typoed name because the source template hasn't been renamed yet — that
   is intentional and self-corrects on the next dogfood pass after mindfold-ai#296.

A `git merge origin/main` is still required before merge because main has
moved on since this branch was opened (PR mindfold-ai#324 + the historical-manifest
restoration in mindfold-ai#296). I left that conflict resolution to the maintainer
at merge time rather than rebasing the contributor's commit history.

Build / verification on the PR worktree:
- `pnpm typecheck` clean
- `pnpm test` 1049/1049 passing
- `trellis init --omp --skip-existing -y` smoke test produces a valid `.omp/` tree
Blocker 1: revert reformatting noise in cli/index.ts, init.ts,
configurators/index.ts. Rebase onto main and re-apply only the omp
registration lines (7 lines net, down from ~3900 lines of 3-space
reindentation noise).

Blocker 2: sync docs-site for the Oh My Pi platform.
- start/install-and-first-task.mdx (en + zh): add --omp flag, bump
  platform count 16 -> 17, add Oh My Pi row to platform config table
- advanced/multi-platform.mdx (en + zh): bump platform count, add
  Oh My Pi to capability matrix and platform list, add Oh My Pi
  section (extension-backed, like Pi Agent, no settings.json)
- marketplace/workflows/native/workflow.md: mirror the bundled
  workflow.md Oh My Pi platform markers

Submodule pointers updated to the synced docs-site and marketplace
commits on the feat/support-oh-my-pi branches of their forks.
@VinciWu557 VinciWu557 force-pushed the feat/support-oh-my-pi branch from 0b32ee1 to 0a8b1a2 Compare June 19, 2026 10:11
@VinciWu557

VinciWu557 commented Jun 19, 2026

Copy link
Copy Markdown
Author

感谢 PR!omp 配置器本身写得干净 —— 复刻了 qoder/pi 的 extension-backed 模式,omp.tswrapWithOmpFrontmatter、agents/commands/skills 生成都符合约定,omp.test.ts + regression 测试也加了。但合并前有两个 blocker 要处理:

1. [blocker] ~3900 行是纯重格式化噪声,请还原

init.tscli/index.tsconfigurators/index.ts 这三个文件被整体从 2 空格缩进改成了 3 空格(应该是编辑器配置带的)。git diff -w(忽略空白)显示这三个文件零实质改动 —— 真正的 omp 注册(configurators/index.ts 的 export、cli/index.ts--omp option、init.ts 的 InitOptions)就埋在重格式化里。

这让 PR 的 +6694/-2014 几乎全是噪声,没法 review,也会跟其他 PR 频繁冲突。请:

  • 把这三个文件 revert 成 main 的格式,只重新加 omp 那几行
  • 本地用项目的 prettier/eslint 配置(2 空格)跑一遍,避免编辑器再带 3 空格进来

2. [blocker] 缺 docs-site 平台同步

新增平台需要同步 docs(见 .trellis/spec/docs-site/docs/sync-on-change.md Trigger 2)。当前 PR 没碰 docs-site。需要:

  • advanced/multi-platform.mdx + zh/ 镜像:平台数 + 列表加上 Oh My Pi
  • start/install-and-first-task.mdx + zh/--omp flag + 平台数
  • (docs-site 是 submodule,可以单独提 docs PR,或在这个 PR 的 base 仓里补)

另外想确认一下:Oh My Pi 跟现有的 pi(Pi Agent)平台是什么关系?omp / pi / reasonix 这些小众平台在持续增加,想了解下 Oh My Pi 的用户规模 / 是否有稳定的产品形态,以便判断长期维护投入。

格式还原 + docs 补齐后就可以推进合并,再次感谢 🙏

已按要求完成修改。

oh my pi 可以理解为一个开箱即用的 pi agent,它在 pi 内置了一系列的常用工具,如 lsp、subagent 等
项目地址:https://github.com/can1357/oh-my-pi - 当前 13k star

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.

4 participants