skills/generators/force-update/SKILL.md
Generates a minimum version enforcement system with hard-block and soft-prompt update flows, App Store redirect, and remote config or App Store lookup for version checks. Use when user wants force update, mandatory update, or minimum version check.
npx skillsauth add taiberium/claude_code_setting force-updateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a minimum version check system that blocks app usage when a critical update is required, or shows a dismissible prompt for recommended updates. Checks the current app version against a remote configuration endpoint or the App Store lookup API and presents the appropriate UI.
Use this skill when the user:
Search for existing version check code:
Glob: **/*ForceUpdate*.swift, **/*VersionCheck*.swift, **/*UpdateManager*.swift, **/*AppVersion*.swift
Grep: "ForceUpdate" or "minimumVersion" or "mandatoryUpdate" or "CFBundleShortVersionString"
If an existing update mechanism is found:
Search for existing networking code:
Glob: **/*API*.swift, **/*Client*.swift, **/*Network*.swift
Grep: "APIClient" or "URLSession" or "NetworkService"
If a networking layer exists, generate the version checker to use it rather than raw URLSession.
Ask user via AskUserQuestion:
Update check source?
Update types to support?
Check frequency?
Include skip option for soft updates?
Read templates.md for production Swift code.
Generate these files:
AppVersion.swift — Semantic version model (major.minor.patch) with ComparableUpdateRequirement.swift — Enum: none, softUpdate, hardUpdate with message and store URLVersionChecker.swift — Protocol + implementation based on chosen sourceUpdateManager.swift — @Observable manager that coordinates checks, caches timing, exposes stateForceUpdateView.swift — Full-screen blocking view with App Store buttonSoftUpdateBannerView.swift — Dismissible banner with Update and Later buttonsUpdateCheckModifier.swift — ViewModifier that auto-checks on appear and presents UICheck project structure:
Sources/ exists → Sources/ForceUpdate/App/ exists → App/ForceUpdate/ForceUpdate/After generation, provide:
ForceUpdate/
├── AppVersion.swift # Semantic version model with Comparable
├── UpdateRequirement.swift # none / softUpdate / hardUpdate enum
├── VersionChecker.swift # Protocol + remote/App Store implementation
├── UpdateManager.swift # @Observable coordinator
├── ForceUpdateView.swift # Full-screen blocking UI
├── SoftUpdateBannerView.swift # Dismissible banner UI
└── UpdateCheckModifier.swift # ViewModifier for auto-check
Add the modifier to your root view:
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.checkForUpdates()
}
}
}
Custom configuration:
ContentView()
.checkForUpdates(
checker: RemoteJSONVersionChecker(
url: URL(string: "https://api.example.com/app-config")!
),
frequency: .daily
)
Manual check from a settings screen:
struct SettingsView: View {
@Environment(UpdateManager.self) private var updateManager
var body: some View {
Section("App") {
if case .softUpdate(_, let message) = updateManager.requirement {
Button("Update Available") {
updateManager.openAppStore()
}
}
Button("Check for Updates") {
Task { await updateManager.checkNow() }
}
}
}
}
@Test
func hardUpdateBlocksWhenBelowMinimum() async throws {
let checker = MockVersionChecker(
requirement: .hardUpdate(
version: AppVersion(major: 2, minor: 0, patch: 0),
message: "Critical security fix"
)
)
let manager = UpdateManager(
checker: checker,
currentVersion: AppVersion(major: 1, minor: 0, patch: 0)
)
await manager.checkNow()
guard case .hardUpdate = manager.requirement else {
Issue.record("Expected hard update requirement")
return
}
}
@Test
func softUpdateAllowsSkip() async throws {
let checker = MockVersionChecker(
requirement: .softUpdate(
version: AppVersion(major: 1, minor: 5, patch: 0),
message: "New features available"
)
)
let manager = UpdateManager(
checker: checker,
currentVersion: AppVersion(major: 1, minor: 0, patch: 0)
)
await manager.checkNow()
manager.skipCurrentUpdate()
#expect(manager.requirement == .none)
}
@Test
func respectsCheckFrequency() async throws {
let checker = MockVersionChecker(requirement: .none)
let manager = UpdateManager(checker: checker, frequency: .daily)
await manager.checkNow()
#expect(checker.checkCount == 1)
// Second check within frequency window should skip
await manager.checkIfNeeded()
#expect(checker.checkCount == 1)
}
// In your App's root view
ContentView()
.checkForUpdates(frequency: .everyLaunch)
The remote JSON should differentiate between hard and soft:
{
"minimumVersion": "2.0.0",
"minimumVersionMessage": "This version is no longer supported. Please update for security fixes.",
"recommendedVersion": "2.1.0",
"recommendedVersionMessage": "Update for new features and improvements.",
"storeURL": "https://apps.apple.com/app/id123456789"
}
SoftUpdateBannerView(
message: "A new version is available",
onUpdate: { updateManager.openAppStore() },
onSkip: { updateManager.skipCurrentUpdate() }
)
The iTunes Search API (itunes.apple.com/lookup?bundleId=...) has undocumented rate limits. For high-volume apps, prefer a remote JSON endpoint you control. Cache the response and avoid calling on every cold launch.
Never compare version strings lexicographically — "9.0.0" > "10.0.0" evaluates to true. Always parse into semantic version components (major, minor, patch) and compare numerically.
If the user hasn't completed onboarding, defer the force update check until after. Blocking a first-launch user with an update screen creates confusion.
If the version check network request fails, do not block the user. Default to .none (allow usage). Only block when you have a confirmed response that the version is below minimum.
Skip force update checks for TestFlight and debug builds. TestFlight builds always have a higher build number but may have a lower marketing version during development:
#if DEBUG
// Skip version check
#else
// Check version
#endif
Apple may reject apps that show an update prompt during review if the current App Store version is the one under review. Consider disabling the check when the app is running in a sandbox/review environment.
generators/networking-layer — Base networking layer for API callsgenerators/feature-flags — Feature flags can control update enforcementgenerators/whats-new — Show what's new after an update completestools
Generates multi-step onboarding flows with persistence for iOS/macOS apps. Use when user wants to add onboarding, welcome screens, or first-launch experience.
tools
Generates an offline operation queue with persistence, automatic retry on connectivity, and conflict resolution. Use when user needs offline-first behavior, queued mutations, or pending operations that sync when back online.
development
Generates offer code distribution strategies and configuration guides for subscription and IAP promotions — including partner campaigns, influencer programs, and email re-engagement. Use when setting up offer codes for distribution.
tools
Generates a protocol-based networking layer with async/await, error handling, and swappable implementations. Use when user wants to add API client, networking, or HTTP layer.