pagination

Generate offset- or cursor-based pagination infrastructure for SwiftUI apps.

27|5|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/bocan/bocan-music --skill pagination-bocan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pagination
Source: https://github.com/bocan/bocan-music/tree/main/.claude/skills/generators/pagination
Command: npx skills add https://github.com/bocan/bocan-music --skill pagination-bocan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manually implementing pagination logic, state management, and infinite scroll UI for Swift apps is time-consuming and prone to edge case bugs like duplicate requests or lost data on errors. This Skill eliminates that manual work by generating production-ready pagination infrastructure out of the box.

Core Features & Use Cases

  • Dual Pagination Patterns: Supports both offset-based (page number + size) and cursor-based (opaque token) pagination for REST APIs and real-time feeds.
  • Flexible Loading Triggers: Configurable infinite scroll (with threshold prefetching) or manual "Load More" button, with optional pull-to-refresh support.
  • Search Integration: Optional debounced search that resets pagination context automatically when queries change.
  • Robust State Management: Built-in @Observable state machine handles idle, loading, loaded, error, and exhausted states, with retry logic that preserves existing items on failure.
  • Pre-built SwiftUI Views: Includes ready-to-use list wrappers, loading spinners, empty state views, and error banners for common UI patterns.
  • Use Case: Perfect for building social feeds, product listings, search results, or any list view that loads data in pages from a backend API.

Quick Start

Use the pagination skill to add cursor-based infinite scroll pagination to your SwiftUI music track list view.

Frequently Asked Questions about pagination

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

FAQPage Schema
How do I implement infinite scroll with pagination in SwiftUI?

Cursor-based pagination in SwiftUI uses opaque tokens to load data feeds progressively. This Skill generates the required infrastructure automatically, supporting real-time feeds and REST APIs with built-in error retry handling.

Can I add debounced search to a paginated SwiftUI list view?

SwiftUI pagination state is managed using a Swift 6 compliant @Observable state machine. This architecture handles idle, loading, loaded, error, and exhausted states natively, preserving existing items during failure and retry logic.

What's the best way to handle pagination errors and retry logic in iOS apps?

Offset-based pagination in SwiftUI uses page number and size parameters to load list data sequentially. This approach suits standard REST APIs and is generated automatically alongside pre-built loading spinners and empty state views.

Does this pagination infrastructure work with macOS 14 apps?

This pagination infrastructure works with macOS 14 apps and iOS 17+ applications. It generates production-ready Swift 6 compliant code that supports both cursor-based and offset-based paginated data loading for feeds and search results.