Skip to content
public-library› Skills›Ratchet files

Ratchet files

ratchet-filesRecommended : fabricahq/public-library recommends installing this skill when you add its skills and rules. Forked from dzhng : fabricahq/public-library created its own copy of this skill from dzhng.

Keep every file small enough for an agent to read whole, and stop files from growing back.

Find every file over a token budget, split the ones in your way by the concepts they already own, and add a ratchet so files only ever get smaller.

A long file in which the agent read only the first 2,000 lines and missed a caller at line 4,612.
Agents can't read a big file whole.
A 24,100-token file split by concept into four files under the 8,000-token budget.
Keep every file under a token budget.
A terminal in which a commit is blocked because a file grew past the budget, then passes after a split.
A file can only get smaller.
The fork slide: the original skill's source, repository, path, and commit, and why the original couldn't be used.
This skill is a fork, and why.

Why it exists

Agents read big files in pieces, and miss the pieces they skip. A file an agent can read whole is a file it can change without breaking what it didn't see.

How it works

  1. It measures every source file against a token budget, 8,000 by default, and lists the ones over it.
  2. It splits an oversized file by the concepts it already holds, so each new file has one job and a name that says so.
  3. With your OK, it adds a pre-commit check: a file can't grow past the budget, and one already over it can't grow further.