rayfin / tools
AGENTS.md646 starsChanged 24 days agoMITView on GitHub
Code under packages/tools/** is ESM. Use .js in all relative import specifiers. @microsoft/rayfin-tools-common (packages/tools/common/) is a private package for code shared across CLI, MCP, and VS Code extension. It must stay universal (no Node.js or DOM-specific APIs). See packages/tools/common/AGENTS.md. @microsoft/rayfin-docs (packages/tools/docs-lib/) owns DocsService, installed package discovery, docs search, symbol lookup, and catalog-backed package recommendations. See packages/tools/docs-lib/AGENTS.md before editing it. @microsoft/rayfin-mcp (packages/tools/mcp/) exposes the docs service to agents through listdocs, searchdocs, getdoc, and discoverpackages. See packages/tools/mcp/AGENTS.md before editing it. Docs lookup…
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 4
Use .js in all relative import specifiers.
- Distinctive: line 25
Do not reintroduce the old MCP-bundled docs corpus as a fallback.
- Very specific: line 29
After scaffolding a new package under packages/tools/, add its directory to entryPoints in common/config/typedoc/typedoc.lint.json so rush …
- Very specific: line 35
Write comments for Builders consuming the tool, not for Rayfin contributors.
- Very specific: line 36
Do not reference internal helpers, non-exported types, internal module paths (_internal/..., dist/...), internal env vars / feature flags / …
- Very specific: line 37
If a symbol is exported only for cross-package wiring, tests, or other contributor-only consumers, tag it @internal so it is stripped from …
≈ “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
Tools packages agent notes
Code under packages/tools/** is ESM.
Use .js in all relative import specifiers.
import { run } from './run.js';
import { readConfig } from '../config/readConfig.js';Shared code
@microsoft/rayfin-tools-common (packages/tools/common/) is a private package for code shared across CLI, MCP, and VS Code extension. It must stay universal (no Node.js or DOM-specific APIs). See packages/tools/common/AGENTS.md.
Docs and MCP
@microsoft/rayfin-docs (packages/tools/docs-lib/) owns DocsService, installed package discovery, docs search, symbol lookup, and catalog-backed package recommendations.
See packages/tools/docs-lib/AGENTS.md before editing it.
@microsoft/rayfin-mcp (packages/tools/mcp/) exposes the docs service to agents through list_docs, search_docs, get_doc, and discover_packages.
See packages/tools/mcp/AGENTS.md before editing it.
Docs lookup must stay version-locked to packages installed in the user's Rayfin project.
Construct CLI and MCP docs services with discover: { from: process.cwd() } so a global CLI or npx @microsoft/rayfin-mcp still walks the project-local node_modules, not the tool install location.
Do not reintroduce the old MCP-bundled docs corpus as a fallback.
Adding a new tools package
After scaffolding a new package under packages/tools/, add its directory to entryPoints in common/config/typedoc/typedoc.lint.json so rush lint validates its TSDoc. See common/config/typedoc/AGENTS.md for the full convention and troubleshooting notes (including the cross-package dist/*.d.ts resolution caveat).
Public API documentation
For any tools package whose src/index.ts (or package.json exports) is consumed by Builders — @microsoft/rayfin-cli, @microsoft/create-rayfin, @microsoft/rayfin-mcp — every public symbol must have a Builder-facing TSDoc comment. The same rules apply as for the SDK:
- Write comments for Builders consuming the tool, not for Rayfin contributors. Prefer
@examplefor non-trivial APIs. - Do not reference internal helpers, non-exported types, internal module paths (
_internal/...,dist/...), internal env vars / feature flags / secrets / endpoints, or contributor-only notes in public TSDoc. - If a symbol is exported only for cross-package wiring, tests, or other contributor-only consumers, tag it
@internalso it is stripped from the documented surface.
Private-only tools packages (@microsoft/rayfin-tools-common, the VS Code extension internals) don't ship to Builders, but anything they re-export to other tools packages should still be @internal unless it's intended for end-user consumption.
Full rules and examples: common/config/typedoc/AGENTS.md.
Architecture migration (in progress)
The Rayfin tools line (CLI, create-rayfin, VS Code extension) is migrating to the target architecture in docs/rfc/rayfin-tools-architecture.md. Live status and the per-PR breakdown live in docs/rfc/rayfin-tools-architecture-migration.md.
Two principles when working on this migration matter for every PR:
Dual-path via tools-arch-v2 feature flag. New code lands behind the flag and is off by default. CI E2E runs as a matrix (flag off + flag on) so regressions surface before the default flips. The carrying cost is one if (flag) { v2 } else { legacy } branch per Layer 1 wrapper; the safety from being able to roll back per command is worth it.
State changes are the contract; output is not. Current tool output (text and --json) is known-buggy. Parity assertions between the legacy and v2 paths target on-disk and cloud state, not printed bytes. When the new path produces cleaner JSON, clearer error messages, or improved progress output, that is success, not a regression. Use packages/tools/cli-e2e/src/helpers/state-equivalence.ts for parity comparisons rather than snapshotting output.
The migration is also a chance to improve. Where the new architecture naturally enables a better design — e.g., one telemetry event per workflow step instead of one per command, typed Result<T> instead of thrown control flow, cancellation between steps — take it. Document the decision in the migration PR; do not bolt the improvement onto the legacy path.
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/cli/AGENTS.mdAGENTS.md
- packages/tools/cli/assets/agent-files/AGENTS.mdAGENTS.md
- packages/tools/common/AGENTS.mdAGENTS.md
- packages/tools/docs-lib/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.

