agentleFS
sugarforeversugarforever/01coder-agent-skills/skills/fpl-copilot/SKILL.md

fpl-copilot

Skill136 starsChanged 9 months agoMITView on GitHub

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.

The file

Show its rules and text

We split this skill into the rules it gives an agent

20 rules. About 0 are common, 7 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the database doesn't exist or data is stale, sync first.

    line 38
  2. Very specific:

    Read references/analysis.md for formulas and example SQL queries.

    line 69
  3. Very specific:

    Read references/squad.md for squad management, persistence format, and multi-squad support.

    line 70
  4. Very specific:

    Single self-contained .html file: No build step. CSS in <style>, JS in <script>, SVG inlined.

    line 94
  5. Very specific:

    Vanilla HTML/CSS/JS only: No Tailwind, no shadcn, no external CDN, no web fonts.

    line 95
  6. Very specific:

    Tell the user the path: after saving. On macOS, offer open <path> to view in their default browser.

    line 98
  7. Very specific:

    Adapt the template, don't write from scratch: Read the matching file in templates/, replace the placeholder data with real values from SQL, …

    line 99
  8. Distinctive:

    Read these BEFORE answering questions in their domain:

    line 105
  9. Very specific:

    On squad identification: When the user shares their squad (screenshot, text, or any format), immediately save it to ~/.fplcopilot/squads/.

    line 121
  10. Distinctive:

    On squad changes: When the user makes a transfer, changes captain, uses a chip, or modifies their squad in any way, update the squad file …

    line 122
  11. Very specific:

    On conversation start: If the user asks about "my squad" or "my team", check ~/.fplcopilot/squads/ for existing squad files first.

    line 123
  12. Distinctive:

    On analysis: After generating a strategy report or analysis, update the squad file's Notes section with key takeaways.

    line 124
  13. Very specific:

    File naming: Use kebab-case slugs derived from the squad name (e.g., my-fpl-team.md, daves-team.md, wildcard-draft.md).

    line 126
  14. Very specific:

    Read references/squad.md for the full markdown format specification.

    line 128
  15. Very specific:

    Always check freshness: before answering data questions.

    line 132
  16. Very specific:

    Always check for saved squads: when the user asks about "my squad/team".

    line 133
  17. Distinctive:

    Never guess player IDs: Look up by name:

    line 134
  18. Distinctive:

    Normalize by price: when comparing players: value = points / (cost in millions).

    line 145
  19. Very specific:

    Fetch player detail on demand: Only run sync.sh player <id> when the user asks about a specific player's match-by-match performance.

    line 146
  20. Distinctive:

    Proactively persist squads: Always save/update squad files after any squad-related interaction.

    line 147

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill 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
SKILL.md

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

sqlite3 ~/.fplcopilot/fplcopilot.db "SELECT * FROM sync_metadata;"

If the database doesn't exist or data is stale, sync first.

2. Sync Data

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

# 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 typeFormatTemplate
Squad view (formation, bench, totals)HTMLtemplates/squad-view.html
Fixture difficulty matrix (teams × next N GWs)HTMLtemplates/fixture-matrix.html
Transfer comparison (out → in, deltas)HTMLtemplates/transfer-comparison.html
Captain ranking with reasoningHTMLtemplates/captain-ranking.html
Gameweek strategy report (squad + fixtures + recs)HTMLtemplates/gameweek-report.html
Single-stat lookup ("Salah's form?")markdown—
Short reasoning ("Bench Haaland this week?")markdown—
Deadline, price changes, one-line answersmarkdown—
3-row SQL resultmarkdown—

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 <style>, JS in <script>, SVG inlined.
  2. Vanilla HTML/CSS/JS only. No Tailwind, no shadcn, no external CDN, no web fonts.
  3. Mobile responsive. Include <meta name="viewport" content="width=device-width, initial-scale=1">. Layout survives a phone viewport.
  4. Save to ~/.fplcopilot/reports/{YYYY-MM-DD}-{slug}.html. Create the directory with mkdir -p if missing.
  5. Tell the user the path after saving. On macOS, offer open <path> to view in their default browser.
  6. Adapt the template, don't write from scratch. Read the matching file in templates/, replace the placeholder data with real values from SQL, save the result.

Before generating any HTML report, read references/html-output.md for color tokens, typography, the team-color table, the sortable-table snippet, and the list of anti-patterns to avoid.

Reference Docs

Read these BEFORE answering questions in their domain:

DocWhen to Read
references/api.mdUnderstanding FPL API endpoints and data structure
references/analysis.mdComputing metrics (VAPM, projected points, FDR, momentum, etc.)
references/squad.mdSquad persistence, management, multi-squad, scoring rules
references/schema.sqlUnderstanding database tables and columns
references/html-output.mdStyling rules, color tokens, team colors, anti-patterns for HTML reports

Squad Persistence

Squads are stored as markdown files in ~/.fplcopilot/squads/ — one file per squad. This enables multi-squad support (user's own team, friends' teams, draft plans).

Proactive persistence rules — the agent MUST follow these:

  1. On squad identification: When the user shares their squad (screenshot, text, or any format), immediately save it to ~/.fplcopilot/squads/. Ask for a name if unclear.
  2. On squad changes: When the user makes a transfer, changes captain, uses a chip, or modifies their squad in any way, update the squad file immediately after confirming the change.
  3. On conversation start: If the user asks about "my squad" or "my team", check ~/.fplcopilot/squads/ for existing squad files first. List available squads if multiple exist.
  4. On analysis: After generating a strategy report or analysis, update the squad file's Notes section with key takeaways.
  5. Multi-squad: Users may discuss multiple squads (their own, friends', draft plans). Each gets its own file. The user can specify which squad by name.
  6. File naming: Use kebab-case slugs derived from the squad name (e.g., my-fpl-team.md, daves-team.md, wildcard-draft.md).

Read references/squad.md for the full markdown format specification.

Agent Rules

  1. Always check freshness before answering data questions. If sync_metadata shows stale data (bootstrap > 6h, fixtures on match day > 2h), run the sync script first.
  2. Always check for saved squads when the user asks about "my squad/team". Read ~/.fplcopilot/squads/ before asking the user to re-share.
  3. Never guess player IDs. Look up by name:
    -- Try exact web_name first, then partial, then full name
    SELECT * FROM players WHERE web_name = 'Salah' COLLATE NOCASE;
    SELECT * FROM players WHERE web_name LIKE '%salah%' COLLATE NOCASE;
    SELECT * FROM players WHERE (first_name || ' ' || last_name) LIKE '%salah%' COLLATE NOCASE;
  4. Price units: now_cost is in 0.1m units. 130 = £13.0m. Always display as £X.Xm.
  5. Position codes: GKP, DEF, MID, FWD (mapped from API's 1, 2, 3, 4).
  6. Status codes: a=available, d=doubtful, i=injured, s=suspended, u=unavailable.
  7. FDR scale: 1 (very easy) to 5 (very hard).
  8. Normalize by price when comparing players: value = points / (cost in millions).
  9. Fetch player detail on demand: Only run sync.sh player <id> when the user asks about a specific player's match-by-match performance. Don't batch-fetch unless explicitly needed.
  10. Proactively persist squads: Always save/update squad files after any squad-related interaction. Never rely on conversation context alone.
  11. Generate HTML for spatial outputs: Any request that maps to a template in templates/ — "plan gameweek" / "next gameweek team" → gameweek-report.html; "show/view my squad", formation, bench → squad-view.html; "compare transfer", out → in → transfer-comparison.html; "captain pick" with reasoning → captain-ranking.html; fixture run / FDR matrix → fixture-matrix.html — MUST produce the HTML file (saved to ~/.fplcopilot/reports/{YYYY-MM-DD}-{slug}.html) and report the path with an open <path> hint on macOS. Markdown is only for one-line / single-stat lookups, short reasoning, deadlines, price changes, or ≤3-row SQL results.

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.