Skillpedia
المواقع والواجهات (frontend)29k · #9797

cmux-custom-sidebar

ما الذي تفعله

تكتب هذه المهارة ملف شريط جانبي لـ cmux وفق وصفك، وتفعّل الإعداد التجريبي، وتتحقق منه، وتعرضه مع إعادة تحميل فورية. وهي مناسبة لمستخدمي cmux الذين يريدون تخطيطًا خاصًا للشريط دون خطوة بناء.

متى تستخدمها

  • ✓عندما تريد شريطًا جانبيًا مخصصًا في cmux يعرض مساحات العمل أو الألسنة أو طلبات السحب.
  • ✓عندما تريد تعديل شريط جانبي مخصص موجود ورؤية النتيجة فورًا.
  • ✓عندما تطلب شريطًا جانبيًا مبنيًا بأسلوب vibe-coding في مجلد إعدادات cmux.

رابط المهارة

https://github.com/manaflow-ai/cmux/blob/main/skills/cmux-custom-sidebar/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/manaflow-ai/cmux/blob/main/skills/cmux-custom-sidebar/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“اصنع لي شريط cmux جانبيًا يعرض مساحات العمل الخاصة بي، ويتيح لي الانتقال بينها بنقرة واحدة.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يكتب الوكيل ملف شريط جانبي بأسلوب SwiftUI في مجلد الإعدادات الخاص بـ cmux، ويتحقق منه ببيانات حقيقية، ثم يختاره. ويُعاد تحميل الملف عند كل حفظ، فتظهر التغييرات فورًا.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

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

  1. 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.
  2. 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 (no struct, no var body, no imports). A .json variant exists for static layouts; prefer .swift for anything dynamic.
  3. Validate and select:
    cmux sidebar validate <name>   # parse/interpret check with real data shapes
    cmux sidebar select <name>
    
    The user can also right-click the sidebar toggle button to pick it.
  4. Iterate. Saving hot-reloads in place (cmux sidebar reload forces it). Verify rows show real data and taps do the right thing before declaring it done.

Authoring rules

  • Bind to the workspaces context 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 Reorderable for 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 also description, 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; plus directory, branch + dirty, ports when 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), `

الأسئلة الشائعة

هل أحتاج إلى Xcode لاستخدامه؟

لا. يعمل الشريط الجانبي وقت التشغيل دون خطوة بناء أو Xcode أو توقيع.

أين يُحفظ ملف الشريط الجانبي؟

في مجلد إعدادات cmux ضمن مجلد sidebars، باسم تختاره أنت.

ماذا لو لم يظهر الشريط الجانبي؟

تقول المهارة إن عليك أولًا التأكد من تفعيل إعداد الأشرطة الجانبية المخصصة التجريبي.

التفاصيل

الوصف الأصلي من المؤلف

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

الشعبية

نجوم GitHub
29k
الترتيب
#9797
الترخيص
—
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة