agentleFS
robinebersrobinebers/openusage/.agents/skills/macos-build-run-debug/SKILL.md

macos-build-run-debug

Skill4.3k starsChanged 5 months agoMITView on GitHub

Build, run, and debug macOS apps with shell-first Xcode and Swift workflows. Use when launching apps or diagnosing build, startup, or runtime failures.

1 other project uses a version of this.

Trending

Quiet since October.about the whole repository

Jan 2026: 0 mentionsFeb 2026: 1 mentionMar 2026: 0 mentionsApr 2026: 6 mentionsMay 2026: 0 mentionsJun 2026: 1 mentionJul 2026: 1 mentionAug 2026: 6 mentionsSep 2026: 7 mentionsOct 2026: 4 mentionsNov 2026: 0 mentionsDec 2026: 0 mentions
Jan 2026Jul 2026Dec 2026
Mentions a month of the robinebers/openusage repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about robinebers/openusage

The biggest 5 of 26 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 26

Talked about on GitHub, Bluesky and Hacker News (26 times).

On GitHub · 23

18 more on GitHub

On Hacker News · 1

The file

Show its rules and text

We split this skill into the rules it gives an agent

30 rules. About 0 are common, 18 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈18

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill to set up one project-local script/build_and_run.sh entrypoint, then use that script as the default build/run path.

    line 10
  2. Distinctive:

    Do not assume simulators, touch interaction, or mobile-specific tooling.

    line 21
  3. Distinctive:

    If an Xcode-aware MCP surface is already available and the user explicitly wants it, use it only where it fits.

    line 23
  4. Distinctive:

    Check whether the workspace is already inside a git repo with git rev-parse --is-inside-work-tree.

    line 31
  5. Distinctive:

    If no git repo is present, run git init at the project/workspace root before building so git-backed features are available.

    line 32
  6. Very specific:

    Look for .xcworkspace, .xcodeproj, and Package.swift.

    line 33
  7. Distinctive:

    If more than one candidate exists, explain the default choice and the ambiguity.

    line 34
  8. Distinctive:

    use raw executable launch only for true command-line tools,

    line 40
  9. Very specific:

    use a generated project-local .app bundle for AppKit/SwiftUI GUI apps.

    line 41
  10. Very specific:

    Create or update script/build_and_run.sh.

    line 44
  11. Distinctive:

    stop the existing running app/process if present,

    line 47
  12. Distinctive:

    Add optional flags for debugging/log inspection:

    line 50
  13. Distinctive:

    Keep the default no-flag path simple: kill, build, run.

    line 55
  14. Very specific:

    Prefer writing one script that owns this workflow instead of repeatedly asking the agent to manually run swift build, locate the artifact, …

    line 56
  15. Distinctive:

    Do not recommend direct SwiftPM executable launch for AppKit/SwiftUI GUI apps.

    line 59
  16. Very specific:

    Use references/build-run-script.md as the canonical source for the script shape.

    line 60
  17. Very specific:

    Keep the run script outside app source.

    line 63
  18. Very specific:

    Use ./script/build_and_run.sh --debug, --logs, --telemetry, or --verify when the user asks for debugger/log/telemetry/process verification …

    line 67
  19. Very specific:

    Use the script's --logs or --telemetry mode for config, entitlement, sandbox, and action-event verification.

    line 74
  20. Very specific:

    Use the script's --debug mode or direct lldb if symbolized crash debugging is needed.

    line 76
  21. Very specific:

    If the user needs to instrument and verify specific window, sidebar, menu, or menu bar actions, switch to macos-telemetry.

    line 77
  22. Distinctive:

    Keep evidence tight and user-facing.

    line 78
  23. Distinctive:

    Use Xcode-aware MCP tooling only when it helps.

    line 80
  24. Distinctive:

    If the user explicitly asks for XcodeBuildMCP and it is already available, prefer it over ad hoc setup.

    line 81
  25. Distinctive:

    Use the MCP for Xcode-aware discovery or debug/logging workflows when the available tool surface clearly matches the task.

    line 82
  26. Distinctive:

    Prefer the narrowest command that proves or disproves the current theory.

    line 105
  27. Very specific:

    Do not leave the user with a one-off manual command chain once a stable build_and_run.sh script can own the workflow.

    line 106
  28. Distinctive:

    Do not claim UI state you cannot inspect directly.

    line 108
  29. Distinctive:

    Do not describe mobile or simulator workflows as if they apply to macOS.

    line 109
  30. Distinctive:

    If build output is huge, summarize the first real blocker and point to follow-up commands.

    line 110

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Build / Run / Debug

Quick Start

Use this skill to set up one project-local script/build_and_run.sh entrypoint, then use that script as the default build/run path.

Prefer shell-first workflows:

  • ./script/build_and_run.sh as the single kill + build + run entrypoint once it exists
  • xcodebuild for Xcode workspaces or projects
  • swift build plus raw executable launch inside that script for true SwiftPM command-line tools
  • swift build plus project-local .app bundle staging and /usr/bin/open -n launch for SwiftPM AppKit/SwiftUI GUI apps
  • optional script flags for lldb, log stream, telemetry verification, or post-launch process checks

Do not assume simulators, touch interaction, or mobile-specific tooling.

If an Xcode-aware MCP surface is already available and the user explicitly wants it, use it only where it fits. Keep that usage narrow and honest: prefer it for Xcode-oriented discovery, logging, or debugging support, and do not force simulator-specific workflows onto pure macOS tasks.

Workflow

  1. Discover the project shape.
    • Check whether the workspace is already inside a git repo with git rev-parse --is-inside-work-tree.
    • If no git repo is present, run git init at the project/workspace root before building so git-backed features are available. Never run git init inside a nested subdirectory when the current workspace already belongs to a parent repo.
    • Look for .xcworkspace, .xcodeproj, and Package.swift.
    • If more than one candidate exists, explain the default choice and the ambiguity.
  2. Resolve the runnable target and process name.
    • For Xcode, list schemes and prefer the app-producing scheme unless the user names another one.
    • For SwiftPM, identify executable products when possible.
    • Split SwiftPM launch handling by product type:
      • use raw executable launch only for true command-line tools,
      • use a generated project-local .app bundle for AppKit/SwiftUI GUI apps.
    • Determine the app/process name to kill before relaunching.
  3. Create or update script/build_and_run.sh.
    • Make the script project-specific and executable.
    • It should always:
      1. stop the existing running app/process if present,
      2. build the macOS target,
      3. launch the freshly built app or executable.
    • Add optional flags for debugging/log inspection:
      • --debug to launch under lldb or attach the debugger
      • --logs to stream process logs after launch
      • --telemetry to stream unified logs filtered to the app subsystem/category
      • --verify to launch the app and confirm the process exists with pgrep -x <AppName>
    • Keep the default no-flag path simple: kill, build, run.
    • Prefer writing one script that owns this workflow instead of repeatedly asking the agent to manually run swift build, locate the artifact, then invoke an ad hoc run command.
    • For SwiftPM GUI apps, make the script build the product, create dist/<AppName>.app, copy the binary to Contents/MacOS/<AppName>, generate a minimal Contents/Info.plist with CFBundlePackageType=APPL, CFBundleExecutable, CFBundleIdentifier, CFBundleName, LSMinimumSystemVersion, and NSPrincipalClass=NSApplication, then launch with /usr/bin/open -n <bundle>.
    • For SwiftPM GUI --logs and --telemetry, launch the bundle with /usr/bin/open -n first, then stream unified logs with /usr/bin/log stream --info ....
    • Do not recommend direct SwiftPM executable launch for AppKit/SwiftUI GUI apps.
    • Use references/build-run-script.md as the canonical source for the script shape. Do not fork a second authoritative snippet in another skill or command.
    • Keep the run script outside app source. It belongs in script/build_and_run.sh, not in App/, Views/, Models/, Stores/, Services/, or Support/.
  4. Build and run through the script.
    • Default to ./script/build_and_run.sh.
    • Use ./script/build_and_run.sh --debug, --logs, --telemetry, or --verify when the user asks for debugger/log/telemetry/process verification support.
  5. Summarize failures correctly.
    • Classify the blocker as compiler, linker, signing, build settings, missing SDK/toolchain, script bug, or runtime launch.
    • Quote the smallest useful error snippet and explain what it means.
  6. Debug the right way.
    • Use the script's --logs or --telemetry mode for config, entitlement, sandbox, and action-event verification.
    • For SwiftPM GUI apps, if the app bundle launches but its window still does not come forward, check whether the entrypoint needs NSApp.setActivationPolicy(.regular) and NSApp.activate(ignoringOtherApps: true).
    • Use the script's --debug mode or direct lldb if symbolized crash debugging is needed.
    • If the user needs to instrument and verify specific window, sidebar, menu, or menu bar actions, switch to macos-telemetry.
    • Keep evidence tight and user-facing.
  7. Use Xcode-aware MCP tooling only when it helps.
    • If the user explicitly asks for XcodeBuildMCP and it is already available, prefer it over ad hoc setup.
    • Use the MCP for Xcode-aware discovery or debug/logging workflows when the available tool surface clearly matches the task.
    • Fall back to shell commands immediately when the MCP does not provide a clean macOS path.

Preferred Commands

  • Project discovery:
    • find . -name '*.xcworkspace' -o -name '*.xcodeproj' -o -name 'Package.swift'
  • Scheme discovery:
    • xcodebuild -list -workspace <workspace>
    • xcodebuild -list -project <project>
  • Build/run:
    • ./script/build_and_run.sh
    • ./script/build_and_run.sh --debug
    • ./script/build_and_run.sh --logs
    • ./script/build_and_run.sh --telemetry
    • ./script/build_and_run.sh --verify

References

  • references/build-run-script.md: canonical build_and_run.sh contract.

Guardrails

  • Prefer the narrowest command that proves or disproves the current theory.
  • Do not leave the user with a one-off manual command chain once a stable build_and_run.sh script can own the workflow.
  • Do not launch a SwiftUI/AppKit SwiftPM GUI app as a raw executable unless the user explicitly wants to diagnose that failure mode: it can produce no Dock icon, no foreground activation, and missing bundle identifier warnings. Keep raw executable launch only for true command-line tools.
  • Do not claim UI state you cannot inspect directly.
  • Do not describe mobile or simulator workflows as if they apply to macOS.
  • If build output is huge, summarize the first real blocker and point to follow-up commands.

Output Expectations

Provide:

  • the detected project type
  • the script path you configured, if applicable
  • the command you ran
  • whether build and launch succeeded
  • the top blocker if they failed
  • the smallest sensible next action

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.