with one click
choose-integration-shape
// 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.
// 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.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | choose-integration-shape |
| description | 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. |
| license | Apache-2.0 |
| compatibility | Designed for Codex and compatible Agent Skills clients working with SwiftASB v1.3.1 or newer, Swift 6, SwiftPM, SwiftUI, AppKit, and local Codex app-server integrations. |
| metadata | {"owner":"gaelic-ghost","repo":"socket","package":"SwiftASB","category":"swiftasb-planning"} |
| allowed-tools | Read Bash(rg:*) Bash(git:*) |
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, who owns each conversation thread, where active turn state is shown, where app-server-owned worktree, selected Git status, project identity, thread source, filesystem/config/extension/MCP-resource 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/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.fs, CodexAppServer.config, CodexAppServer.extensions, CodexAppServer.readMcpResource(_:), and CodexWorkspaceSwiftASBFeaturePolicy, and mutation visibility comes from CodexAppServer.featureOperationEvents()swift 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 changesSwiftASBFeaturePolicy 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.readMcpResource(_:) for 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, extension inventory, marketplace maintenance, and runtime facts that should come from the app-serverCodexThread.makeDashboard() for thread-wide activityCodexTurnHandle.minimap for active turn stateCodexAppServerStartupError, 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.LibraryCodexThreadHandoff: 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.extensions, CodexAppServer.readMcpResource(_:), 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, 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-resource/workspace facts, cancellation, and, when relevant, feature-policy choices, mutation-operation events, selected-worktree Git status, and marketplace maintenance.Validation path: exact build/test family to run.Next skill: the next SwiftASB or Apple workflow skill.