Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add magic3007/dotfiles --skill omp-tui-extension-uxgit clone --depth 1 https://github.com/magic3007/dotfilesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/magic3007/dotfiles/omp-tui-extension-ux)<a href="https://agentmods.dev/skills/magic3007/dotfiles/omp-tui-extension-ux"><img src="https://agentmods.dev/badge/skills/magic3007/dotfiles/omp-tui-extension-ux/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/magic3007/dotfiles/omp-tui-extension-ux"><img src="https://agentmods.dev/badge/skills/magic3007/dotfiles/omp-tui-extension-ux.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00076 | $0.02238 |
| Opus 5.5 | $0.00030 | $0.00895 |
| Sonnet 5.5 | $0.00015 | $0.00448 |
| Haiku 4.5 | $0.00008 | $0.00224 |
Grade A, and why
omp-tui-extension-ux scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 19d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.
omp TUI 扩展:交互设计契约
用于「用户手动触发」的 omp 扩展:润色/改写草稿、生成候选、摘要、任何要回填输入框的功能。
分工:
- 本文管交互形态与状态覆盖(为什么会被一个示例带偏、漏掉哪些状态)。
omp-tui-extension-authoring管机制:打包、类型检查、tmux 真机验证。
1. 第一步永远是枚举 API 面
不要从示例倒推能力。先读已安装包的类型定义:
ls ~/.bun/install/global/node_modules/@oh-my-pi/pi-coding-agent/dist/types/index.d.ts
# ExtensionUIContext 里至少包含:
# select / notify / setStatus / getEditorText / setEditorText / supportsEditor / custom
# ExtensionContext 里至少包含:
# ui / model / modelRegistry / runEphemeralTurn? / sessionManager
判断依据:
| 需求 | 正确 API | 错误做法 |
|---|---|---|
| 显示运行中 | ctx.ui.setStatus(key, text) |
用 ui.custom 卡片占屏 |
| 让用户选一项 | ctx.ui.select(title, options) |
让用户背参数 |
| 读当前草稿 | ctx.ui.getEditorText() |
要求用户把草稿写进命令参数 |
| 回填草稿 | ctx.ui.setEditorText(text) |
直接发消息给会话 |
| 判断能否编辑 | ctx.ui.supportsEditor === false 时警告 |
只查 ctx.hasUI |
| 一次不进会话的 LLM 调用 | ctx.runEphemeralTurn(...)(可选路径) |
import @oh-my-pi/pi-ai 的 completeSimple |
单看一个示例会把方案锁死在那个示例的形态上。 examples/hooks/qna.ts 用 ui.custom,因为它要一个问答面板;它不代表“显示进度”就该占屏。
2. 交互形态:默认非阻塞
| 形态 | 适用 | 代价 |
|---|---|---|
| 非阻塞:状态栏 + 原地回填 | 默认;短请求(1–30 s);用户还要读/改草稿 | 需要处理“草稿被改” |
阻塞:ui.custom 非 overlay 卡片 |
必须独占输入;请求长到你确定用户不该打字 | 用户看不见草稿;容易顺手覆盖输入 |
规则:
- 进度只写状态栏,键要唯一(如
prompt-polish),结束时setStatus(key, undefined)。 - 阻塞卡片只在“输入必须冻结”时用。用就配
AbortSignal.any([loader.signal, AbortSignal.timeout(ms)]),Esc 才有取消。 - 非阻塞时,回填前必须比对
ctx.ui.getEditorText() !== draft;不一致就丢弃结果并提示,不覆盖。 - 失败和取消绝不
setEditorText恢复原文;原草稿本来就没被动过。
3. 入口矩阵:两种都要
slash command 会消费整行输入。所以:
| 用户手里的文本 | 入口 |
|---|---|
| 已在输入框 | pi.registerShortcut("ctrl+alt+p", { handler }) |
| 现敲/带参数 | pi.registerCommand("x", { handler: (args, ctx) => … }) |
两者共用一个内部函数,参数 explicitText?: string 区分来源:
const fromEditor = explicitText === undefined;
const draft = fromEditor ? ctx.ui.getEditorText() : explicitText;
// 命令无草稿时回落到输入框,而不是报“没有内容”
选项用 getArgumentCompletions 补全 + select 兜底;select() 只回 label 字符串,label 必须能反查回业务键。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 19d ago First seen · 166 lines · 76 tokens per session scan A 81fe6c96f96e
omp-tui-extension-ux is a skill published in the GitHub repository magic3007/dotfiles (11 stars, last pushed 5d ago), licensed MIT. It adds 76 tokens to every session and 2,238 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-11.
omp-tui-extension-ux compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| omp-tui-extension-uxmagic3007/dotfiles | Skill | 11 | 5d ago | MIT | A | 76 | Claude Code, Codex |
| style-brandurmzd/dotfiles | Skill | 6 | 4d ago | Apache-2.0 | A | 107 | Claude Code, Codex |
| manage-themeurmzd/dotfiles | Skill | 6 | 4d ago | Apache-2.0 | A | 188 | Claude Code |
| create-oss-skillurmzd/dotfiles | Skill | 6 | 4d ago | Apache-2.0 | A | 63 | Claude Code |
| extend-oss-skills-to-claudeurmzd/dotfiles | Skill | 6 | 4d ago | Apache-2.0 | A | 74 | Claude Code |
| scaffold-nodeurmzd/dotfiles | Skill | 6 | 4d ago | Apache-2.0 | A | 119 | Claude Code |
| test-codeurmzd/dotfiles | Skill | 6 | 4d ago | Apache-2.0 | A | 101 | Claude Code |