Agentic FHIR IG Authoring (Demo)
0.1.0 - ci-build
Agentic FHIR IG Authoring (Demo), published by HL7 Switzerland. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/hl7ch/agentic-ig/ and changes regularly. See the Directory of published versions
This page describes how to set up an IG repository for agents and how to work with them. It assumes an agent with shell access to a working copy, such as a terminal or IDE coding agent.
Put an AGENTS.md file in the repository root. Most coding agents read it at the start of every session. Claude Code reads CLAUDE.md, which can contain a single line that imports AGENTS.md. Keep the file short and limit it to what the agent cannot work out from the repository:
fsh-generated/ or adding entries to input/ignoreWarnings.txtThe AGENTS.md in this repository is a working example.
Give the agent the same build entry point a human uses. This repository has a _build.sh script with two modes:
./_build.sh sushi # compile FSH only, a few seconds
./_build.sh # SUSHI and the IG Publisher, several minutes
The script runs the IG Publisher directly when SUSHI and Jekyll are installed, as on the GitHub runner, and in the hl7fhir/ig-publisher-base container otherwise, so a local agent does not need Ruby and Jekyll on the host.
Install the skills that match your guide from the catalogue. For an FSH-based guide the fhir-ig plugin from cqf-skills is the closest fit. Add a project skill for anything specific to your guide; .claude/skills/ig-qa-loop in this repository shows the format.
Prefer skills that state which tool version they were written for, and compare that version with the one you run. A skill written for an older IG Publisher may describe parameters that have changed.
Add an MCP server for validation, and one for each terminology your guide binds to. With these the agent can validate an example before the full build and can look up a code instead of recalling it. A project-level .mcp.json keeps the configuration with the repository:
{
"mcpServers": {
"matchbox": {
"command": "npx",
"args": ["mcp-remote@latest", "http://localhost:8080/matchboxv3/mcp/message"]
}
}
}
Allow the build commands and file edits inside the repository without prompting. Keep pushing, publishing and package releases behind a human confirmation.
output/qa.json for the counts and output/qa.html for the messages.input/ and repeats from step 3.A request that names the outcome and the check works better than one that describes steps.
Add a profile on Observation for body weight to this guide. Bind the code to
LOINC 29463-7 and require valueQuantity in kg. Add one example. Look up the
code with the terminology tool before you use it. Finish when ./_build.sh
reports no errors, and list any new warnings.
The build reports 4 errors in output/qa.html after the update to
hl7.fhir.uv.ips 2.0.0. Find the cause of each one and fix it in input/fsh.
Do not change cardinalities or bindings without asking me, and do not add
anything to ignoreWarnings.txt.
Review the diff on this branch as an IG editor would. Check that each changed
profile still has a valid example, that the narrative pages describe the
change, and that no constraint was loosened. Report findings only.
The IG Publisher writes a summary to output/qa.json with the fields errs, warnings and hints. An agent should read these counts after every full build and treat any value of errs above zero as unfinished work. The individual messages are in output/qa.html, grouped by source file.
Three kinds of message need a human decision before the agent acts:
Splitting work across agents helps when the tasks are independent, for example one agent per profile family, or one agent that writes and a second that reviews without seeing the first agent's reasoning. Run one full IG Publisher build at a time per working copy, because parallel builds write to the same output/ and temp/ folders. Use a separate working copy or git worktree for each agent.
An agent in a pipeline can triage a failed build, comment on a pull request with the cause of new QA errors, or open a pull request for a dependency update. Give it read access to the repository and the build output, and let it propose changes through pull requests that a human merges.
This guide runs such a set-up itself: an agent turns issues into pull requests and responds to review comments. The contributing page describes the workflows, the safeguards and the limits.
When your project wants a formal record of agent authorship, use the Agent Authoring Provenance profile described on the next page. A commit trailer naming the agent is a lighter alternative and is enough for most projects.