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.
npx skills add tmj-90/gaffer --skill pagination-and-filteringgit clone --depth 1 https://github.com/tmj-90/gafferWrote 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.
[](https://agentmods.dev/skills/tmj-90/gaffer/pagination-and-filtering)<a href="https://agentmods.dev/skills/tmj-90/gaffer/pagination-and-filtering"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/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.
<a href="https://agentmods.dev/skills/tmj-90/gaffer/pagination-and-filtering"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/pagination-and-filtering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00095 | $0.01476 |
| Opus 5.5 | $0.00038 | $0.00590 |
| Sonnet 5.5 | $0.00019 | $0.00295 |
| Haiku 4.5 | $0.00010 | $0.00148 |
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 2mo 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.
How it starts
The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Paginate, sort and filter a collection
A list endpoint is where unbounded cost and subtle inconsistency hide. OFFSET makes
the database read and discard every skipped row, and it skips or repeats rows when the
table changes between requests; a non-unique sort order makes page boundaries
nondeterministic; an unbounded limit is a denial of service. Sources: Markus Winand,
Use The Index, Luke ("Paging Through Results", "No Offset"); PostgreSQL and MySQL
documentation on row-value comparison and ORDER BY; RFC 8288 (Link header).
Steps
- Match the existing list contract. Copy a sibling endpoint/component: envelope
(
items,next_cursororpage,totalif offered), parameter names (limit,cursor,sort,filter[...]), defaults, and error shape. Callsearch_lorefor the repo's pagination convention. A second list shape is a defect. - Prefer cursor (keyset) pagination for data that changes. The cursor encodes the
last row's sort-key values plus its id; the next page is
WHERE (created_at, id) < (:c_created_at, :c_id) ORDER BY created_at DESC, id DESC LIMIT :limit + 1. With mixed directions (name ASC, id DESC) a row-value comparison is wrong; expand it:name > :n OR (name = :n AND id < :id). Use offset only for small, static lists or a genuine "jump to page N" need, stated in the code. - Make the sort total, index-backed and NULL-safe. Every sort ends with a unique
tiebreaker (the primary key). Back each allowed sort with a composite index in the
same column order and direction, after any equality filters (the
sql-query-performanceskill). Keyset on a nullable column breaks (NULL compares as unknown); sort on a non-null column, or make NULL placement explicit (NULLS LAST) and handle the NULL segment in the predicate. Allow-list sortable fields; never interpolate a client column name. - Make cursors opaque and bound to their query. Base64url-encode JSON (or sign it
with an HMAC if tampering matters) containing the key values, sort, and a hash of the
filters. Reject a cursor used with different sort/filter parameters or with malformed
contents with
400, never a500or a silent restart from page one. - Bound the page. A default
limit(20–50) and a hard maximum (100–200); reject above it with400(or clamp, if that is the repo's convention, and say so in the response). Fetchlimit + 1rows to computehas_more; returnnext_cursoronly when there is one. OfferLink: <…>; rel="next"if the repo uses it. - Filters are typed data, never query fragments. Each filter has a declared type
and allowed operators (
status=open,ready,created_after=2026-01-01T00:00:00Z), is validated at the boundary, and is bound as a parameter. Tenant/ownership scoping is applied server-side before any client filter (thesecurity-authzskill). Full-text search uses the database's FTS or the search engine, with its own limits. - Be honest about totals. An exact
COUNT(*)over a large filtered set costs as much as the query itself; offer it only when cheap or requested, otherwisehas_moreor a labelled estimate. Never compute an expensive count on every page. - Keep the UI in step. Same parameter names; active sort and filters in the URL
(shareable, back button works); empty, loading and error states handled; filter
changes reset the cursor (the
frontend-data-fetchingskill).
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.
- 2mo ago Changed · +27 lines b4310b36a05e
- 2mo ago First seen · 66 lines · 95 tokens per session scan A 35adcf55882e
pagination-and-filtering is a skill published in the GitHub repository tmj-90/gaffer (1 stars, last pushed yesterday), licensed Apache-2.0. It adds 95 tokens to every session and 1,476 once invoked, about $0.0004 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-28.
pagination-and-filtering compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| pagination-and-filteringtmj-90/gaffer | Skill | 1 | yesterday | Apache-2.0 | A | 95 | Claude Code, Codex |
| compound-field-patternsPranavNagrecha/AwesomeSalesforceSkills | Skill | 27 | 12d ago | none | A | 67 | Claude Code |
| caching-strategiesVersoXBT/claude-initial-setup | Skill | 4 | 6mo ago | MIT | A | 63 | Claude Code |
| backend-patternsWania-Kazmi/claude-code-autonomous-agent-workflow | Skill | 4 | 10mo ago | none | A | 32 | Claude Code |
| event-store-designwshobson/agents | Skill | 43k | 2d ago | MIT | A | 33 | Claude Code |
| ai-persistence/build-drizzle-adapterTanStack/ai | Skill | 3.4k | today | MIT | A | 79 | Claude Code |
| ai-persistence/build-prisma-adapterTanStack/ai | Skill | 3.4k | today | MIT | A | 71 | Claude Code |