agentleFS
validatorjsvalidatorjs/validator.js/AGENTS.md

validator.js

AGENTS.md24k starsChanged 2 years agoMITView on GitHub

This file provides guidance to AI coding agents working with this repository.

  • Installs packages

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

24 rules. About 0 are common, 16 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Keep changes focused on the reported behavior.

    line 19
  2. Very specific:

    Follow the style of recent commit and pull-request titles.

    line 21
  3. Distinctive:

    Use npm for the official build and test path.

    line 25
  4. Very specific:

    Prefer the latest Node.js LTS release for local development.

    line 27
  5. Very specific:

    Run npm run build to generate the Node, ES module, and browser distributions.

    line 28
  6. Very specific:

    Do not infer a source change from generated output alone.

    line 29
  7. Distinctive:

    When changing a shared helper, identify and test its public callers.

    line 38
  8. Distinctive:

    When changing behavior represented in multiple distributions, verify the source implementation and the relevant generated form rather than …

    line 39
  9. Distinctive:

    If a command fails during setup, distinguish dependency, Node-version, filesystem, and tooling failures from product-code failures before …

    line 40
  10. Distinctive:

    Prefer the smallest root-cause fix over special-casing a reported input.

    line 45
  11. Distinctive:

    Keep static locale and format data changes separate from algorithm changes when practical.

    line 46
  12. Very specific:

    Do not update generated distributions manually.

    line 47
  13. Distinctive:

    Do not commit, push, publish a package or advisory, open an issue or pull request, or disclose private security material unless explicitly …

    line 48
  14. Distinctive:

    Update README.md when a public API, option, return contract, or documented limitation changes.

    line 52
  15. Very specific:

    Read SECURITY.md for the supported-version and vulnerability-reporting policy.

    line 53
  16. Very specific:

    Read THREAT_MODEL.md before triaging a suspected vulnerability.

    line 54
  17. Distinctive:

    Do not place private advisories, unpublished findings, reporter information, or private bug-hunt results in public documentation.

    line 55
  18. Distinctive:

    Before describing a finding as novel, check open and closed issues, pull requests, published advisories, available approved private …

    line 59
  19. Distinctive:

    Prefer rejecting speculative candidates over presenting unsupported security conclusions.

    line 60
  20. Distinctive:

    Start from a documented or reasonably supported public API invocation.

    line 64
  21. Distinctive:

    Add a focused regression test that expresses the expected correct behavior rather than an incidental implementation detail.

    line 66
  22. Distinctive:

    Run the test against the unchanged implementation and confirm that it fails for the stated reason.

    line 67
  23. Very specific:

    After a fix, confirm that the focused test passes and run npm test to check the generated builds, lint, and existing test suite.

    line 68
  24. Distinctive:

    Keep reproductions safe, local, bounded, self-contained, and readable.

    line 69

≈ “Common” is an estimate: at least 1 in 5 of the 36,368 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

AGENTS.md

This file provides guidance to AI coding agents working with this repository.

Project map

  • validator.js is a single-package npm project for string validation and sanitization.
  • src/index.js defines the public exports, and src/lib contains validators, sanitizers, normalizers, converters, static format data, and shared utilities.
  • test/validators.test.js contains most API tests; additional test files cover browser builds and individual utilities.
  • README.md is the primary public API reference. Update it when documented API behavior or options change.
  • build-browser.js creates the browser bundle. Babel creates the Node and ES module distributions.
  • index.js, lib/, es/, validator.js, and validator.min.js are generated. Do not edit or commit them manually.
  • The published package contains only the generated distributions, README.md, LICENSE, and package metadata listed in the files field of package.json.
  • validator.js has no runtime dependencies. The packages in devDependencies are used only to build, lint, and test the project.

Branching and pull requests

  • Normal changes target master.
  • Keep changes focused on the reported behavior. Avoid unrelated API, formatting, generated-file, or data-table changes.
  • Bug fixes should include a focused regression test that fails before the fix and passes afterward.
  • Follow the style of recent commit and pull-request titles; the repository does not define a separate title convention in CONTRIBUTING.md.

Install and build

  • Use npm for the official build and test path.
  • Install development dependencies with npm install --legacy-peer-deps, as documented in CONTRIBUTING.md and used by CI.
  • Prefer the latest Node.js LTS release for local development. When adding syntax or runtime APIs, follow the compatibility range declared in package.json and verify compatibility with the Node.js versions supported by CI.
  • Run npm run build to generate the Node, ES module, and browser distributions.
  • Do not infer a source change from generated output alone; inspect the corresponding file under src/.

Test

  • npm test is the broad local check. Its pretest lifecycle builds every distribution and runs ESLint before the Mocha suite.
  • npm run lint checks src/ and test/.
  • npm run build builds all published forms without running the tests.
  • For a focused Mocha run, use npm test -- --grep '<test name>'; retain the broad npm test run before considering a code change complete.
  • Tests use Mocha, Babel, and nyc. Coverage output under coverage/ and .nyc_output/ is generated and should not be committed.
  • When changing a shared helper, identify and test its public callers. A helper-level test alone does not establish public API behavior.
  • When changing behavior represented in multiple distributions, verify the source implementation and the relevant generated form rather than editing generated files.
  • If a command fails during setup, distinguish dependency, Node-version, filesystem, and tooling failures from product-code failures before changing source.

Change discipline

  • Preserve documented behavior and compatibility outside the stated scope of a change.
  • Prefer the smallest root-cause fix over special-casing a reported input.
  • Keep static locale and format data changes separate from algorithm changes when practical.
  • Do not update generated distributions manually; building and publishing generate them from src/.
  • Do not commit, push, publish a package or advisory, open an issue or pull request, or disclose private security material unless explicitly authorized.

Documentation and threat model

  • Update README.md when a public API, option, return contract, or documented limitation changes.
  • Read SECURITY.md for the supported-version and vulnerability-reporting policy.
  • Read THREAT_MODEL.md before triaging a suspected vulnerability.
  • Do not place private advisories, unpublished findings, reporter information, or private bug-hunt results in public documentation.

Security analysis

  • Before describing a finding as novel, check open and closed issues, pull requests, published advisories, available approved private advisory material, tests, documentation, changelog entries, and relevant source history.
  • Prefer rejecting speculative candidates over presenting unsupported security conclusions.

Security reproduction standards

  • Start from a documented or reasonably supported public API invocation. An internal-helper test alone does not demonstrate public behavior unless that helper is itself public.
  • State the exact arguments, options, environment, expected documented behavior, observed behavior, independent security effect, and relevant preconditions.
  • Add a focused regression test that expresses the expected correct behavior rather than an incidental implementation detail.
  • Run the test against the unchanged implementation and confirm that it fails for the stated reason. If the behavior does not reproduce, stop and report the evidence instead of modifying source.
  • After a fix, confirm that the focused test passes and run npm test to check the generated builds, lint, and existing test suite.
  • Keep reproductions safe, local, bounded, self-contained, and readable. Do not contact external targets or run unbounded denial-of-service payloads.
  • Report the root cause, files changed, before-and-after results, compatibility effects, assumptions, and remaining limitations.

Download now (ZIP)

Trending

Quiet since August.about the whole repository

Dec 2025: 6 mentionsJan 2026: 5 mentionsFeb 2026: 10 mentionsMar 2026: 7 mentionsApr 2026: 7 mentionsMay 2026: 5 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 1 mentionSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the validatorjs/validator.js repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about validatorjs/validator.js

The biggest 5 of 67 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 67

Talked about on GitHub, Stack Overflow, the web and Hacker News (67 times).

On GitHub · 50

45 more on GitHub

On Stack Overflow · 12

7 more on Stack Overflow

On the web · 4

On Hacker News · 1

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 28,693 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.

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.