feat(skills): support inline $ Skill references - #321
Conversation
|
感谢 @bkyssn 和 @sowen1023 的投入。这里由维护者统一整合:以 #322 的 Session 实现为基础,纳入 #321 的 TUI 补全和相关测试,并修复评审发现的队列、压缩与解析边界问题。整合、冲突处理和验证由我们负责,采用的代码会保留原作者贡献与共同署名。请先不用继续重复修改这两块;我们会在整合结果通过验证后合并主 PR,再将另一 PR 标明已整合并关闭。当前尚未合并。 |
…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>
* 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>
…i-dev#322) * 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 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> * 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>
tt-a1i
left a comment
There was a problem hiding this comment.
Exact-head review: 18e5509
[P1] This reintroduces the Skill lifecycle that accepted Decision 0002 explicitly retired. extensions/inline-skill-references/index.ts adds a separate dollar-reference parser, TUI autocomplete contract, filesystem body read, and hidden model-visible injection. Decision 0002 lines 22-26 says Pi owns Skill loading/completion and specifically prohibits retaining a separate dollar-skill parser or autocomplete adapter. Merging this would create a second invocation and body-loading contract alongside the Pi-native path already adopted through PR #322.
Please close or supersede this PR unless the maintainers first amend/supersede Decision 0002 through the governed decision process. If the product direction changes, align the issue/spec and add lifecycle tests for persistence, queued input, compaction, and trust before implementation review.
Verification boundary: static Standards + Spec review against current main and the exact PR head; CI is green, but CI does not resolve the accepted-design conflict.
Problem
Closes #282
Closes #316
Closes #317
Pi 的 Skill 补全只能通过消息开头的
/skill:name使用,无法在提示词中间自然引用 Skill。Value
用户可以在提示词任意位置输入
$,从当前已加载的 Skills 中选择,并用 Tab 补全而不发送消息。提交后模型会获得对应 Skill 内容,用户原始消息保持不变。Approach
$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 测试通过。$能显示已加载 Skill,Tab 只补全不提交,提交后对应 Skill 可以正常使用。Impact
$skill-name补全与展开。/skill:name和@path兼容。