pagination-optimization

Installation
SKILL.md

Pagination Optimization

Three pagination strategies with fundamentally different performance characteristics and API contracts. The choice is irreversible once clients depend on it — pick correctly upfront.


Phase 1: Discovery

Establish before recommending anything:

What does the sort order depend on?

  • Stable unique column (created_at + id, auto-increment id) → keyset is viable
  • Arbitrary user-defined sort (price, name, relevance score) → keyset is harder; offset may be necessary with mitigation
  • Relevance/ranking from full-text search → offset only; keyset doesn't compose with score-based ranking

What are the access patterns?

  • Sequential forward traversal only (infinite scroll, feeds) → cursor/keyset
  • Random access to arbitrary page numbers ("jump to page 47") → offset required
  • Bidirectional navigation (previous page) → keyset requires storing both directions; cursor is forward-only by default
Related skills

More from blunotech-dev/agents

Installs
1
GitHub Stars
2
First Seen
Apr 22, 2026