fhir-ig-analysis
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMeasuring a FHIR Implementation Guide
FHIR Implementation Guide 测量
Measures a FHIR IG objectively and reports what it counted. Strictly read-only: it never
builds, changes, or publishes anything, and it does not forecast.
本工具可对FHIR IG进行客观测量,并输出统计结果。严格只读: 绝不会进行构建、修改或发布操作,也不提供预测功能。
Preconditions
前置条件
Discover the context; do not assume it, and never create it.
-
The tool.must be runnable. The analyser is standard-library only — nothing to install. If
python3is absent, say so and stop; do not fetch an interpreter.python3 -
The subject. One or more IGs, each given as a local path, a git URL, or a package.
.tgzresolves each itself (shallow clone for a URL, download for a package). Nothing needs to be discovered inside the repository beyond what the tool reads.run- A local path with neither nor
sushi-config.yamlis not an IG project. Report that and stop.input/ - A git URL requires network access; if cloning fails, report the failure rather than reporting an empty measurement.
- A local path with neither
-
Static by default, and know what that costs. Without a build, the analysis is static: sushi-config/package metadata, FSH counts, narrative, directives, dependencies, linguistics, duplication, hygiene. Build-derived metrics (: errors, warnings, broken links, validation) stay
qa.jsonand are marked Build in the catalog. A packagenullyields a further reduced analysis — generated resources only..tgzState which mode produced the numbers whenever you report them. Ais not a zero.null
明确上下文,切勿假设或自行创建上下文。
-
工具环境:必须能运行。本分析工具仅依赖Python标准库——无需安装额外依赖。若缺少
python3,请告知并终止操作;不要自行获取解释器。python3 -
分析对象:一个或多个IG,可通过本地路径、Git URL或**包文件**提供。
.tgz命令会自行解析每个输入(URL采用浅克隆,包文件会自动下载)。除工具读取的内容外,无需在仓库内查找其他内容。run- 若本地路径中既无也无
sushi-config.yaml目录,则不属于IG项目。请报告该情况并终止操作。input/ - Git URL需要网络访问;若克隆失败,请报告失败情况,而非输出空的测量结果。
- 若本地路径中既无
-
默认静态模式及局限性:未进行构建时,分析为静态模式:仅包含sushi-config/包元数据、FSH计数、叙述内容、指令、依赖项、语言特征、重复度、规范性等指标。构建衍生指标(中的错误、警告、失效链接、验证结果)会显示为
qa.json,并在指标目录中标记为Build。null包文件仅能提供简化版分析——仅包含生成的资源。.tgz输出统计结果时,务必说明所使用的模式。不等于0。null
Procedure
操作步骤
The generated reports are in German; this skill's instructions are in English. That is
deliberate and does not follow from either fact on its own — the report prose was inherited and has
not been translated. Do not "fix" it silently, and do not translate the numbers.
Resolve the script path first. The commands below name the tool relative to this skill's own directory, not to your working directory — which is the project you are operating on. Setto the directory containing thisSKILL_DIR(you just read it, so you know where it is) and use it in every invocation:SKILL.mdbashSKILL_DIR=<the directory containing this SKILL.md> # e.g. .claude/skills/fhir-ig-analysisRunning a barefrom the project root does not merely fail — if the project happens to have its ownscripts/...directory with a same-named file, it silently runs that instead.scripts/
-
Measure. One IG or several, from the IG's root or anywhere:bash
python3 "$SKILL_DIR/scripts/ig-stats.py" run <input…> [-o OUTDIR] [--label a,b]With two or more inputs this writes one report per IG plusautomatically.compare-report.mdsets the display label (report heading, compare columns), one per input; output filenames always derive from the IG id.--labelTwo consequences of how inputs resolve, so the numbers are read correctly: a git URL is shallow-cloned, so the git-history metrics (bus factor, maintenance cadence) are reported as not derivable (, valuesgit.history_complete: false) — measure a full local clone when you need them. And the tool reports counted maturity components without an aggregated score: a 0–100 "readiness" number would be a forecast, which this skill deliberately does not produce.null -
Power-user entry points, when you want the stages separately:bash
python3 "$SKILL_DIR/scripts/ig-stats.py" analyze <ig-dir> [-o stats.json] python3 "$SKILL_DIR/scripts/ig-stats.py" report <stats.json> [-o report.md] python3 "$SKILL_DIR/scripts/ig-stats.py" compare <stats.json…> [-o compare.md] -
Read the mandatory-page finding carefully. The page set the tool checks against lives inunder
references/report-content.jsonand is hand-editable on purpose. It is seeded with the MII KDS module template's actual page names.mandatory_pagesIf a measured IG legitimately uses a different page set, correct the list rather than reporting its pages as missing — and say in your report which list you used. A page-completeness metric is only as good as the set it compares against. -
Report both artefacts. The JSON is the durable one: it has a fixed schema, so a series of runs diffs cleanly and shows how a module grows between releases. The Markdown is for people.
-
Compare only on normalised metrics. Absolute counts across IGs of different size say almost nothing; the comparison report aggregates a Σ total for scope but the fair columns are the normalised ones.
-
Same-module verification is automatic. When every compared input carries the same, the inputs are states of ONE module (typically: the platform source vs its migrated copy) and the report switches to Same-Module-Verifikation: identity-field equality, published-artifact-set equality (internal FSH constructs reported separately — template adoption adds scaffold rulesets legitimately), canonical-URL equality (read from
packageIdwhen both inputs have it), and narrative per language level (default / translations / retained platform pages) with word-coverage indicators. The Σ column is dropped (meaningless for one module). Every verdict is counted, none forecast. Order matters: the FIRST input is the reference.fsh-generated
生成的报告为德语;本技能的说明文档为英语。这是有意设计的,并非由单一因素导致——报告文本为继承内容,尚未进行翻译。请勿擅自“修正”,也不要翻译统计数值。
首先解析脚本路径。以下命令中工具的路径是相对于本技能自身的目录,而非您的工作目录(即您操作的项目目录)。将设置为包含本SKILL_DIR文件的目录(您刚阅读了该文件,所以知道其位置),并在每次调用时使用该变量:SKILL.mdbashSKILL_DIR=<包含本SKILL.md的目录> # 例如 .claude/skills/fhir-ig-analysis若直接从项目根目录运行,不仅会失败——如果项目恰好有自己的scripts/...目录且包含同名文件,会静默运行该项目的脚本而非本技能的脚本。scripts/
-
执行测量:可测量单个或多个IG,在IG根目录或任意目录下执行:bash
python3 "$SKILL_DIR/scripts/ig-stats.py" run <input…> [-o OUTDIR] [--label a,b]若输入两个或以上IG,会自动为每个IG生成一份报告,同时生成对比报告。compare-report.md参数用于设置显示标签(报告标题、对比列名),每个输入对应一个标签;输出文件名始终由IG的id生成。--label输入解析方式有两个注意事项,以便正确解读统计结果:Git URL采用浅克隆,因此Git历史指标(总线因子、维护频率)会报告为无法获取(,值为git.history_complete: false)——若需要这些指标,请测量完整的本地克隆版本。此外,工具会单独报告成熟度组件的统计值,不生成综合评分:0-100的“就绪度”数值属于预测范畴,本技能刻意不提供此类功能。null -
高级用户入口,如需分步执行:bash
python3 "$SKILL_DIR/scripts/ig-stats.py" analyze <ig-dir> [-o stats.json] python3 "$SKILL_DIR/scripts/ig-stats.py" report <stats.json> [-o report.md] python3 "$SKILL_DIR/scripts/ig-stats.py" compare <stats.json…> [-o compare.md] -
仔细阅读必填页面检查结果。工具对照的页面列表位于中的
references/report-content.json字段,可手动编辑。初始列表基于MII KDS模块模板的实际页面名称。mandatory_pages若被测IG确实使用不同的页面集,请修正该列表,而非报告页面缺失——并在报告中说明您使用的列表。页面完整性指标的准确性取决于对比的页面集。 -
同时提交两种输出产物。JSON文件是持久化的:它具有固定的Schema,因此多次运行的结果可清晰对比,展示模块在不同版本间的演进情况。Markdown文件则便于人工阅读。
-
仅基于标准化指标进行对比。不同规模IG的绝对统计值几乎没有参考意义;对比报告会汇总范围的Σ总数,但公平的对比应基于标准化指标列。
-
同模块验证自动触发。当所有对比输入的相同时,这些输入属于同一模块的不同状态(通常为:平台源码 vs 迁移后的副本),报告将切换为Same-Module-Verifikation(同模块验证):验证身份字段一致性、发布工件集一致性(内部FSH结构会单独报告——模板适配会合理添加脚手架规则集)、规范URL一致性(若两个输入均有
packageId目录则从中读取),以及各语言层级的叙述内容(默认/翻译/保留的平台页面)及词汇覆盖指标。Σ列会被移除(对单个模块无意义)。所有结论均为统计结果,无预测内容。顺序很重要:第一个输入为基准版本。fsh-generated
Verification
验证步骤
bash
python3 "$SKILL_DIR/scripts/ig-stats.py" run <ig-dir> -o /tmp/igstats
python3 -c "import json;d=json.load(open('/tmp/igstats/<name>-stats.json'));print(d['mode'],d['schemaVersion'])"- The run exits 0 and writes one and one
*-stats.jsonper input.*-report.md - With ≥2 inputs, exists.
compare-report.md - in the JSON matches what you claim (
mode/static), andreducedis present.schemaVersion - Every metric you quote is either a counted number or — never an estimate. If a field is
null, report it as not derivable statically rather than as zero.null - The mandatory-page result is plausible against the IG you measured. All-missing usually means the wrong page set, not a broken IG.
- On a same-module comparison, the Befund block states IDENTISCH/DIVERGIERT per aspect — a migration is only faithful when identity, published artifact set and canonical URLs are all IDENTISCH; the migration skill's Definition of Done requires exactly that.
bash
python3 "$SKILL_DIR/scripts/ig-stats.py" run <ig-dir> -o /tmp/igstats
python3 -c "import json;d=json.load(open('/tmp/igstats/<name>-stats.json'));print(d['mode'],d['schemaVersion'])"- 运行后返回码为0,每个输入对应生成一个和一个
*-stats.json文件。*-report.md - 若输入≥2个IG,会生成文件。
compare-report.md - JSON中的与您声称的模式匹配(
mode/static),且包含reduced字段。schemaVersion - 您引用的每个指标要么是统计数值,要么是——绝无估算值。若字段为
null,请报告为无法通过静态分析获取,而非视为0。null - 必填页面检查结果与被测IG的实际情况相符。全部缺失通常意味着页面集错误,而非IG存在问题。
- 在同模块对比中,Befund(结论)块会针对每个方面标注IDENTISCH(一致)/DIVERGIERT(差异)——只有当身份、发布工件集和规范URL均为IDENTISCH时,迁移才是忠实的;迁移技能的完成标准对此有明确要求。
Scope and delimitation
范围与边界
Covers measurement and comparison: what is in an IG, how clean it is, how it compares, how it
changes over time.
Deliberately not covered:
- Effort forecasting. The tool reports what it counted. It does not estimate person-days, cost or a readiness score, and an earlier version of this skill that framed the numbers as migration scoping was narrowed on purpose. Do not reintroduce it: a measurement dressed as a forecast is the least trustworthy thing this skill could produce.
- Migration onto the MII KDS module template — see . Verifying a migrated guide against its source belongs there too, in its
mii-ig-migration: artefact reachability, menu structure, content placement, rendered header metadata and toolchain provenance are pass/fail gates that read the migration's page map and run log — inputs that are not properties of an IG and would break this skill's "a path, a URL or ascripts/verify-migration.py" contract. The same-module verification below is the measurement that gate consumes, not a substitute for it: it proves an artefact is PRESENT, never that anything links to it..tgz - Translation — see .
fhir-ig-translation - Convention and naming checks against the MII meta wiki or the metadata contract. Those are a different check, and the module template ships its own skill for them.
- Building or publishing anything. Read-only is a guardrail, not a default.
If a skill of this name is provided both by this catalog and locally, the local one wins.
涵盖测量与对比:IG包含的内容、规范性、对比情况、随时间的变化情况。
刻意不涵盖以下内容:
- 工作量预测。工具仅报告统计结果,不估算人天、成本或就绪度评分;本技能的早期版本曾将统计数值用于迁移范围界定,现已特意缩小范围。请勿重新引入此类功能:伪装成预测的测量结果是本技能最不可信的输出。
- 迁移至MII KDS模块模板——请参考技能。验证迁移后的指南与源指南的一致性也属于该技能的范畴,具体为其
mii-ig-migration:工件可达性、菜单结构、内容布局、渲染后的头部元数据及工具链来源是通过/失败的检查项,这些检查需要读取迁移的页面映射和运行日志——这些输入不属于IG的属性,会破坏本技能“仅接受路径、URL或scripts/verify-migration.py文件”的约定。下文的同模块验证是该检查项所依赖的测量结果,而非替代方案:它仅能证明工件存在,无法证明有任何链接指向该工件。.tgz - 翻译——请参考技能。
fhir-ig-translation - 对照MII元维基或元数据契约的规范与命名检查。这些属于不同的检查范畴,模块模板自带对应的技能。
- 构建或发布任何内容。只读是本工具的防护机制,而非默认设置。
若本技能在本目录和本地均存在,本地版本优先。
Guardrails
防护机制
- Read-only. Never modify the analysed IG; never force a build.
- Measurement, not forecasting. See above.
- Fair comparison only via normalised metrics.
- No invention. A missing input yields , never a guess. Heuristic metrics are marked as heuristics in the catalog and must be reported as such.
null
- 只读。绝不修改被测IG;绝不强制构建。
- 仅测量,不预测。见上文说明。
- 仅通过标准化指标进行公平对比。
- 不臆造数据。输入缺失时返回,绝不猜测。启发式指标会在指标目录中标记为启发式,报告时必须明确说明。
null
References
参考资料
- — the parameter catalog (groups A–N), each metric with its source and its use. Hand-extensible; this is the SSOT for what is measured.
references/metrics-catalog.md - — the schema of
references/ig-stats-schema.json.ig-stats.json - — plain-language texts, glossary, directive patterns, metric explanations, and the
references/report-content.jsonlist. Hand-editable.mandatory_pages - — the Gate 3 prompt set.
references/triggers.md - — the analyser (
scripts/ig-stats.py/run/analyze/report).compare
- —— 参数目录(分组A-N),每个指标包含来源及用途。可手动扩展;这是测量内容的唯一可信来源(SSOT)。
references/metrics-catalog.md - ——
references/ig-stats-schema.json的Schema定义。ig-stats.json - —— 自然语言文本、术语表、指令模式、指标说明及
references/report-content.json列表。可手动编辑。mandatory_pages - —— Gate 3提示集。
references/triggers.md - —— 分析工具(包含
scripts/ig-stats.py/run/analyze/report命令)。compare
Provenance
来源
Derived from in
at commit
, which in turn adapted the skill of
(CC-BY-4.0). Both steps of that
lineage are recorded deliberately.
skills/ig-analyzeforschungsgruppe-digital-health/mii-kds-module-templateb5beedb17a66a4397d597429668c7b6d54202c62ig-analyzeforschungsgruppe-digital-health/mii-kds-sample-ig-inoffiziellReworked on 2026-07-31 for this catalog. Beyond the catalog contract, three substantive changes:
- The analyser now ships with the skill. It previously lived in the source repository's
and was referenced by parent traversal, so the skill pointed at a file it could not reach once installed elsewhere.
scripts/ - locates
scripts/ig-stats.pyrelative to its own path. It previously built that path from a computed repository root plus a hard-codedreferences/report-content.json, which broke twice here: there is no repository root to compute, and the skill was renamed.skills/ig-analyze/references/… - The mandatory-page list moved out of the code into and was corrected. The inherited list named eleven pages of which six do not exist in the template modules are built from (
references/report-content.json,use-cases,data-sets,uml,context,references), so every measurement reported six false missing pages.security-privacy
Revised on 2026-08-01 after the skill's first real-task exercise (a dry run against
+ ). Four output defects were fixed, all in the
direction of "measurement, not forecasting": the aggregated /"Freigabe-Indikator"
score was removed (components are now reported unaggregated — schemaVersion 1.4); the
"Empfehlungen" table's migration-scoping prose became neutral "Befunde & Einordnung"
measurement explanations and its metric-less "Arbeitsweise" row was dropped; git-history
metrics on shallow clones (including every clone the tool makes itself) now report
and instead of a fictive "100 % top author"; and
was regenerated from the real output after drifting
( was declared but never emitted). The dry-run findings live in the
sandbox under .
kerndatensatz-dokumentkerndatensatz-basisReifegradhistory_complete: falsenullreferences/ig-stats-schema.jsonmandatory_missingmii-kds-dokument-ig-inoffizielldocs/reports/dry-run-2026-07-31/Original licence: CC-BY-4.0, as declared by both source repositories. is Apache-2.0,
matching this repository's code licence.
scripts/Promoted to on 2026-08-05: repeated real-task use: module measurement/comparison across four KDS modules, and the same-module verification gate of two completed migrations. The trigger set in
references/triggers.md was exercised by those runs.
stable衍生自中的,提交哈希为;该技能又改编自的技能(CC-BY-4.0协议)。该传承关系已被特意记录。
forschungsgruppe-digital-health/mii-kds-module-templateskills/ig-analyzeb5beedb17a66a4397d597429668c7b6d54202c62forschungsgruppe-digital-health/mii-kds-sample-ig-inoffiziellig-analyze于2026-07-31针对本目录进行重写。除目录契约外,主要有三处实质性变更:
- 分析工具现在与技能捆绑发布。之前它位于源仓库的目录中,通过父路径引用,因此当技能安装到其他位置后,无法访问该文件。
scripts/ - 现在相对于自身路径定位
scripts/ig-stats.py。之前它通过计算仓库根目录加上硬编码的references/report-content.json来构建路径,在此处两次失效:一是无法计算仓库根目录,二是技能已重命名。skills/ig-analyze/references/… - 必填页面列表从代码中移至并已修正。继承的列表包含11个页面,其中6个在模板模块中不存在(
references/report-content.json、use-cases、data-sets、uml、context、references),因此每次测量都会报告6个虚假的缺失页面。security-privacy
于2026-08-01进行修订,基于本技能首次实际任务演练(针对 + 的试运行)。修复了4个输出缺陷,均朝着“仅测量,不预测”的方向改进:移除了综合的(成熟度)/“Freigabe-Indikator”(发布指标)评分(现在单独报告各组件——schemaVersion 1.4);“Empfehlungen”(建议)表格中的迁移范围界定文本改为中性的“Befunde & Einordnung”(结论与分类)测量说明,并移除了无指标的“Arbeitsweise”(操作方式)行;浅克隆(包括工具自行创建的所有克隆)的Git历史指标现在报告为和,而非虚构的“100 % top author”;重新生成了,修复了与实际输出不一致的问题(字段已声明但从未输出)。试运行结果存储在沙箱的目录下。
kerndatensatz-dokumentkerndatensatz-basisReifegradhistory_complete: falsenullreferences/ig-stats-schema.jsonmandatory_missingmii-kds-dokument-ig-inoffizielldocs/reports/dry-run-2026-07-31/原始协议:CC-BY-4.0,由两个源仓库声明。目录下的代码采用Apache-2.0协议,与本仓库的代码协议一致。
scripts/于2026-08-05升级为版本:经过多次实际任务验证:对四个KDS模块进行测量/对比,以及对两次完成的迁移进行同模块验证检查。references/triggers.md中的触发集已通过这些运行得到验证。
stable