pagination

Implements cursor pagination for Self Serve backend list endpoints using page_token and page_size.

12|6|Updated Jul 14, 2025
One-click install
npx skills add https://github.com/linuxfoundation/lfx-self-serve --skill pagination-linuxfoundation
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pagination
Source: https://github.com/linuxfoundation/lfx-self-serve/tree/main/.claude/skills/pagination
Command: npx skills add https://github.com/linuxfoundation/lfx-self-serve --skill pagination-linuxfoundation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Backend list endpoints in the Self Serve codebase must follow the query service's cursor pagination contract, and mistakes like using limit instead of page_size or hand-rolling pagination loops cause bugs and contract mismatches. ## Core Features & Use Cases - Cursor Pagination Guidance: Enforces page_token / page_size conventions and the PaginatedResponse<T> wrapper for all list endpoints. - All-Pages Fetching: Directs use of the fetchAllQueryResources helper instead of manual while (page_token) loops for exports and aggregations. - Filtering and Search: Documents the filters array format (field:value, auto-prefixed with data.) for sorting, search, and tag matching. - Use Case: When adding a new GET /api/<resource> endpoint that wraps the query service, follow the workflow to wire cursor pagination correctly and verify the upstream contract before shipping. ## Quick Start Ask the AI to add cursor pagination with page_token and page_size to a new Self Serve list endpoint that wraps the query service.

Frequently Asked Questions about pagination

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

FAQPage Schema
How do I add cursor pagination to a backend list endpoint?▼

Use page_token for the cursor and page_size for the page limit, conditionally spreading the token with `...(pageToken ? { page_token: pageToken } : {})`. Wrap the result in PaginatedResponse<T> with shape `{ data: T[], page_token?: string }`.

How to fetch all pages of a resource from the query service?▼

Use the fetchAllQueryResources helper located in the helpers directory. Never hand-roll a while loop over page_token, since the helper handles iteration and aggregation for exports and full-list use cases.

Should I use limit or page_size for query service endpoints?▼

Use page_size, which is the query-service convention; using limit is a canonical bug. The exception is the upstream meetings API, which uses limit, so verify the upstream contract via gh api before assuming.

How do filters work with the query service?▼

Pass a filters array in `field:value` format. The query service automatically prefixes fields with `data.`, so you specify the logical field name without the prefix.

Does this skill cover frontend infinite scroll UI?▼

No, frontend infinite-scroll implementation is out of scope and covered by the self-serve-dev skill's frontend code generation reference. This skill only covers backend endpoint pagination against the query service.