go-cursor-pagination

Generate a Go pagination package with cursor encoding, SQL helpers, and gRPC tokens.

Updated Jan 17, 2026
One-click install
npx skills add https://github.com/saddam-eng-tech/ai-agent-skills --skill go-cursor-pagination
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-cursor-pagination
Source: https://github.com/saddam-eng-tech/ai-agent-skills/tree/main/go-cursor-pagination
Command: npx skills add https://github.com/saddam-eng-tech/ai-agent-skills --skill go-cursor-pagination

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the inefficiencies and complexities of traditional offset-based pagination in Go microservices, providing a robust and scalable cursor-based solution.

Core Features & Use Cases

  • Cursor Encoding/Decoding: Safely encodes and decodes cursors for reliable pagination state management.
  • SQL Builder Helper: Assists in constructing efficient SQL queries for cursor-based retrieval.
  • Generic Page Response: Provides a standardized Page[T] type for consistent API responses.
  • gRPC Proto Additions: Includes necessary proto definitions for page tokens in gRPC services.
  • Use Case: Implement infinite scrolling in a mobile app's feed by using this Skill to generate the backend pagination logic for fetching new items as the user scrolls down.

Quick Start

Add cursor-based pagination to my Go microservice for the 'User' entity, sorting by 'created_at' descending, with a primary key of 'uuid' and a default page size of 20.

Frequently Asked Questions about go-cursor-pagination

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

FAQPage Schema
How do I implement cursor-based pagination in a Go microservice to replace offset pagination?

You can implement cursor-based pagination by generating a reusable package that handles cursor encoding and decoding, provides SQL builder helpers for efficient queries, and includes a generic Page[T] response type for consistent API responses across your Go microservices.

Why should I use cursor pagination instead of offset pagination for high-throughput applications?

Cursor pagination solves performance and scalability issues associated with offset pagination in high-throughput applications by using encoded cursors instead of row offsets, allowing the database to avoid scanning and discarding previously fetched records.

Does cursor-based pagination work with gRPC proto definitions in Go?

Yes, cursor-based pagination works with gRPC by including necessary proto additions for page tokens, allowing Go microservices to pass encoded cursor tokens seamlessly between gRPC client and server requests for continuous data fetching.

What inputs do I need to generate a reusable cursor pagination package for my Go application?

Generating a reusable cursor pagination package requires the entity name, sort field(s), primary key type, and default page size, which configure the cursor encoding, SQL builder helpers, and generic Page[T] response type for your specific data model.

Can I use cursor pagination to implement infinite scrolling in a mobile app feed?

Yes, cursor pagination is ideal for implementing infinite scrolling in a mobile app feed because it generates backend pagination logic with encoded cursors, allowing the app to fetch new items reliably as the user scrolls down without performance degradation.