Api Pagination Contract Repairs

    by Mariusz Wrzeszczynski

    1

    Repair API pagination contract drift in a repo using Cursor.

    Secure checkout via Stripe

    0 installsSecurity scanned

    Works with the AI tools you already use

    CClaude CodeCCursorCCodex CLIGGitHub CopilotGGemini CLIVVS CodeWWindsurfMManus+14 more

    See it in action

    You say

    We switched our customer list API to cursor pagination, but the React table is still sending page numbers and our MSW mocks are breaking. Repair the contract drift in the repo.

    Your agent does

    1. Pagination Contract Decision

    Decision: PAGINATION CONTRACT DRIFT FOUND The route handler uses nextCursor, but useCustomers.ts and CustomerTable.tsx still track pageNumber.

    4. Drift Findings

    • Request: UI sends page (Expected: cursor)
    • Response: UI expects totalPages (Actual: hasMore)
    • Mocks: MSW returns offset metadata (Stale)

    5. Patch Plan

    • Update customerClient.ts to use cursor params.
    • Update useCustomers.ts to handle cursor state.
    • Align openapi.yaml and MSW handlers.
    • Add traversal tests to customer.test.ts.

    What you get

    Align frontend hooks with new cursor-based API response shapes.Fix duplicate or skipped row bugs in infinite scroll implementations.Synchronize OpenAPI and GraphQL schemas with actual route handler behavior.Update test mocks and snapshots to reflect current pagination metadata.

    About this skill

    The problem

    API pagination contracts often drift between the backend and frontend. You migrated from offset to cursor pagination, but your UI still expects page numbers, your OpenAPI docs are stale, and your tests are failing or hiding duplicate row bugs.

    What it does

    • Scans route handlers, controllers, and schemas to identify the canonical pagination contract.
    • Detects drift across GraphQL schemas, TypeScript types, API clients, and frontend hooks.
    • Identifies risks like missing next tokens, stale total-count assumptions, and duplicate-row bugs.
    • Prepares safe repository patches for mocks, fixtures, UI components, and documentation.
    • Generates guard tests for first page, end-of-list, and empty result edge cases.

    Frameworks & tools

    Works with REST, GraphQL, OpenAPI, Apollo, React Query, SWR, MSW, Zod, and Playwright.

    Why this beats prompting it yourself

    Manually tracing pagination drift across types, mocks, and UI logic is tedious and error-prone. This skill uses a structured register to ensure every layer of your stack—from the route validator to the Storybook story—stays in sync with the canonical contract.

    Use cases

    • Fixing infinite scroll bugs where rows are duplicated or skipped.
    • Aligning frontend hooks and UI components after an offset-to-cursor migration.
    • Updating stale MSW handlers and JSON fixtures to match new API response shapes.
    • Generating comprehensive pagination tests that cover traversal and boundary conditions.

    Known limitations

    Does not call live APIs or query production databases. Operations are limited to repository files and user-supplied context.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    Listedtoday

    Creator

    Mariusz Wrzeszczynski
    Mariusz Wrzeszczynski

    109 skills on Agensi

    Frequently Asked Questions

    Popular in Testing & QA