Force Update logo

Force Update

Community
rshankras
force-update

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.

Overview

Publisherrshankras
Repositoryclaude-code-apple-skills
Skill nameforce-update
Stars
744
Forks
70
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by rshankras on GitHub. Read the source before you install it.

Installation

Install the Force Update AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills.git /tmp/claude-code-apple-skills
mkdir -p .claude/skills
cp -r /tmp/claude-code-apple-skills/skills/generators/force-update .claude/skills/force-update
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Force Update in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Force Update on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Force Update is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Force Update Generator

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.

When This Skill Activates

Use this skill when the user:

  • Asks to "add force update" or "force update screen"
  • Wants "minimum version check" or "minimum version enforcement"
  • Mentions "required update" or "mandatory update"
  • Asks about "version check" or "app version check"
  • Wants an "app update prompt" or "update dialog"
  • Mentions "block old versions" or "deprecate old versions"

Pre-Generation Checks

1. Project Context Detection

  • Check Swift version (requires Swift 5.9+)
  • Check deployment target (iOS 16+ / macOS 13+)
  • Check for @Observable support (iOS 17+ / macOS 14+)
  • Identify source file locations

2. Conflict Detection

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:

  • Ask if user wants to replace or extend it
  • If extending, integrate with the existing check flow

3. Network Layer Detection

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.

Configuration Questions

Ask user via AskUserQuestion:

  1. Update check source?

    • Remote JSON endpoint (your own server hosts a JSON config) — recommended
    • App Store lookup API (uses iTunes Search API, no server needed)
    • Firebase Remote Config (requires Firebase SDK)
  2. Update types to support?

    • Hard block only (always force update)
    • Soft prompt only (always dismissible)
    • Both hard block and soft prompt — recommended
  3. Check frequency?

    • Every app launch
    • Once per day — recommended
    • Once per week
  4. Include skip option for soft updates?

    • Yes — user can skip a specific version and won't be prompted again until a newer version is available
    • No — prompt shows every time (respecting check frequency)

Generation Process

Step 1: Read Templates

Read templates.md for production Swift code.

Step 2: Create Core Files

Generate these files:

  1. AppVersion.swift — Semantic version model (major.minor.patch) with Comparable
  2. UpdateRequirement.swift — Enum: none, softUpdate, hardUpdate with message and store URL
  3. VersionChecker.swift — Protocol + implementation based on chosen source

Step 3: Create Manager

  1. UpdateManager.swift — @Observable manager that coordinates checks, caches timing, exposes state

Step 4: Create UI Files

  1. ForceUpdateView.swift — Full-screen blocking view with App Store button
  2. SoftUpdateBannerView.swift — Dismissible banner with Update and Later buttons

Step 5: Create Integration

  1. UpdateCheckModifier.swift — ViewModifier that auto-checks on appear and presents UI

Step 6: Determine File Location

Check project structure:

  • If Sources/ exists → Sources/ForceUpdate/
  • If App/ exists → App/ForceUpdate/
  • Otherwise → ForceUpdate/

Output Format

After generation, provide:

Files Created

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

Integration Steps

Add the modifier to your root view:

swift
@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
                .checkForUpdates()
        }
    }
}

Custom configuration:

swift
ContentView()
    .checkForUpdates(
        checker: RemoteJSONVersionChecker(
            url: URL(string: "https://api.example.com/app-config")!
        ),
        frequency: .daily
    )

Manual check from a settings screen:

swift
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() }
            }
        }
    }
}

Testing

swift
@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)
}

Common Patterns

Check on Every Launch

swift
// In your App's root view
ContentView()
    .checkForUpdates(frequency: .everyLaunch)

Hard Block for Critical Security Updates

The remote JSON should differentiate between hard and soft:

json
{
    "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"
}

Soft Prompt with Skip

swift
SoftUpdateBannerView(
    message: "A new version is available",
    onUpdate: { updateManager.openAppStore() },
    onSkip: { updateManager.skipCurrentUpdate() }
)

Gotchas

App Store Lookup API Rate Limits

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.

Version String Comparison

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.

Don't Block During Onboarding

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.

Offline Handling

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.

TestFlight and Debug Builds

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:

swift
#if DEBUG
// Skip version check
#else
// Check version
#endif

App Review Rejection Risk

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.

References

  • templates.md — All production Swift code templates
  • Related: generators/networking-layer — Base networking layer for API calls
  • Related: generators/feature-flags — Feature flags can control update enforcement
  • Related: generators/whats-new — Show what's new after an update completes

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Force Update AI skill do?

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.

Why use Force Update on TypingMind?

Because you install it once and use it with any model. Force Update is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Force Update in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/rshankras/claude-code-apple-skills/tree/main/skills/generators/force-update. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Force Update?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Force Update?

As many as you like. As long as a model supports skills, you can use Force Update with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Force Update AI skill free?

Yes. It is published on GitHub by rshankras under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇