AI_Cycling_Coach

AGENT.md — Instructions for AI Agents

This file provides context and instructions for AI coding agents (GitHub Copilot, Cursor, Cline, Aider, etc.) working on this codebase.

Project Overview

AI Cycling Coach — a web app where cyclists chat with an AI coaching agent to build training plans. The AI creates workouts on a calendar; users log ride results.

Quick Orientation

What Where
Backend entry point backend/run.py
Flask app factory backend/app/__init__.py
Database models backend/app/models/
API routes backend/app/routes/
AI coach logic backend/app/services/coach_agent.py
Frontend entry frontend/src/main.tsx
React router frontend/src/App.tsx
API client frontend/src/services/api.ts
TypeScript types frontend/src/types/index.ts
Living plan Plan.md (update this as you make changes)

Dev Server Commands

# Backend
cd backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env  # then edit with your API key
python run.py          # http://localhost:5000

# Frontend
cd frontend
npm install
npm run dev            # http://localhost:3000 (proxies /api to :5000)

Coding Conventions

Backend (Python)

Frontend (TypeScript/React)

Common Tasks

Adding a new API endpoint

  1. If needed, add/modify model in backend/app/models/
  2. Create or modify route in backend/app/routes/
  3. Register blueprint in backend/app/__init__.py (if new file)
  4. Add corresponding function in frontend/src/services/api.ts
  5. Add TypeScript types in frontend/src/types/index.ts

Modifying the AI coaching behavior

Adding a new page

  1. Create component folder under frontend/src/components/
  2. Add route in frontend/src/App.tsx
  3. Add nav link in frontend/src/components/Layout/AppLayout.tsx

Skills That Help

Known Limitations (Good First Issues)

Architecture Notes