build-run-debug

작성자: openai

로컬 macOS 앱과 데스크탑 실행 파일을 셸 우선 Xcode 및 Swift 워크플로를 사용하여 빌드, 실행 및 디버그합니다. Mac 앱을 빌드하거나 실행하라는 요청을 받았을 때 사용합니다.

npx skills add https://github.com/openai/plugins --skill build-run-debug

Build / Run / Debug

Quick Start

Use this skill to set up one project-local script/build_and_run.sh entrypoint, wire .codex/environments/environment.toml so the Codex app shows a Run button, 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 Codex app 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/run-button-bootstrap.md as the canonical source for the script shape and exact environment file format. 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. Write .codex/environments/environment.toml at the project root once the script exists.

    • Use this exact placement: .codex/environments/environment.toml.
    • Use the exact action shape in references/run-button-bootstrap.md.
    • This file is what gives the user a Codex app Run button wired to the script.
    • If the project already has this file, update the Run action command to point at ./script/build_and_run.sh instead of creating a duplicate action.
    • Keep this Codex environment config separate from Swift app source files.
  5. 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.
  6. 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.
  7. 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 telemetry.
    • Keep evidence tight and user-facing.
  8. 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/run-button-bootstrap.md: canonical build_and_run.sh and .codex/environments/environment.toml 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 write .codex/environments/environment.toml before the run script exists, and do not point the Run action at a stale script path.
  • 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 and Codex environment action you configured, if applicable
  • the command you ran
  • whether build and launch succeeded
  • the top blocker if they failed
  • the smallest sensible next action

openai의 다른 스킬

user-context
openai
데이터 분석 플러그인의 지속적인 소스 라우팅 기본 설정, 온보딩 로직, 설정 진행 상황 및 의미 계층 레지스트리를 로드하거나 관리합니다.
official
notion-research-documentation
openai
Notion 콘텐츠를 조사하고 인용문과 함께 구조화된 브리핑, 보고서 또는 비교 자료로 종합합니다. 대상 질의를 사용해 Notion 페이지를 검색하고 가져온 후, 인라인 출처 인용과 참고 문헌 섹션을 포함해 주제별로 결과를 정리합니다. 범위와 사용자 목표에 따라 네 가지 출력 형식(빠른 브리핑, 연구 요약, 비교, 종합 보고서) 중에서 선택합니다. 내장 템플릿을 사용해 Notion 페이지를 생성 및 업데이트하고, 새 정보가 도착하면 출처를 직접 연결하고 변경 사항을 추적합니다...
official
rcsb-pdb-skill
openai
핵심 메타데이터, Search API 쿼리 및 FASTA 다운로드를 위한 간결한 RCSB PDB 요청을 제출합니다. 사용자가 간결한 RCSB 요약을 원할 때 사용하며, 원시 JSON 또는…을 저장합니다.
official
pdf
openai
PDF 읽기, 생성 및 검증 기능을 제공하며, 시각적 렌더링과 프로그래매틱 생성을 지원합니다. Poppler(pdftoppm)를 사용하여 PDF 페이지를 PNG로 렌더링하여 레이아웃, 간격, 타이포그래피를 시각적으로 검사할 수 있습니다. reportlab을 사용하여 프로그래매틱 방식으로 PDF를 생성하여 안정적인 포맷을 보장하며, pdfplumber 또는 pypdf를 통해 텍스트와 메타데이터를 추출합니다. 품질 기준을 준수합니다: 잘린 텍스트, 겹치는 요소, 깨진 표, 렌더링 아티팩트가 없어야 하며, ASCII 하이픈만 사용하고 사람이 읽을 수 있는 인용을 사용합니다.
official
test-coverage-improver
openai
Improve test coverage in the OpenAI Agents JS monorepo: run `pnpm test:coverage`, inspect coverage artifacts, identify low-coverage files and branches, propose…
official
playwright
openai
터미널 기반 브라우저 자동화로 요소 스냅샷 및 대화형 UI 워크플로우 지원. playwright-cli 래퍼 스크립트를 통해 작동하며(npx 필요), 헤드리스 및 헤드 모드 모두 지원하여 시각적 디버깅 가능. 핵심 워크플로우: 페이지 열기, 안정적인 요소 참조를 위한 스냅샷 생성, 참조를 사용한 상호작용, 탐색 또는 DOM 변경 후 재스냅샷. 양식 작성, 클릭, 타이핑, 다중 탭 관리, 스크린샷/PDF 캡처, 흐름 디버깅을 위한 트레이스 기록 포함. 요소 참조(예: e3, e15)...
official
ukb-topmed-phewas-skill
openai
단일 변이에 대한 간결한 UKB-TOPMed PheWAS 요약을 가져오며, rsID, GRCh37 또는 GRCh38 입력을 받아 필요한 GRCh38 쿼리로 변환합니다. 다음과 같은 경우에 사용하세요…
official
code-review-context
openai
모델 가시 컨텍스트
official