Kaiord README

The full upstream README, mirrored for reference. Install config, tool schemas, adoption signals and our own overview live on the Kaiord listing page.

Kaiord

kaiord.com | Kaiord App | npm

License: MIT TypeScript: strict

CI codecov npm version npm version MCP Registry Glama MCP server Sponsor

Kaiord gathers an athlete's training and health data from the platforms where it is scattered, and lets them plan, convert and move it between those platforms. It keeps no accounts and stores no user data on its own infrastructure.

It comes as two products:

  • Kaiord SDK: the published libraries and tools that read, validate and convert training data. That is @kaiord/core, the format adapters (@kaiord/fit, @kaiord/tcx, @kaiord/zwo, @kaiord/garmin), the command-line tool @kaiord/cli, and the MCP server @kaiord/mcp.
  • Kaiord App: the browser application an athlete uses to see, plan and move their data, together with the browser extensions it relies on.

Kaiord is a personal project, not affiliated with any employer.


✨ Features

  • Kaiord App: create and edit workouts in your browser, with no account.
  • KRD, the SDK's internal canonical model: every format adapter converts to and from it. It is JSON, validated by Zod schemas, and not offered to third parties as a standard.
  • Conversions between FIT, TCX, ZWO and Garmin Connect (GCN) workouts, each going through KRD.
  • @kaiord/mcp is published in the official MCP registry as io.github.pablo-albaladejo/kaiord.
  • Hexagonal architecture, checked by a script on every pull request, and a TypeScript API in strict mode.

πŸ“‹ FIT reference

Supported FIT Fields

Workout Metadata

  • Sub-sport categorization: Detailed sport types (trail running, indoor cycling, lap swimming, etc.)
  • Pool dimensions: Pool length and unit for swimming workouts

Workout Steps

  • Coaching notes: Instructional text for each step (max 256 characters)
  • Swimming equipment: Fins, kickboard, paddles, pull buoy, snorkel

Duration Types

  • Time & distance: Standard interval durations
  • Calorie-based: Steps ending after burning specified calories
  • Power-based: Steps ending based on power thresholds (watts)
  • Heart rate conditionals: Steps ending based on HR thresholds (bpm)
  • Repeat conditionals: Repeat blocks until time/distance/calories/HR/power targets reached

Known Limitations

  • Training Stress Score (TSS): The training_peaks_tss duration type is not yet implemented in the FIT converter. This is a TrainingPeaks-specific metric that requires additional mapping logic. Contributions welcome!

πŸ”’ Local-first architecture

Kaiord keeps no accounts and stores no user data on its own infrastructure. It runs two Cloudflare Workers: one in front of the site, which adds headers for AI agents, and one at kaiord.com/mcp, which converts workouts in transit. That second Worker's code also has an A2A endpoint for kaiord.com/a2a, which is not deployed yet. Neither binds any storage. Your data leaves your device only to destinations you configured:

  • Storage is your browser's IndexedDB. The Kaiord App persists every workout, template, profile, and setting in a local Dexie.js / IndexedDB database (KaiordDatabase in dexie-database.ts).
  • Opens offline after one visit. A service worker scoped to the Kaiord App keeps the files of the version you loaded, checked byte for byte, so the App opens and shows the Day and the Calendar with no network. Connections, sync and the assistant still need one.
  • Conversions run on your machine. In the Kaiord App and in @kaiord/cli, FIT / TCX / ZWO / GCN ↔ KRD conversion happens in-process (import-workout-formats.ts, export-workout-formats.ts).
  • The assistant calls the AI provider whose key you enter. Anthropic, OpenAI or Google is called directly from your browser, with what the conversation needs, including summaries of your workouts and health data. The App's content security policy lists those three hosts and no other model service.
  • Each extension reaches one platform, with your own session. Garmin Connect, Train2Go, Tanita, TrainingPeaks and WHOOP each have their own browser extension, which may only reach that platform's hosts. The Garmin extension keeps its Garmin tokens in your browser; they never travel to Kaiord.
  • intervals.icu, if you save its API key. The App sends the key to intervals.icu to check it.
  • Sync is opt-in and goes to your cloud. If you connect Google Drive, the cloud-sync adapter uses the Google Identity Services drive.appdata scope, so synced data lands in your own Drive's app folder.

πŸ“š Documentation

Comprehensive documentation is available in the /docs directory:

  • Getting Started - Installation, basic usage, and quick examples for both library and CLI
  • Architecture - Hexagonal architecture, ports & adapters pattern, and design principles
  • Testing - Testing strategy, TDD workflow, and coverage requirements
  • Deployment - CI/CD pipeline, GitHub Pages deployment, and npm publishing
  • Contributing - Contribution guidelines, development workflow, and code standards
  • KRD Format - Complete specification of the Kaiord Representation Definition format
  • AI Agents - Guidance for AI-assisted development

🧩 Tech Stack

LayerTooling
CoreTypeScript, tsdown, Zod
CLIyargs
Kaiord AppReact, Zustand, Tailwind, Radix UI
TestingVitest, Playwright
Package managerpnpm

πŸ— Monorepo Layout

Code
kaiord/
β”œβ”€ packages/
β”‚  β”œβ”€ core/                β†’ domain types, schemas, ports & use cases
β”‚  β”œβ”€ fit/                 β†’ Garmin FIT format adapter
β”‚  β”œβ”€ tcx/                 β†’ Training Center XML adapter
β”‚  β”œβ”€ zwo/                 β†’ Zwift ZWO format adapter
β”‚  β”œβ”€ garmin/              β†’ Garmin Connect API adapter
β”‚  β”œβ”€ cli/                 β†’ command-line interface
β”‚  β”œβ”€ mcp/                 β†’ MCP server for AI/LLM integration
β”‚  └─ workout-spa-editor/  β†’ the Kaiord App (https://kaiord.com/app/)
β”œβ”€ docs/   β†’ documentation
β”œβ”€ LICENSE
β”œβ”€ README.md
└─ pnpm-workspace.yaml

πŸš€ Quick Start

Try the Kaiord App

Open the Kaiord App β†’

Create and edit workouts in your browser. No installation required.

Use the Library

bash
pnpm install
pnpm -r build
pnpm -r test

# Example usage
pnpm kaiord --help

For detailed installation instructions and usage examples, see the Getting Started Guide.


πŸš€ CI/CD Pipeline

Kaiord uses GitHub Actions for continuous integration and deployment:

  • Automated Testing: Tests on Node.js 22 and 24
  • Code Quality: ESLint, Prettier, and TypeScript strict mode validation
  • Release Automation: Changesets for version management and npm publishing
  • Security: Dependency vulnerability audits on every pull request, on every push to main and weekly, CodeQL static analysis, and automated dependency updates

For complete CI/CD documentation, deployment guides, and npm publishing instructions, see Deployment.

Mechanical invariant guards

Beyond linting, the repo enforces its architecture and conventions with purpose-built guard scripts under scripts/, each with its own co-located test suite. They run on every commit (husky pre-commit) and in CI (pnpm test:scripts), and cover, among others:

  • Hexagonal architecture β€” layer purity, adapter isolation, and the packages/core/src/ directory allowlist (check-architecture.mjs)
  • Package dependency graph β€” every @kaiord/* dependency must match the spec table (check-package-deps.mjs)
  • Test conventions β€” should -prefixed titles and Arrange/Act/Assert structure on every test (check-test-title-should.mjs, check-test-aaa.mjs)
  • Privacy β€” no runtime values interpolated into toasts or console logs (check-no-pii-leakage.mjs)
  • State discipline β€” no Zustand store writes persistence directly (check-no-zustand-writethrough.mjs)
  • Spec hygiene β€” OpenSpec format, archive dates, and auto-generated indexes stay in sync (check-spec-format.mjs, check-archive-*.mjs)

If a rule matters here, a script enforces it β€” documentation describes the rules, but the guards are what make them true.

Contributing

To contribute to Kaiord:

  1. Fork and clone the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Make your changes following the code style guidelines
  4. Add a changeset: pnpm exec changeset (for version-worthy changes)
  5. Test locally: pnpm -r test and pnpm -r build
  6. Submit a PR: All checks must pass before merging

For detailed contribution guidelines, development workflow, and code standards, see Contributing.


πŸ“š References & Resources

Format Specifications


❀️ Support

If you find Kaiord useful, consider supporting its development:

Your support helps maintain and improve Kaiord for the fitness community!

Built by Pablo Albaladejo


πŸ“œ License

MIT Β© 2025 Pablo Albaladejo See LICENSE for details.