agentleFS
rbrandsrbrands/intervals-icu-sync/.github/copilot-instructions.md

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
  1. Distinctive:

    All code, comments, variable names, function names, and documentation must be written in English.

    line 5
  2. Very specific:

    All scripts are runnable directly: python scripts/<script>.py

    line 49
  3. Very specific:

    Use pathlib.Path for all file path handling — never os.path.

    line 53
  4. Very specific:

    Keep functions small and named clearly.

    line 54
  5. Very specific:

    No hardcoded credentials. Always read from environment variables via config.py.

    line 55
  6. Very specific:

    Never commit .env or any file containing credentials.

    line 78
  7. Distinctive:

    Never log or print the API key.

    line 79

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Copilot Instructions

Language

All code, comments, variable names, function names, and documentation must be written in English.

README

  • The README.md must 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.md must reflect the actual file layout at all times.
  • Usage examples in README.md must 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: .env file (never committed); API_KEY and ATHLETE_ID are loaded via src/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.md

Code Conventions

  • All scripts are runnable directly: python scripts/<script>.py
  • Scripts import from src/ using sys.path insertion or the package being installed in editable mode.
  • Raw data is always saved to data/raw/, processed/derived data to data/processed/.
  • Output filenames include an ISO date (Monday of the current week or today) for traceability.
  • Use pathlib.Path for all file path handling — never os.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 .env or any file containing credentials.
  • Never log or print the API key.
  • Validate all external data at the boundary (API responses may be None or missing fields).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.