0.0.0-local · Open Draft Specification

Portable fitness, nutrition, and health data.

FitData is a vendor-neutral specification, JSON Schema family, and TypeScript SDK for training, wearables, sleep, nutrition, and laboratory records. One uniform domain.noun entity model—built for apps, pipelines, and AI agents.

18
Canonical kinds
5
Domain packages
55 / 87
LOINC biomarkers/tests
7
Offline mappers
Reusable timed cycling class with a linear FTP ramp and posture cues. No subject required.
@fitdata/trainingversionSpec →
{
  "kind": "training.routine",
  "id": "example:five-minute-climb",
  "version": "1",
  "sport": "fitdata:indoor_cycling",
  "name": "Five-minute climb",
  "structure": {
    "kind": "timeline",
    "durationSeconds": 300,
    "segments": [
      {
        "id": "climb",
        "startSeconds": 0,
        "endSeconds": 300,
        "targets": [
          {
            "metric": "fitdata:power",
            "target": {
              "kind": "ramp",
              "basis": "fitdata:ftp",
              "unit": "%",
              "start": 70,
              "end": 85,
              "interpolation": "linear"
            }
          }
        ]
      }
    ],
    "cues": [
      { "atSeconds": 0, "posture": "seated", "text": "Start seated." },
      { "atSeconds": 180, "posture": "standing", "text": "Stand for the final two minutes." }
    ]
  }
}
Domain Architecture

Four independent domains. One unified document.

Import a standalone domain package or compose every record kind in a single JSON/JSONL FitData document with closed reference validation.

Specification Principles

Strict where correctness matters. Flexible where apps differ.

Entities first, ownership optional

Standalone records require only kind and id. Multi-user and audit guarantees are enforced cleanly through document profiles, not mandatory user IDs on every reusable routine or food.

Separate version & revision lifecycles

Reusable definitions (routines, foods, lab tests) use string versions. Personal events (workouts, intakes, lab results) use integer revisions with deterministic tombstone history.

JSON Schema + semantic validation

Every package ships Draft 2020-12 JSON Schema for structure alongside TypeScript validators checking units, timelines, recalculated nutrition snapshots, and closed reference graphs.

Offline mappers with source residue

Seven pure, offline adapters normalize Strava, Garmin, Convex Wearables, and CLIPIN payloads while preserving original source JSON and stripping known credential keys.

Machine-Readable Artifacts

Generated JSON Schemas and LLM-ready spec bundles

Download Draft 2020-12 JSON Schemas generated directly from the workspace Zod definitions, browse the canonical LOINC registry, or feed /llms.txt to your coding agent.