widget-generator
Widget Generator creates full WidgetKit implementations including timeline providers, size-specific views, lock screen accessories, and interactive elements for iOS 17+. It handles project detection, conflict resolution, and generates all necessary files with proper App Intent setup. Configure widget purpose, sizes, data sources, and update frequency through guided questions.
Widget Generator creates complete WidgetKit implementations with timeline providers and interactive elements for home and lock screens.
AI-generated summary based on this skill's SKILL.md
Install
rshankras/claude-code-apple-skills/widget-generator · repository language: Swift
git clone https://github.com/rshankras/claude-code-apple-skills
cp -r claude-code-apple-skills/skills/generators/widget-generator ~/.claude/skills/widget-generatorFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I add widgets to my iOS app using widget-generator?
Widget Generator creates complete WidgetKit implementations for your iOS app. It generates timeline providers, size-specific views, and all necessary configuration files. The tool guides you through setup questions about widget purpose, supported sizes, data sources, and update frequency, then produces ready-to-use code that integrates directly into your Xcode project with proper App Intent setup.
Can widget-generator create lock screen accessory widgets for iOS 16+?
Yes, widget-generator supports lock screen accessory widgets for iOS 16 and later. It generates the specialized view hierarchies and timeline configurations needed for lock screen integration. The tool handles the unique constraints of lock screen widgets and produces code optimized for the smaller form factors and specific design requirements of iOS 16+ lock screen accessories.
What is a WidgetKit timeline provider and how does widget-generator set it up?
Widget Generator's timeline provider setup creates the scheduling logic that determines when your widget updates. The tool generates provider code that defines your widget's refresh policy, handles data fetching, and manages timeline entries. It configures appropriate update frequencies based on your widget's purpose and generates the complete provider implementation with proper error handling and data management.
How does widget-generator handle interactive widgets with buttons?
Widget Generator creates interactive widgets by generating App Intent configurations and button handlers. It produces code for interactive toggle buttons and other interactive elements, setting up the necessary intents that respond to user interactions. The generated implementation includes proper state management and refresh logic to update your widget when users interact with buttons or controls.
Can widget-generator set up widget data sharing via App Groups?
Widget Generator supports App Groups configuration for data sharing between your main app and widget extension. It generates the necessary setup code and handles the entitlements configuration needed for secure data sharing. The tool produces code that enables your widget to access shared data from your main application through App Groups containers.
Does widget-generator support multiple widget sizes and configurations?
Yes, widget-generator creates implementations supporting multiple widget sizes including systemSmall, systemMedium, and larger formats. It generates size-specific view layouts and configurations, allowing your widget to adapt across different home screen positions. The tool also handles widget bundle configuration and supports configurable widgets with App Intent setup for customizable widget behavior.
SKILL.md
rendered from the published skill — quoted content, verbatim
Widget Generator
Generate a complete WidgetKit widget implementation with timeline providers, size-specific views, lock screen accessory widgets, interactive elements (iOS 17+), and App Intent configuration.
When This Skill Activates
Use this skill when the user: - Asks to "add widgets" or "add a widget" to their app - Mentions "WidgetKit" or "home screen widgets" - Wants "lock screen widgets" or "accessory widgets" - Asks about "widget timelines" or "timeline providers" - Wants "interactive widgets" with buttons or toggles - Mentions "widget configuration" or "configurable widgets" - Asks about "App Intent widgets" or "AppIntentConfiguration" - Wants to show data on the home screen or lock screen
Pre-Generation Checks
1. Project Context Detection
- [ ] Check for existing widget extension target
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 2 files
skills/generators/widget-generator/SKILL.md
skills/generators/widget-generator/templates.md