agentleFS
MicrosoftKnown publishermicrosoft/rayfin/packages/tools/docs-lib/AGENTS.md

rayfin / docs-lib

AGENTS.md646 starsChanged 24 days agoMITView on GitHub

@microsoft/rayfin-docs is the shared docs engine for rayfin docs and @microsoft/rayfin-mcp. It discovers package-owned docs through each installed package's rayfinDocs package.json field and loads markdown from that package's assets/docs directory by default. Run focused docs-lib tests with rushx test -- src/tests/discovery.test.ts src/tests/docs.test.ts from packages/tools/docs-lib. For cross-package changes, also run the relevant CLI or MCP tests from their package directories.

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

8 rules. About 0 are common, 2 are distinctive, and 6 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.

  • 6

    Very specific

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

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

    Use discover: { from: process.cwd() } for CLI and MCP callers so docs are version-locked to the user's project dependencies.

    line 9
  2. Very specific:

    Treat omitted rayfinDocs.dir as assets/docs, but reject empty, absolute, or traversal paths.

    line 11
  3. Distinctive:

    Keep realpath guards for package roots, docs roots, and individual files so symlinks cannot escape the installed package.

    line 12
  4. Very specific:

    Do not fall back to the old @microsoft/rayfin-mcp/assets/docs bundled corpus.

    line 13
  5. Very specific:

    Prefer IDs for exact lookup because relative paths like index.md can exist in multiple packages.

    line 17
  6. Very specific:

    Use getDocsByPath() when callers need to surface ambiguity and list candidate IDs.

    line 19
  7. Distinctive:

    Use catalog discovery for missing-package or too-old-package guidance instead of returning newer docs from a package the project did not …

    line 21
  8. Very specific:

    Run focused docs-lib tests with rushx test -- src/__tests__/discovery.test.ts src/__tests__/docs.test.ts from packages/tools/docs-lib.

    line 25

≈ “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

Rayfin docs library agent notes

@microsoft/rayfin-docs is the shared docs engine for rayfin docs and @microsoft/rayfin-mcp. It discovers package-owned docs through each installed package's rayfinDocs package.json field and loads markdown from that package's assets/docs directory by default.

Discovery model

  • Discovery is scoped to trusted Rayfin packages only.
  • Use discover: { from: process.cwd() } for CLI and MCP callers so docs are version-locked to the user's project dependencies.
  • Support local and global tool installs by walking node_modules from the caller's current working directory and parent directories.
  • Treat omitted rayfinDocs.dir as assets/docs, but reject empty, absolute, or traversal paths.
  • Keep realpath guards for package roots, docs roots, and individual files so symlinks cannot escape the installed package.
  • Do not fall back to the old @microsoft/rayfin-mcp/assets/docs bundled corpus.

API behavior

  • Prefer IDs for exact lookup because relative paths like index.md can exist in multiple packages.
  • getDocByPath() must return a result only when the path is unambiguous.
  • Use getDocsByPath() when callers need to surface ambiguity and list candidate IDs.
  • Apply module filters before loading/indexing discovered docs, including cache-backed paths.
  • Use catalog discovery for missing-package or too-old-package guidance instead of returning newer docs from a package the project did not install.

Validation

Run focused docs-lib tests with rushx test -- src/__tests__/discovery.test.ts src/__tests__/docs.test.ts from packages/tools/docs-lib. For cross-package changes, also run the relevant CLI or MCP tests from their package directories.

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.

Reviews can't be read right now.

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.