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
Who's talking about microsoft/fhir-server
- dotnet/aspnetcore“HttpContextAccessor.HttpContext is null when using TestServer and .net 2.2.2”GitHub · Feb 26, 2019 · 6 reactions
- FirelyTeam/firely-net-sdk“IFhirClient Implementation Using Injected HttpClient”GitHub · Sep 11, 2020 · 2 reactions
- brendankowitz/ignixa-fhir“Number search failing for strict inequality operators (lt/gt) due to EF Core decimal parameter precision bug”GitHub · Dec 14, 2025
- Azure-Samples/azure-health-data-and-ai-samples“ONC g 10 test 3.3.10 returning "Received scope patient/Patient.read does not follow the format: user/[ …”GitHub · Apr 21, 2025
- openiddict/openiddict-core“Use `Uri.TryCreate()` to build the base and request URIs used by OpenIddict”GitHub · Mar 24, 2025
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
- Feb 26, 2019HttpContextAccessor.HttpContext is null when using TestServer and .net 2.2.2 — dotnet/aspnetcore6 reactions · 29 comments
- Sep 11, 2020IFhirClient Implementation Using Injected HttpClient — FirelyTeam/firely-net-sdk2 reactions · 4 comments
- Dec 14, 2025Number search failing for strict inequality operators (lt/gt) due to EF Core decimal parameter precision bug — brendankowitz/ignixa-fhir0 reactions · 1 comment
- Apr 21, 2025ONC g 10 test 3.3.10 returning "Received scope patient/Patient.read does not follow the format: user/[ <ResourceType> | * ].[ read |" — Azure-Samples/azure-health-data-and-ai-samples0 reactions · 5 comments
- Mar 24, 2025Use `Uri.TryCreate()` to build the base and request URIs used by OpenIddict — openiddict/openiddict-core0 reactions · 1 comment
22 more on GitHub
- Oct 17, 2024plain/text responses are not support for OperationAsync — FirelyTeam/firely-net-sdk0 reactions · 1 comment
- Dec 22, 2023Add Microsoft FHIR server — TrivadisPF/platys-modern-data-platform0 reactions
- Aug 7, 2023ValueSet bugfix for DocumentReference — jfabrizio329/signal-mso-fhir-profiles0 reactions
- Aug 3, 2023ValueSet bugfix for Practitioner — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Aug 2, 2023ValueSet bugfix for Invoice — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Aug 2, 2023ValueSet bugfix for Account — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Aug 2, 2023ValueSet bugfix for Contract — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Aug 2, 2023ValueSet bugfix for Coverage — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Aug 2, 2023ValueSet bugfix for ServiceRequest — jfabrizio329/signal-mso-fhir-profiles0 reactions · 2 comments
- Aug 2, 2023ValueSet bugfix for Condition Problems — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Aug 2, 2023ValueSet bugfix for QuestionnaireResponse — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Aug 2, 2023ValueSet bugfix for Observation Screening Assessment — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Aug 2, 2023ValueSet bugfix for EpisodeOfCare — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Jul 15, 2023ValueSet bugfix for Simple Observation — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Jul 15, 2023ValueSet bugfix for Location — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Jul 15, 2023ValueSet bugfix for Procedure — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Jul 15, 2023ValueSet bugfix for PractitionerRole — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Jul 15, 2023ValueSet bugfix for Encounter — jfabrizio329/signal-mso-fhir-profiles0 reactions · 1 comment
- Mar 6, 2023Bump Microsoft.Health.Fhir.R4.Client from 2.0.55 to 3.4.57 — Indie365/dicom-serve0 reactions
- Oct 24, 20213317.f - Kajian untuk pengembangan fasilitas penyimpanan dan pengolahan data kesehatan publik — data-engineers-id/stratnas-data-infrastructure0 reactions · 2 comments
- Jun 2, 2021IdentityServer4.Admin Client Register — skoruba/IdentityServer4.Admin0 reactions
- Jun 1, 2021IdentityServer4.Admin Client Register — skoruba/IdentityServer4.Admin0 reactions
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.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- create-adrSkill
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
- Distinctive: line 36
When fixing an unhandled exception, identify the violated invariant and the earliest point it can be enforced.
- Distinctive: line 38
Don't add or suggest guards for states the contract excludes — they hide violations instead of surfacing them.
- Distinctive: line 45
If the total is under ~1% of the operation's duration, drop it.
- Distinctive: line 52
Prefer concise, direct, review-ready answers by default.
- Very specific: line 76
All SQL work lives in Microsoft.Health.Fhir.SqlServer.
- Common: line 84
Never commit secrets or credentials.
- Distinctive: line 85
Follow Azure security best practices: encrypted transport, least-privilege identity, no plaintext config.
- Distinctive: line 86
All data access must respect FHIR resource-level authorization.
≈ “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.
Files
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.
_camelCasefor private fields. - XML doc on all public members.
- One blank line between
namespaceandclassdeclarations. - Dependency injection and interface-based design throughout — never
newa 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
| Path | Purpose |
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/AsyncJobGenerator | Scaffold 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/)
| Agent | Use when |
coding-agent | General implementation, delegates to fast/complex as needed |
complex-coding-agent | Complex multi-file refactors, threading, race conditions |
fast-coding-agent | Single-file edits, simple fixes, build errors |
Available Skills (.github/skills/)
| Skill | Use when |
create-adr | Drafting an Architectural Decision Record |
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
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.

