agentleFS
oocxoocx/tfplan2md/.agents/skills/context-pack/SKILL.md

context-pack

Skill174 starsChanged 2 months agoMITView on GitHub

Assemble the context a role needs without reading whole files - structural search with ast-grep, and what to delegate instead of reading.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not delegate a single file read or one rg — the spawn costs more than the call.

    line 50
  2. Very specific:

    Do not cat a 300-line file to answer a one-line question.

    line 67
  3. Distinctive:

    Do not read a file "for context" before knowing what you are looking for.

    line 68
  4. Distinctive:

    Do not paste a role file into a subagent prompt — the subagent reads it itself.

    line 69

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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

Context Pack

Token cost is dominated by what enters context, not by what you do with it. This skill is about reading less while knowing more.

Read known paths, search for unknown ones

A role usually needs specific artifacts — specification.md, architecture.md, tasks.md, analysis.md. Read those directly; there is nothing to discover.

Reach for search only when the question is "where is X". Then make the search structural rather than textual.

ast-grep for code questions

ast-grep matches syntax, not strings, so it returns the construct you asked about instead of every line mentioning it.

# Every class implementing an interface, without reading any file whole
ast-grep --lang csharp -p 'class $NAME : $$$ IResourceRenderer $$$'

# Every call to a method, with its arguments
ast-grep --lang csharp -p 'RegisterRenderer($$$)'

# Every method with a given attribute
ast-grep --lang csharp -p '[Test] $RET $NAME($$$) { $$$ }'

Always invoke ast-grep by its full name. On Linux, sg is util-linux's setgid binary; a script that calls sg expecting ast-grep runs the wrong program silently.

Fall back to rg for prose, configuration and markdown, where there is no syntax tree worth matching.

Delegate what you do not need verbatim

Spawn a cheap-tier subagent for anything whose output you need conclusions from rather than content:

  • "Where is the display-name logic for azurerm?" — the answer is a path, not a file.
  • Build and test runs where only pass/fail matters.
  • "Does anything else already do X?" before writing something new.

Do not delegate a single file read or one rg — the spawn costs more than the call.

Command output is compressed for you

rtk sits in front of Bash calls and compresses the output of git, test runners, linters, gh and docker before it reaches context. You do not invoke it; the hook rewrites the command.

Two consequences worth knowing:

  • Its compression is lossy — dedup, truncation, grouping. Where you need the exact bytes, say so; tee mode preserves full output on failure.
  • The Code Reviewer's diff is excluded, because a truncated diff produces a confident review of code nobody saw.

What not to do

  • Do not cat a 300-line file to answer a one-line question.
  • Do not read a file "for context" before knowing what you are looking for.
  • Do not paste a role file into a subagent prompt — the subagent reads it itself.

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.