--- name: fpl-copilot version: 1.2.0 description: "Fantasy Premier League copilot: syncs live FPL data, analyzes players/teams/fixtures, manages your fantasy squad, and generates self-contained HTML reports for squads, fixtures, transfers, captain picks, and gameweek strategy. Use when the user asks about FPL, player stats, transfer advice, captain picks, fixture difficulty, gameweek strategy, or squad management." metadata: requires: bins: ["curl", "jq", "sqlite3"] --- # FPL Copilot Fantasy Premier League data sync, analysis, and squad management. - **FPL data**: SQLite database at `~/.fplcopilot/fplcopilot.db` - **User squads**: Markdown files in `~/.fplcopilot/squads/` ## When to Use Activate this skill when the user mentions: - FPL, Fantasy Premier League, fantasy football (UK context) - Player stats, form, price, points, xG, xA, ICT, ownership - Transfer advice, who to buy/sell, budget options - Captain pick, vice-captain, chip timing - Fixture difficulty, FDR, schedule, easy/hard fixtures - Gameweek deadline, scores, standings, averages - Squad management, team composition, formation - Team analysis: momentum, xG differential, leaky defences, hot attacks - Rotation pairs, differential picks, value picks ## Quick Start ### 1. Check Data Freshness ```bash sqlite3 ~/.fplcopilot/fplcopilot.db "SELECT * FROM sync_metadata;" ``` If the database doesn't exist or data is stale, sync first. ### 2. Sync Data ```bash SYNC="${CLAUDE_PLUGIN_ROOT}/skills/fpl-copilot/references/sync.sh" # First time or daily refresh $SYNC bootstrap # Teams, gameweeks, ~600 players (~5s) $SYNC fixtures # All 380 fixtures (~2s) # On demand — single player's match history $SYNC player 328 # e.g., Salah's detailed GW-by-GW stats # Batch — all players' histories (slow, ~60s, rate-limited) $SYNC player-stats # Everything at once $SYNC all # Bypass freshness checks $SYNC bootstrap --force ``` ### 3. Query and Analyze ```bash # All queries go through sqlite3 sqlite3 ~/.fplcopilot/fplcopilot.db "SELECT web_name, position, form, total_points, now_cost FROM players ORDER BY form DESC LIMIT 10;" ``` Read `references/analysis.md` for formulas and example SQL queries. Read `references/squad.md` for squad management, persistence format, and multi-squad support. ## Output Format: HTML vs Markdown Many FPL outputs are inherently spatial or color-coded — formation, FDR matrix, transfer comparison. For those, generate a self-contained **HTML report** instead of a markdown table. For quick lookups and one-shot answers, stay in markdown. ### When to output HTML | Output type | Format | Template | |---|---|---| | Squad view (formation, bench, totals) | HTML | `templates/squad-view.html` | | Fixture difficulty matrix (teams × next N GWs) | HTML | `templates/fixture-matrix.html` | | Transfer comparison (out → in, deltas) | HTML | `templates/transfer-comparison.html` | | Captain ranking with reasoning | HTML | `templates/captain-ranking.html` | | Gameweek strategy report (squad + fixtures + recs) | HTML | `templates/gameweek-report.html` | | Single-stat lookup ("Salah's form?") | markdown | — | | Short reasoning ("Bench Haaland this week?") | markdown | — | | Deadline, price changes, one-line answers | markdown | — | | 3-row SQL result | markdown | — | Heuristic: if the user will *refer back to it, share it, or scan it visually* → HTML. If they glance and move on → markdown. ### Universal rules for HTML output 1. **Single self-contained `.html` file.** No build step. CSS in `