Skip to content

feat(skills): support inline $ Skill references - #321

Open
bkyssn wants to merge 1 commit into
openpi-dev:mainfrom
bkyssn:feat/issue-282-inline-skill-references
Open

feat(skills): support inline $ Skill references#321
bkyssn wants to merge 1 commit into
openpi-dev:mainfrom
bkyssn:feat/issue-282-inline-skill-references

Conversation

@bkyssn

@bkyssn bkyssn commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Problem

Closes #282
Closes #316
Closes #317

Pi 的 Skill 补全只能通过消息开头的 /skill:name 使用,无法在提示词中间自然引用 Skill。

Value

用户可以在提示词任意位置输入 $,从当前已加载的 Skills 中选择,并用 Tab 补全而不发送消息。提交后模型会获得对应 Skill 内容,用户原始消息保持不变。

Approach

  • 在现有 TUI 补全器上增加 $skill-name 补全,候选始终来自 pi.getCommands(),不重复维护 Skill 清单。
  • before_agent_start 中把已知引用展开为隐藏的模型上下文,并保持原始用户消息不变。
  • 未知、转义、重复和标点相邻引用均有明确处理;原有 /skill:name、slash command 和 @path 行为保持不变。

Validation

  • bun run check:通过。
  • bun run test:1089 个 Node 测试通过,1 个既有测试跳过;30 个 Vitest 测试通过。
  • 人工 TUI 验证:输入 $ 能显示已加载 Skill,Tab 只补全不提交,提交后对应 Skill 可以正常使用。

Impact

  • 新增 TUI 内联 $skill-name 补全与展开。
  • 不新增配置、工具、缓存或持久化状态。
  • 保持现有 /skill:name@path 兼容。

@tt-a1i

tt-a1i commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

感谢 @bkyssn@sowen1023 的投入。这里由维护者统一整合:以 #322 的 Session 实现为基础,纳入 #321 的 TUI 补全和相关测试,并修复评审发现的队列、压缩与解析边界问题。整合、冲突处理和验证由我们负责,采用的代码会保留原作者贡献与共同署名。请先不用继续重复修改这两块;我们会在整合结果通过验证后合并主 PR,再将另一 PR 标明已整合并关闭。当前尚未合并。

tt-a1i added a commit to sowen1023/openpi that referenced this pull request Aug 31, 2026
…ections

Integrate the autocomplete adapter and Editor tests from bkyssn/openpi PR openpi-dev#321 into sowen1023/openpi PR openpi-dev#322. Preserve run-scoped Skill snapshots through native compaction and repair Unicode and autocomplete composition boundaries.

Co-authored-by: lwc <1803086257@qq.com>
tt-a1i added a commit that referenced this pull request Aug 31, 2026
* feat(skills): expand inline skill references

* fix(skills): expand queued inline references

* fix(skills): isolate inline skill projections

* docs: use a public inline Skill example

* feat(skills): integrate inline completion and preserve compacted projections

Integrate the autocomplete adapter and Editor tests from bkyssn/openpi PR #321 into sowen1023/openpi PR #322. Preserve run-scoped Skill snapshots through native compaction and repair Unicode and autocomplete composition boundaries.

Co-authored-by: lwc <1803086257@qq.com>

* refactor(skills): defer loading and lifecycle to native Pi

---------

Co-authored-by: tt-a1i <tt-a1i@users.noreply.github.com>
Co-authored-by: lwc <1803086257@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants