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.
- playground/AGENTS.mdAGENTS.md
- playground/CLAUDE.mdCLAUDE.md
- add-diagnosticSkill
- nosticsSkill
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
- Distinctive: line 15
Never use em-dashes in your writing.
- Distinctive: line 29
When adding, removing, renaming, or moving an export, update together:
≈ “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.
Files
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 # tscNever 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(rootnosticsexports) plus thesrc/**file that owns it.- A subpath export needs matching entries in
package.jsonexportsandtsdown.config.tsentry(e.g.nostics/formatters/ansi). Same rule insidepackages/unplugin/. docs/content/**: import paths and the API/installation tables.demo-lib/and thepackages/unplugin/src/tree-shake.test.tsnostics 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 indefineDiagnostics(), add it toPURE_FACTORIESinpackages/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/y2in 0..1, explicitoffset);userSpaceOnUseclamps 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/nuxtbefore rebuilding.
Claude Plugin
This repo also contains a Claude Plugin
.claude-plugin/plugin.json: update version when applying changeshooks/: Claude Code hooksskills/: Agent skills
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
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.

