agentleFS
MicrosoftKnown publishermicrosoft-foundry/foundry-samples/samples/cli/prompt-agents/AGENTS.md

foundry-samples / prompt-agents

AGENTS.md476 starsChanged 3 months agoMITView on GitHub

Conventions for AI agents creating or editing declarative prompt and managed-harness agent samples under samples/cli/prompt-agents/. Agents read the nearest AGENTS.md up the tree, so this applies to all samples in this directory. Samples under samples/cli/prompt-agents/ are validated by the CLI prompt-agent pipeline (.azure-pipelines/prompt-agents-samples-ci.yml), not the hosted-agent pipeline (.azure-pipelines/hosted-agents-samples-ci.yml): Every non-excluded sample under samples/cli/prompt-agents/ must either: 1. Provide .azure-pipelines/prompt-agent-tests/cli/<complete-sample-path>/test-spec.yml with a responsible Microsoft alias in sample.owner, supported experiences, deterministic string-input turns, and at least one assistant_text assertion. Do not use raw,…

  • Installs packages

The file

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

4 rules. About 1 is common, 1 is distinctive, and 2 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Every non-excluded sample under samples/cli/prompt-agents/ must either:

    line 19
  2. Very specific:

    Do not use raw, session_files, console_log, trace, approvals.mcp, or structured message-array inputs in prompt/managed contracts.

    line 24
  3. Distinctive:

    Read both references before adding or updating a sample or contract:

    line 36
  4. Common:

    Run these credential-free checks from the repository root before submitting changes:

    line 41

≈ “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 — CLI prompt-agent samples

Conventions for AI agents creating or editing declarative prompt and managed-harness agent samples under samples/cli/prompt-agents/. Agents read the nearest AGENTS.md up the tree, so this applies to all samples in this directory.

Choosing the right E2E test contract (prompt/managed vs. hosted)

Samples under samples/cli/prompt-agents/ are validated by the CLI prompt-agent pipeline (.azure-pipelines/prompt-agents-samples-ci.yml), not the hosted-agent pipeline (.azure-pipelines/hosted-agents-samples-ci.yml):

Sample locationFixture pathExecution profileSupported turn inputsSupported assertions
samples/<python|csharp>/hosted-agents/<path>.azure-pipelines/hosted-agent-tests/<python|csharp>/<path>/test-spec.ymlhostedstring, JSON mapping, or sequenceassistant_text, raw, session_files, console_log, trace, plus approvals.mcp
samples/cli/prompt-agents/<path> (no harness).azure-pipelines/prompt-agent-tests/cli/<path>/test-spec.ymlpromptstring onlyassistant_text only (contains, equals, regex)
samples/cli/prompt-agents/<path> (harness.type set).azure-pipelines/prompt-agent-tests/cli/<path>/test-spec.ymlmanagedstring onlyassistant_text only (contains, equals, regex)

Every non-excluded sample under samples/cli/prompt-agents/ must either:

  1. Provide .azure-pipelines/prompt-agent-tests/cli/<complete-sample-path>/test-spec.yml with a responsible Microsoft alias in sample.owner, supported experiences, deterministic string-input turns, and at least one assistant_text assertion. Do not use raw, session_files, console_log, trace, approvals.mcp, or structured message-array inputs in prompt/managed contracts; azd ai agent invoke exposes only terminal assistant text, and contract validation rejects unsupported sources even on filtered-out tests.
  2. Or, if the sample requires capabilities outside the prompt CI adapter (such as client-executed function tools, file-based skills, connections, extra Azure resources like Azure AI Search, or lifecycle hooks), add an entry with a non-empty reason in .azure-pipelines/scripts/prompt-agents/blacklist.json.

References and local validation

Read both references before adding or updating a sample or contract:

  • Prompt-agent E2E runner and manifest/contract limits
  • Shared test-spec.yml schema reference

Run these credential-free checks from the repository root before submitting changes:

python -m pip install -r .github/scripts/requirements.txt

python .github/scripts/hosted_agent_test_spec.py validate \
  --spec .azure-pipelines/prompt-agent-tests/cli/<complete-sample-path>/test-spec.yml

python .github/scripts/hosted_agent_test_spec.py plan \
  --spec .azure-pipelines/prompt-agent-tests/cli/<complete-sample-path>/test-spec.yml \
  --protocol responses \
  --profile <prompt|managed> \
  --output /tmp/prompt-agent-test-plan.json

python .azure-pipelines/scripts/prompt-agents/discover_samples.py discover --validate-contracts

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.