agentleFS
codingjoecodingjoe/esupgrade/AGENTS.md

esupgrade

AGENTS.md15 starsChanged 6 months agoBSD-2-ClauseView on GitHub

The package includes transformers for upgrading JavaScript syntax. For a full list of transformations, see README.md. For contributing guidelines, see CONTRIBUTING.md. Use EOF syntax to run node scripts directly from the command line. For example: Transformers must only apply to types that are statically verifiable. Use NodeTest from src/types.js to guard transformations: Never apply a transformation based solely on structural shape (e.g., a .length property or bracket access) without first verifying the receiver is a known type. An unknown identifier…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 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.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use EOF syntax to run node scripts directly from the command line.

    line 22
  2. Very specific:

    Never apply a transformation based solely on structural shape (e.g., a .length property or bracket access) without first verifying the …

    line 46
  3. Very specific:

    Every transformer also declares a pre-filter in src/prefilters.js, so files that cannot contain the pattern skip the syntax tree walk.

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
AGENTS.md

esupgrade

The package includes transformers for upgrading JavaScript syntax.

Categories

  • Widely Available: Transformers for features available in all major browsers for at least 30 months.
  • Newly Available: Transformers for features available in all major browsers for 0-30 months.

For a full list of transformations, see README.md.

Package Structure

  • bin/: Command-line interface script.
  • src/: Source code and transformers.
  • tests/: Test suite.

For contributing guidelines, see CONTRIBUTING.md.

Instructions

Use EOF syntax to run node scripts directly from the command line. For example:

node --input-type=module <<'EOF'
import { transform } from './src/index.js';

const sample = "const v = $(input).val();";
const res = transform(sample);
console.log('modified:', res.modified);
console.log('code:\n' + res.code);
EOF

Writing Transformers

Transformers must only apply to types that are statically verifiable. Use NodeTest from src/types.js to guard transformations:

  • new NodeTest(node).isIterable() — array literals, new Array(), Array.from(), and Array.of(). Use this when the transformation is array-specific (e.g., index access, .at()).
  • new NodeTest(node).hasIndexOfAndIncludes() — arrays and strings (includes string literals and array method chains like .map(), .filter()). Use this when the transformation applies to both arrays and strings.
  • new NodeTest(node).isMethodCall(["concat"]) — a non-computed call to a named method such as .concat(), on any receiver. Use a receiver guard such as isIterable() when the transformation depends on the receiver type.
  • new NodeTest(node).isFunctionExpression() — arrow and function expressions. Use this before inspecting a callback's parameters or body.
  • new NodeTest(node).isVarLetOrConstDeclaration() — var, let, and const declarations. Use this before rewriting or removing a declaration, because using and await using declarations dispose a resource when the scope exits.

Never apply a transformation based solely on structural shape (e.g., a .length property or bracket access) without first verifying the receiver is a known type. An unknown identifier such as arr cannot be assumed to be an array and must not be transformed.

Every transformer also declares a pre-filter in src/prefilters.js, so files that cannot contain the pattern skip the syntax tree walk. See CONTRIBUTING.md.

Writing Docs

README.md

We add one new section per transformation:

  1. Headline + MDN link
  2. One diff-based example.
  3. Notable exception, which are not transformed.

We MUST NOT add any comments about "what it does". The functionality documentation is fully covered by the diff-based example.

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.