⚽ Football Assistant Coach

AI-powered player selection based on team chemistry, training performance, and form

Python Claude Haiku Streamlit Plotly Anthropic SDK Multi-Agent

📋 Project Overview

Challenge: Selecting the starting lineup for a 22-player squad is one of the hardest decisions a coach makes each week. Form fluctuates. Training observations are subjective. And traditional coaching instincts can favour star players over team players — even when the data says otherwise.

Solution: Football Assistant Coach runs four AI-evaluated training sessions every week, scores each player on team chemistry (max 50), individual performance (max 35), and universal metrics (max 15), then recommends the optimal Starting XI, bench, and identifies players at transfer risk — all using a formation-aware selection engine.

Key Design Decisions

📊 Scoring System

50
Team Chemistry (max)
35
Individual Performance (max)
15
Universal Metrics (max)
100
Total Score

Selection Thresholds

Form ScoreStatus
65 and aboveStarting XI eligible
50 – 64Bench eligible
40 – 49Unused — needs more training
Below 40 (2 weeks)Transfer shortlist

Training Session Weights

DaySessionWeightFocus
MondayFitness & Conditioning15%Universal 60%, Individual 30%, Chemistry 10%
WednesdayPosition-Specific Drill25%Individual 70%, Universal 20%, Chemistry 10%
ThursdayTactical Shape & Pressing25%Chemistry 70%, Individual 10%, Universal 20%
FridayFull Team Scrimmage35%Equal thirds

⚙️ How It Works

22-Player Squad

2 GK, 6 DEF, 8 MID, 6 FWD — each with name, age, style, strength, weakness, and base form built in. No external dataset required.

Position-Specific AI Coach

Claude Haiku takes on the role of a goalkeeping coach, defensive coach, midfield coach, or attacking coach — matching the persona to each player's position.

4 Sessions Per Week

Each player is evaluated in Monday fitness, Wednesday drills, Thursday tactics, and Friday scrimmage. Each session has different scoring weights.

Formation Advisor

After simulation, the app scores all three formations against the week's in-form players and warns you if your preferred formation isn't the best fit.

Transfer Risk Detection

Players who score below 40 for two consecutive weeks are automatically flagged on the transfer shortlist — a pattern-based warning, not a one-off bad session.

Bench Coverage Rule

Bench always includes 1 GK before filling the remaining 4 spots. Ensures position coverage for substitutions in any match scenario.

🛠️ Tech Stack

Python 3 Claude Haiku (Anthropic) Streamlit Plotly Pandas python-dotenv Rich (CLI) Anthropic SDK

Architecture

Sample Claude Output (per player per session)

{ "individual_score": 28, "chemistry_score": 41, "universal_score": 12, "highlight": "Excellent pressing coordination during shape drills.", "concern": "Needs to improve distribution under pressure." }

🚀 Setup & Run

pip install -r requirements.txt

Add your Anthropic API key to the .env file, then:

# Double-click run.bat (Windows) # or run manually: streamlit run app.py

The app opens at http://localhost:8501. Pick formation → click Run Training Week → review selection.