Skip to content

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

Open
VinciWu557 wants to merge 15 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 15 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 added 14 commits June 8, 2026 13:25
- 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.
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
…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

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.

3 participants