agentleFS
Wsh7AshWsh7Ash/skillmcp/skills/pagination-and-limit-discipline/SKILL.md

pagination-and-limit-discipline

Skill0 starsChanged 17 days agoMITView on GitHub

Page through results deliberately and stop when the remaining results stop being useful. Use when a tool returns a truncated list with a total count

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Stop as soon as the decision is determined

    line 24

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Pagination and Limit Discipline

Page through results deliberately and stop when the remaining results stop being useful

Use when: a tool returns a truncated list with a total count

Avoid when: the result set is smaller than one page and truncation never occurs

Procedure

  1. Compare the returned count against the total
  2. Decide whether the missing results could change the decision
  3. Refine the query before paging when the first page is unfocused
  4. Page with an explicit limit and offset only when the extra results matter
  5. Stop as soon as the decision is determined
  6. Record how many results were actually consumed

Signals

  • the total count is compared against the returned count every time
  • paging happens only when the decision depends on it
  • the query is refined instead of paging through noise
  • the notes state how many results were used

Patterns

1. Count comparison

returned 10 of 50 -> is 11-50 relevant?

2. Refine first

add a tag to the query instead of offset=10

3. Explicit page

limit=10 offset=10 only when needed

Pitfalls

  • Paging through every result when the first three answered the question
  • Assuming a short page means the end when the total says otherwise
  • Raising the limit to the maximum and re-reading the same first page

Done when

  • the returned and total counts are compared before any paging
  • the number of results actually consumed is recorded

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.