Skill站外收录 @skilllib/skill-2014279416006782980
hud
配置并管理 OMC HUD 状态栏的显示内容与布局,支持多种预设模式切换以展示系统状态、任务进度及上下文信息,通过自动检测与修复机制确保环境变量正确加载,适用于实时监控工作流执行情况的场景。
效率工具 AI 技能
Skills.MD
# HUD Skill
Configure the OMC HUD (Heads-Up Display) for the statusline.
## Quick Commands
| Command | Description |
|---------|-------------|
| `/hud` | Show current HUD status (auto-setup if needed) |
| `/hud setup` | Install/repair HUD statusline |
| `/hud minimal` | Switch to minimal display |
| `/hud focused` | Switch to focused display (default) |
| `/hud full` | Switch to full display |
| `/hud status` | Show detailed HUD status |
## Auto-Setup
When you run `/hud` or `/hud setup`, the system will automatically:
1. Check if `~/.claude/hud/omc-hud.mjs` exists
2. Check if `statusLine` is configured in `~/.claude/settings.json`
3. If missing, create the HUD wrapper script and configure settings
4. Report status and prompt to restart Claude Code if changes were made
**IMPORTANT**: If the argument is `setup` OR if the HUD script doesn't exist at `~/.claude/hud/omc-hud.mjs`, you MUST create the HUD files directly using the instructions below.
### Setup Instructions (Run These Commands)
**Step 1:** Check if setup is needed:
```bash
ls ~/.claude/hud/omc-hud.mjs 2>/dev/null && echo "EXISTS" || echo "MISSING"
```
**Step 2:** Check if the plugin is built (CRITICAL - common issue!):
```bash
# Find the latest version and check if dist/hud/index.js exists
PLUGIN_VERSION=$(ls ~/.claude/plugins/cache/omc/oh-my-claudecode/ 2>/dev/null | sort -V | tail -1)
if [ -n "$PLUGIN_VERSION" ]; then
ls ~/.claude/plugins/cache/omc/oh-my-claudecode/$PLUGIN_VERSION/dist/hud/index.js 2>/dev/null && echo "BUILT" || echo "NOT_BUILT"
fi
```
**If NOT_BUILT**, the plugin needs to be compiled. Run:
```bash
cd ~/.claude/plugins/cache/omc/oh-my-claudecode/$PLUGIN_VERSION && npm install
```
This will install dependencies and build the TypeScript code automatically (via the `prepare` script).
**Step 3:** If omc-hud.mjs is MISSING or argument is `setup`, create the HUD directory and script:
First, create the directory:
```bash
mkdir -p ~/.claude/hud
```
Then, use the Write tool to create `~/.claude/hud/omc-hud.mjs` with this exact content:
```javascript
#!/usr/bin/env node
/**
* OMC HUD - Statusline Script
* Wrapper that imports from plugin cache or development paths
*/
import { existsSync, readdirSync } from "node:fs";
import { homedir } from "node:os";
import { join } from "node:path";
async function main() {
const home = homedir();
// 1. Try plugin cache first (marketplace: omc, plugin: oh-my-claudecode)
const pluginCacheBase = join(home, ".claude/plugins/cache/omc/oh-my-claudecode");
if (existsSync(pluginCacheBase)) {
try {
const versions = readdirSync(pluginCacheBase);
if (versions.length > 0) {
const latestVersion = versions.sort().reverse()[0];
const pluginPath = join(pluginCacheBase, latestVersion, "dist/hud/index.js");
if (existsSync(pluginPath)) {
await import(pluginPath);
return;
}
}
} catch { /* continue */ }
}
// 2. Development paths
const devPaths = [
join(home, "Workspace/oh-my-claude-sisyphus/dist/hud/index.js"),
join(home, "workspace/oh-my-claude-sisyphus/dist/hud/index.js"),
join(home, "Workspace/oh-my-claudecode/dist/hud/index.js"),
join(home, "workspace/oh-my-claudecode/dist/hud/index.js"),
];
for (const devPath of devPaths) {
if (existsSync(devPath)) {
try {
await import(devPath);
return;
} catch { /* continue */ }
}
}
// 3. Fallback
console.log("[OMC] run /omc-setup to install properly");
}
main();
```
**Step 3:** Make it executable:
```bash
chmod +x ~/.claude/hud/omc-hud.mjs
```
**Step 4:** Update settings.json to use the HUD:
Read `~/.claude/settings.json`, then update/add the `statusLine` field:
```json
{
"statusLine": {
"type": "command",
"command": "node ~/.claude/hud/omc-hud.mjs"
}
}
```
Use the Edit tool to add/update this field while preserving other settings.
**Step 5:** Clean up old HUD scripts (if any):
```bash
rm -f ~/.claude/hud/sisyphus-hud.mjs 2>/dev/null
```
**Step 6:** Tell the user to restart Claude Code for changes to take effect.
## Display Presets
### Minimal
Shows only the essentials:
```
[OMC] ralph | ultrawork | todos:2/5
```
### Focused (Default)
Shows all relevant elements:
```
[OMC] ralph:3/10 | US-002 | ultrawork skill:planner | ctx:67% | agents:2 | bg:3/5 | todos:2/5
```
### Full
Shows everything including multi-line agent details:
```
[OMC] ralph:3/10 | US-002 (2/5) | ultrawork | ctx:[████░░]67% | agents:3 | bg:3/5 | todos:2/5
├─ O architect 2m analyzing architecture patterns...
├─ e explore 45s searching for test files
└─ s executor 1m implementing validation logic
```
## Multi-Line Agent Display
When agents are running, the HUD shows detailed information on separate lines:
- **Tree characters** (`├─`, `└─`) show visual hierarchy
- **Agent code** (O, e, s) indicates agent type with model tier color
- **Duration** shows how long each agent has been running
- **Description** shows what each agent is doing (up to 45 chars)
## Display Elements
| Element | Description |
|---------|-------------|
| `[OMC]` | Mode identifier |
| `ralph:3/10` | Ralph loop iteration/max |
| `US-002` | Current PRD story ID |
| `ultrawork` | Active mode badge |
| `skill:name` | Last activated skill (cyan) |
| `ctx:67%` | Context window usage |
| `agents:2` | Running subagent count |
| `bg:3/5` | Background task slots |
| `todos:2/5` | Todo completion |
## Color Coding
- **Green**: Normal/healthy
- **Yellow**: Warning (context >70%, ralph >7)
- **Red**: Critical (context >85%, ralph at max)
## Configuration Location
HUD config is stored at: `~/.claude/.omc/hud-config.json`
## Manual Configuration
You can manually edit the config file:
```json
{
"preset": "focused",
"elements": {
"omcLabel": true,
"ralph": true,
"prdStory": true,
"activeSkills": true,
"lastSkill": true,
"contextBar": true,
"agents": true,
"backgroundTasks": true,
"todos": true
},
"thresholds": {
"contextWarning": 70,
"contextCritical": 85,
"ralphWarning": 7
}
}
```
## Troubleshooting
If the HUD is not showing:
1. Run `/hud setup` to auto-install and configure
2. Restart Claude Code after setup completes
3. If still not working, run `/doctor` for full diagnostics
Manual verification:
- HUD script: `~/.claude/hud/omc-hud.mjs`
- Settings: `~/.claude/settings.json` should have `statusLine` configured
---
*The HUD updates automatically every ~300ms during active sessions.*
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「hud」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次