datasource

Create DataSource scaffolding with Repository pattern for Swift modular apps.

Updated Jan 15, 2026
One-click install
npx skills add https://github.com/vjr2005/Challenge --skill datasource
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: datasource
Source: https://github.com/vjr2005/Challenge/tree/main/.claude/skills/datasource
Command: npx skills add https://github.com/vjr2005/Challenge --skill datasource

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

DataSource scaffolding standardizes and accelerates the creation of data access components (RemoteDataSource, MemoryDataSource, LocalDataSource) and their DTOs, aligning with the Repository pattern to reduce boilerplate and improve testability.

Core Features & Use Cases

  • RemoteDataSource: REST API consumption via HTTPClient contracts with async throws.
  • MemoryDataSource: In-memory caching using actors for thread safety.
  • LocalDataSource: UserDefaults-backed persistence for small local state.
  • Use Case: Add a new feature with API integration and a cached layer.

Quick Start

Create a RemoteDataSource for a new API resource along with its MemoryDataSource and DTO to complete the data layer scaffold.

Frequently Asked Questions about datasource

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a Swift Repository pattern data layer for a new feature module?

Scaffold a Swift data layer by generating RemoteDataSource, MemoryDataSource, and LocalDataSource classes alongside their DTOs to provide API consumption, in-memory caching, and local persistence for feature modules.

What is the best way to structure testable data access objects in an iOS app?

Structure testable data access objects by defining internal contracts for RemoteDataSource and MemoryDataSource, generating async throws DTOs, and providing structured test fixtures and mocks to verify repository pattern implementations.

How do I implement thread-safe in-memory caching for Swift data sources?

Implement thread-safe in-memory caching by scaffolding a MemoryDataSource using Swift actors, ensuring concurrent data access across your feature modules is safe without requiring manual lock management.

Can I use UserDefaults for local data persistence within the Swift Repository pattern?

Yes, you can use UserDefaults for local data persistence by generating a LocalDataSource module, which provides structured access for small local state requirements within the repository pattern architecture.

How do I mock data sources for Swift repository pattern testing?

Mock data sources for testing by utilizing the generated testable mocks and structured test fixtures that satisfy the internal contracts defined during the data source scaffolding process.

Does the Swift data source scaffolding support async REST API consumption?

Yes, the scaffolding supports async REST API consumption by wiring a RemoteDataSource with HTTPClient contracts using Swift's async throws pattern for network requests across modular apps.