cmux-custom-sidebar
Skill này làm gì
Skill này viết một file sidebar cho cmux từ mô tả của bạn, bật cài đặt beta, kiểm tra nó và hiển thị với hot reload. Dành cho người dùng cmux muốn bố cục sidebar riêng mà không cần bước build.
Khi nào nên dùng
- ✓Khi bạn muốn một sidebar cmux tùy chỉnh hiển thị workspace, tab hoặc pull request của bạn.
- ✓Khi bạn muốn thay đổi một sidebar tùy chỉnh đã có và thấy kết quả ngay.
- ✓Khi bạn yêu cầu một sidebar được tạo theo kiểu vibe coding trong thư mục cài đặt cmux của bạn.
Liên kết skill
https://github.com/manaflow-ai/cmux/blob/main/skills/cmux-custom-sidebar/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tạo cho tôi một sidebar cmux hiển thị các workspace của tôi và cho phép tôi chuyển giữa chúng chỉ bằng một lần chạm.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent viết một file sidebar theo kiểu SwiftUI trong thư mục cấu hình cmux của bạn, kiểm tra nó với dữ liệu thật và chọn nó. File tự nạp lại ở mỗi lần lưu, nên bạn thấy thay đổi ngay.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
cmux Custom Sidebar
cmux renders custom sidebars from a small SwiftUI-style file at runtime: no Xcode, no build step, no signing. The file hot-reloads on save, binds to live cmux state (workspaces, tabs, git, PRs, clock), and runs real cmux commands on tap.
The person asking is describing a result ("a sidebar that shows my workspaces and lets me jump between them"), not an implementation. Make the engineering decisions for them; do not ask them about SwiftUI, files, or syntax.
This skill is the workflow summary. Read the complete authoring contract (every supported view, modifier, language feature, and data field) before writing a non-trivial sidebar:
cmux docs sidebars
curl -fsSL https://raw.githubusercontent.com/manaflow-ai/cmux/main/docs/custom-sidebars.md
Workflow
- Enable the beta (once): Settings > Beta features > Custom sidebars (
customSidebars.beta.enabled). If a written sidebar does not appear in the picker, check this first. - Write a named file at
~/.config/cmux/sidebars/<name>.swift. The name becomes the menu label; use short kebab-case. The file is a single SwiftUI-style view expression (nostruct, novar body, no imports). A.jsonvariant exists for static layouts; prefer.swiftfor anything dynamic. - Validate and select:
The user can also right-click the sidebar toggle button to pick it.cmux sidebar validate <name> # parse/interpret check with real data shapes cmux sidebar select <name> - Iterate. Saving hot-reloads in place (
cmux sidebar reloadforces it). Verify rows show real data and taps do the right thing before declaring it done.
Authoring rules
- Bind to the
workspacescontext instead of hard-coding text, so the sidebar stays correct on its own. - Rows that represent something openable run the matching
cmux(...)action on tap. A list that only displays text is rarely what they wanted. - Use
Reorderablefor workspace-like lists; it gives persisted drag-and-drop reordering for free. - Keep it native and uncluttered: a title, a divider, then the content.
- Cap long lists (
.prefix(20), filter/sort before rendering). The sidebar re-evaluates about once a second. - Stay inside the supported subset. Unsupported syntax is skipped gracefully rather than crashing, but choose the closest supported approach instead of shipping a half-blank sidebar.
Quick start
cat > ~/.config/cmux/sidebars/mine.swift <<'SWIFT'
VStack(alignment: .leading, spacing: 8) {
Text("My sidebar").font(.title3).bold()
Text(clock.time).font(.caption).foregroundColor(.secondary)
Divider()
Reorderable(workspaces, move: "workspace.reorder") { w in
Button(action: { cmux("workspace.select", workspace_id: w.id) }) {
HStack {
Text(w.selected ? "●" : "○").foregroundColor(w.selected ? "#FF8800" : .secondary)
Text(w.title)
Spacer()
}.padding(4)
}
}
}
SWIFT
cmux sidebar validate mine && cmux sidebar select mine
Live data context (read-only, refreshes ~1s)
workspaces:id,title,selected,pinned,index,directory,ports+portCount,unread,status(todo/working/needs-attention/review/done),tabs+tabCount; when present alsodescription,color,branch+dirty,pr/prs({number, label, url, status, stale, branch}),progress({value, label}),latestMessage,latestPrompt,latestAt,remote({target, state, connected}).workspaces[i].tabs:id,title,focused,pinned; plusdirectory,branch+dirty,portswhen available.clock:{time, hour, minute, second, weekday, epoch}.- Scalars:
workspaceCount,selectedTitle,selectedId,unreadTotal.
Optional fields are omitted when absent; guard with if let b = w.branch { ... } or w.pr != nil ? ... : ....
Actions
A button or .onTapGesture body calls cmux("<method>", param: value), dispatched through the same surface as the CLI. Common methods: workspace.select (workspace_id), surface.focus (surface_id), workspace.reorder (workspace_id + index). openURL("https://...") opens links. Full command surface: cmux docs api.
Supported subset
Containers: stacks (including lazy), Group, List, Section, grids, ViewThatFits, ScrollView, HSplitView (two resizable columns). Content: Text, Label, Image(systemName:), Button (title and label form), `
Câu hỏi thường gặp
Tôi có cần Xcode để dùng không?
Không. Sidebar chạy lúc thực thi mà không cần bước build, Xcode hay ký số.
File sidebar được lưu ở đâu?
Trong thư mục cấu hình cmux của bạn dưới mục sidebars, với tên bạn chọn.
Nếu sidebar của tôi không xuất hiện thì sao?
Skill nói rằng bạn cần kiểm tra cài đặt beta custom sidebars đã được bật chưa.
Chi tiết
Mô tả gốc của tác giả
Build a custom cmux sidebar from a plain-language request. Use when the user asks for a custom sidebar, a sidebar that shows their workspaces/tabs/PRs/clock, a vibe-coded sidebar, or anything involving files in ~/.config/cmux/sidebars/. Covers authoring the interpreted SwiftUI-style file, enabling the beta flag, selecting it, and iterating with hot reload.
repo: manaflow-ai/cmux
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9797
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
cmux-browser
29kCho phép agent của bạn mở website trong cmux, đọc, nhấp và trích xuất thông tin từ khung trình duyệt mà không chiếm tiêu điểm của bạn.
cmux-capture
29kCho phép agent của bạn chụp ảnh màn hình hoặc ghi lại ngắn một cửa sổ cmux, để bạn có bằng chứng thực tế khi cho thấy một thay đổi trực quan hoặc một lỗi.
cmux-cloud-vm
29kCho phép agent của bạn chạy lệnh, khởi động agent lập trình và hiển thị workspace trên các máy cmux Cloud, giữ công việc chạy tiếp sau khi pane đóng.
cmux-cua
29kCho phép agent của bạn thao tác ứng dụng macOS thật qua engine Computer Use của cmux, đọc cây accessibility và nhấp, gõ, cuộn thay bạn.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.