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
- Very specific: line 9
Use discover: { from: process.cwd() } for CLI and MCP callers so docs are version-locked to the user's project dependencies.
- Very specific: line 11
Treat omitted rayfinDocs.dir as assets/docs, but reject empty, absolute, or traversal paths.
- Distinctive: line 12
Keep realpath guards for package roots, docs roots, and individual files so symlinks cannot escape the installed package.
- Very specific: line 13
Do not fall back to the old @microsoft/rayfin-mcp/assets/docs bundled corpus.
- Very specific: line 17
Prefer IDs for exact lookup because relative paths like index.md can exist in multiple packages.
- Very specific: line 19
Use getDocsByPath() when callers need to surface ambiguity and list candidate IDs.
- Distinctive: line 21
Use catalog discovery for missing-package or too-old-package guidance instead of returning newer docs from a package the project did not …
- Very specific: line 25
Run focused docs-lib tests with rushx test -- src/__tests__/discovery.test.ts src/__tests__/docs.test.ts from packages/tools/docs-lib.
≈ “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.
Files
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_modulesfrom the caller's current working directory and parent directories. - Treat omitted
rayfinDocs.dirasassets/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/docsbundled corpus.
API behavior
- Prefer IDs for exact lookup because relative paths like
index.mdcan 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.
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.
In this repository76 other files it gives its agents.
- common/config/typedoc/AGENTS.mdAGENTS.md
- docs/site/AGENTS.mdAGENTS.md
- .github/skills/react-best-practices/AGENTS.mdAGENTS.md
- packages/docgen/AGENTS.mdAGENTS.md
- packages/guide/AGENTS.mdAGENTS.md
- packages/host-docs/AGENTS.mdAGENTS.md
- packages/tools/AGENTS.mdAGENTS.md
- packages/tools/cli/AGENTS.mdAGENTS.md
- packages/tools/cli/assets/agent-files/AGENTS.mdAGENTS.md
- packages/tools/common/AGENTS.mdAGENTS.md
- packages/tools/mcp/AGENTS.mdAGENTS.md
- packages/tools/vscode/AGENTS.mdAGENTS.md
- packages/typescript-sdk/AGENTS.mdAGENTS.md
- packages/typescript-sdk/auth/AGENTS.mdAGENTS.md
- packages/typescript-sdk/core/AGENTS.mdAGENTS.md
- packages/typescript-sdk/data/AGENTS.mdAGENTS.md
- packages/typescript-sdk/storage/AGENTS.mdAGENTS.md
- packages/udf/udf-worker-extension/AGENTS.mdAGENTS.md
- samples/data-app/AGENTS.mdAGENTS.md
- samples/getting-started-auth/AGENTS.mdAGENTS.md
- samples/notes-app/AGENTS.mdAGENTS.md
- samples/todo-app/AGENTS.mdAGENTS.md
- samples/universal-app/template/AGENTS.mdAGENTS.md
- samples/welcome-app-react-auth/AGENTS.mdAGENTS.md
- samples/welcome-app-react-no-auth/AGENTS.mdAGENTS.md
- samples/welcome-app-typescript/AGENTS.mdAGENTS.md
- hotfix-releaseSkill
- launch-vscode-extensionSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-bulk-archive-changeSkill
- openspec-continue-changeSkill
- openspec-exploreSkill
- openspec-ff-changeSkill
- openspec-new-changeSkill
- openspec-onboardSkill
- openspec-sync-specsSkill
- openspec-verify-changeSkill
- privacy-dfdSkill
- rayfin-cli-uxSkill
- vercel-react-best-practicesSkill
- react-clean-architectureSkill
- run-cli-e2e-locallySkill
- vscode-react-webview-architectureSkill
- vscode-webview-trpc-messagingSkill
- rayfin-connectorsSkill
- rayfin-functionsSkill
- rayfinSkill
- rayfin-storageSkill
- rayfin-getting-startedSkill
- app-designSkill
- app-validationSkill
- dax-authoringSkill
- fabric-cliSkill
- fabric-sdkSkill
- playwright-cliSkill
- query-designSkill
- schema-discoverySkill
- visualsSkill
- analyticsSkill
- The first 60 shown.
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.

