‹ 首页

macos-menubar-tuist-app

@dimillian · 收录于 1 周前 · 上游提交 4 个月前

Build, refactor, or review macOS menubar apps that use Tuist and SwiftUI. Use when creating or maintaining LSUIElement menubar utilities, defining Tuist targets/manifests, implementing model-client-store-view architecture, adding script-based launch flows, or validating reliable local build/run behavior without Xcode-first workflows.

适合你,如果你在用 Tuist 和 SwiftUI 开发 macOS 菜单栏应用。

/ 通过 npx 安装 校验哈希
npx oh-my-skill add dimillian/skills/macos-menubar-tuist-app
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- dimillian/skills/macos-menubar-tuist-app
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify dimillian/skills/macos-menubar-tuist-app
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
3846GitHub stars
~869最小装载
~869含声明引用
~921文本包总量
索引托管

怎么用

商店整理自技能原文 · 版本 05ba982 · 表述以原文为准
它做什么

帮你用 Tuist 和 SwiftUI 构建、重构或审查 macOS 菜单栏应用。它会保持 LSUIElement 为 true,把网络、状态和 UI 分离到不同文件,并生成可运行的脚本。

什么时候触发

当你创建或维护 macOS 菜单栏工具,定义 Tuist 目标/清单,实现模型-客户端-存储-视图架构,添加脚本启动流程,或验证本地构建/运行行为时触发。

装好后可以这样说
它会生成 Project.swift 和分层文件结构。
它会更新 store 和 client 层,不修改视图逻辑。
它会验证 run-menubar.sh 并建议修改。
技能原文 SKILL.md作者撰写 · MIT · 05ba982

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.

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
  2. Verify Tuist.swift and Project.swift (or workspace manifests) exist.
  3. Read existing run scripts before changing launch behavior.
  1. Probe backend behavior before coding assumptions
  2. Use curl to verify endpoint shape, auth requirements, and pagination behavior.
  3. If endpoint ignores limit/page, implement full-list handling with local trimming in the store.
  1. Implement layers from bottom to top
  2. Define/adjust models first.
  3. Add or update client request/decoding logic.
  4. Update store refresh, filtering, and cache policy.
  5. Wire views last.
  1. Keep app wiring minimal
  2. Keep app entry focused on scene/menu wiring and dependency injection.
  3. Avoid embedding business logic in App or menu scene declarations.
  1. Standardize launch ergonomics
  2. Ensure run script restarts an existing instance before relaunching.
  3. Ensure run script does not open Xcode as a side effect.
  4. Use tuist generate --no-open when generation is required.
  5. 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.
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。