/biotope:biotope-croissantfrom biotope
Builds typed knowledge-graph projects with Biotope from local data described in Croissant. Covers describing datasets, extracting records from unstructured documents, generating source inventory, authoring schemas, and exporting through BioCypher.
Ships in biotope. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Terms used throughout.
.biotope/datasets/<data path>.jsonld, such as .biotope/datasets/data/raw/people.csv.jsonld for the file data/raw/people.csv. Biotope makes it from the data and the dataset's annotation file; never edit it.<folder>/.biotope.yaml for a dataset added as a folder, <file>.biotope.yaml for a single file. The one place for everything people and agents write about the dataset.push/people.csv and its table push/people.csv#people, so new data keeps every ID.graph/sources/<manifest>/<source>/, holding its schema, SOURCE registration and loader.__source_digest__ records the revision you reviewed.What you deliver. graph/build/: BioCypher import files, schema_config.yaml with every concept and property description, provenance.json, and run.json with the scope, policies, bindings, counts and exclusions. The consumer gets the graph and graph/build/, never this repository or your reasoning, so everything needed to read a value correctly belongs in a description, a policy or the scope.
Ownership. The user owns scientific decisions; you own engineering ones. Reuse decisions already made. Ask about missing ones that change selection or identity; when no one can answer, apply the default this skill names and record the question in graph/ASSUMPTIONS.md and the hand-over. Never settle a scientific question silently.
Scope. Curation, scaffolding and execution are independent: do the steps the request needs. Describing a dataset does not imply building a graph. Database import, querying and new Baker format handlers are separate work.
Copy this checklist and track progress.
Biotope graph project:
- [ ] Step 1: Read the inputs and the existing project
- [ ] Step 2: Agree the purpose and its questions
- [ ] Step 3: Describe and annotate every source
- [ ] Step 4: Turn unstructured documents into structured records (if any unstructured docs exist)
- [ ] Step 5: Generate the inventory and decide exclusions
- [ ] Step 6: Author schemas and terms, then loaders
- [ ] Step 7: Declare the topology by concept
- [ ] Step 8: Align identities, then write mappings and the pipeline
- [ ] Step 9: Check, fix, build
- [ ] Step 10: Review and hand over
Step 1: Read the inputs and the existing project.
graph/pyproject.toml declares and graph/uv.lock pins; the user commits both files. Its graph extra brings Pyright with Node.js, so uv is the only prerequisite..biotope/, run uvx --from 'biotope>=1.0,<2' biotope init . --no-prompt at the root of the host repository; without graph/, run uvx --from 'biotope>=1.0,<2' biotope graph scaffold. Then run uv sync --project graph. Every other biotope command in this skill and its references runs as uv run --project graph biotope ….biotope map --show, and graph/README.md; it documents the layout you will edit..biotope/, graph/, data/extracted/, annotation files and a root .gitignore the project lacks, and never to git. Leave committing to the user. When a command warns that git ignores a file, tell the user: it must be committed, so .gitignore needs an exception..gitignore that ignores /data/ or an unanchored data/ hides files the project must commit: git cannot re-include a file under an ignored folder, and an unanchored data/ also matches .biotope/datasets/data/, where the descriptions of datasets under data/ live. Tell the user and propose replacing the rule with /data/** and the three exceptions biotope init writes: !/data/**/, !/data/**/*.biotope.yaml and !/data/extracted/**. Another data folder that must stay ignored gets its own anchored rule, such as /src/app/data/.Step 2: Agree the purpose and its questions. Do this before any modelling.
graph/ASSUMPTIONS.md.biotope map --purpose "...". The entities and relations follow from the questions; they are not recorded separately.Step 3: Describe and annotate every source.
biotope add <data-path> --json and review each file's outcome. Do not scan environments or previous outputs. Keep the requested scope, including whole directories; never split a Croissant file to shape the packages, and never invent structure to make a mapping work.biotope add refuses a folder that holds a dataset or lies inside one; only the records files of extractions may lie inside a folder dataset.biotope add also creates the dataset's annotation file, empty. Everything you or the user know about the dataset goes there, never into .biotope/datasets/: descriptions, keys, equivalent properties, a license, a creator. Follow curation.md.biotope config set-project-metadata, for example --license <url>; biotope add applies it to each dataset, and a dataset's annotation file overrides it. Never store a template or placeholder there.biotope add reports a file Baker has no handler for as not described, with the reason no_handler, and a file Baker claims but cannot read as failed. It still gives each a file entry whose ID is its path. Keep these. Baker reads every .csv as comma-separated: a semicolon-separated one is described as a single column, or reported failed when a value holds a comma, so check each table's columns. An unstructured document goes through extraction in Step 4: sort the unstructured documents by how they are built before adding them, so that each kind can be routed to its own extractor. A structured file Baker cannot parse, such as tab-separated .txt, RDF or a shapefile, is read by its own package's loader, as curation.md describes. Describe every input, unstructured documents included, with biotope add: extraction refuses a document no dataset describes. Never add a FileObject or RecordSet by hand, since the next rebake drops it.biotope map inspect <manifest> --json, which reads metadata only.biotope annotate set, and put the evidence in a comment beside the value. The next command that reads the description applies it; biotope add --rebake keeps it. A key is structure: declaring one changes the source's revision once, as "When the data changes" describes.Step 4: Turn unstructured documents into structured records. Skip this step when the inputs hold no unstructured documents. Follow extraction.md.
graph/extraction/: it reads structure with code, gives a model only what needs language, and fails loudly on a document it does not expect.biotope extract try output on those samples against each document, wrong and missing records included, and fix the extractor or sharpen the descriptions. Then show the user the schema with that output, and run biotope extract run only after the user approves it. Every later change to the schema needs a new try and a new approval before run.--redo, and check it again.biotope extract run stores each extraction's records in data/extracted/<name>.jsonl and registers that file as a dataset, as biotope add would. From Step 5 on it is a structured file like any table: source generate writes its package and loader template, and writes no package for a document the extraction read. An unstructured document the user keeps out of extraction gets a package instead, and Step 6 transcribes its facts.Step 5: Generate the inventory and decide exclusions.
biotope source generate .biotope/datasets/<name>.jsonld --out graph/sources once per manifest. Every source gets a package with a schema, a SOURCE registration and a placeholder loader. Existing files are never rewritten, apart from the IDs biotope mv updates.data/a/raw and data/b/raw, would share the root raw: the second one's first generation reports a conflict and writes nothing until you name its root with --package, as in biotope source generate .biotope/datasets/data/b/raw.jsonld --out graph/sources --package b_raw. Later generations, the refresh included, find that root without it.graph/sources/__init__.py, each source is either selected or listed in EXCLUDED_SOURCES with a reason a reviewer can check. To leave a source out, exclude it. Deleting its package does not remove it: the next generation recreates the package and the check reports it as stale.Step 6: Author schemas and terms, then loaders. Before writing the first schema, loader or mapping, read example.md: a complete small project that passes the check, file by file. The references document the contracts you build against; the installed package's source is internal and changes between releases.
schema.py is yours: rename attributes, tighten types, set __missing_values__, and bind each Croissant field exactly once with source_field(...). The check enforces complete coverage, so no described field is silently dropped. Examples are in authoring.md.Term in standardization.py, and bind each of those fields to it with source_field(..., term=...) on an attribute named after the term. The check validates the bindings, and run.json shows reviewers which source fields were treated as equivalent. An equivalence written only into mapping code is invisible to them. Bind a field only after reading what each source means by it, since matching names establish no equivalence. A field kept as its source reported it needs no term.__init__.py and loader.py) rather than adding a module of aliases.# biotope:placeholder. The generated load passes SOURCE.path(), the file's path from the manifest, to _read(path); read that path, never one written into code, so biotope mv keeps the loader working. A loader decodes every described field of every row and attaches Evidence with the file, a pinned version (such as sha256: plus the digest of the bytes read) and a row or page location. It does not filter, impute, join or deduplicate: those are selection decisions, and only mappings report them.uv add --project graph <library>, which declares it in graph/pyproject.toml, pins it in graph/uv.lock and installs it in the project environment. graph check warns about an undeclared import, and the build records the installed version of every imported library in run.json.Facts schema; its loader cites each page or section read.Step 7: Declare the topology by concept.
graph/topology/<node>/node.py, the folder named after the class in snake_case, and each edge class in its own file in its source node's folder, named the same way: Sample in topology/sample/node.py, and FromPerson, from a sample to a person, in topology/sample/from_person.py. Helper modules and shared types there are free. Register the classes in topology/__init__.py. Never name a property preferred_id or biotope_provenance_id: the export reserves them.field(metadata={"description": ...}): what it measures, against which reference, and what it does not establish. Descriptions are the only interpretation that travels with the export; see interpretation.md and modeling.md.symbol:<source>/<symbol>, so that counting sources never counts one name twice. The rule covers every way records come to compare as one thing: a shared node, or a normalised value such as one common analyte or cell-type label. A match that looks obvious, such as a spelling variant, is still the user's decision. Keep each source's own label, and record the candidate match as an explicit, described link or property, not as the join itself.Step 8: Align identities, then write mappings and the pipeline.
In graph/alignment/, gather identity evidence from every participating source first, then resolve it. Identity comes before admission, an unambiguous resolution must not depend on the order sources were read, and each resolved identity keeps its contributing rows as evidence.
Every build is a full rebuild, so take each ID from the sources. Build an ID that nothing outside the graph stores from a source key. When IDs are stored outside, for example in a table people edit, read them back from its export as a source: a matched entity keeps its ID, and only a new entity gets a new one. Keep a committed key map from each alias to its ID only when the IDs cannot be read back.
Write each group of mappings in a module named after what it maps, such as graph/mappings/person.py; a group that grows large becomes a folder of named modules. Write the stage sequence in graph/pipelines/compose.py. Mappings select, join and construct. Send every record you do not emit through context.exclude(...), against a policy declared in Pipeline.policies. Put aggregate losses into context.record_audit(...) counts.
Audit yourself: every hit below must sit beside an exclude call or increment a recorded count.
rg -n -g '*.py' '\bcontinue\b|^\s*pass$' graph/alignment graph/pipelines graph/mappings
Step 9: Check, fix, build.
biotope graph check --json. Stdout carries exactly one JSON report and every diagnostic goes to stderr, so parse the two streams separately.Any, blanket ignores or invented metadata.biotope graph build; it replaces graph/build/ only after a successful run. Then run biotope graph metagraph --report graph/build/run.json.Biotope derives the export schema from the topology: write no project adapter or hand-written export schema. If the agreed scope will not execute, agree a new one rather than sampling silently.
| Finding | Meaning | Fix in |
|---|---|---|
inventory.absent, inventory.mismatch | The pipeline is not wired to INVENTORY, or a selected source differs from it | Step 5 |
inventory.stale, inventory.manifest_not_generated | A source has no package, or a manifest was never generated | Step 5 |
inventory.unselected, inventory.conflicting_selection | A source is neither selected nor excluded, or both | Step 5 |
inventory.unknown_exclusion, inventory.exclusion_reason | An exclusion names no source, or gives no reason | Step 5 |
inventory.placeholder | A selected loader is still the placeholder | Step 6 |
extraction.placeholder | A listed extraction's schema or extractor is still the template | Step 4 |
inventory.orphan, inventory.manifest_missing | A package's source is no longer described. After a move outside biotope, the finding names the old and the new ID; otherwise exclude it, then delete the directory; delete a package of a document an extraction has read | "When the data changes" |
inventory.conflict, inventory.manifest_invalid | Two packages claim one source, a source has no or a shared @id, a package directory is not a Python identifier, a root is contested, or a manifest cannot be read; nothing was written | Step 3 |
source.drift | The structure changed since the schema's revision was reviewed | "When the data changes" |
source.unscoped_field | A field @id is not under its RecordSet; only a description written by hand has one | Step 3 |
source.contract, source.opaque, standardization.* | A schema does not cover its fields, a value type is unknown, or a term binding is invalid | Step 6 |
topology.undescribed, topology.undescribed_property, topology.examples | A consumer would see only a label, or a placeholder concept is registered | Step 7 |
topology.layout | A node or edge class sits outside its file; the finding names the file it belongs in | Step 7 |
topology.reserved | A property uses a name the export reserves, such as preferred_id | Step 7 |
intent.* | The project has no project.yaml, or it states no purpose | Step 2 |
python.*, mapping.contract | Authored code is wrong | Step 8 |
dependencies.undeclared | Graph code imports a library that graph/pyproject.toml does not declare | Step 6 |
Step 10: Review and hand over.
Checks establish structure, not scientific correctness: a dropped eligible record passes all of them. Before handing over, make independent reads for the claims the purpose depends on. Read the original source or a published result, never the pipeline's own selection; compare missing and unexpected records by namespaced ID; and name the source of each expectation. Report these reads in the hand-over; they are not committed as code.
Build: graph/build/ Sources: <n> selected / <n> excluded
Excluded sources: <name> — <reason>; ...
Excluded records: <policy> <count>; ...
Independent reads: <claim> — <source of the expectation> — <agrees | differs: ...>
Open questions: see graph/ASSUMPTIONS.md
Then read graph/build/schema_config.yaml as the consumer will, with only the graph and graph/build/:
- [ ] A consumer can tell which study and comparison each concept belongs to
- [ ] Every numeric property states what it measures and against which reference
- [ ] Every identifier states when it may be joined and when it may not
- [ ] run.json's scope and policies state what the selection excluded
Anything unticked returns to Step 7 or Step 8. Human scientific review stays manual.
New data of the same shape (new rows, a new file, a re-downloaded document, a same-named file in another folder) needs commands only:
biotope add --rebake <dataset-path>
biotope extract run
biotope source generate .biotope/datasets/<dataset-path>.jsonld --out graph/sources
biotope graph check --json
biotope graph build
Run extract run whenever the project lists an extraction; it runs every listed one and reuses each unchanged document's records. Without it, every check and the build pass on records extracted from the previous documents, and the rebake records each document's new checksum, so check-data no longer reports the change. Run source generate once per description, the records file's included. Every existing file and table keeps its ID and the annotation file applies again, so no schema, loader or annotation needs an edit unless graph check reports source.drift. A new table or file gets a package with a placeholder loader: implement it (Step 6) or exclude it (Step 5). To keep later data from breaking the build, select sources by name and exclude the rest with one rule in graph/sources/__init__.py:
SOURCES: tuple[SourceContract, ...] = (PEOPLE, REPORT)
EXCLUDED_SOURCES: dict[str, str] = {
source.name: "New data; select it once its loader is written" for source in INVENTORY if source not in SOURCES
}
Moves. Move a described file with biotope mv <old> <new>, and a folder with biotope mv -r, never with mv or git mv: it updates the manifest, the annotation file and the source package's IDs in one step, and the check passes. After moving a document that an extraction reads, run biotope extract run again: the records name each document by its dataset and its path within it, and the run reuses the moved document's records without creating the extractor while a pattern still matches the new path. The records keep their IDs only when the dataset's name and the path within it stay the same, as when a whole dataset folder moves; otherwise they take IDs from the new path, so check any mapping that joins on them. A records file stays at data/extracted/<name>.jsonl, and biotope mv refuses to move it. A move made outside biotope shows at the next refresh. A single-file dataset has no folder to rebake: its refresh runs biotope add on the file at its new path, which moves the description and the annotation file there while the content is unchanged, then biotope source generate on .biotope/datasets/<new path>.jsonld. After a move made outside biotope, graph check reports inventory.orphan naming the old and the new ID and the package generation created for the new path: an error when the pipeline selects the old package's source, a warning when it excludes it. Move the file back, run biotope add --rebake, move it with biotope mv, then delete that package. When the file must stay at its new path, as when a download script puts it there, delete that package first, replace the old ID with the new one in the old package's schema.py, run biotope source generate again and set __source_digest__ to the revision graph check names. The finding names another package for deletion only while its loader is still a placeholder, and tells a package generated for a path the file has since left to delete itself.
source.drift means the structure changed: a new column or a changed type in the data, a key in the annotation file, or a changed file reference. Descriptions never cause it. New rows can: the structure is inferred from the values present, so a field that was null or an empty list in every record changes it when it first gets a value. Follow these steps exactly; each schema holds reviewed work.
biotope source generate .biotope/datasets/<data-path>.jsonld --out graph/sources. It reports each drifted source and rewrites nothing.biotope graph check --json. Each source.drift finding names the source and lists its current fields with their types (<id>: sc:Integer). Compare them with the schema; git diff on the description shows what changed.__source_digest__ to the full revision the finding names.source.drift remains.Never delete a schema to regenerate it: that discards the reviewed bindings, and the new schema would still need the same review.
After code changes, rerun Step 9. During requested cleanup, remove generated outputs such as graph/build/, and preserve raw data, annotation files, .biotope/ and authored code. Do not use biotope rm raw for test cleanup.
biotope extract try, the run, and the contract for declarations, schemas, extractors, stored records and reuse.RunContext.run.json and provenance.json.references/authoring.md (opens in a new tab)references/curation.md (opens in a new tab)references/example.md (opens in a new tab)references/extraction.md (opens in a new tab)references/interpretation.md (opens in a new tab)references/modeling.md (opens in a new tab)references/reports.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
knowledge-graph, biotope, croissant, biocypher, data-pipeline
Other plugins' skills for the same job
npx claudepluginhub biocypher/biotope --plugin biotope