agentleFS
MicrosoftKnown publishermicrosoft-foundry/foundry-samples/samples/csharp/hosted-agents/AGENTS.md

foundry-samples / hosted-agents

AGENTS.md476 starsChanged 3 months agoMITView on GitHub

Conventions for AI agents creating or editing samples under samples/csharp/hosted-agents/. Agents read the nearest AGENTS.md up the tree, so this applies to C# hosted-agent samples. Treat these as shared conventions and a starting point — adapt to what each sample actually needs. Every new C# hosted-agent sample must add a public test-spec.yml with a responsible Microsoft owner alias, supported experiences, deterministic turns, and assertions for its defining behavior. Legacy payload/default support is for migration and is not sufficient for a…

The file

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

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

  • 5

    Very specific

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

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

    Every new C# hosted-agent sample must add a public test-spec.yml with a responsible Microsoft owner alias, supported experiences, …

    line 10
  2. Very specific:

    Read and follow the authoritative hosted-agent cloud E2E test-spec schema and onboarding checklist.

    line 15
  3. Very specific:

    Run both the documented validate and protocol-aware plan commands before submitting changes.

    line 17
  4. Very specific:

    Prefer the current CLI commands (the template reflects these.

    line 43
  5. Very specific:

    Prefer self-contained READMEs over deferring run/deploy steps to a parent README or hiding steps inside collapsible <details> blocks.

    line 45
  6. Distinctive:

    Not every sample fits the two-option shape, and that's fine — adapt rather than force it:

    line 50
  7. Distinctive:

    Use the template for structure and shared vocabulary, and keep whatever sample-specific sections a reader needs.

    line 59

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

Coding Agent Instructions — C# hosted-agent samples

Conventions for AI agents creating or editing samples under samples/csharp/hosted-agents/. Agents read the nearest AGENTS.md up the tree, so this applies to C# hosted-agent samples. Treat these as shared conventions and a starting point — adapt to what each sample actually needs.

Cloud E2E contract for new samples

Every new C# hosted-agent sample must add a public test-spec.yml with a responsible Microsoft owner alias, supported experiences, deterministic turns, and assertions for its defining behavior. Legacy payload/default support is for migration and is not sufficient for a new sample.

Read and follow the authoritative hosted-agent cloud E2E test-spec schema and onboarding checklist. Run both the documented validate and protocol-aware plan commands before submitting changes.

README conventions

Most samples follow the shared template, README-template.md: a good default is to copy it and fill in the {{placeholders}}. It keeps a familiar section flow:

  1. What this sample demonstrates
  2. How it works — plus any sample-specific background (e.g. "Environment variables", "Architecture", "Features")
  3. Prerequisites — what the sample needs: a Foundry project + model deployment, the .NET 10 SDK, and (only if applicable) RBAC roles, extra Azure resources, and environment variables / secrets
  4. Option 1: Azure Developer CLI (azd) — init → provision → run → invoke → deploy → invoke-deployed
  5. Option 2: VS Code (Foundry Toolkit) — the one-click F5 run-and-debug flow (Agent Inspector opens automatically) and/or a manual run (dotnet restore → configure env → az login → dotnet run) → open the Agent Inspector → deploy
  6. Any sample-specific deep-dive sections (customization, advanced demos, reference)
  7. Troubleshooting
  8. Next steps

Conventions worth keeping

  • Prefer the current CLI commands (the template reflects these; avoid older forms such as azd ext install azure.ai.agents).
  • Prefer self-contained READMEs over deferring run/deploy steps to a parent README or hiding steps inside collapsible <details> blocks.

When a sample legitimately differs

Not every sample fits the two-option shape, and that's fine — adapt rather than force it:

  • Command-line-only samples (e.g. VoiceLive, WebSocket, some A2A samples) may have no VS Code / Agent Inspector path. Document the flow they actually support (curl / azd / a browser client) and omit Option 2 when it doesn't apply.
  • Deploy-first samples (e.g. A2A) may lead with deployment instead of a local run. Keep the section order sensible for the scenario.

Use the template for structure and shared vocabulary, and keep whatever sample-specific sections a reader needs.

The per-sample AGENTS.md (hosted-agent overview, azd lifecycle, Microsoft Foundry Skill) still applies; this file only adds README conventions.

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.