agentleFS
VercelKnown publishervercel-labs/nostics/AGENTS.md

nostics

AGENTS.md251 starsChanged 57 days agoMITView on GitHub

Structured diagnostic for libraries and frameworks to keep code agents in the loop. Never use em-dashes in your writing. Structured diagnostic SDK: typed, serializable Diagnostic objects with stable codes. defineDiagnostics() → callable handles per code; call to build/report a Diagnostic, throw the returned value to raise. packages/unplugin/ (@nostics/unplugin): build-time plugins, published separately. strip-transform.ts is the build-time AST transform that marks diagnostic code as pure and wraps with NODE_ENV guard for tree-shaking; dev-server-collector.ts is the Vite dev-server WS listener that forwards…

  • 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 32,671 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 repository4 other files it gives its agents.

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never use em-dashes in your writing.

    line 15
  2. Distinctive:

    When adding, removing, renaming, or moving an export, update together:

    line 29

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

Agentic Diagnostics

Structured diagnostic for libraries and frameworks to keep code agents in the loop.

Commands

pnpm exec vitest run                          # run all tests once
pnpm exec vitest run src/diagnostic.test.ts   # single test file
pnpm lint:fix                             # format and lint with oxfmt and oxlint
pnpm build                                # build with tsdown
pnpm typecheck                            # tsc

Never use em-dashes in your writing.

Architecture

Structured diagnostic SDK: typed, serializable Diagnostic objects with stable codes.

defineDiagnostics() → callable handles per code; call to build/report a Diagnostic, throw the returned value to raise.

packages/unplugin/ (@nostics/unplugin): build-time plugins, published separately. strip-transform.ts is the build-time AST transform that marks diagnostic code as pure and wraps with NODE_ENV guard for tree-shaking; dev-server-collector.ts is the Vite dev-server WS listener that forwards browser diagnostics to a log file. It has nostics as a peer dependency (workspace:^), so building it requires the root nostics dist first (root pnpm build handles the order).

Monorepo (pnpm workspaces): root is the nostics package, publishable packages live in packages/*, and playground/ and demo-lib/ are subprojects. Vitest runs as projects from the root config (nostics + packages/*). Releases: add new publishable packages to PKG_FOLDERS/FILES_TO_COMMIT in scripts/release.ts and to the folder MAP in .github/workflows/release.yml.

Public API: keep in sync

When adding, removing, renaming, or moving an export, update together:

  • src/index.ts (root nostics exports) plus the src/** file that owns it.
  • A subpath export needs matching entries in package.json exports and tsdown.config.ts entry (e.g. nostics/formatters/ansi). Same rule inside packages/unplugin/.
  • docs/content/**: import paths and the API/installation tables.
  • demo-lib/ and the packages/unplugin/src/tree-shake.test.ts nostics stub when they use the symbol.
  • New side-effect-free factory: add /* @__NO_SIDE_EFFECTS__ */ to its definition (so bundlers tree-shake calls), and if it's a root export used in defineDiagnostics(), add it to PURE_FACTORIES in packages/unplugin/src/transform.ts.

__snapshots__/tsnapi/** are generated by pnpm build: never hand-edit, rebuild to refresh (and trash stale ones after removing an entry point).

Docs OG images

nuxt-og-image via Docus (zeroRuntime, takumi). Landing template: docs/app/components/OgImage/Landing.takumi.vue, with the docs/public/nostics-full.svg logo inlined (colors baked because takumi drops currentColor/<style>): keep both in sync. Doc pages use Docus' default Docs template.

  • takumi SVG gradients: default bbox units only (x1/y1/x2/y2 in 0..1, explicit offset); userSpaceOnUse clamps the fill to the last stop.
  • Stale OG renders survive cache cleans via the Nuxt build cache: also trash docs/.nuxt docs/node_modules/.cache/nuxt before rebuilding.

Claude Plugin

This repo also contains a Claude Plugin

  • .claude-plugin/plugin.json: update version when applying changes
  • hooks/: Claude Code hooks
  • skills/: Agent skills

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.