atom2ueki/codingplankit/coding-plan-kit
Claude Code and agent skill by atom2ueki/codingplankit
- community
Checking that the SKILL.md file is still in the repository.
Integrate the CodingPlanKit Swift package into iOS 17+ / macOS 14+ apps. Use when the user wants to (a) sign users in to ChatGPT/OpenAI with OAuth 2.0 + PKCE and persist credentials in the Keychain, or (b) call the Codex backend on the signed-in user's plan instead of charging an API key. Triggers on "CodingPlanKit", "CodingPlanAuth", "CodingPlanCodex", "plan-bound API", "ChatGPT login in iOS / SwiftUI", "Codex chat in Swift", "OpenAI OAuth in Swift", "AsyncThrowingStream Codex", "image generation Codex Swift", "fetch rate limits Codex Swift". Trigger even if the user just says "add CodingPlanKit" or pastes the GitHub URL.
Install
npx vskill@latest install atom2ueki/codingplankit/coding-plan-kitSKILL.md
CodingPlanKit integration skill
CodingPlanKit is an umbrella Swift package (iOS 17+ / macOS 14+, Swift 6 strict concurrency) that ships two SwiftPM products:
| Product | Purpose | Add when… | |
|---|---|---|---|
CodingPlanAuth | OAuth 2.0 + PKCE login, Keychain-backed credentials, pluggable provider registry. | The app needs to sign users in to ChatGPT (or any provider you add) and store tokens. | |
CodingPlanCodex | Plan-bound API clients on chatgpt.com/backend-api — Codex chat (buffered + streaming, with optional image generation), usage / rate limits, cloud tasks, environments, models, safety monitor. | You want to call the Codex backend using the signed-in user's plan, no API key. |
CodingPlanCodex depends on CodingPlanAuth. Pick CodingPlanAuth alone if the app only needs OAuth.
Authoritative reference
The repo ships an `llms.txt` at the root with full file-by-file index of the public surface. Read it whenever the user asks for anything beyond the patterns below: <https://raw.githubusercontent.com/atom2ueki/CodingPlanKit/main/llms.txt>
DocC catalogs are also bundled inside both targets.
Install
In Package.swift:
For an iOS app target, register a custom URL scheme in Info.plist (e.g. myapp) so ASWebAuthenticationSession returns cleanly from the OAuth redirect.
Sign-in (SwiftUI, the canonical pattern)
For an @Observable view-model that already wraps AuthService, use AuthState(service:providerId:) from CodingPlanAuth.
Calling Codex (plan-bound)
After sign-in, Credentials.accountId is non-nil — that's the chatgpt-account-id header the backend uses to bill the user's plan.
Buffered
Streaming text deltas
Streaming text + image events
Usage / rate limits
Other plan-bound endpoints (use only when relevant)
OpenAICodexEnvironmentsClient—wham/environmentsand config-requirements fileOpenAICodexModelsClient—codex/models(pass a recent CLI semver asclientVersion, e.g."0.150.0"— the backend rejects non-SemVer or stale values)OpenAICodexTasksClient— list / get / create cloud tasks, sibling turnsOpenAICodexSafetyClient— ARC monitor; auth via plan credentials orCODEX_ARC_MONITOR_TOKENOpenAICodexClient.compactResponse(...)andsummarizeMemories(...)— Codex agent loop helpers
Behaviours worth knowing
- Tokens auto-refresh.
AuthService.credentials(for:)returns a refreshedCredentialsif the access token is pastexpiresAt - 60s. Always call it on the way to a Codex request rather than caching the value. - Errors are typed.
AuthError.tokenExchangeFailed(statusCode:message:)carries the HTTP status.CodexError.backendError(statusCode: Int?, message:)—statusCodeis nil when the failure was reported as an SSE event over an HTTP 200 stream (response.failed/response.incomplete).CodexError.missingAccountIdmeans the user isn't actually on a plan-bound account; treat as "log them out and ask to sign in again".- Custom URL schemes vs. localhost.
OpenAIAuthProvider(callbackScheme:)switches the engine to bridge through your scheme soASWebAuthenticationSessioncan dismiss; without it the provider redirects through a localhost server on port 1455 by default. - App Group / extension sharing. Pass
accessGroup:toKeychainTokenStorageto share credentials with widgets / extensions. - Long stalls during image generation. The streaming request timeout is 5 minutes by default — image events (
.started/.generating/.keepalive) fire while bytes are silent.
Adding a new auth provider (Anthropic, Google, …)
Three files, no changes to Core/:
XxxOAuthConfig— static factory returning anOAuthConfig(client id, endpoints, scopes).XxxTokenResponseParser: OAuth2TokenResponseParser— decodes the provider's JWT claim shape intoCredentials.XxxAuthProvider: AuthProvider— actor that constructs anOAuth2PKCEFlow(providerId:config:parser:…)and forwardsbeginLogin()/refresh(credentials:)to it.
Plan-bound API clients for that provider should ship in their own SPM target / product so adopters who only want auth don't take them along.
Things to avoid
- Don't read
Credentials.accessTokendirectly — always go throughAuthService.credentials(for:)so refresh happens. - Don't keep the
LoginSessionaround aftercomplete(with:)— it's single-shot. - Don't put the OpenAI client id in your own config —
OpenAIOAuthConfig.default()already matches the official Codex CLI flow. - Don't roll your own SSE parsing on top of
streamTextResponse— usestreamResponseif you need image events.
When to fetch the source for verification
Reach for the file via the llms.txt path when:
- The user references a type not covered above (
JSONValue,CodexArcResult,CodexTaskListItem, etc.). - They want to write a new provider and need the protocol shapes.
- They get a typed error you don't recognise.
The repo follows Hexagonal / Ports-and-Adapters: domain protocols in Sources/CodingPlanAuth/Core/, infrastructure adapters in Infrastructure/, provider strategies in Providers/. The llms.txt index links each file directly.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/coding-plan-kit/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/atom2ueki/codingplankit/coding-plan-kit)