APIs · plan by default

/api-pagination

Design stable pagination, filtering, and sorting

Use for stable bounded collection traversal; db-query handles result correctness below it.

Make it your own.

In Claude Code, use the slash command and add your context. In Codex, select api-pagination from the just-vibe skill picker, then send the same brief.

Version 0.11.0 also supports /jv api-pagination, /just-vibe api-pagination and /jv:api-pagination in Claude. See shortcut setup and context examples.

Example · plan
/just-vibe:api-pagination Plan stable cursor pagination when concurrent inserts share sort values.
edge · apply
/just-vibe:api-pagination Add cursor pagination with equal timestamps and deleted records between pages.
blocked · inspect
/just-vibe:api-pagination Design pagination without a declared consistency requirement; show the decision explicitly.

What the agent does

  1. Choose deterministic ordering with a unique tie-breaker, and assess offset against cursor traversal.
  2. Bind cursor identity to filters and tenant scope, and specify consistency under concurrent inserts and deletes.
  3. Test ties, concurrent inserts and deletes, invalid cursors and end conditions.

Inputs

  • dataset/order, concurrent-write behavior, filters, consumer contract, and scale.

Optional context: scope, references, constraints, successCriteria, environment, mode, budget.

Scope

Reads
Stable pagination and sorting semantics; implement when requested.
Writes
Inspect/plan: inspect or propose; save requested artifacts only. Apply: edit the requested local implementation and perform relevant bounded checks while preserving unrelated work. Live data changes, remote actions and paid jobs require their resolved target and existing session authorization.
Mode
Plan a pagination contract when requested; apply for requested implementation with resolved ordering, cursor scope and consistency semantics.
Prerequisites
Interface definitions, producer/consumer source, authentication model, versioning constraints, and isolated test endpoints. External API calls must respect environment, credentials, rate limits, and side-effect scope.

Expected output

  • Ordering and cursor contract or implementation, with tie, mutation, invalid-cursor and end-of-list checks.

How the work is checked

  • Equal sort values do not create accidental duplication; invalid or mismatched cursors fail predictably.

When to stop or clarify

  • Do not promise snapshot consistency without a mechanism. Preserve public response shape when constrained.

Handling missing context

Infer
Read producer/consumer schemas, error contracts, auth conventions and known supported client versions.
Assume
Keep compatible response and pagination semantics where the brief does not request a breaking change.
Ask
Ask when contract sources disagree or an unknown consumer changes compatibility; do not require live credentials to write or test an isolated client.

Technical guidance

Evidence
Inspect ordering columns, uniqueness, null ordering, filters, tenant scope and consistency requirements.
Method
Use a deterministic composite position and bind cursors to query/scope; define live versus snapshot traversal.
Pitfall
Offset shifts under writes and nonunique sort keys can skip or duplicate records; base64 is not tamper protection.
Check
Test equal sort values, concurrent insert/delete, empty/last pages and a cursor from another tenant or filter.

Situational decisions

When the product requires a stable snapshot across pages: Choose an actual snapshot/version mechanism or explicitly narrow the guarantee.

The coding agent follows this workflow using its available tools. Installation does not grant service access or guarantee an outcome. Read the compatibility notes.

Keep exploring