Mirror FHIR packages from packages.fhir.org into a git repository
On a machine that reaches packages.fhir.org, fetch exactly a missing list (from fhir-cache-seed-npm --missing-out), check each tarball names itself exactly, record SHA512SUMS, and commit and push to a git repository that an environment without packages.fhir.org reads with --mirror. The person running it is the trust anchor for what it adds.
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, ig-ast-export, 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 | mirror-repo-dir | FilesystemPath | yes | A git checkout to fill; committed and pushed when it is one. | string · A filesystem path, possibly outside the repository. Not admissible as a command-line argument. |
| in | missing | FilesystemPath | yes | The seeder’s --missing-out file, so nothing unneeded is mirrored. | string · A filesystem path, possibly outside the repository. Not admissible as a command-line argument. |
| out | mirrored | Count | Exit non-zero when any could not be fetched or named itself differently. | 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:
fhir-ig-publisher/ast-export/scripts/mirror-fhir-packages.sh <mirror-repo-dir> <missing.txt | name#version ...>. - 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 |
| runtime | bash, curl, python3, git |
| network | yes |
When a host it reaches is refused:
| host / error | remedy |
|---|---|
packages.fhir.org | none: It exists to run where packages.fhir.org IS reachable. A GitHub Actions runner is such a place, and one a cloud session can drive by itself: in litlfred/fhir-package-mirror, push a claude/mirror-* branch that edits packages.txt (name#version, name#1.2.x or name#latest), and .github/workflows/mirror.yml fetches each package with its dependencies, checks it names itself, records SHA512SUMS and commits back to the branch. Merge the branch, then fhir-cache-seed-npm --mirror reads it here. A local networked agent works too. |
| when to choose it | |
|---|---|
| when | The seeder reports missing packages and the environment that needs them cannot reach packages.fhir.org. |
| limits | Run where packages.fhir.org is reachable. It mirrors exact versions only; a wildcard in the list is resolved by the seeder first. |
| cost | One download per package; terminology packages are megabytes each. |
What it is made of
| role | file | |
|---|---|---|
| definition | fhir-harness/tools/fhir-package-mirror/fhir-package-mirror.ts | |
| script | fhir-ig-publisher/ast-export/scripts/mirror-fhir-packages.sh | not in this checkout |
Linked data
The Tool is published as its own JSON-LD document at its IRI, https://litlfred.github.io/folio-assistant/fhir-harness/tools/fhir-package-mirror.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/fhir-package-mirror.jsonld",
"@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
"partOf": "https://litlfred.github.io/folio-assistant/fhir-harness/fhir-harness.jsonld",
"name": "fhir-package-mirror",
"title": "Mirror FHIR packages from packages.fhir.org into a git repository",
"description": "On a machine that reaches packages.fhir.org, fetch exactly a missing list (from `fhir-cache-seed-npm --missing-out`), check each tarball names itself exactly, record SHA512SUMS, and commit and push to a git repository that an environment without packages.fhir.org reads with `--mirror`. The person running it is the trust anchor for what it adds.",
"install": {
"cli": "git clone -b claude/ast-export https://github.com/litlfred/fhir-ig-publisher"
},
"invoke": {
"shell": "fhir-ig-publisher/ast-export/scripts/mirror-fhir-packages.sh <mirror-repo-dir> <missing.txt | name#version ...>"
},
"io": {
"inputs": [
{
"name": "mirror-repo-dir",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/FilesystemPath",
"description": "A git checkout to fill; committed and pushed when it is one.",
"required": true
},
{
"name": "missing",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/FilesystemPath",
"description": "The seeder's `--missing-out` file, so nothing unneeded is mirrored.",
"required": true
}
],
"outputs": [
{
"name": "mirrored",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Count",
"description": "Exit non-zero when any could not be fetched or named itself differently."
}
]
},
"satisfies": [
"ig-publisher-fork"
],
"requirements": {
"runtime": [
"bash",
"curl",
"python3",
"git"
],
"network": true
},
"remedies": [
{
"host": "packages.fhir.org",
"none": "It exists to run where packages.fhir.org IS reachable. A GitHub Actions runner is such a place, and one a cloud session can drive by itself: in litlfred/fhir-package-mirror, push a `claude/mirror-*` branch that edits `packages.txt` (`name#version`, `name#1.2.x` or `name#latest`), and `.github/workflows/mirror.yml` fetches each package with its dependencies, checks it names itself, records SHA512SUMS and commits back to the branch. Merge the branch, then `fhir-cache-seed-npm --mirror` reads it here. A local networked agent works too."
}
],
"selection": {
"when": "The seeder reports missing packages and the environment that needs them cannot reach packages.fhir.org.",
"limits": "Run where packages.fhir.org is reachable. It mirrors exact versions only; a wildcard in the list is resolved by the seeder first.",
"cost": "One download per package; terminology packages are megabytes each."
}
}