healthkit-code-review
Reviews HealthKit code for authorization patterns, query usage, background delivery, and data type handling. Use when reviewing code with import HealthKit, HKHealthStore, HKSampleQuery, HKObserverQuery, or HKQuantityType.
What this skill does
# HealthKit Code Review ## Quick Reference | Issue Type | Reference | |------------|-----------| | HKHealthStore, permissions, status checks, privacy | [references/authorization.md](references/authorization.md) | | HKQuery types, predicates, anchored queries, statistics | [references/queries.md](references/queries.md) | | Background delivery, observer queries, completion handlers | [references/background.md](references/background.md) | | HKQuantityType, HKCategoryType, workouts, units | [references/data-types.md](references/data-types.md) | ## Review Checklist - [ ] `HKHealthStore.isHealthDataAvailable()` called before any HealthKit operations - [ ] Authorization requested only for needed data types (minimal permissions) - [ ] `requestAuthorization` completion handler not misinterpreted as permission granted - [ ] No attempt to determine read permission status (privacy by design) - [ ] Query results dispatched to main thread for UI updates - [ ] `HKObjectQueryNoLimit` used only with bounded predicates - [ ] `HKStatisticsQuery` used for aggregations instead of manual summing - [ ] Observer query `completionHandler()` always called (use `defer`) - [ ] Background delivery registered in `application(_:didFinishLaunchingWithOptions:)` - [ ] Background delivery entitlement added (iOS 15+) - [ ] Correct units used for quantity types (e.g., `count/min` for heart rate) - [ ] Long-running queries stored as properties and stopped in `deinit` ## When to Load References - Reviewing authorization/permissions flow -> authorization.md - Reviewing HKSampleQuery, HKAnchoredObjectQuery, or predicates -> queries.md - Reviewing HKObserverQuery or `enableBackgroundDelivery` -> background.md - Reviewing HKQuantityType, HKCategoryType, or HKWorkout -> data-types.md ## Review gates Run in order. **Do not state a finding in a later step until the pass condition for the current step is satisfied** (each pass condition is answerable from the codebase under review). 1. **Scope** — **Pass:** Name the file path(s) and types/symbols using `HealthKit`, `HKHealthStore`, or `HK*` APIs (or state clearly that the diff touches none). 2. **Availability and store** — **Pass:** Cite the call site of `isHealthDataAvailable()` before HealthKit use, or document why omission is acceptable for the scoped code; cite where `HKHealthStore` is created or injected. 3. **Authorization semantics** — **Pass:** For each `requestAuthorization` / `getRequestStatusForAuthorization`, cite handler branches per [references/authorization.md](references/authorization.md) (e.g. success does not prove read access); do not infer read permission from `authorizationStatus` alone. 4. **Queries and limits** — **Pass:** For each query, cite predicate + limit (`HKObjectQueryNoLimit` only with a bounded predicate); for totals/aggregates, cite `HKStatisticsQuery` / collection vs manual summing per [references/queries.md](references/queries.md). 5. **Observers and background** — **Pass:** If `HKObserverQuery` or `enableBackgroundDelivery` appears, cite where the observer is started/stopped and where background delivery is registered; cite entitlements/Info.plist or flag missing config per [references/background.md](references/background.md). If absent, **Pass:** one line “no observer/background in scope.” 6. **Threading and lifecycle** — **Pass:** Cite main-queue (or documented pattern) for UI updates from query callbacks; cite retention/`stop()`/`deinit` for long-running queries per checklist above. ## Review Questions 1. Is `isHealthDataAvailable()` checked before creating HKHealthStore? 2. Does the code gracefully handle denied permissions (empty results)? 3. Are observer query completion handlers called in all code paths? 4. Is work in background handlers minimal (~15 second limit)? 5. Are HKQueryAnchors persisted per sample type (not shared)?
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.