/ratchet-backend:list-readsfrom ratchet-backend
Use whenever a task writes or reviews a query, function, or endpoint that returns a list - a feed, timeline, inbox, search results, or any paginated read - including a review of a feed or list query before merge, and its cursors and page size. Covers keyset pagination, one walk over the listed entity with filters in the query, bounding rows scanned, ranked lists, and how a page signals the end.
Ships in ratchet-backend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Read every applicable AGENTS.md first. Repository-local policy overrides these defaults.
For sweeps, exports, and scheduled jobs, use bounded-iteration. A ranking over every row is its global-ranking rule, not a list read.
OFFSET. Clamp the client's page size on the server. The API schema
keeps a static ceiling; the default and the effective maximum are runtime-tunable but never
above it.WHERE, served by an
index. Order with ORDER BY key DESC, id DESC and LIMIT page+1, and continue with a plain
keyset cursor, (key, id) < ($1, $2).LIMIT plus a time window or the keyset bound
the read. A keyset alone does not bound rows scanned. When a filter can reject long runs, such
as a viewer's blocks or mutes, the time window is the scan bound where the sort has one, and
EXPLAIN at representative cardinality compares rows read with rows returned.ORDER BY on the stored score.MATERIALIZED CTE over the listed entity that is filtered
or limited afterward, no window loops or resume probes, no proof state in the cursor, and no
setting for the size of such a pool. A single walk with an inspected-row cap is fine; the cap
is a tunable, from runtime configuration as in
bounded-iteration rule 8. The walk may return a short or empty page with a continuation cursor and has_next_page true.
See MATERIALIZED CTEs.
This rule is for lists and feeds a reader pages through. A background dispatcher may skip rows
it read, so it follows bounded-iteration.
A vector search's ORDER BY embedding <=> $1 LIMIT $k is how its index is read, not a pool;
see search indexes.has_next_page
and a cursor, and nothing else says the list is over. A short or empty page with the flag
true is valid, so set the flag from whether the read can continue, not from the rows returned:
it is true when an inspected-row cap stopped the read, even with no rows to return. The
page+1 row only answers it when the read ran to its LIMIT.items.length === 0, and not from
items.length < limit. It requests the next page while the flag is true and a cursor came
back. It shows the empty state only when it holds no items and no further page can be
requested; an empty list with more pages still offers a way to load more. Otherwise a capped
read that returns an empty first page shows "nothing here" and hides every older item.EXISTS per term, inside the one walk and its inspected-row cap of rules 5 and 8. Do not
IN (...) an unbounded list. Bound the query's input, not the stored data: do not cap how
many tags an item may carry to make a query cheap.Rules 8 to 10 are the contract for a page that crosses an API boundary. A sweep that reads its own table may still end on a short batch, as in bounded-iteration.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub jongleberry/ratchet-stack --plugin ratchet-backend18 skills in this plugin
/bounded-iterationUse when writing or reviewing a sweep, scheduled job, reconciler, cleanup, dispatcher, backfill, or export - any loop that reads rows. Covers bounding the rows each run reads, sweeps that re-select their own writes, and effects that repeat on every run./error-handlingUse when writing or reviewing code that throws, catches, or matches an error, turns a failure into a response, or reports errors to a tracker such as Sentry, including a review of a diff that does. Covers one defined list of error codes, matching on type or code instead of message, details as attributes on the error, and reporting only errors someone can act on./event-handlersUse when writing or reviewing code that acts on an event or a state change - a serverless function, a queue consumer, a scheduled task, or a deploy or config hook - and above all one that sleeps or waits before it acts. React to the change instead of waiting a fixed time, de-duplicate by reading current state, and defer work the target is not ready for without losing it./expand-contract-migrationsUse when renaming or dropping a column or table, changing a column type, making a column NOT NULL, renaming an API or event field, splitting or merging tables, or changing a config shape that running code reads. Change a shape in separate deploys so old and new code never disagree./feature-rolloutUse when adding or reviewing a feature flag, a flag's default, rollout or rollback steps, or a change that adds a table, migration, service, or write path. Ship new behavior behind a flag that starts off, treat deploying and enabling as separate steps, and add no table or service that no entry point reaches./glide-mqUse when writing or reviewing a queue producer, worker, dispatcher, scheduler, or flow, choosing which queue or lane a job belongs in, deciding what a job payload carries, or handling a request that waits on a job's result. Design glide-mq queues, jobs, lanes, concurrency, rate limits, and replay safety.