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.

porttyperequireddescriptionconstraint
inmirror-repo-dirFilesystemPathyesA 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.
inmissingFilesystemPathyesThe 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.
outmirroredCountExit 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:

processsteplanevia skill
An IG site, built from the AST on its cache branchBuild the IG with the AST exporterAST 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.

installcli: git clone -b claude/ast-export https://github.com/litlfred/fhir-ig-publisher
runtimebash, curl, python3, git
networkyes

When a host it reaches is refused:

host / errorremedy
packages.fhir.orgnone: 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
whenThe seeder reports missing packages and the environment that needs them cannot reach packages.fhir.org.
limitsRun where packages.fhir.org is reachable. It mirrors exact versions only; a wildcard in the list is resolved by the seeder first.
costOne download per package; terminology packages are megabytes each.

What it is made of

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."
  }
}

folio-assistant — code under the Apache License 2.0, documentation under CC BY 3.0. Generated schema and API references are rebuilt from source on every push to main.

deployed dev