# felixrieseberg/claude-coach architecture

> Architecture diagram of the GitHub repository felixrieseberg/claude-coach, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/felixrieseberg/claude-coach
- Repository: https://github.com/felixrieseberg/claude-coach

## Overview

Claude Coach combines a Claude skill for athlete assessment and endurance-plan design with CLI tools for importing Strava history and rendering a plan, then a browser viewer for managing workouts and exporting them. The documented workflow starts with athlete context and optional Strava data, proceeds through plan creation, and ends with local plan use and workout exports. The CLI and viewer excerpts show their respective persistence and dispatch behavior; the skill’s detailed internal sequencing is documented but not sampled, so its finer-grained links are omitted.

Main entry points: [`src/cli.ts`](https://github.com/felixrieseberg/claude-coach/blob/main/src/cli.ts) (Plan CLI), [`skill/SKILL.md`](https://github.com/felixrieseberg/claude-coach/blob/main/skill/SKILL.md) (Coaching skill), [`src/viewer/App.svelte`](https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/App.svelte) (Plan application), [`src/viewer/lib/export/index.ts`](https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/lib/export/index.ts) (Export dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_coaching["Coaching workflow"]
  node_skill["Coaching skill<br/>[SKILL.md]"]
  node_assessment["Fitness assessment<br/>[assessment.md]"]
  node_training_principles["Training principles<br/>[load-management.md]"]
  node_periodization["Periodization<br/>[periodization.md]"]
  node_workout_guidance["Workout guidance<br/>[workouts.md]"]
  node_race_day["Race strategy<br/>[race-day.md]"]
  node_training_plan["Training plan model<br/>[training-plan.ts]"]
end

subgraph group_cli["CLI and sync"]
  node_cli["Plan CLI<br/>[cli.ts]"]
  node_configuration["CLI configuration<br/>[config.ts]"]
  node_oauth["Strava authorization<br/>[oauth.ts]"]
  node_strava_api["Strava activity API<br/>[api.ts]"]
  node_sqlite[("Training database<br/>[client.ts]")]
end

subgraph group_viewer["Plan viewer"]
  node_viewer["Plan application<br/>[App.svelte]"]
  node_plan_state["Plan data state<br/>[plan.ts]"]
  node_settings_state["Settings state<br/>[settings.ts]"]
  node_changes_state["Workout changes<br/>[changes.ts]"]
  node_weeks["Workout calendar"]
end

subgraph group_exports["Workout exports"]
  node_export_router["Export dispatcher<br/>[index.ts]"]
  node_ics["Calendar export<br/>[ics.ts]"]
  node_zwo["Zwift export<br/>[zwo.ts]"]
  node_fit["Garmin export<br/>[fit.ts]"]
  node_erg["ERG export<br/>[erg.ts]"]
end

node_athlete(("Athlete"))
node_claude(("Claude"))
node_strava(("Strava"))
node_local_storage[("Browser storage")]
node_export_apps(("Calendar and training apps"))

node_athlete -->|"provides context"| node_claude
node_claude -->|"uses guidance"| node_skill
node_skill -->|"consults"| node_assessment
node_skill -->|"consults"| node_training_principles
node_skill -->|"consults"| node_periodization
node_skill -->|"consults"| node_workout_guidance
node_skill -->|"consults"| node_race_day
node_athlete -->|"runs commands"| node_cli
node_cli -->|"loads credentials"| node_configuration
node_cli -->|"authenticates"| node_oauth
node_oauth -->|"exchanges tokens"| node_strava
node_cli -->|"fetches activities"| node_strava_api
node_strava_api -->|"requests activities"| node_strava
node_cli -->|"stores activity data"| node_sqlite
node_strava -->|"returns athlete data"| node_cli
node_claude -->|"creates plan data"| node_training_plan
node_cli -->|"renders plan"| node_training_plan
node_athlete -->|"views and edits"| node_viewer
node_viewer -->|"loads plan"| node_plan_state
node_viewer -->|"loads and saves settings"| node_settings_state
node_viewer -->|"saves workout edits"| node_changes_state
node_viewer -->|"displays workouts"| node_weeks
node_plan_state -->|"reads and writes"| node_local_storage
node_settings_state -->|"reads and writes"| node_local_storage
node_changes_state -->|"reads and writes"| node_local_storage
node_viewer -->|"requests exports"| node_export_router
node_export_router -->|"generates calendar"| node_ics
node_export_router -->|"generates Zwift"| node_zwo
node_export_router -->|"generates Garmin"| node_fit
node_export_router -->|"generates ERG"| node_erg
node_export_router -->|"downloads files"| node_export_apps

click node_skill "https://github.com/felixrieseberg/claude-coach/blob/main/skill/SKILL.md"
click node_assessment "https://github.com/felixrieseberg/claude-coach/blob/main/skill/reference/assessment.md"
click node_training_principles "https://github.com/felixrieseberg/claude-coach/blob/main/skill/reference/load-management.md"
click node_periodization "https://github.com/felixrieseberg/claude-coach/blob/main/skill/reference/periodization.md"
click node_workout_guidance "https://github.com/felixrieseberg/claude-coach/blob/main/skill/reference/workouts.md"
click node_race_day "https://github.com/felixrieseberg/claude-coach/blob/main/skill/reference/race-day.md"
click node_training_plan "https://github.com/felixrieseberg/claude-coach/blob/main/src/schema/training-plan.ts"
click node_cli "https://github.com/felixrieseberg/claude-coach/blob/main/src/cli.ts"
click node_configuration "https://github.com/felixrieseberg/claude-coach/blob/main/src/lib/config.ts"
click node_oauth "https://github.com/felixrieseberg/claude-coach/blob/main/src/strava/oauth.ts"
click node_strava_api "https://github.com/felixrieseberg/claude-coach/blob/main/src/strava/api.ts"
click node_sqlite "https://github.com/felixrieseberg/claude-coach/blob/main/src/db/client.ts"
click node_viewer "https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/App.svelte"
click node_plan_state "https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/stores/plan.ts"
click node_settings_state "https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/stores/settings.ts"
click node_changes_state "https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/stores/changes.ts"
click node_weeks "https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/components/WeeksContainer.svelte"
click node_export_router "https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/lib/export/index.ts"
click node_ics "https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/lib/export/ics.ts"
click node_zwo "https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/lib/export/zwo.ts"
click node_fit "https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/lib/export/fit.ts"
click node_erg "https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/lib/export/erg.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_skill,node_assessment,node_training_principles,node_periodization,node_workout_guidance,node_race_day,node_training_plan toneBlue
class node_cli,node_configuration,node_oauth,node_strava_api,node_sqlite,node_local_storage toneAmber
class node_viewer,node_plan_state,node_settings_state,node_changes_state,node_weeks toneMint
class node_export_router,node_ics,node_zwo,node_fit,node_erg toneRose
class node_athlete,node_claude,node_strava,node_export_apps toneIndigo
```

## Components

### Coaching workflow

- [Coaching skill](https://github.com/felixrieseberg/claude-coach/blob/main/skill/SKILL.md): `skill/SKILL.md`
- [Fitness assessment](https://github.com/felixrieseberg/claude-coach/blob/main/skill/reference/assessment.md): `skill/reference/assessment.md`
- [Training principles](https://github.com/felixrieseberg/claude-coach/blob/main/skill/reference/load-management.md): `skill/reference/load-management.md`
- [Periodization](https://github.com/felixrieseberg/claude-coach/blob/main/skill/reference/periodization.md): `skill/reference/periodization.md`
- [Workout guidance](https://github.com/felixrieseberg/claude-coach/blob/main/skill/reference/workouts.md): `skill/reference/workouts.md`
- [Race strategy](https://github.com/felixrieseberg/claude-coach/blob/main/skill/reference/race-day.md): `skill/reference/race-day.md`
- [Training plan model](https://github.com/felixrieseberg/claude-coach/blob/main/src/schema/training-plan.ts): `src/schema/training-plan.ts`

### CLI and sync

- [Plan CLI](https://github.com/felixrieseberg/claude-coach/blob/main/src/cli.ts): `src/cli.ts`
- [CLI configuration](https://github.com/felixrieseberg/claude-coach/blob/main/src/lib/config.ts): `src/lib/config.ts`
- [Strava authorization](https://github.com/felixrieseberg/claude-coach/blob/main/src/strava/oauth.ts): `src/strava/oauth.ts`
- [Strava activity API](https://github.com/felixrieseberg/claude-coach/blob/main/src/strava/api.ts): `src/strava/api.ts`
- [Training database](https://github.com/felixrieseberg/claude-coach/blob/main/src/db/client.ts): `src/db/client.ts`

### Plan viewer

- [Plan application](https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/App.svelte): `src/viewer/App.svelte`
- [Plan data state](https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/stores/plan.ts): `src/viewer/stores/plan.ts`
- [Settings state](https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/stores/settings.ts): `src/viewer/stores/settings.ts`
- [Workout changes](https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/stores/changes.ts): `src/viewer/stores/changes.ts`
- [Workout calendar](https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/components/WeeksContainer.svelte): `src/viewer/components/WeeksContainer.svelte`

### Workout exports

- [Export dispatcher](https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/lib/export/index.ts): `src/viewer/lib/export/index.ts`
- [Calendar export](https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/lib/export/ics.ts): `src/viewer/lib/export/ics.ts`
- [Zwift export](https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/lib/export/zwo.ts): `src/viewer/lib/export/zwo.ts`
- [Garmin export](https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/lib/export/fit.ts): `src/viewer/lib/export/fit.ts`
- [ERG export](https://github.com/felixrieseberg/claude-coach/blob/main/src/viewer/lib/export/erg.ts): `src/viewer/lib/export/erg.ts`

### Other components

- **Athlete**
- **Claude**
- **Strava**
- **Browser storage**
- **Calendar and training apps**

## Connections

- Athlete → Claude: provides context
- Claude → Coaching skill: uses guidance
- Coaching skill → Fitness assessment: consults
- Coaching skill → Training principles: consults
- Coaching skill → Periodization: consults
- Coaching skill → Workout guidance: consults
- Coaching skill → Race strategy: consults
- Athlete → Plan CLI: runs commands
- Plan CLI → CLI configuration: loads credentials
- Plan CLI → Strava authorization: authenticates
- Strava authorization → Strava: exchanges tokens
- Plan CLI → Strava activity API: fetches activities
- Strava activity API → Strava: requests activities
- Plan CLI → Training database: stores activity data
- Strava → Plan CLI: returns athlete data
- Claude → Training plan model: creates plan data
- Plan CLI → Training plan model: renders plan
- Athlete → Plan application: views and edits
- Plan application → Plan data state: loads plan
- Plan application → Settings state: loads and saves settings
- Plan application → Workout changes: saves workout edits
- Plan application → Workout calendar: displays workouts
- Plan data state → Browser storage: reads and writes
- Settings state → Browser storage: reads and writes
- Workout changes → Browser storage: reads and writes
- Plan application → Export dispatcher: requests exports
- Export dispatcher → Calendar export: generates calendar
- Export dispatcher → Zwift export: generates Zwift
- Export dispatcher → Garmin export: generates Garmin
- Export dispatcher → ERG export: generates ERG
- Export dispatcher → Calendar and training apps: downloads files
