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 source file small enough for an agent to read in one pass. Files that grow past what an agent can hold get read in pieces, and agents miss what's in the pieces they skip.

The skill bundles check-file-size.mjs, which finds every file over a token budget, 8,000 tokens unless the repository sets another. The agent then:

  1. Splits the files over budget by the concepts they already own, starting with the one blocking the work in front of it.
  2. Once you agree, sets up a pre-commit ratchet: a file can't grow past the budget, and a file already over it can't grow further. It asks first, because the ratchet freezes every file over the budget.

Adapted from dzhng/skills by David Zhang. The fork quotes a frontmatter value Trail Guide can't otherwise read, validates --max-tokens, and parses renames of non-ASCII paths.