/grdb
Use when writing raw SQL with GRDB, complex joins across 4+ tables, window functions, ValueObservation for reactive queries, or dropping down from SQLiteData for performance. Direct SQLite access for iOS/macOS with type-safe queries and migrations.
$ npx -y skills add johnrogers/claude-swift-engineering --skill grdb --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/grdb
Context preview
The summary Claude sees to decide when to auto-load this skill.
Use when writing raw SQL with GRDB, complex joins across 4+ tables, window functions, ValueObservation for reactive queries, or dropping down from SQLiteData for performance. Direct SQLite access for iOS/macOS with type-safe queries and migrations.
SKILL.md
grdb.SKILL.mdname: grdb
description: Use when writing raw SQL with GRDB, complex joins across 4+ tables, window functions, ValueObservation for reactive queries, or dropping down from SQLiteData for performance. Direct SQLite access for iOS/macOS with type-safe queries and migrations.
GRDB
Direct SQLite access using [GRDB.swift](https://github.com/groue/GRDB.swift) - type-safe Swift wrapper with full SQLite power when you need it.
Reference Loading Guide
**ALWAYS load reference files if there is even a small chance the content may be required.** It's better to have the context than to miss a pattern or make a mistake.
| Reference | Load When | |-----------|-----------| | **[Getting Started](references/getting-started.md)** | Setting up DatabaseQueue or DatabasePool | | **[Queries](references/queries.md)** | Writing raw SQL, Record types, type-safe queries | | **[Value Observation](references/value-observation.md)** | Reactive queries, SwiftUI integration | | **[Migrations](references/migrations.md)** | DatabaseMigrator, schema evolution | | **[Performance](references/performance.md)** | EXPLAIN QUERY PLAN, indexing, profiling |
When to Use GRDB vs SQLiteData
| Scenario | Use | |----------|-----| | Type-safe @Table models | SQLiteData | | CloudKit sync needed | SQLiteData | | Complex joins (4+ tables) | GRDB | | Window functions (ROW_NUMBER, RANK) | GRDB | | Performance-critical raw SQL | GRDB | | Reactive queries (ValueObservation) | GRDB |
Core Workflow
1. Choose DatabaseQueue (single connection) or DatabasePool (concurrent reads) 2. Define migrations with DatabaseMigrator 3. Create Record types (Codable, FetchableRecord, PersistableRecord) 4. Write queries with raw SQL or QueryInterface 5. Use ValueObservation for reactive updates
Requirements
- iOS 13+, macOS 10.15+
- Swift 5.7+
- GRDB.swift 6.0+
Common Mistakes
1. **Performance assumptions without EXPLAIN PLAN** — Assuming your query is fast or slow without checking `EXPLAIN QUERY PLAN` is guessing. Always profile queries with EXPLAIN before optimizing.
2. **Missing indexes on WHERE clauses** — Queries filtering on non-indexed columns scan the entire table. Index any column used in WHERE, JOIN, or ORDER BY clauses for large tables.
3. **Improper migration ordering** — Running migrations out of order or skipping intermediate versions breaks schema consistency. Always apply migrations sequentially; never jump versions.
4. **Record conformance shortcuts** — Not conforming Record types to `PersistableRecord` or `FetchableRecord` correctly leads to silent data loss or deserialization failures. Always implement all required protocols correctly.
5. **ValueObservation without proper cleanup** — Forgetting to cancel ValueObservation when views disappear causes memory leaks and stale data subscriptions. Store the cancellable and clean up in deinit.
Read more
name: grdb description: Use when writing raw SQL with GRDB, complex joins across 4+ tables, window functions, ValueObservation for reactive queries, or dropping down from SQLiteData for performance. Direct SQLite access for iOS/macOS with type-safe queries and migrations.
GRDB
Direct SQLite access using [GRDB.swift](https://github.com/groue/GRDB.swift) - type-safe Swift wrapper with full SQLite power when you need it.
Reference Loading Guide
**ALWAYS load reference files if there is even a small chance the content may be required.** It's better to have the context than to miss a pattern or make a mistake.
| Reference | Load When | |-----------|-----------| | **[Getting Started](references/getting-started.md)** | Setting up DatabaseQueue or DatabasePool | | **[Queries](references/queries.md)** | Writing raw SQL, Record types, type-safe queries | | **[Value Observation](references/value-observation.md)** | Reactive queries, SwiftUI integration | | **[Migrations](references/migrations.md)** | DatabaseMigrator, schema evolution | | **[Performance](references/performance.md)** | EXPLAIN QUERY PLAN, indexing, profiling |
When to Use GRDB vs SQLiteData
| Scenario | Use | |----------|-----| | Type-safe @Table models | SQLiteData | | CloudKit sync needed | SQLiteData | | Complex joins (4+ tables) | GRDB | | Window functions (ROW_NUMBER, RANK) | GRDB | | Performance-critical raw SQL | GRDB | | Reactive queries (ValueObservation) | GRDB |
Core Workflow
1. Choose DatabaseQueue (single connection) or DatabasePool (concurrent reads) 2. Define migrations with DatabaseMigrator 3. Create Record types (Codable, FetchableRecord, PersistableRecord) 4. Write queries with raw SQL or QueryInterface 5. Use ValueObservation for reactive updates
Requirements
- iOS 13+, macOS 10.15+
- Swift 5.7+
- GRDB.swift 6.0+
Common Mistakes
1. **Performance assumptions without EXPLAIN PLAN** — Assuming your query is fast or slow without checking `EXPLAIN QUERY PLAN` is guessing. Always profile queries with EXPLAIN before optimizing.
2. **Missing indexes on WHERE clauses** — Queries filtering on non-indexed columns scan the entire table. Index any column used in WHERE, JOIN, or ORDER BY clauses for large tables.
3. **Improper migration ordering** — Running migrations out of order or skipping intermediate versions breaks schema consistency. Always apply migrations sequentially; never jump versions.
4. **Record conformance shortcuts** — Not conforming Record types to `PersistableRecord` or `FetchableRecord` correctly leads to silent data loss or deserialization failures. Always implement all required protocols correctly.
5. **ValueObservation without proper cleanup** — Forgetting to cancel ValueObservation when views disappear causes memory leaks and stale data subscriptions. Store the cancellable and clean up in deinit.
Claude Code plugin marketplace for modern Swift/SwiftUI development A specialized AI toolkit for building professional iOS/macOS features with modern Swift 6.2, TCA (The Composable Architecture), and SwiftUI.
Other skills on claude-swift-engineering.
- /composable-architecture
Use when building features with TCA (The Composable Architecture), structuring reducers, managing state, handling effects, navigation, or testing TCA features. Covers @Reducer, Store, Effect, TestStore, reducer composition, and TCA patterns.
Open skill - /foundation-models
Use when implementing on-device AI with Apple's Foundation Models framework (iOS 26+), building summarization/extraction/classification features, or using @Generable for type-safe structured output.
Open skill - /generating-swift-package-docs
Use when encountering unfamiliar import statements, exploring dependency APIs, or when user asks "what's import X" or "what does X do". Generates on-demand API documentation for Swift package dependencies.
Open skill - /haptics
Use when adding haptic feedback for user confirmations (button presses, toggles, purchases), error notifications, or custom tactile patterns (Core Haptics). Covers UIFeedbackGenerator and CHHapticEngine patterns.
Open skill - /ios-26-platform
Use when implementing iOS 26 features (Liquid Glass, new SwiftUI APIs, WebView, Chart3D), deploying iOS 26+ apps, or supporting backward compatibility with iOS 17/18.
Open skill - /ios-hig
Use when designing iOS interfaces, implementing accessibility (VoiceOver, Dynamic Type), handling dark mode, ensuring adequate touch targets, providing animation/haptic feedback, or requesting user permissions. Apple Human Interface Guidelines for iOS compliance.
Open skill

