api-pagination
Installation
SKILL.md
API Pagination
Use this skill when
- Choosing cursor vs offset pagination
- Implementing filters, sorting, and page size limits
- Handling large datasets efficiently
Do not use this skill when
- Internal non-API data passing
Instructions
- Prefer cursor pagination for large and frequently-changing datasets.
- Return a next/prev cursor and total only when cheap to compute.
- Enforce a max page size and document defaults.
- Keep ordering stable during pagination.
- Delegate filtering/sorting to the query, not in-app.
- Avoid infinite cursor loops with changing data.
- Expose metadata: hasMore, nextCursor, returnedCount.