pagination-and-filtering

pagination-and-filtering is a skill for Claude Code from RaNDoM6913/claude-code-superkit. It costs 35 tokens per session (2,550 once invoked), scanned A, original, MIT.

A set of patterns for loading lists in pages and filtering them, including cursor-based SQL queries, search delays, and infinite scrolling. Cursor-based pagination uses the last item seen to fetch the next stable batch.

In plain words
What is it for?
Use it to build feeds, notifications, likes, matches, admin tables, filtered searches, and infinite-scroll views.
Why use it?
It helps lists stay consistent and efficient as data changes or grows, avoiding slow or shifting page results.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: positional $N argument.

Good fit Use it to build feeds, notifications, likes, matches, admin tables, filtered searches, and infinite-scroll views.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/random6913/claude-code-superkit/pagination-and-filtering
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add RaNDoM6913/claude-code-superkit --skill pagination-and-filtering
Clone the repo
git clone --depth 1 https://github.com/RaNDoM6913/claude-code-superkit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pagination-and-filtering

README.md
[![agentmods](https://agentmods.dev/badge/skills/random6913/claude-code-superkit/pagination-and-filtering/github.svg)](https://agentmods.dev/skills/random6913/claude-code-superkit/pagination-and-filtering)
Your own site
<a href="https://agentmods.dev/skills/random6913/claude-code-superkit/pagination-and-filtering"><img src="https://agentmods.dev/badge/skills/random6913/claude-code-superkit/pagination-and-filtering/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pagination-and-filtering

Your own site · 80×15
<a href="https://agentmods.dev/skills/random6913/claude-code-superkit/pagination-and-filtering"><img src="https://agentmods.dev/badge/skills/random6913/claude-code-superkit/pagination-and-filtering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,550 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00035 $0.02550
Opus 5.5 $0.00014 $0.01020
Sonnet 5.5 $0.00007 $0.00510
Haiku 4.5 $0.00003 $0.00255

Measured 1mo ago against content hash 2e8a9472eb0c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pagination-and-filtering scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/showcase/.claude/skills/pagination-and-filtering/SKILL.md · 332 lines

How it starts

The opening of the file, as written. The whole thing — 332 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pagination & Filtering Patterns

Backend SQL Patterns

Cursor-Based Pagination (Feeds & Lists)

SocialApp uses cursor-based pagination for all user-facing lists (feed, likes, notifications, matches). Never use OFFSET-based pagination for these — it's slow on large tables and produces inconsistent results when rows are inserted/deleted between pages.

Composite cursor pattern — use (created_at, id) tuple for stable ordering:

func (r *LikeRepo) ListIncomingProfilesCursor(
    ctx context.Context,
    userID int64,
    limit int,
    cursorCreatedAt *time.Time,
    cursorID *int64,
) ([]IncomingLikeRecord, error) {
    hasCursor := cursorCreatedAt != nil && cursorID != nil

    query := `
SELECT l.id, l.from_user_id, p.display_name, l.created_at
FROM likes l
JOIN profiles p ON p.user_id = l.from_user_id
WHERE l.to_user_id = $1`

    var args []any
    args = append(args, userID)

    if hasCursor {
        // Composite cursor: skip rows at or before the cursor position
        query += `
    AND (l.created_at, l.id) < ($2, $3)`
        args = append(args, *cursorCreatedAt, *cursorID)
    }

    query += `
ORDER BY l.created_at DESC, l.id DESC
LIMIT $` + fmt.Sprintf("%d", len(args)+1)
    args = append(args, limit)

    rows, err := r.pool.Query(ctx, query, args...)
    // ...
}

Rules:

  • Always use (timestamp, id) composite for cursor — timestamp alone is not unique
  • Order and cursor comparison must match: ORDER BY created_at DESC, id DESC with (created_at, id) < ($2, $3)
  • Cursor fields come from the last item of the previous page
  • Parameter numbers are dynamic ($N) — build with fmt.Sprintf("%d", len(args)+1)
  • Default limit: 20, max limit: 100 — enforce in repo:
    if limit <= 0 { limit = 20 }
    if limit > 100 { limit = 100 }
    

LIMIT + 1 Pattern for hasMore Detection

Request one extra row to know if more pages exist — avoids a separate COUNT query:

// Service layer
func (s *Service) ListLikes(ctx context.Context, userID int64, limit int, cursor *Cursor) (*Page, error) {
    // Fetch limit+1 rows
    items, err := s.repo.ListIncoming(ctx, userID, limit+1, cursor)
    if err != nil {
        return nil, fmt.Errorf("ListLikes: %w", err)
    }

    hasMore := len(items) > limit
    if hasMore {
        items = items[:limit] // trim the extra row
    }

    var nextCursor *Cursor
    if hasMore && len(items) > 0 {
        last := items[len(items)-1]
        nextCursor = &Cursor{CreatedAt: last.CreatedAt, ID: last.ID}
    }

    return &Page{Items: items, HasMore: hasMore, NextCursor: nextCursor}, nil
}

Read the full file on GitHub · 332 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 332 lines · 35 tokens per session scan A 2e8a9472eb0c

Subscribe to this mod's changes

pagination-and-filtering is a skill published in the GitHub repository RaNDoM6913/claude-code-superkit (3 stars, last pushed 6d ago), licensed MIT. It adds 35 tokens to every session and 2,550 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

Supabase Expert

Database and backend knowledge for business operators — table design, auth setup, row-level security, storage, and edge functions explained in plain English. Not a developer guide — domain expertise for building your backend on Supabase.

yuchenbigpen1/normies · 47 tokens

backend-patterns

Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes. Use when building or reviewing Node.js, Express, or Next.js API routes and their data access.

affaan-m/ECC · 51 tokens

cqrs-implementation

Implement Command Query Responsibility Segregation for scalable architectures. Use when separating read and write models, optimizing query performance, or building event-sourced systems.

wshobson/agents · 35 tokens

event-store-design

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

wshobson/agents · 33 tokens

ai-persistence/build-drizzle-adapter

Use when an app already runs Drizzle ORM and needs TanStack AI chat persistence — writes a chat-persistence.ts into the app against its existing db handle, schema file, and drizzle-kit journal. Covers the four tables (SQLite/Postgres/MySQL), the onConflict idempotency rules, JSON columns, and per-request bindings like…

TanStack/ai · 79 tokens

ai-persistence/build-prisma-adapter

Use when an app already runs Prisma and needs TanStack AI chat persistence — writes a chat-persistence.ts into the app against its existing PrismaClient and schema.prisma. Covers the four models, BigInt timestamps, JSON-as-string columns, upsert-with-empty-update idempotency, and model renaming.

TanStack/ai · 71 tokens