Skip to content
Skills Library
Programming · Planning

extend-schema

/extend-schema

Use when changing the data model / schema in src/dismech/schema/*.yaml; when considering a schema change, including deciding whether a curation need warrants one at all; or when migrating KB content after a schema change. Not for filling in an existing slot (see the curation skills) or for ontology bindings inside the schema's dynamic enums (see dismech-terms).

Repository
dismech ↗
Licence
BSD-3-Clause
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

BSD-3-Clause, otwarta.

What it does and when to use it

Use when changing the data model / schema in src/dismech/schema/*.yaml; when considering a schema change, including deciding whether a curation need warrants one at all; or when migrating KB content after a schema change. Not for filling in an existing slot (see the curation skills) or for ontology bindings inside the schema's dynamic enums (see dismech-terms).

Original author description

Use when changing the data model / schema in src/dismech/schema/*.yaml; when considering a schema change, including deciding whether a curation need warrants one at all; or when migrating KB content after a schema change. Not for filling in an existing slot (see the curation skills) or for ontology bindings inside the schema's dynamic enums (see dismech-terms).

How it works

  1. When to use
  2. The schema files
  3. Do Background Research
  4. Major Schema Changes should be approved
  5. Have a data population strategy
  6. A note on extensions to the evidence model
  7. Does this need a schema change?
  8. The migration hazard (read before narrowing anything)
  9. Mechanics — what to regenerate
  10. Downstream — what a new slot must be wired into
Original SKILL.md headings · 161 lines, 1,082 words
SKILL.md preview
---
name: extend-schema
description: >
  Use when changing the data model / schema in src/dismech/schema/*.yaml; when
  considering a schema change, including deciding whether a curation need
  warrants one at all; or when migrating KB content after a schema change. Not
  for filling in an existing slot (see the curation skills) or for ontology
  bindings inside the schema's dynamic enums (see dismech-terms).
---

# Extend the dismech LinkML Schema

## When to use

- Adding a class, slot, or enum to `src/dismech/schema/dismech.yaml`.
- Narrowing, deprecating, or removing an existing one.
- Deciding whether a curation need warrants a schema change at all.
- Migrating `kb/` content after a schema change lands.

Do **not** use for: filling an existing slot (use the curation skills),
ontology `meaning` / `reachable_from` bindings inside dynamic enums (use
`dismech-terms`), or `kb/groupings/` membership logic (use `curate-grouping`).

## The schema files

| File | Class it governs |
|---|---|
| `src/dismech/schema/dismech.yaml` | `Disease` (disorders, modules), `Grouping`, `ModuleCollection` — 322 KB, the main one |
| `src/dismech/schema/curation_stub.yaml` | `CurationStub` (`stubs/`) |
| `src/dismech/schema/history.yaml` | `history/` records |
| `src/dismech/schema/hypothesis_assessment.yaml`, `hypothesis_reconciliation.yaml` | `kb/hypotheses/` |
| `src/dismech/schema/research_synthesis.yaml` | deep-research synthesis |
| `src/dismech/schema/classifications/` | the `classifications` block |
| `src/dismech/schema/dismech.history.yaml` | not a schema — an auto-appended edit log beside `dismech.yaml`. Never hand-edit it; `validate-all` skips `*.history.yaml` |

This guide mostly pertains to the *core schema* ie dismech.yaml

## Do Background Research

It is likely your proposal has been discussed before. Be sure to check issues.

## Major Schema Changes should be approved

If you are reviewing a schema change and it is not trivial, block merging until
approved by @cmungall or @mellybelly.

## Have a data population strategy

It is easy to have "nice to have" new slots. But think hard about the population strategy.

Will this be deterministically populated? If so, include code.

If non-deterministic, you MUST include string guidelines on how to populate. Especially
if subjective in nature. We want to avoid situations where agent and reviewer go back and forth
arguing on populating the slot because we underspecified how it was to be populated.

In general, things that involve new ontology terms should be fine because we have good practice
and deterministic search tools and checker tools.

## A note on extensions to the evidence model

It is easy to come up with proposed extensions to the evidence model but implementing them can be harder.
Adding some way of being able to determine good evidence from bad evidence is laudable, but there must be
good guidelines on populating this.

Don't try and over generalize - a strategy for evidence for cellular assays may be different for one for clinical approval.

Remember the core of dismech is the biological mechanism, this requires a lot of careful coordinated thought about how to
represent assays, readouts, interpretations etc. Be sure to read the docs and evidence slides.

## Does this need a schema change?

1. Does a slot already express this? #972 proposed treatment_category; the
answer was that therapeutic_modality already was that discriminator. Do not add a second, redundant slot.
2. Can it be derived instead of stored? Cancer cell of origin is derived from the pathograph (genetic_context.variant_origin on a node) and design decisions says no cell_of_origin: slot should be added.
3. Is qualifiers the right home? Usually not — prefer a dedicated slot
4. Is this a decision the register already made? Read `docs/explanation/design-decisions.md` before proposing, and cite it.

## The migration hazard (read before narrowing anything)

Additive changes are easier if they are optional or recommended slots. However, anything
that narrows or invalidates will be hard and needs a proper schema migration path.

Otherwise the schema change will need to be also bundle a giant set of changes on multiple yamls,
and the 100s of open PRs will become invalid!

In future we may properly implement schema migrations. For now you should do these kinds of changes
in two stages - a superposition stage where the narrower form can co-exist, weakly deprecating the old form;
then once migration is done (including open PRs) narrow the schema.

## Mechanics — what to regenerate

```bash
just lint-schema                              # linkml-lint -- dismech.yaml ONLY, not the other five
just validate-all                             # every *disorder* file; modules/groupings have their own recipes
just check-enum-values                        # whole-KB, offline
just validate-terms-schema                    # the schema's own dynamic enums
just gen-jsonschema                           # -> project/jsonschema/ (gitignored)
just gen-schema-docs                          # -> elements/ (derived; CI commits it, you don't)
```

**Committed generated artifacts:** `src/dismech/datamodel/dismech.py` and
`dismech_pydantic.py` are in git and are what `gen-python` writes.
**TODO — resolve:** history is inconsistent about whether a schema change must
regenerate them (#10758 did; #9806 and #10629 did not). Decide the rule and
state it here.

**Do not hand-commit** `elements/`, `docs/` HTML, or anything else the
generate-pages workflow owns. See CLAUDE.md "What NOT to commit".

## Downstream — what a new slot must be wired into

TODO. Checklist to confirm and expand:

- [ ] `src/dismech/entity_refs.py` — `SECTION_KEYS` if the new section can be
      the target of an `<kind>#<name>` reference. It is the source of truth
      shared by validation and rendering.
- [ ] `src/dismech/graph.py` — if the slot carries a `target` that should draw
      an edge. Note bare-name targets vs entity-reference grammar; mixing them
      up is silent (#10112).
- [ ] `src/dismech/render.py` + `src/dismech/templates/` — page rendering.
- [ ] `src/dismech/export/` — `kgx_export.py`, `cx2_export.py`,
      `browser_export.py`, `tabular_export.py` as applicable.
- [ ] `src/dismech/qc_plugins.py` — compliance scoring.
- [ ] A test in `tests/` (`test_clinical_burden_schema.py`,
      `test_genetic_schema.py`, `test_medical_action_schema.py` are the
      existing per-area schema tests).
- [ ] `CLAUDE.md` — curator-facing semantics, if a curator will fill the slot.
- [ ] `docs/explanation/design-decisions.md` — if this settles or reopens a
      recorded decision.
- [ ] **A `history/schema/` record.** The convention is live — `history/schema/`
      already holds records for `ModuleCategoryEnum`, `TherapeuticModalityEnum`,
      `maxo-removal`, `entity-ref-prefix-normalisation` and others, i.e. exactly
      the enum-narrowing and slot-addition changes this skill is for. Unlike the
      KB kinds, `schema` records need an explicit `--path`:

      ```bash
      just new-history --kind schema --slug <EnumOrSlotName> \
        --path src/dismech/schema/dismech.yaml \
        --event EDIT --outcome changed \
        --summary "Add <slot>" --agent-tool claude-code --model <model-id> \
        --pr <PR_NUMBER> --details "What changed and why."
      just validate-history <path-printed-by-new-history>
      ```

## Common mistakes

TODO. Seeds:

- Adding a slot that duplicates one that exists under a name you did not guess.
- Narrowing an enum without a plan for in-flight PRs.
- Leaving prose that argues for a value the schema no longer has.
- Renaming instead of deprecating, breaking entries mid-review.
- Committing `elements/` or `project/` output alongside the schema change.

## Validation before the PR

```bash
just lint-schema
just validate-terms-schema
just qc
```

`just qc` already chains `check-duplicate-keys`, `check-enum-values`,
`validate-all`, `validate-modules`, `validate-groupings` and
`validate-module-collections` (`project.justfile:879`), so do not run those
separately — `validate-all` is the slow one and you would pay for it twice.
`validate-terms-schema` is not in the chain and is the one that checks the
dynamic enums you just edited.

Versions

RepositoryScoreLicence
This page · monarch-initiative/dismech100BSD-3-Clause
monarch-initiative/mechmaker90BSD-3-Clause
monarch-initiative/mechmaker90BSD-3-Clause
monarch-initiative/mechmaker90BSD-3-Clause

Database snapshot: 13.11.2026 · package version 47fade181c58 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100dismech-compliance
    Skill for analyzing and improving compliance in the dismech knowledge base. Use this skill when checking disorder file completeness, identifying missing fields (ontology terms, evidence, descriptions), understanding weighted priority scoring, and systematically improving knowledge base coverage.
  • 100schema-migration
    Design, review, or implement a database schema migration. Use when adding, changing, or removing columns, indexes, constraints, relationships, or stored data.
  • 100dismech-terms
    Select, add, validate, review, or repair ontology bindings and derived term caches in dismech. Use when changing term IDs, canonical labels, preferred_term values, enum meaning mappings, phenotype, cell-type, biological-process, disease, anatomy, exposure, or treatment…
  • 91effect-schema-v4
    Authoritative reference for Effect Schema v4 API changes and migration patterns from v3. Use this skill when writing Schema code to avoid v3 patterns, when migrating existing v3 Schema code, or when unsure about current Schema API names.
  • 91effect-schema-v4
    Authoritative reference for Effect Schema v4 API changes and migration patterns from v3. Use this skill when writing Schema code to avoid v3 patterns, when migrating existing v3 Schema code, or when unsure about current Schema API names.
  • 96db-change
    Use for database schema/model/query changes AND new entity/relation/document modeling — SQL, NoSQL, ORM, indexes, constraints, data safety. Once a migration file exists, hand off to migration-review.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.