Skill: ivangdavila/siri (version 1.0.0)

--- name: Siri description: Control devices, run automations, and help users get more from Siri with HomeKit, Shortcuts, and voice command guidance. --- ## Activation & Setup **Trigger methods:** - Hold Side/Home button - "Hey Siri" (always-listening) - "Siri" alone (iOS 17+) **Hey Siri not working?** Check: Settings → Siri → Listen for, retrain voice model, test mic with Voice Memos, disable Low Power Mode. ## Command Patterns **Structure:** Action + Target + Details - "Call Mom on speaker" - "Set a timer for 12 minutes" - "Remind me to buy milk when I get home" **Discovery:** "What can I say?" or "What can you do with [App]?" **Corrections:** Say "Change that to..." after Siri transcribes wrong. ## Smart Home (HomeKit) **Device naming:** Short, distinct, no special characters. "Kitchen light" not "Philips Hue A19 Kitchen #2". **Room-aware commands:** - "Turn off the lights" (current room on HomePod) - "Turn off the bedroom lights" (specific room) - "Turn off downstairs" (zone) **Scenes:** Name for voice: "Good morning", "Movie time", "I'm leaving". Trigger with "Hey Siri, [scene name]". **Schedules:** "Turn on porch light at sunset", "Lock doors at 10 PM". **Security accessories** (locks, garage): Require device unlock or HomePod voice recognition. ## Shortcuts Integration **Naming for voice:** - Short (2-3 words ideal) - Unique (avoid similar sounds) - No punctuation - Test pronunciation **Triggering:** Just say the shortcut name. Works on iPhone, HomePod, Apple Watch, CarPlay. **User input:** Use "Ask for Input" action—Siri will speak the prompt and wait. **Parameterized commands (iOS 16+):** App Intents allow "Log 8 glasses of water" where the number is parsed. Requires developer implementation. **Feedback:** End shortcuts with "Show Result" for spoken response or "Show Notification" for silent confirmation. ## Troubleshooting | Problem | Fix | |---------|-----| | Siri doesn't hear me | Check mic, remove case, disable Bluetooth audio | | Wrong transcription | Speak slower, reduce background noise, check language setting | | "I can't do that" | Feature not supported or app not Siri-enabled | | HomeKit device not responding | Check Home app, verify device online, restart Home hub | | Shortcut won't run by voice | Rename shorter, check Siri toggle in shortcut settings | ## Power Tips - **CarPlay:** Siri is hands-free default—just start talking after beep - **AirPods:** Squeeze stem or say "Siri" (if enabled) - **Type to Siri:** Settings → Accessibility → Siri → Type to Siri - **Announce notifications:** HomePod/AirPods can read incoming messages - **Intercom:** "Hey Siri, intercom I'm home" broadcasts to all HomePods --- ## When to Load More | Situation | Reference | |-----------|-----------| | Full command list by category | `commands.md` | | HomeKit setup, scenes, zones, troubleshooting | `homekit.md` | | Building Shortcuts, triggers, automation | `shortcuts.md` | | SiriKit, App Intents, developer integration | `development.md` |

path: commands.md
content: # Siri Commands Reference

## Communication
- "Call [name]" / "FaceTime [name]" / "FaceTime Audio [name]"
- "Send a message to [name]: [content]"
- "Read my messages"
- "Reply [message]"
- "Send an email to [name] about [subject]"

## Timers, Alarms, Reminders
- "Set a timer for [duration]"
- "Set an alarm for [time]" / "Wake me up at [time]"
- "Cancel my [time] alarm"
- "Remind me to [task] at [time/location]"
- "Show my reminders"
- "What's on my calendar today?"
- "Schedule [event] for [date] at [time]"

## Music & Media
- "Play [song/artist/playlist]"
- "Play something I like"
- "Skip this song" / "Pause" / "Resume"
- "What song is this?"
- "Play [podcast] podcast"
- "Set volume to [percent]"
- "Play [show] on [Netflix/Apple TV]"

## Information
- "What's the weather?"
- "How's traffic to [location]?"
- "Navigate to [destination]"
- "What time is it in [city]?"
- "Convert [amount] [currency] to [currency]"
- "How much is [calculation]?"
- "Translate [phrase] to [language]"
- "Define [word]"
- "Search for [query]"

## Device Control
- "Turn on Do Not Disturb"
- "Set brightness to [percent]"
- "Take a selfie" (opens camera, countdown)
- "Turn on flashlight"
- "Open [app]"
- "Take a screenshot"

## Productivity
- "Create a note: [content]"
- "Add [item] to my shopping list"
- "Show me my photos from [date/location]"
- "Find my iPhone" (requires Find My setup)

## Discovery Commands
- "What can you do?"
- "What can I do here?"
- "What can I do with [app name]?"

---

## Tips for Natural Commands

**Being Specific Helps:**
- ❌ "Text John" → Which John?
- ✅ "Text John Smith"

**Add Context:**
- ❌ "Set an alarm"
- ✅ "Set an alarm for 7 AM tomorrow"

**Chaining Usually Fails:**
- ❌ "Turn off lights and play music and lock the door"
- ✅ Create a Shortcut for multi-step sequences

---

## CarPlay & AirPods

**CarPlay:**
- Siri activates with steering wheel button
- Maps commands: "Take me home", "Find gas stations"
- "Hey Siri" available when enabled on phone

**AirPods:**
- "Hey Siri" works hands-free with AirPods Pro/Max
- Squeeze stem (AirPods Pro) or tap (AirPods Max) to activate
- Announce notifications: Settings > Siri > Announce Notifications

---

## Voice Settings

**Change Siri Voice:**
Settings > Siri & Search > Siri Voice > Select variety and voice

**Languages:**
- Siri supports 20+ languages
- Can set different language than device language
- Some features limited to English (US)

**Type to Siri:**
Settings > Accessibility > Siri > Type to Siri

**Siri History:**
Settings > Siri & Search > Siri & Dictation History > Delete


path: development.md
content: # SiriKit & App Intents Development

## Framework Evolution

**SiriKit (iOS 10+):**
- Intent Definition Files (.intentdefinition)
- Limited to predefined domains
- Requires Intents extension

**App Intents (iOS 16+):**
- Swift-only, code-first approach
- Custom actions with parameters
- Automatic Shortcuts/Spotlight integration
- No extension required

**Migration Path:**
- New apps: Use App Intents directly
- Existing apps: Can wrap old intents with App Intents for consistency

---

## App Intents Basics

```swift
import AppIntents

struct LogSleepIntent: AppIntent {
    static var title: LocalizedStringResource = "Log Sleep"
    static var description = IntentDescription("Records hours of sleep")
    
    @Parameter(title: "Hours")
    var hours: Double
    
    func perform() async throws -> some IntentResult & ProvidesDialog {
        // Save sleep data
        return .result(dialog: "Logged \(hours) hours of sleep")
    }
}
```

**Key Points:**
- Return type must be `some IntentResult & ...` (never primitives)
- `@Parameter` for voice-capturable values
- `perform()` is async, can call APIs
- Registration is automatic (no manual setup)

---

## Supported Domains (Classic SiriKit)

| Domain | Example Intents |
|--------|-----------------|
| Messages | Send, Search messages |
| VoIP Calling | Start call, Answer call |
| Payments | Send payment, Request payment |
| Workouts | Start, End, Pause workout |
| Lists & Notes | Create note, Add to list |
| Visual Codes | Show QR code |
| Photos | Search photos |
| Ride Booking | Request ride, Get status |
| Car Commands | Lock, Unlock, Get status |
| Media | Play media, Add to library |

---

## NSUserActivity Donations

For Spotlight and Siri Suggestions (non-intent based):

```swift
let activity = NSUserActivity(activityType: "com.app.viewRecipe")
activity.title = "Chicken Curry Recipe"
activity.isEligibleForSearch = true
activity.isEligibleForPrediction = true
activity.suggestedInvocationPhrase = "Show curry recipe"
activity.persistentIdentifier = "recipe-123"
activity.becomeCurrent()
```

**Donation Flow:**
1. User performs action in app
2. Create NSUserActivity with relevant metadata
3. Call `becomeCurrent()` to donate
4. iOS learns patterns, suggests in Spotlight/Siri

**Deleting Donations:**
```swift
NSUserActivity.deleteSavedUserActivities(
    withPersistentIdentifiers: ["recipe-123"]
)
```

---

## App Shortcuts (Automatic)

```swift
struct MyAppShortcuts: AppShortcutsProvider {
    static var appShortcuts: [AppShortcut] {
        AppShortcut(
            intent: LogSleepIntent(),
            phrases: [
                "Log sleep in \(.applicationName)",
                "Record \(\.$hours) hours of sleep in \(.applicationName)"
            ],
            shortTitle: "Log Sleep",
            systemImageName: "bed.double"
        )
    }
}
```

**Benefits:**
- Available immediately on install
- Appears in Shortcuts app automatically
- No user setup required

---

## Testing & Debugging

**Simulator:**
- Siri available in simulator (iOS 14+)
- Test intent handling with "Test in Siri" button in Xcode

**Device Testing:**
- Real voice recognition only on device
- Test with actual voice commands
- Check Console.app for intent logs

**Common Issues:**
- Intent not appearing: Check Info.plist IntentsSupported
- Parameters not captured: Verify @Parameter types match expected
- Shortcut not in app: Ensure AppShortcutsProvider is registered

---

## Certification Requirements

**Required Behaviors:**
- Handle gracefully when permissions denied
- Don't request capabilities app doesn't use
- Provide meaningful responses (not just "Done")
- Handle edge cases (empty input, network failure)

**Common Rejections:**
- Requesting SiriKit permissions without clear use case
- Silent failures (no user feedback)
- Blocking UI during intent processing

---

## Extension Architecture

**For Classic SiriKit:**
```
Main App
└── Intents Extension (handles background)
└── IntentsUI Extension (custom UI, optional)
```

**For App Intents:**
```
Main App (all code lives here)
└── AppIntent structs auto-registered
```

**Sharing Data:**
- App Groups for UserDefaults/files
- Core Data with shared container
- Keychain for sensitive data

---

## Voice Recognition Tips

**Slot Values:**
- Define synonyms: "7", "seven", "VII" → 7
- Handle common mishearings
- Use `@Parameter(default:)` for optional values

**Phrasing:**
- Register multiple phrases for same intent
- Include app name: "in \(.applicationName)"
- Test pronunciation of custom terms

---

## Accessibility Considerations

**Type to Siri:**
- Works with all intents automatically
- No special handling needed

**VoiceOver:**
- Siri responses read automatically
- Custom UI should support VoiceOver

**Switch Control:**
- Siri provides alternative input method
- Ensure intents work without touch


path: homekit.md
content: # Siri HomeKit Control

## Device Naming Best Practices

**Format:** Location + Function
- ✅ "Kitchen Light", "Bedroom Fan", "Front Door Lock"
- ❌ "Light 1", "Lamp", "Smart Bulb #3"

**Naming Rules:**
- No punctuation or special characters
- Avoid numbers unless meaningful ("Floor 2 Hallway")
- Keep names short (2-3 words ideal)
- Make names phonetically distinct
- Test by saying the command before committing

---

## Room & Zone Setup

**Rooms:**
- Group devices by physical location
- HomePod knows which room it's in (responds to "turn off the lights")
- Create in Home app → + → Add Room

**Zones:**
- Group multiple rooms: "Downstairs", "Upstairs", "Outdoors"
- Home app → Room Settings → Add to Zone
- Commands: "Turn off downstairs" / "Lock all outdoor doors"

**Multi-Home:**
- "Set the [Home Name] to [temperature]"
- "Turn on lights at the beach house"
- Each home needs its own hub

---

## Scene Commands

**Built-in Suggestions:**
- "Good Morning" / "Good Night"
- "I'm Leaving" / "I'm Home"
- "Movie Time"

**Creating Scenes:**
Home app → + → Add Scene → Custom
Name it for voice activation: "Start cooking", "Party mode"

**Voice Activation:**
- "Hey Siri, [scene name]"
- "Set the scene to [name]"
- "Activate [name]"

---

## Automation Triggers

**Time-Based:**
- "Turn on porch light at sunset"
- "Lock doors at 10 PM every night"
- (Requires Home app automation setup, not voice-creatable)

**Location-Based:**
- "When I leave home, turn off all lights"
- Uses phone location, requires permission

**Accessory-Based:**
- "When front door unlocks, turn on hallway light"
- Sensor triggers: motion, contact, temperature

---

## Status Queries

- "Are the lights on?"
- "Is the front door locked?"
- "What's the temperature in the living room?"
- "Is anyone home?" (requires location sharing with Home)
- "Show me [camera name]"

---

## Security Accessories

**Lock Behavior:**
- Unlocking requires device unlock or voice verification
- "Hey Siri, unlock the front door" → may require Face ID/Touch ID

**Garage Doors:**
- Same security behavior as locks
- "Open the garage" may require authentication

**Cameras:**
- "Show me [camera name]" displays on device/HomePod with screen
- HomeKit Secure Video for recording

---

## Home Hub Requirements

**For Remote Access:**
- HomePod (any model)
- Apple TV (4th gen or later)
- iPad (left at home, signed in)

**Hub Status:**
Home app → Home Settings → Home Hubs
Should show "Connected" for remote commands to work

---

## Troubleshooting

| Issue | Solution |
|-------|----------|
| "No Response" | Check device in Home app, verify hub is connected, reboot device |
| Wrong light responds | Rename with more specific location |
| Scene not activating | Check scene name pronunciation, rename if needed |
| Remote control not working | Verify home hub status in Home app settings |
| Automation didn't run | Check automation conditions in Home app |
| New device not appearing | Re-add from manufacturer app, then link to HomeKit |

---

## Siri vs Home App

**Use Siri for:**
- Quick commands ("Turn off kitchen")
- Scene activation
- Status checks

**Use Home app for:**
- Creating automations
- Device setup and renaming
- Troubleshooting offline devices
- Viewing camera feeds
- Managing home members


path: shortcuts.md
content: # Siri Shortcuts

## Naming for Voice Activation

**Rules:**
- 2-3 words ideal
- No punctuation or special characters
- Phonetically distinct (avoid rhymes with other shortcuts)
- Easy to remember and pronounce
- Test by saying it aloud before saving

**Good Names:**
- "Morning Routine", "Work Mode", "Quick Note"
- "Start Workout", "Call Mom", "Night Mode"

**Bad Names:**
- "My Super Awesome Morning Routine v2" (too long)
- "Do the thing" (too vague, easy to mis-trigger)
- "Test 1" (meaningless)

---

## Triggering Shortcuts

**By Voice:**
- "Hey Siri, [exact shortcut name]"
- Works on iPhone, iPad, Mac, HomePod, Apple Watch

**Alternative Methods:**
- Spotlight search (type shortcut name)
- Shortcuts app directly
- Home Screen widget
- Back Tap (Settings > Accessibility > Touch > Back Tap)
- Lock Screen widget (iOS 16+)

---

## User Input in Shortcuts

**Ask for Input:**
- Add "Ask for Input" action
- Siri will speak the prompt and wait for response
- Supports text, number, URL, date, time

**Dictation:**
- "Dictate Text" action captures voice as text
- Useful for notes, messages, quick captures

**Choose from Menu:**
- Present options for user to select
- Works via voice with numbered options

---

## Variables and Parameters

**App Intents (iOS 16+):**
- Pass parameters directly via voice
- "Hey Siri, log 8 hours of sleep" (if shortcut accepts number)
- Requires developer implementation of App Intents

**Classic Shortcuts:**
- Can't pass voice parameters directly
- Use "Ask for Input" as workaround
- Store variables between runs with Data Jar or files

---

## Error Handling

**Use If/Otherwise blocks:**
```
If [Input] has any value
  → Process input
Otherwise
  → Show notification "No input provided"
```

**iOS 18 Change:**
- Blank text fields now return empty string, not "nothing"
- Update conditions: check "is empty" instead of "has no value"

**Test Edge Cases:**
- What if user says nothing?
- What if Siri misunderstands?
- What if dependent app isn't installed?

---

## Output and Feedback

**Show Result:**
- Displays text/result on screen
- Siri reads it aloud

**Speak Text:**
- Explicitly speak custom message
- Useful for hands-free confirmation

**Show Notification:**
- Silent banner notification
- Doesn't interrupt flow

**Best Practice:**
- Confirm completion: "Done" or "Added [item]"
- Report failures: "Couldn't connect to [service]"

---

## Running on Other Devices

**HomePod:**
- Shortcuts run on HomePod if they don't require display
- Actions requiring screen fail silently
- Test on HomePod before relying on it

**Apple Watch:**
- Subset of actions available
- Complications can trigger shortcuts
- Keep watch shortcuts simple

**Mac:**
- Full Shortcuts app on macOS Monterey+
- Can trigger via Siri, menu bar, keyboard shortcut

---

## Automation Triggers

| Trigger | Example |
|---------|---------|
| Time of Day | 7 AM weekdays |
| Location | Arriving at work |
| CarPlay | Connecting to car |
| App Opens | When opening Camera |
| Email/Message | From specific sender |
| Workout | Starting/ending workout |
| NFC Tag | Tapping tag with phone |
| Alarm | After dismissing alarm |

**Note:** Some triggers require confirmation, some run automatically.
Settings > Shortcuts > Automation > [your automation] > Ask Before Running

---

## Debugging Tips

1. **Run manually first** - Test shortcut by tapping before trying voice
2. **Check action order** - Actions execute top to bottom
3. **Use Quick Look** - Add "Quick Look" action to inspect variables mid-flow
4. **Simplify** - If complex shortcut fails, break into smaller parts
5. **Check permissions** - Some actions need explicit permissions per shortcut

---

## Common Patterns

**Morning Routine:**
1. Get weather forecast
2. Read calendar events
3. Start podcast/music
4. Set device modes (Do Not Disturb off)

**Quick Capture:**
1. Dictate text
2. Add to Notes/Reminders
3. Confirm completion

**Smart Home Scene:**
1. Set multiple HomeKit scenes
2. Open specific app
3. Start music


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)