From swiftasb-skills
Choose the right SwiftASB integration shape for a SwiftUI app, AppKit app, command-line tool, helper service, package library, test harness, or mixed Swift project before implementation starts.
How this skill is triggered — by the user, by Claude, or both
Slash command
/swiftasb-skills:choose-integration-shapeThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
When a task combines SwiftData with SwiftUI, keep SwiftData directly coupled to SwiftUI through Apple's data-driven path: `modelContainer`, environment `modelContext`, `@Query`, SwiftData model objects, and bindings. Do not add repositories, stores, service layers, DTO mirrors, view-model caches, wrapper objects, or other abstraction layers between SwiftData and SwiftUI. If this skill is not th...
When a task combines SwiftData with SwiftUI, keep SwiftData directly coupled to SwiftUI through Apple's data-driven path: modelContainer, environment modelContext, @Query, SwiftData model objects, and bindings. Do not add repositories, stores, service layers, DTO mirrors, view-model caches, wrapper objects, or other abstraction layers between SwiftData and SwiftUI. If this skill is not the right owner for SwiftData-backed SwiftUI work, hand off to apple-dev-skills:swiftui-app-architecture-workflow instead of inventing an intermediate data layer.
Pick the smallest correct way for a project to use SwiftASB before code changes begin.
The practical decision is who owns the local Codex runtime, who owns the app-wide stored-thread library and inventory companions, who owns each conversation thread and its agenda, where active turn state is shown, where app-server-owned worktree, selected Git status, project identity, thread source, filesystem/config/extension/MCP facts appear, which SwiftASB feature categories the host app enables, and how much SwiftASB behavior should be exposed through the user's own app or package API.
Verify current SwiftASB docs and public API before naming exact symbols:
README.mdSources/SwiftASB/SwiftASB.docc/GettingStartedWithSwiftASB.mdSources/SwiftASB/SwiftASB.docc/SwiftUIObservableCompanions.mdSources/SwiftASB/SwiftASB.docc/ThreadHistoryAndObservables.mdSources/SwiftASB/SwiftASB.docc/AppWideCapabilities.mdSources/SwiftASB/SwiftASB.docc/CodexInventory.mdSources/SwiftASB/SwiftASB.docc/CodexMCP.mdSources/SwiftASB/SwiftASB.docc/CodexFS.mdSources/SwiftASB/SwiftASB.docc/CodexConfig.mdSources/SwiftASB/SwiftASB.docc/CodexExtensions.mdSources/SwiftASB/SwiftASB.docc/CodexWorkspace.mdSources/SwiftASB/SwiftASB.docc/FeaturePermissionPolicy.mdSources/SwiftASB/SwiftASB.docc/ThreadHistoryAndObservables.mdSources/SwiftASB/Public/For SwiftUI, AppKit, SwiftPM, or Xcode behavior, use Apple Dev Skills and Apple documentation first. SwiftASB chooses the Codex integration shape; Apple frameworks still own app lifecycle, view updates, window behavior, and project execution.
CodexAppServerCodexAppServer.start(_:) so startup, compatibility validation, initialization, selected-CLI diagnostics, and typed startup errors stay in one SwiftASB-owned callCodexAppServer.Library when the UI lists stored threads before a thread is chosenCodexThreadCodexTurnHandleCodexAppServer.makeInventory(configuration:); advanced extension pagination and marketplace upgrades stay on CodexAppServer.extensionsCodexAppServer.fs, CodexAppServer.config, CodexAppServer.extensions, CodexAppServer.mcp, and CodexWorkspaceSwiftASBFeaturePolicy, and mutation visibility comes from CodexAppServer.featureOperationEvents()CodexThread.makeAgenda(), CodexThread.startPlanningTurn(...), and CodexThread goal helpersCodexThread.startReview(against:placement:)shellCommandExecutionswift build and swift testUse an app or workspace model to own CodexAppServer, then create a CodexAppServer.Library when the UI needs a launcher, sidebar, or project browser before choosing a thread. Create a CodexThread per conversation or workspace. Store SwiftASB observable companions in a view model instead of replaying raw events into unrelated state.
Prefer:
CodexAppServer.makeLibrary(configuration:) for stored-thread sidebars, cwd or repository grouping, stable worktree groups, repository/worktree filters, selected worktree or repository context, library-local selection, CodexWorkspace.ProjectInfo project identity, CodexAppServer.ThreadSource source facts, and app-wide model/MCP/hook snapshots that refresh when app-server app/skill/MCP state changesCodexAppServer.makeInventory(configuration:) for routine app-wide capability and extension UI such as model capabilities, global MCP summaries, hook diagnostics, apps, skills, plugins, and collaboration modesSwiftASBFeaturePolicy on CodexAppServer.Configuration or CodexAppServer.Library.Configuration when the app should enable, disable, or present feature categories such as gitObservability, extensionInventory, and extensionMaintenanceCodexAppServer.Library.selectedGitStatus and refreshSelectedGitStatus() for selected-worktree Git facts when gitObservability is enabledCodexAppServer.featureOperationEvents() for human-readable records of SwiftASB-owned mutations such as marketplace upgradesCodexAppServer.ThreadListQD for repeatable thread-list intent across direct reads and library loadingCodexAppServer.fs and CodexFS.FileDiscoveryQD for sandbox-safe metadata, directory, file-byte, watch, fuzzy file-discovery UI, highlight ranges, and ranking explanationsCodexAppServer.mcp.install(_:), statusSnapshot(), and readResource(...) for MCP installs, full MCP detail reads, and app-wide or thread-scoped MCP resource contentsCodexAppServer.config, CodexAppServer.extensions, and CodexWorkspace for diagnostics, worktree snapshots, selected Git status, project identity, repository facts, permissions, advanced extension pagination, plugin-detail inspection, marketplace maintenance, and runtime facts that should come from the app-serverCodexThread.startReview(against:placement:) for app-server code review UICodexThread.sendShellCommand(_:) only when the app deliberately exposes high-impact user-level shell execution and enables shellCommandExecutionCodexThread.makeDashboard() for thread-wide activityCodexThread.makeAgenda() and CodexThread.startPlanningTurn(...) for current goal, accepted plan, proposed plan text, and explicit plan-mode controlsCodexTurnHandle.minimap for active turn stateASBPresentation, ASBAppKit, and ASBSwiftUI products when the app wants ready-made sidebar, agenda, or dashboard surfaces over SwiftASB presentation snapshotsCodexAppServerStartupError, compatibility, and turn failuresHandoff: swiftasb:build-swiftui-app.
Use an application, document, or window-controller-owned model to hold SwiftASB handles. Keep UI mutation on the main actor and make lifetime explicit so windows do not accidentally keep app-server work alive after close.
Plan:
CodexAppServer starts and stopsCodexAppServer.LibraryCodexThreadASBAppKit or ASBPresentation can provide the sidebar or presentation snapshot layer instead of custom controller stateHandoff: swiftasb:build-appkit-app.
Use CodexAppServer in a short-lived async main flow. Call start(_:), create or resume a thread, start a turn, stream terminal output or summary, and stop the app-server predictably. Use the lower-level startup calls only when the tool needs a diagnostics screen or custom compatibility decision before initialization.
Avoid building SwiftUI observable companions unless the tool also feeds a UI.
Use a long-lived owner for CodexAppServer, but keep library refreshes, thread ownership, and cancellation explicit. Document how the service starts, stops, exposes status, and avoids overlapping same-thread turns.
Treat service interruption, process cleanup, and logs as part of the product behavior.
Use CodexAppServer.fs, CodexAppServer.config, CodexAppServer.makeInventory(configuration:), CodexAppServer.extensions, CodexAppServer.mcp, CodexWorkspace, and SwiftASBFeaturePolicy when the service needs Codex-owned workspace, worktree, selected Git status, project identity, thread source, config, plugin, skill, MCP resource, filesystem facts, inventory, or extension-maintenance authority instead of reading local state directly.
Expose the package's own narrow API instead of re-exporting all SwiftASB types by default. Use SwiftASB internally unless the consumer genuinely needs direct CodexAppServer, CodexThread, or CodexTurnHandle access.
Keep live Codex tests opt-in and timeout-bounded.
Handoff: swiftasb:build-swift-package.
Prefer mock or deterministic transport tests for package behavior. Use live Codex probes only when the test's purpose is runtime compatibility, and isolate them with temporary directories and environment flags.
Return:
Chosen shape: one of SwiftUI app, AppKit app, command-line tool, helper service, package library, test harness, or mixed.SwiftASB owners: who owns CodexAppServer, CodexThread, and CodexTurnHandle.State surface: library companion, observable companions, AppKit model, CLI stream, package API, or tests.User-visible behavior: progress, approvals, errors, diagnostics, history, worktree, project identity, thread source, filesystem/config/extension/MCP/workspace facts, cancellation, and, when relevant, inventory, feature-policy choices, mutation-operation events, selected-worktree Git status, MCP installs, code reviews, shell commands, and marketplace maintenance.Validation path: exact build/test family to run.Next skill: the next SwiftASB or Apple workflow skill.sendShellCommand(_:) as a routine helper; treat it as explicit, high-impact user-level shell execution.Creates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.
npx claudepluginhub gaelic-ghost/socket --plugin swiftasb-skills