name: biomodals-app-development description: Biomodals Modal app development standards. Use when Codex is creating, editing, reviewing, or scaffolding files under src/biomodals/app/**/*_app.py, including app discovery, AppConfig usage, Modal image construction, helper APIs, volumes, data flow, local entrypoint CLI docstrings, examples, and smoke-test expectations.
Biomodals App Development
Core Workflow
Use this skill for Biomodals app files named *_app.py.
Before changing behavior, read the current repo guidance:
references/app-development.mdfor the app-development standards and checklist.docs/agents/app-development.mdfor repo-level coordination notes and deviation links.- The closest reference apps for current patterns:
src/biomodals/app/fold/alphafold3_app.pysrc/biomodals/app/bioinfo/rosetta_app.pysrc/biomodals/app/design/boltzgen_app.pysrc/biomodals/app/design/rfdiffusion_app.pyfor durable, workflow-compatible app outputs backed by an app output volume.src/biomodals/app/design/ligandmpnn_app.pyfor fast, workflow-compatible rerunnable app outputs returned as inline zstd bytes.
For new apps, ask the user which data-flow class applies before choosing architecture: short-lived inference, long-running/cached, or parallel/resumable. If the user already gave enough context, state the classification and proceed. Also ask whether the app must be workflow-compatible. If yes, follow the workflow-compatible app guidance in the reference and use RFdiffusion or LigandMPNN as the closest implementation pattern.
Implementation Rules
Keep app code compatible with biomodals app help and app discovery:
- Name files
<toolname>_app.pyundersrc/biomodals/app/<category>/. - Use a user-facing module docstring with upstream links, prerequisites, and output behavior.
- Add
# ruff: noqa: PLC0415near the top. - Use module-level
CONF = AppConfig(...)for new apps; pinrepo_commit_hashorversion. - Let
gpuandtimeoutbe overridden fromos.environ. - Build runtime images through
patch_image_for_helper(...). - Before adding app or workflow helpers, check
biomodals.helperfirst. Reuse existing helper APIs for local output paths, shell, archive, copy, download, hashing, warmup, and serialization behavior; only define local helpers when the behavior is app-specific and no shared helper fits. - Prefer
CONF.mounts(...)for model and output volumes. Import shared volumes frombiomodals.helper.constantonly when a function needs a nonstandard mountpoint, a shared database/cache volume, or an explicitcommit(). When usingVolume.with_mount_options(...)directly, combine read-only and subpath options in one call. - Avoid extracting trivial two- or three-line helpers that are used only once or twice. Inline them and add a short comment when the intent is not obvious.
- Name local entrypoints
submit_<toolname>_task(...)and use Google-styleArgs:docstrings sobiomodals app help <app>renders flags. - Use
🧬for local entrypoint status messages and💊for remote Modal-container status messages. - Keep Modal function return values primitive when practical:
int,str,float,bool,bytes,list,dict, orNone. Return complex objects only when they provide much more benefit than a primitive payload, and ensure the type is serializable bycloudpickle. For example, return paths asstr(path)rather thanPathobjects. - For workflow-compatible remote functions, return
AppRunResultwithAppOutputstorage frombiomodals.schema; keep local entrypoints CLI-only and adapt them to consume the same app result object. - Add or update an example command under
examples/app/when app behavior or invocation changes.
Review Checklist
When reviewing or finishing an app change, check:
- Discovery: path, filename, app name, and local entrypoint name match CLI expectations.
- Reproducibility: upstream version or commit is pinned.
- Runtime boundaries: dependencies used only inside Modal images stay lazily imported.
- Volumes: model/cache mounts use app-specific subdirectories when practical; inference mounts are read-only unless the tool writes caches there; writable volumes are committed after writes; mounted volume paths are logged or returned as
VolumePathwhen they cross app/workflow boundaries. - Data flow: quick jobs return
.tar.zstbytes viapackage_outputs(...); persistent, resumable, or batch jobs useCONF.output_volume,CONF.mounts(output_volume=True), or shared volumes. - Workflow compatibility: if requested, add a remote function that returns
AppRunResult; useVolumePathfor durable/cached outputs andInlineByteswithmedia_type="application/zstd"only for small zstd archives that are cheap to pass through the workflow runtime. - Modal return payloads: prefer primitive,
cloudpickle-serializable values; avoid returningPathobjects directly or nested inside tuples, lists, dicts, or dataclasses. - Output safety: local output directories are created, existing tarballs are not overwritten accidentally, and final paths or Modal volume locations are printed.
- CLI docs: local entrypoint docstrings use exact Google-style
Args:formatting with continuation indentation. - Verification: run
prek run --files <changed files>when practical, plusuv run biomodals app listanduv run biomodals app help <app-name>for CLI or discovery changes.
Reference
Load references/app-development.md when implementing a non-trivial app, reviewing details, or checking exact patterns for AppConfig, image construction, volumes, remote functions, helper APIs, entrypoints, data flow, caching, legacy migration, and examples.