Repository navigation
openehr-specs: add bmm-authoring skill for writing and checking BMM schemas - #11
Merged
Merged
Conversation
Add a knowledge skill for writing a component's BMM schema (the P_BMM
JSON in computable/BMM/) from scratch or changing one: header
conventions, includes, how packages set the class-table file names and
{pkg}, every class, property, type and function kind, invariants and
constants, documentation text, what the legacy class tables do not
show, and the persistence-spec features bmm-publisher does not read
(indexed containers, ancestor_defs, type_ref value sets), with the form
to write instead.
bmm-publisher renders most modelling mistakes without a message (a
misspelt _type becomes a property of type Any, unknown keys are
ignored, a class missing from packages gets no table), so the skill
ships a read-only, standard-library checker (scripts/check_bmm.py) and
a worked example that passes it and renders cleanly. CI runs the
checker's unit tests.
class-generation and authoring now route changes to the class model to
bmm-authoring; the prompting guide, plugin README, AGENTS.md and
testing docs list the new skill and script.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Add exclusions for folders without BMM ITS REST etc. |
# Conflicts: # AGENTS.md # CHANGELOG.md
Review of #11 found that the checker could pass schemas bmm-publisher mis-renders, and could crash on malformed input: - A run without -d for an included schema exits 3 (incomplete) instead of 0, also under --strict; the summary counts the unchecked names, and names close to a known class are still flagged ("did you mean"). - No traceback on wrongly typed values; a non-UTF-8 file, or a -d file that is not a BMM schema, exits 2. Duplicate -d schema ids are merged. - Type shapes bmm-publisher renders wrongly are errors: a simple type in a container's type_def (List<Any>), a non-generic type object in generic_parameters (publisher crash), generic_parameters and generic_parameter_defs together (defs ignored), a container type in generic_parameter_defs (prints nothing). - Generic arguments bind by position, as bmm-publisher renders them; an argument that is the enclosing class's parameter conforms through its own constraint. - An unknown _type is reported and the item is still checked, as the closest known kind. Lost content is an error: a parent only in ancestor_defs, index_type, class keys on enumerations and interfaces. - Classes in packages deeper than four levels (no table) are errors. - Corrected: a container parameter's cardinality is optional (the parser defaults it), a missing bmm_version is a warning, class_definitions is optional, void is accepted only as a function result, and only lower-case {attribute} references are flagged. Tests cover every finding the checker can report (a mutation run that disables each one in turn leaves no test green), use a slice of the real BASE ancestry and constraints, and put a wrongly typed value at every node of the worked example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the checker - The reference now follows the development BMM Persistence spec, which names JSON as bmm-publisher's primary format and covers functions, constants and invariants (P_BMM 2.4): corrected chapter names, the procedure rule (no result, written as void in the published schemas), class_definitions as optional, aliases as written, constant values, invariant and condition tags, and the documentation escaping rules. - It documents what bmm-publisher renders wrongly and how to avoid it: simple element types, type objects in generic_parameters, both generic-parameter forms at once, containers in generic_parameter_defs, binding by position, the four-level package limit, enumeration values, and which maps keep their keys. - Corrected: a document can have several top-level packages; ITS-BMM republishes only from repos that carry its notify workflow; a container parameter's cardinality is optional; lifecycle values for an unreleased schema are a suggestion to confirm. - SKILL.md: compare checker output before and after with diff, treat exit 3 as an incomplete check, report a schema as unchecked without python3, and replace the scaffold starter's root package. - scaffold routes filling a new repository's empty schema to bmm-authoring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A class with an unknown _type has its keys checked as the plain class bmm-publisher reads it as, so a near-miss such as P_BMM_INTERFACES no longer reports its properties as lost. - While an included schema is not loaded, a name close to a local class (ARCHETYPE_ID next to ARCHETYPED) is counted as unchecked, with the suggestion in the INFO line, instead of a false warning. - The "incomplete" notice and the unchecked count are printed whatever the exit status, so a run with errors still says it was incomplete. - Input nested too deeply to read or check exits 2 without a traceback. - An empty ancestor_defs loses no parent and is no longer an error. - Reference: maps keyed by name versus a type's generic_parameter_defs, the Required legend, nested container types, binding order, condition tags, and constant values as the P_BMM model types them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sebastian-iancu
marked this pull request as ready for review
October 9, 2026 14:09
4 of 6 tasks
…plain-language pass on the docs Split the long bmm-authoring CHANGELOG entry into short sub-bullets and use one term, "BMM schema edits", for the routing. Give the new-component prompt its own prompting-guide section, say what Claude does after each BMM prompt, and keep testing.md and the README to what the tests and the skill actually cover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…outing bmm-authoring: imperative wording without "you"; a description that also routes archetype work away and triggers on fixing a .bmm.json; one schema_revision bump per change set; a step for renames and removals; source changes committed together; exit 0 no longer called clean; the reference sections named instead of repeated; the from-scratch steps say which release and what to do when no :pkg: is set yet. scaffold template set revision 3 (unreleased, resealed): the AGENTS.md task table and build region send BMM schema edits to bmm-authoring, and the empty schema uses 4-space indentation like the published schemas. class-generation runs the checker first after a hand edit; authoring's related-skill line matches it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
bmm-authoring, a skill for writing a component's BMM schema (the P_BMM JSON incomputable/BMM/) from scratch or changing one. Until now the plugin only covered generating class tables from a BMM (class-generation).SKILL.mdscaffoldcreates. Also a quick reference from construct to JSON, how to run the checker, and guardrails, such as editing the JSON in place because the published files mix PHP-style escapes with raw characters.references/p-bmm-json.mdbmm-publisher0.12.0 reads and renders. It lists what the class tables leave out, the spec features the publisher ignores (indexed containers,ancestor_defs,type_refvalue sets) with what to write instead, and how the spec's ODIN and YAML examples map to JSON.assets/openehr_demo_0.1.0.bmm.jsonscripts/check_bmm.pyThe checker is there because
bmm-publisherexits 0 on modelling mistakes such as these, and renders something else in their place. It reports, for example:_type, or a misspelt key such asis_mandatory;{"lower": 2, "upper": 5}without"upper_unbounded": false, which loses its upper limit;List<Any>, print nothing, or crash the publisher;conforms_to_type.It exits 0 when the check is complete with no errors, 1 on errors, 2 on unreadable input, and 3 when names from an included schema went unchecked because that schema was not passed with
-d.Other changes:
class-generation,authoringandscaffoldsend BMM schema edits tobmm-authoring, and so does theAGENTS.mdthat scaffold writes. Template set revision 3 is not in a plugin release yet, so it was edited in place and its digest recomputed. Its empty schema now uses 4-space indentation, like the published schemas.AGENTS.md,docs/testing.mdand the CHANGELOG are updated.main(with openehr-specs: scaffold a computable/BMM schema in new repositories #9) is merged in.How it was tested
/pr-review-toolkit:review-pr(code, tests, documentation, silent failures) ran twice. Each finding was checked against the parser and publisher source, or a publisher run, before it was fixed.plugin-dev:skill-reviewerreviewed the skill and its routing in the sibling skills. Fixes made from its findings cover rename and removal, the commit rule, a singleschema_revisionbump per change set, and the scaffoldAGENTS.mdrouting. Adocs-editingprose review covered the CHANGELOG, the docs and this description.scripts/test_check_bmm.pyhas 107 tests (239 in the whole suite). Every finding the checker can report has a test: disabling any one of them makes at least one test fail. The tests' BASE stub copies the real ancestry and generic constraints. A wrongly typed value at any node of the worked example must produce a finding, not a traceback.Defects found in published schemas (not fixed here)
P_ARCHETYPE_SLOT.includesandexcludes: aListwith no element type, which the published table shows asList<Any>.c_conforms_to(rmcc)in eight classes:FUNCTION<Boolean, TUPLE2<String, String>>. BASE declaresFUNCTION<ARGS, RESULT>and the AOM2 text saysFUNCTION<<a_type, other_type: String>, Boolean>, so the arguments are in reverse order.BMM_CLASS.featuresandflat_features: a resultListwith no element type.includes(a warning).Checklist
python3 scripts/validate.pyandpython3 -m unittest discover -s scripts -p 'test_*.py'pass (239 tests);claude plugin validate plugins/openehr-specs --strictpassesUnreleased; no version bumpbmm-publisher0.12.0🤖 Generated with Claude Code