ms-data-ingestion
Skill1 starsChanged 24 days agoMITView on GitHub
Rules for reading mass-spectrometry files in msmcp: supported formats, the single dispatch point, reader semantics, and what must never be invented.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- add-mcp-toolSkill
- data-referencesSkill
- instrument-class-defaultsSkill
- quality-gateSkill
- security-boundarySkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this when reading an acquisition or adding support for a new format.
- Very specific: line 16
All ingestion goes through ingest.resolve_source(path, policy).
- Very specific: line 25
Do not call massflow_io, mzml, or mgf directly from a tool.
- Very specific: line 68
Do not invent cvParams, retention times, MS levels, or precursor m/z that the file does not state.
- Distinctive: line 70
Do not convert between units unless the file states the unit.
- Very specific: line 71
Every read goes through the security boundary (see the security-boundary skill): allowed root, file size, and spectrum count all apply to …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MS data ingestion
Use this when reading an acquisition or adding support for a new format. The guiding constraint: do not silently change mzML/MGF semantics, and do not invent metadata.
One entry point
All ingestion goes through ingest.resolve_source(path, policy). It picks the
reader from the file extension and returns a Source whose spectra are all the
same msmcp.mzml.Spectrum type, so no downstream tool knows or cares which
library parsed the file.
file -> ingest.resolve_source -> (MassFlow | msmcp reader) -> Spectrum -> DataReferenceDo not call massflow_io, mzml, or mgf directly from a tool. Tools depend
on the interface (resolve_source), not the mechanism.
Supported formats
| Format | Extensions | Reader / backend |
| mzML | .mzML, .mzML.gz | msmcp.mzml |
| MGF | .mgf, .mgf.gz | msmcp.mgf |
| imzML (imaging) | .imzML (+ .ibd) | MassFlow (massflow.imzML) |
The reader chosen is carried into provenance as Source.backend, which is what
makes it possible to tell later whether two results came from the same parsing
path.
Unsupported formats
Vendor formats are recognised and rejected with actionable guidance, not a generic failure:
| Suffix | Vendor |
.raw | Thermo |
.d | Agilent / Bruker |
.wiff | SCIEX |
.mzxml | legacy mzXML |
The error directs the user to convert with ProteoWizard MSConvert (except
imzML, which is passed through directly). A new UnsupportedFormatError case
should name the vendor and the next step, mirroring ingest.py.
Reader semantics to preserve
- An empty scan is legal and must not abort a run. Real Bruker mzML files
contain thousands of legitimately empty spectra;
tests/conftest.pymodels this with the"empty"and"absent"payload modes. - A file that declares peaks but carries none is corruption, not emptiness. Distinguish the two; do not treat a malformed payload as a valid empty scan.
- Empty arrays are spelled several legal ways in the wild (
<binary/>withencodedLength="0", or<binary>omitted entirely). Handle both.
Metadata honesty
- Do not invent cvParams, retention times, MS levels, or precursor m/z that the
file does not state. Report
Nonewhen absent. - Do not convert between units unless the file states the unit.
- Every read goes through the security boundary (see the
security-boundaryskill): allowed root, file size, and spectrum count all apply to ingestion.
Tests
Ingestion tests build fixtures rather than committing binary data. See
tests/conftest.py for the mzML/MGF builders and tests/test_ingest.py,
tests/test_mzml.py, tests/test_mgf.py. The imzML fixture is written with
pyimzml (a MassFlow dependency) and skipped when that dependency is absent,
rather than faked.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

