mcpbeat Sign in

App Extensions Skill for Claude

Generates app extension infrastructure for Share Extensions, Action Extensions, Keyboard Extensions, and Safari Web Extensions with data sharing via App Groups. Use when user wants to add a share extension, action extension, keyboard extension, Safari web extension, or any app extension type.

10k tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
585
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/rshankras/claude-code-apple-skills --skill app-extensions

The instruction itself

28 sections, as written by the author

App Extensions Generator

Generate production app extension infrastructure -- Share Extensions for receiving content from other apps, Action Extensions for manipulating content in-place, Keyboard Extensions for custom input, and Safari Web Extensions for browser integration. Includes App Group data sharing between the host app and extensions.

When This Skill Activates

Use this skill when the user:

  • Asks to "add a share extension" or "share sheet extension"
  • Wants to "receive content from other apps" or "accept shared content"
  • Mentions "action extension" or "content manipulation extension"
  • Wants to "add a custom keyboard" or "keyboard extension"
  • Asks about "Safari extension" or "Safari web extension"
  • Mentions "app extension" or "extension target" generically
  • Wants to "share data between app and extension" or "App Groups"

Pre-Generation Checks

1. Project Context Detection

  • [ ] Check deployment target (iOS 16+ / macOS 13+)
  • [ ] Check Swift version (requires Swift 5.9+)
  • [ ] Identify project structure (find .xcodeproj or Package.swift)
  • [ ] Identify source file locations

2. Existing Extension Detection

Search for existing extension targets:

Glob: **/*Extension*/*.swift, **/*Extension*/Info.plist
Grep: "NSExtensionPointIdentifier" or "NSExtensionPrincipalClass"

If existing extensions found:

  • Ask if user wants to add another or modify existing
  • Identify existing App Groups configuration

3. App Groups Detection

Check for existing App Groups setup:

Glob: **/*.entitlements
Grep: "com.apple.security.application-groups"

If App Groups exist, reuse the existing group identifier.

Configuration Questions

Ask user via AskUserQuestion:

  • What type of extension?
  • Share Extension (accept content from other apps, display share UI)
  • Action Extension (manipulate content in-place -- transform text, edit images)
  • Keyboard Extension (custom input keyboard with KeyboardViewController)
  • Safari Web Extension (inject JavaScript/CSS into web pages)
  • What content types does it handle?
  • Text (plain text, rich text)
  • URLs (web links, deep links)
  • Images (photos, screenshots)
  • Files (documents, PDFs, archives)
  • All (any content type)
  • Does the extension need to share data with the main app?
  • Yes -- needs App Groups (shared UserDefaults, shared file container, shared Keychain)
  • No -- extension is self-contained

Generation Process

Step 1: Read Templates

Read templates.md for production Swift code.

Step 2: Create Extension Files

Based on extension type selected:

Share Extension:

  • ShareViewController.swift -- Main share extension view controller with content handling
  • Info.plist -- Extension configuration with activation rules

Action Extension:

  • ActionViewController.swift -- Action extension with content manipulation
  • Info.plist -- Extension configuration

Keyboard Extension:

  • KeyboardViewController.swift -- Custom keyboard with UIInputViewController
  • Info.plist -- Keyboard extension configuration

Safari Web Extension:

  • SafariWebExtensionHandler.swift -- Native message handler
  • manifest.json -- Web extension manifest
  • content.js -- Content script template

Step 3: Create Shared Infrastructure

If data sharing selected:

10. SharedDataManager.swift -- App Group data sharing helper

Step 4: Determine File Location

Extensions are separate targets:

  • Share Extension -> ShareExtension/
  • Action Extension -> ActionExtension/
  • Keyboard Extension -> KeyboardExtension/
  • Safari Web Extension -> SafariWebExtension/
  • Shared code -> Shared/ or within main app target

Output Format

After generation, provide:

Files Created

Share Extension:

ShareExtension/
├── ShareViewController.swift  # Main share extension view controller
└── Info.plist                 # Extension activation rules & config

Action Extension:

ActionExtension/
├── ActionViewController.swift # Content manipulation controller
└── Info.plist                 # Extension activation rules & config

Keyboard Extension:

KeyboardExtension/
├── KeyboardViewController.swift # UIInputViewController subclass
└── Info.plist                   # Keyboard extension config

Safari Web Extension:

SafariWebExtension/
├── SafariWebExtensionHandler.swift # Native message handler
└── Resources/
    ├── manifest.json               # Web extension manifest
    ├── content.js                  # Content script
    └── popup.html                  # Popup UI (optional)

Shared (if data sharing enabled):

Shared/
└── SharedDataManager.swift    # App Group data sharing

Integration Steps

1. Add Extension Target in Xcode:

  • File > New > Target
  • Select the extension type (Share, Action, Keyboard, Safari Web)
  • Configure bundle identifier: com.yourapp.ShareExtension
  • Xcode creates the target with boilerplate -- replace with generated code

2. Configure App Groups (if data sharing):

  • Select main app target > Signing & Capabilities > Add "App Groups"
  • Add group: group.com.yourapp.shared
  • Select extension target > Signing & Capabilities > Add "App Groups"
  • Add the same group identifier

3. Share code between targets:

  • Add shared files to both the app and extension targets
  • Or create a shared framework target

Extension Content Handling

Accept shared URLs:

if provider.hasItemConformingToTypeIdentifier(UTType.url.identifier) {
    provider.loadItem(forTypeIdentifier: UTType.url.identifier) { item, error in
        guard let url = item as? URL else { return }
        // Process URL
    }
}

Accept shared images:

if provider.hasItemConformingToTypeIdentifier(UTType.image.identifier) {
    provider.loadItem(forTypeIdentifier: UTType.image.identifier) { item, error in
        if let imageURL = item as? URL {
            let imageData = try? Data(contentsOf: imageURL)
            // Process image data
        }
    }
}

Share data to main app via App Groups:

let shared = SharedDataManager.shared
shared.saveSharedContent(url.absoluteString, forKey: "lastSharedURL")

Testing

Share Extension:

  • Build and run the extension scheme
  • Select a host app (Safari, Photos, etc.)
  • Share content and verify your extension appears
  • Test with different content types

Action Extension:

  • Build and run the extension scheme
  • Open content in a supported app
  • Tap the share/action button and select your action

Keyboard Extension:

  • Build and run the keyboard extension scheme
  • Go to Settings > General > Keyboard > Keyboards > Add New Keyboard
  • Select your keyboard
  • Open any text field and switch to your keyboard

Safari Web Extension:

  • Build and run the app (which contains the extension)
  • Go to Safari > Settings > Extensions
  • Enable your extension
  • Navigate to a web page and verify behavior

Extension Lifecycle and Limits

Memory Limits

  • Share Extension: ~120 MB
  • Action Extension: ~120 MB
  • Keyboard Extension: ~48 MB (very constrained)
  • Safari Web Extension: ~6 MB for content scripts

Execution Limits

  • Extensions must complete work quickly (no long background execution)
  • Must call completeRequest() or cancelRequest() when done
  • No access to HealthKit, CallKit, or some restricted frameworks
  • Network requests are allowed but should be brief

Extension Termination

The system can terminate extensions at any time for resource reclamation. Save state frequently and handle interruption gracefully.

Gotchas

completeRequest Must Be Called

The extension host waits for extensionContext?.completeRequest(returningItems:). If you never call it, the share sheet hangs and the user is stuck. Always call it in both success and error paths.

Keyboard Extensions Need Open Access for Network

By default keyboard extensions have no network access. The user must explicitly grant "Allow Full Access" in Settings. Without it, URLSession calls fail silently. Design your keyboard to work without network and enhance when access is granted.

App Groups Require Matching Identifiers

The App Group identifier must be identical in both the main app and extension entitlements. A typo means UserDefaults(suiteName:) returns a different (empty) container.

Safari Web Extension Content Scripts Run in Isolated World

Content scripts cannot directly access the page's JavaScript variables. Use window.postMessage or the browser messaging API to communicate between content scripts and the page.

Extension Bundle Identifier Convention

Extension bundle identifiers must be prefixed with the main app bundle identifier:

  • Main app: com.yourcompany.myapp
  • Share Extension: com.yourcompany.myapp.ShareExtension

References

Other skills for the same job

different authors, same section of the catalogue
Azure Kubernetes Automatic Readiness
by microsoft
vendor ×3

Assess Kubernetes workloads and cluster configuration for AKS Automatic compatibility. Identifies incompatibilities, generates fixes, and guides migration from AKS Standard to AKS Automatic. WHEN: migrate to AKS Automatic, check AKS Automatic readiness, validate manifests for Automatic, assess cluster for Automatic compatibility, fix deployment for Automatic compatibility, identify AKS Automatic migration blockers, is my cluster ready for AKS Automatic.

13k tokens
Capacity
by microsoft
vendor ×3

Discovers available Azure OpenAI model capacity across regions and projects. Analyzes quota limits, compares availability, and recommends optimal deployment locations based on capacity requirements. USE FOR: find capacity, check quota, where can I deploy, capacity discovery, best region for capacity, multi-project capacity search, quota analysis, model availability, region comparison, check TPM availability. DO NOT USE FOR: actual deployment (hand off to preset or customize after discovery), quota increase requests (direct user to Azure Portal), listing existing deployments.

6k tokens scripts
Customize
by microsoft
vendor ×3

Interactive guided deployment flow for Azure OpenAI models with full customization control. Step-by-step selection of model version, SKU (GlobalStandard/Standard/ProvisionedManaged), capacity, RAI policy (content filter), and advanced options (dynamic quota, priority processing, spillover). USE FOR: custom deployment, customize model deployment, choose version, select SKU, set capacity, configure content filter, RAI policy, deployment options, detailed deployment, advanced deployment, PTU deployment, provisioned throughput. DO NOT USE FOR: quick deployment to optimal region (use preset).

8k tokens
Deploy Model
by microsoft
vendor ×3

Unified Azure OpenAI model deployment skill with intelligent intent-based routing. Handles quick preset deployments, fully customized deployments (version/SKU/capacity/RAI policy), and capacity discovery across regions and projects. USE FOR: deploy model, deploy gpt, create deployment, model deployment, deploy openai model, set up model, provision model, find capacity, check model availability, where can I deploy, best region for model, capacity analysis. DO NOT USE FOR: listing existing deployments (use foundry_models_deployments_list MCP tool), deleting deployments, agent creation (use agent/create), project creation (use project/create).

26k tokens scripts
Preset
by microsoft
vendor ×3

Intelligently deploys Azure OpenAI models to optimal regions by analyzing capacity across all available regions. Automatically checks current region first and shows alternatives if needed. USE FOR: quick deployment, optimal region, best region, automatic region selection, fast setup, multi-region capacity check, high availability deployment, deploy to best location. DO NOT USE FOR: custom SKU selection (use customize), specific version selection (use customize), custom capacity configuration (use customize), PTU deployments (use customize).

9k tokens
Lamindb
by christophacham
×3

This skill should be used when working with LaminDB, an open-source data framework for biology that makes data queryable, traceable, reproducible, and FAIR. Use when managing biological datasets (scRNA-seq, spatial, flow cytometry, etc.), tracking computational workflows, curating and validating data with biological ontologies, building data lakehouses, or ensuring data lineage and reproducibility in biological research. Covers data management, annotation, ontologies (genes, cell types, diseases, tissues), schema validation, integrations with workflow managers (Nextflow, Snakemake) and MLOps platforms (W&B, MLflow), and deployment strategies.

22k tokens
Latchbio Integration
by christophacham
×3

Latch platform for bioinformatics workflows. Build pipelines with Latch SDK, @workflow/@task decorators, deploy serverless workflows, LatchFile/LatchDir, Nextflow/Snakemake integration.

12k tokens
Modal
by christophacham
×3

Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.

17k tokens

How to use it

Copy the folder

Take rshankras/app-extensions from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.