pagination-implementer

Enforces offset-based pagination with `{ collection, total }` return shapes in HustleXP backend SQL and Prisma patterns.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/Sebdysart/omni-link-hustlexp --skill pagination-implementer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pagination-implementer
Source: https://github.com/Sebdysart/omni-link-hustlexp/tree/main/skills/pagination-implementer
Command: npx skills add https://github.com/Sebdysart/omni-link-hustlexp --skill pagination-implementer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents the common AI error of implementing cursor-based pagination, which is incompatible with the HustleXP backend and breaks existing systems. It ensures the correct offset-based pagination pattern is used for all list procedures.

Core Features & Use Cases

  • Enforces Offset Pagination: Guarantees that all list endpoints use { collection, total } return shapes, not { items, nextCursor }.
  • Guides Backend Implementation: Provides specific SQL and Prisma patterns for implementing offset pagination.
  • Guides iOS Caller Updates: Details how to update Swift services to consume the correct pagination response.
  • Use Case: When adding a new feature to list user-generated tasks, this Skill ensures the API endpoint correctly returns a paginated list with the total count, preventing integration issues with the iOS app.

Quick Start

Use the pagination-implementer skill to add offset-based pagination to the admin.listUsers procedure in the backend.

Frequently Asked Questions about pagination-implementer

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

FAQPage Schema
How do I implement offset pagination in a tRPC backend procedure?

To implement offset pagination in a tRPC backend, use SQL and Prisma query patterns that return a `{ collection, total }` response shape, ensuring your list endpoints provide the total count needed for client-side pagination.

Why does cursor pagination break my backend API and iOS app integration?

Cursor pagination breaks API and iOS integration because it returns a `{ items, nextCursor }` shape instead of the required `{ collection, total }` format, disrupting systems that rely on total counts for procedures like `admin.listUsers`.

How do I update Swift services to consume offset pagination responses?

Update Swift services to consume offset pagination by adjusting iOS service logic to expect the `{ collection, total }` return shape from your tRPC API, ensuring the app correctly processes the total record count alongside the retrieved collection.

What input and output schemas are needed for offset pagination in Prisma?

Offset pagination in Prisma requires input schemas for limit and offset values, and output schemas returning `{ collection, total }`, ensuring list procedures like `squad.listTasks` deliver both the paginated data and the total record count.

What is the correct return shape for tRPC list procedures in a TypeScript backend?

The correct return shape for tRPC list procedures in a TypeScript backend is `{ collection, total }`. Using this offset-based pattern instead of cursor-based formats prevents integration issues and maintains compatibility with existing iOS services.