agentleFS
MicrosoftKnown publishermicrosoft/fhir-server/AGENTS.md

fhir-server

AGENTS.md1.4k starsChanged 6 months agoMITView on GitHub

Universal agent instructions for all AI tools working in this repository. This is the Microsoft FHIR Server — an open-source, standards-compliant implementation of HL7 FHIR (Fast Healthcare Interoperability Resources) built on .NET and Azure. It supports both Azure Cosmos DB and SQL Server as storage backends, and exposes a RESTful API conforming to FHIR R4/R5/STU3.

Trending

Quiet since December.about the whole repository

Dec 2025: 1 mentionJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/fhir-server repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about microsoft/fhir-server

The biggest 5 of 27 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 27

Talked about on GitHub (27 times).

On GitHub · 27

22 more on GitHub
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 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 repository3 other files it gives its agents.

The file

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

8 rules. About 1 is common, 6 are distinctive, and 1 is very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    When fixing an unhandled exception, identify the violated invariant and the earliest point it can be enforced.

    line 36
  2. Distinctive:

    Don't add or suggest guards for states the contract excludes — they hide violations instead of surfacing them.

    line 38
  3. Distinctive:

    If the total is under ~1% of the operation's duration, drop it.

    line 45
  4. Distinctive:

    Prefer concise, direct, review-ready answers by default.

    line 52
  5. Very specific:

    All SQL work lives in Microsoft.Health.Fhir.SqlServer.

    line 76
  6. Common:

    Never commit secrets or credentials.

    line 84
  7. Distinctive:

    Follow Azure security best practices: encrypted transport, least-privilege identity, no plaintext config.

    line 85
  8. Distinctive:

    All data access must respect FHIR resource-level authorization.

    line 86

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

AGENTS.md — Microsoft FHIR Server

Universal agent instructions for all AI tools working in this repository.


Repository Overview

This is the Microsoft FHIR Server — an open-source, standards-compliant implementation of HL7 FHIR (Fast Healthcare Interoperability Resources) built on .NET and Azure. It supports both Azure Cosmos DB and SQL Server as storage backends, and exposes a RESTful API conforming to FHIR R4/R5/STU3.


Coding Conventions

  • C# naming: PascalCase for classes, methods, public properties. _camelCase for private fields.
  • XML doc on all public members.
  • One blank line between namespace and class declarations.
  • Dependency injection and interface-based design throughout — never new a service directly.
  • MediatR Request/Response/Handler pattern for all business operations.
  • FHIR compliance first — any behavior change must be validated against the HL7 FHIR specification.

Testing Requirements

  • Build and fix all errors before writing tests.
  • xUnit as the testing framework; NSubstitute for mocks.
  • Arrange-Act-Assert pattern in every test.
  • Unit tests for all new functionality; E2E tests when the feature touches the HTTP layer.
  • Validate inputs rigorously; handle exceptions gracefully with no unhandled runtime exceptions.

Debugging

  • When fixing an unhandled exception, identify the violated invariant and the earliest point it can be enforced. Prefer rejecting invalid input at the entry point over making downstream code tolerate it. State the intended contract before writing the fix.
  • Tests must assert the intended contract, not the behavior the patched code happens to produce.
  • Don't add or suggest guards for states the contract excludes — they hide violations instead of surfacing them.

Performance Claims

  • State per-call cost and call frequency, or don't raise it. "Hot path" and "adds an allocation" are not findings without both.
  • If the total is under ~1% of the operation's duration, drop it.
  • Measure before proposing added indirection. If the measurement kills the rationale, withdraw it — don't re-justify on other grounds.

Response Style

  • Prefer concise, direct, review-ready answers by default. Establish the relevant scope and assumptions, then provide only the detail needed to support the conclusion.

Project Structure

PathPurpose
src/Microsoft.Health.Fhir.Api/RESTful API layer (controllers, filters, actions)
src/Microsoft.Health.Fhir.Core/Core FHIR domain logic and models
src/Microsoft.Health.Fhir.SqlServer/SQL Server data persistence
src/Microsoft.Health.Fhir.SqlServer/Features/Schema/SQL schema, migrations, stored procs
src/Microsoft.Health.Fhir.CosmosDb/Cosmos DB data persistence
src/Microsoft.Health.Fhir.Shared.*/Components shared across FHIR versions
src/Microsoft.Health.Fhir.[Stu3|R4|R5].*/Version-specific implementations
docs/arch/Architectural Decision Records (ADRs)
docs/flow diagrams/Mermaid architecture and request-flow diagrams
tools/AsyncJobGeneratorScaffold tool for new background job types

Architectural Principles

  • Strict separation of concerns: API → Business Logic → Data Access → Infrastructure.
  • All SQL work lives in Microsoft.Health.Fhir.SqlServer; keep Core/API layers SQL-agnostic.
  • ADRs live in docs/arch/. If a change makes a prior ADR obsolete, update it.
  • Clearly link code changes back to the user story or requirement that motivated them.

Security and Compliance

  • Never commit secrets or credentials.
  • Follow Azure security best practices: encrypted transport, least-privilege identity, no plaintext config.
  • All data access must respect FHIR resource-level authorization.

Available Agents (.github/agents/)

AgentUse when
coding-agentGeneral implementation, delegates to fast/complex as needed
complex-coding-agentComplex multi-file refactors, threading, race conditions
fast-coding-agentSingle-file edits, simple fixes, build errors

Available Skills (.github/skills/)

SkillUse when
create-adrDrafting an Architectural Decision Record

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.