Build an IG and write its AST
Run one ordinary IG Publisher build through AstPublisher (a subclass that overrides nothing) and write the AST beside output/: one JSON file per resource keyed canonical|version, dependencies.json (upstream’s DependencyAnalyser plus the Library/PlanDefinition/ActivityDefinition/Measure edges it leaves empty), SUSHI’s fsh-index.json, and a manifest that declares itself a cache and records the inputs it is valid for.
Skills it satisfies
A skill states the capability; this Tool is one way to exercise it. Each skill’s declared input and output contract follows, where it has one.
ig-publisher-fork
Requirements for an agent working a local experimental fork of the IG Publisher — which repositories, what the AST must carry, what must not change, and the acceptance criteria. Read before forking, and before reporting a fork’s work complete.
Source: fhir-harness/skills/fhir-ig-base/ig-publisher-fork.md.
Also satisfied by: fhir-cache-seed-npm, fhir-package-mirror, ig-ast-incremental-build, ig-ast-measure-real-igs, ig-ast-plan, smart-fhir-cache-seed.
The skill declares no I/O contract (schemas/skills/ig-publisher-fork/{input,output}.schema.json).
Inputs and outputs
Each port names a shared type by IRI, so two Tools for one skill can be checked for interchangeability.
| port | type | required | description | constraint | |
|---|---|---|---|---|---|
| in | ig | FilesystemPath | yes | The IG root. | string · A filesystem path, possibly outside the repository. Not admissible as a command-line argument. |
| in | ast-out | FilesystemPath | Default <ig>/output-ast, OUTSIDE the Publisher’s output/. | string · A filesystem path, possibly outside the repository. Not admissible as a command-line argument. | |
| out | resources | Count | Resources written, one file each. | integer · A non-negative count — how many of something, or how many to show. Zero is a real answer. | |
| out | edges | Count | Dependency edges, including those whose target is outside the IG (kept, resolved: null). | integer · A non-negative count — how many of something, or how many to show. Zero is a real answer. |
Processes and tasks
Steps this Tool can carry out, because each names a skill it satisfies:
| process | step | lane | via skill |
|---|---|---|---|
| An IG site, built from the AST on its cache branch | Build the IG with the AST exporter | AST refresh (GitHub runner: IG Publisher with the AST exporter) | ig-publisher-fork |
How it is deployed and reached
- Command line. From the repository root:
java -cp "target/classes:$(cat cp.txt)" org.hl7.fhir.igtools.ast.AstExportCli -ig <ig> [-ast-out <dir>]. - GitHub Actions. No workflow in this checkout runs its command.
As an API: its operation in the OpenAPI document and the MCP tool list of its layer.
| install | cli: git clone -b claude/ast-export https://github.com/litlfred/fhir-ig-publisher && cd fhir-ig-publisher/ast-export && mvn -q package && mvn -q dependency:build-classpath -Dmdep.outputFile=cp.txt |
| runtime | java, maven, sushi, jekyll |
| network | yes |
When a host it reaches is refused:
| host / error | remedy |
|---|---|
packages.fhir.org | tool fhir-cache-seed-npm |
tx.fhir.org | none: No declared Tool replaces the terminology server. The HL7 IG Publisher’s own -tx n/a skips terminology validation, at the cost of not validating it. |
repo1.maven.org | none: The Maven build needs Maven Central; a populated ~/.m2 from an earlier build is the only other source. |
| when to choose it | |
|---|---|
| when | Producing a base AST for incremental work, or measuring what an IG’s logic layer depends on. |
| limits | Taken AFTER the build, so resources carry generated narratives. It is a full Publisher run: it needs the package registry and a terminology server, and an environment without them cannot run it. |
| cost | A full IG build: minutes to tens of minutes. |
What it is made of
| role | file | |
|---|---|---|
| definition | fhir-harness/tools/ig-ast-export/ig-ast-export.ts |
Linked data
The Tool is published as its own JSON-LD document at its IRI, https://litlfred.github.io/folio-assistant/fhir-harness/tools/ig-ast-export.jsonld, partOf its layer’s document. The node below is the definition this page was drawn from, and is embedded in the page as application/ld+json.
{
"@context": "https://litlfred.github.io/folio-assistant/fhir-harness/fhir-harness.context.jsonld",
"@id": "https://litlfred.github.io/folio-assistant/fhir-harness/tools/ig-ast-export.jsonld",
"@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
"partOf": "https://litlfred.github.io/folio-assistant/fhir-harness/fhir-harness.jsonld",
"name": "ig-ast-export",
"title": "Build an IG and write its AST",
"description": "Run one ordinary IG Publisher build through `AstPublisher` (a subclass that overrides nothing) and write the AST beside `output/`: one JSON file per resource keyed `canonical|version`, `dependencies.json` (upstream's DependencyAnalyser plus the Library/PlanDefinition/ActivityDefinition/Measure edges it leaves empty), SUSHI's `fsh-index.json`, and a manifest that declares itself a cache and records the inputs it is valid for.",
"install": {
"cli": "git clone -b claude/ast-export https://github.com/litlfred/fhir-ig-publisher && cd fhir-ig-publisher/ast-export && mvn -q package && mvn -q dependency:build-classpath -Dmdep.outputFile=cp.txt"
},
"invoke": {
"shell": "java -cp \"target/classes:$(cat cp.txt)\" org.hl7.fhir.igtools.ast.AstExportCli -ig <ig> [-ast-out <dir>]"
},
"io": {
"inputs": [
{
"name": "ig",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/FilesystemPath",
"description": "The IG root.",
"required": true
},
{
"name": "ast-out",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/FilesystemPath",
"description": "Default `<ig>/output-ast`, OUTSIDE the Publisher's `output/`.",
"required": false
}
],
"outputs": [
{
"name": "resources",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Count",
"description": "Resources written, one file each."
},
{
"name": "edges",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Count",
"description": "Dependency edges, including those whose target is outside the IG (kept, `resolved: null`)."
}
]
},
"satisfies": [
"ig-publisher-fork"
],
"requirements": {
"runtime": [
"java",
"maven",
"sushi",
"jekyll"
],
"network": true
},
"remedies": [
{
"host": "packages.fhir.org",
"tool": "fhir-cache-seed-npm"
},
{
"host": "tx.fhir.org",
"none": "No declared Tool replaces the terminology server. The HL7 IG Publisher's own `-tx n/a` skips terminology validation, at the cost of not validating it."
},
{
"host": "repo1.maven.org",
"none": "The Maven build needs Maven Central; a populated `~/.m2` from an earlier build is the only other source."
}
],
"selection": {
"when": "Producing a base AST for incremental work, or measuring what an IG's logic layer depends on.",
"limits": "Taken AFTER the build, so resources carry generated narratives. It is a full Publisher run: it needs the package registry and a terminology server, and an environment without them cannot run it.",
"cost": "A full IG build: minutes to tens of minutes."
}
}