Chuyển đến nội dung
Skillpedia
Ứng dụng di động48k · #5127

macos-menubar-tuist-app

Skill này làm gì

Công cụ này giúp xây dựng và tổ chức ứng dụng thanh menu trên macOS bằng Tuist và SwiftUI. Nó đảm bảo các phần của ứng dụng (mạng, trạng thái, giao diện) hoạt động độc lập và dễ đoán.

Khi nào nên dùng

  • ✓Khi bạn xây dựng tiện ích thanh menu macOS bằng Tuist và SwiftUI.
  • ✓Khi bạn cần hỗ trợ về cấu trúc và các script chạy ứng dụng thanh menu.
  • ✓Khi bạn muốn giữ mã nguồn gọn gàng và dễ kiểm thử.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/macos-menubar-tuist-app/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/macos-menubar-tuist-app/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một ứng dụng thanh menu macOS bằng Tuist và SwiftUI để theo dõi pin của Mac tôi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ chia mã nguồn thành các phần riêng: mô hình dữ liệu, logic mạng, quản lý trạng thái và giao diện menu. Nó dùng Tuist để quản lý dự án và các script để chạy và kiểm thử dễ hơn.

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.

macos-menubar-tuist-app

Build and maintain macOS menubar apps with a Tuist-first workflow and stable launch scripts. Preserve strict architecture boundaries so networking, state, and UI remain testable and predictable.

When to Use

  • When working on LSUIElement menubar utilities built with Tuist and SwiftUI.
  • When you need Tuist manifests, launch scripts, or architecture guidance for a menubar app.

Core Rules

  • Keep the app menubar-only unless explicitly told otherwise. Use LSUIElement = true by default.
  • Keep transport and decoding logic outside views. Do not call networking from SwiftUI view bodies.
  • Keep state transitions in a store layer (@Observable or equivalent), not in row/view presentation code.
  • Keep model decoding resilient to API drift: optional fields, safe fallbacks, and defensive parsing.
  • Treat Tuist manifests as the source of truth. Do not rely on hand-edited generated Xcode artifacts.
  • Prefer script-based launch for local iteration when tuist run is unreliable for macOS target/device resolution.
  • Prefer tuist xcodebuild build over raw xcodebuild in local run scripts when building generated projects.

Expected File Shape

Use this placement by default:

  • Project.swift: app target, settings, resources, Info.plist keys
  • Sources/*Model*.swift: API/domain models and decoding
  • Sources/*Client*.swift: requests, response mapping, transport concerns
  • Sources/*Store*.swift: observable state, refresh policy, filtering, caching
  • Sources/*Menu*View*.swift: menu composition and top-level UI state
  • Sources/*Row*View*.swift: row rendering and lightweight interactions
  • run-menubar.sh: canonical local restart/build/launch path
  • stop-menubar.sh: explicit stop helper when needed

Workflow

  1. Confirm Tuist ownership
  • Verify Tuist.swift and Project.swift (or workspace manifests) exist.
  • Read existing run scripts before changing launch behavior.
  1. Probe backend behavior before coding assumptions
  • Use curl to verify endpoint shape, auth requirements, and pagination behavior.
  • If endpoint ignores limit/page, implement full-list handling with local trimming in the store.
  1. Implement layers from bottom to top
  • Define/adjust models first.
  • Add or update client request/decoding logic.
  • Update store refresh, filtering, and cache policy.
  • Wire views last.
  1. Keep app wiring minimal
  • Keep app entry focused on scene/menu wiring and dependency injection.
  • Avoid embedding business logic in App or menu scene declarations.
  1. Standardize launch ergonomics
  • Ensure run script restarts an existing instance before relaunching.
  • Ensure run script does not open Xcode as a side effect.
  • Use tuist generate --no-open when generation is required.
  • When the run script builds the generated project, prefer TUIST_SKIP_UPDATE_CHECK=1 tuist xcodebuild build ... instead of invoking raw xcodebuild directly.

Validation Matrix

Run validations after edits:

TUIST_SKIP_UPDATE_CHECK=1 tuist xcodebuild build -scheme <TargetName> -configuration Debug

If launch workflow changed:

./run-menubar.sh

If shell scripts changed:

bash -n run-menubar.sh
bash -n stop-menubar.sh
./run-menubar.sh

Failure Patterns and Fix Direction

  • tuist run cannot resolve the macOS destination: Use run/stop scripts as canonical local run path.

  • Menu UI is laggy or inconsistent after refresh: Move derived state and filtering into the store; keep views render-only.

  • API payload changes break decode: Relax model decoding with optional fields and defaults, then surface missing data safely in UI.

  • Feature asks for quick UI patch: Trace root cause in model/client/store before changing row/menu presentation.

Completion Checklist

  • Preserve menubar-only behavior unless explicitly changed.
  • Keep network and state logic out of SwiftUI view bodies.
  • Keep Tuist manifests and run scripts aligned with actual build/run flow.
  • Run the validation matrix for touched areas.
  • Report concrete commands run and outcomes.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Câu hỏi thường gặp

Tuist là gì?

Tuist là công cụ giúp quản lý dự án Xcode tự động hơn, bằng cách định nghĩa cấu trúc dự án trong file cấu hình thay vì chỉnh trực tiếp trong Xcode.

SwiftUI là gì?

SwiftUI là framework hiện đại của Apple để xây dựng giao diện cho mọi ứng dụng Apple, theo cách khai báo và đơn giản hơn.

LSUIElement là gì?

LSUIElement là thiết lập cho phép ứng dụng chạy mà không có biểu tượng trên Dock, rất phù hợp với tiện ích thanh menu.

Chi tiết

Mô tả gốc của tác giả

Build, refactor, or review SwiftUI macOS menubar apps that use Tuist.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5127
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự