pagination
Installation
SKILL.md
Pagination Skill
Purpose
Pagination is how you serve large datasets without killing your database, your bandwidth, or your users' patience. This skill covers choosing the right pagination strategy, implementing it correctly at the database and API level, and building the matching frontend components.
When to Use What
| Strategy | Best For | Drawbacks | Consistency |
|---|---|---|---|
Offset (LIMIT/OFFSET) |
Small datasets, page-number UX | Slow on large offsets, drift on inserts | Unstable |
| Cursor-based | Infinite scroll, real-time feeds | No jump-to-page, complex multi-field cursors | Stable |
| Keyset | Large sorted datasets, APIs | Requires unique sortable column | Stable |
| Page tokens | Public APIs, opaque cursors | Extra encoding step | Stable |
Decision shortcut:
- Need page numbers (1, 2, 3...)? Offset (but cap max page)
- Feed, timeline, or infinite scroll? Cursor-based
- Large dataset, API consumers? Keyset with opaque tokens