intervals-icu-sync
Copilot instructions25 starsChanged 25 days agoMITView on GitHub
All code, comments, variable names, function names, and documentation must be written in English. This project fetches, analyzes, and exports cycling training data from the intervals.icu API.
- Reads credentials
The file
We split this copilot-instructions.md into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 5
All code, comments, variable names, function names, and documentation must be written in English.
- Very specific: line 49
All scripts are runnable directly: python scripts/<script>.py
- Very specific: line 53
Use pathlib.Path for all file path handling — never os.path.
- Very specific: line 54
Keep functions small and named clearly.
- Very specific: line 55
No hardcoded credentials. Always read from environment variables via config.py.
- Very specific: line 78
Never commit .env or any file containing credentials.
- Distinctive: line 79
Never log or print the API key.
≈ “Common” is an estimate: at least 1 in 5 of the 3,894 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions
Language
All code, comments, variable names, function names, and documentation must be written in English.
README
- The
README.mdmust be kept up to date. - Whenever a new script is added or an existing script is changed, update the relevant section in
README.md. - The project structure section in
README.mdmust reflect the actual file layout at all times. - Usage examples in
README.mdmust match the current script behavior (arguments, output filenames, etc.).
Project Overview
This project fetches, analyzes, and exports cycling training data from the intervals.icu API.
- Language: Python 3.12+
- Virtual environment:
.venv/ - Dependencies:
requirements.txt - Configuration:
.envfile (never committed);API_KEYandATHLETE_IDare loaded viasrc/intervals_icu/config.py
Project Structure
intervals-icu-sync/
├── scripts/ # Runnable entry-point scripts
│ ├── get_activities.py # Fetch activities → data/raw/
│ ├── get_metrics.py # Fetch athlete metrics → data/processed/
│ ├── analyze_week.py # Analyze current calendar week (Joe Friel)
│ ├── prepare_activities_for_coach.py # Export simplified JSON for coach/ChatGPT
│ ├── fueling_analysis.py # Analyze carbohydrate fueling quality
│ └── prepare_week_for_coach.py # Run all scripts in sequence
├── src/
│ └── intervals_icu/
│ ├── __init__.py
│ ├── client.py # HTTP client (intervals.icu API)
│ └── config.py # Loads API_KEY, ATHLETE_ID from .env
├── data/
│ ├── raw/ # Raw API responses (git-ignored)
│ └── processed/ # Derived JSON exports (git-ignored)
├── .env.example
├── requirements.txt
└── README.mdCode Conventions
- All scripts are runnable directly:
python scripts/<script>.py - Scripts import from
src/usingsys.pathinsertion or the package being installed in editable mode. - Raw data is always saved to
data/raw/, processed/derived data todata/processed/. - Output filenames include an ISO date (Monday of the current week or today) for traceability.
- Use
pathlib.Pathfor all file path handling — neveros.path. - Keep functions small and named clearly. Each script has a
main()entry point. - No hardcoded credentials. Always read from environment variables via
config.py.
Data Flow
intervals.icu API
→ get_activities.py → data/raw/activities_{date}.json
→ get_metrics.py → data/processed/metrics_{date}.json
→ prepare_activities_for_coach.py → data/processed/coach_input_{monday}.json
→ fueling_analysis.py → data/processed/fueling_analysis_{monday}.json
→ analyze_week.py → console output only
(prepare_week_for_coach.py runs all of the above in order)intervals.icu API
- Base URL:
https://intervals.icu/api/v1 - Auth: HTTP Basic with
auth=("API_KEY", api_key)— the username is literally"API_KEY" - Activity source filter:
source != "STRAVA"(keeps Garmin Connect and manual uploads) - Date range for activity fetches: Monday of the previous week → today
Security
- Never commit
.envor any file containing credentials. - Never log or print the API key.
- Validate all external data at the boundary (API responses may be
Noneor missing fields).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

