This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
CelestraKit is a shared Swift package that provides CloudKit models and utilities for the Celestra RSS reader ecosystem. It contains shared data models for CloudKit's public database, designed to work across:
- CelestraApp: iOS client application
- CelestraCloud: Server-side CLI tool for feed processing
The package is designed for cross-platform compatibility, with CloudKit-specific code available on Apple platforms and platform-agnostic DTOs for Linux/server environments.
swift build# Run all tests
swift test
# Run specific test
swift test --filter CelestraKitTests.testVersion# Update dependencies
swift package update
# Resolve dependencies
swift package resolve
# Generate Xcode project (if needed)
swift package generate-xcodeproj- Sources/CelestraKit/: Main library code
- Models/PublicDatabase/: CloudKit public database models
Feed.swift: RSS feed metadata and server-side metricsArticle.swift: RSS article content with caching and deduplication
- Services/: Reusable web etiquette services
RateLimiter.swift: Per-domain and global rate limitingRobotsTxtService.swift: robots.txt parsing and caching
- Models/PublicDatabase/: CloudKit public database models
- SyndiKit (v0.6.1): RSS/Atom feed parsing
This project uses Swift 6.2 with strict concurrency checking and many experimental features enabled:
Upcoming Features Enabled:
ExistentialAny(SE-0335)InternalImportsByDefault(SE-0409)MemberImportVisibility(SE-0444)FullTypedThrows(SE-0413)
Experimental Features Enabled:
BitwiseCopyable,BorrowingSwitch,ExtensionMacros,FreestandingExpressionMacrosInitAccessors,IsolatedAny,MoveOnlyClasses,MoveOnlyEnumDeinitsMoveOnlyPartialConsumption,MoveOnlyResilientTypes,MoveOnlyTuplesNoncopyableGenerics(SE-0427),OneWayClosureParametersRawLayout,ReferenceBindingsSendingArgsAndResults(SE-0430),TransferringArgsAndResultsSymbolLinkageMarkers,VariadicGenerics(SE-0393)WarnUnsafeReflection
Compiler Flags:
-warn-concurrency: Enable concurrency warnings-enable-actor-data-race-checks: Enable actor data race checks-strict-concurrency=complete: Complete strict concurrency checking-enable-testing: Enable testing support-warn-long-function-bodies=100: Warn about functions >100 lines-warn-long-expression-type-checking=100: Warn about slow type checking
All new code must:
- Use
Sendablefor types that cross concurrency boundaries - Use
public importinstead ofimportfor re-exported dependencies - Follow strict concurrency checking (no implicit Sendable conformances)
- Avoid long functions (>100 lines) and complex type checking expressions
Represents RSS feeds shared across all users. Key features:
- Unique identifier:
feedURL - CloudKit fields:
recordName,recordChangeTagfor optimistic locking - Metadata: title, description, category, image, language, tags
- Server metrics: fetch attempts, success rate, failure tracking, HTTP caching headers (ETag, Last-Modified)
- Quality indicators:
qualityScore(0-100),isVerified,isFeatured - Computed properties:
successRate,isHealthy
Represents RSS articles in the public content cache. Key features:
- Unique identifier: Combination of
feedRecordName+guid - Content: title, excerpt, content (HTML), contentText (plain), author, URL, image
- Metadata: publishedDate, language, tags, wordCount, estimatedReadingTime
- Caching:
fetchedAt,expiresAt(TTL-based),contentHash(composite key deduplication) - Computed properties:
isExpiredfor cache invalidation - Static helpers:
calculateContentHash(): Composite key of title|URL|guid for deduplicationextractPlainText(): Basic HTML tag removal (use proper parser in production)calculateWordCount(): Word count for reading time estimationestimateReadingTime(): Assumes 200 words/minute
- iOS 26.0+
- macOS 26.0+
- visionOS 26.0+
- watchOS 26.0+
- tvOS 26.0+
- macCatalyst 26.0+
CloudKit Integration:
- Models store
recordNameandrecordChangeTagfor CloudKit optimistic locking - All models are
Sendable,Codable,Hashable, andIdentifiable - Designed for both CloudKit record mapping (Apple platforms) and JSON DTOs (Linux/server)
Caching Strategy:
- Articles use TTL-based expiration (
expiresAt) - Content deduplication via composite key (title|URL|guid)
- Server-side metrics track feed health and update frequency
Concurrency:
- All public types are
Sendablefor safe concurrent access - Strict concurrency checking enforced via compiler flags
- Main branch:
main - Development happens on feature branches
- Current work is on
v0.0.1branch
This package is part of the Celestra ecosystem:
- CelestraKit (this package): Shared CloudKit models
- Celestra: Main iOS application (at
../Celestra) - SyndiKit: RSS/Atom parsing library (at
../Syndikit) - MistKit: Related package (at
../MistKit)
Recent commits show focus on:
- Phase 2 modularization with MistKit integration
- CloudKit public database integration
- Background parsing queue with resilience patterns
- Feed discovery and auto-detection services