fpl-copilot
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFPL Copilot
FPL 助手
Fantasy Premier League data sync, analysis, and squad management.
- FPL data: SQLite database at
~/.fplcopilot/fplcopilot.db - User squads: Markdown files in
~/.fplcopilot/squads/
梦幻英超(Fantasy Premier League)数据同步、分析与阵容管理工具。
- FPL数据: 存储于的SQLite数据库
~/.fplcopilot/fplcopilot.db - 用户阵容: 存储于目录下的Markdown文件
~/.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
当用户提及以下内容时激活该技能:
- FPL、Fantasy Premier League、梦幻足球(英国语境)
- 球员数据、状态、身价、得分、预期进球(xG)、预期助攻(xA)、ICT指数、持有率
- 转会建议、引援/出售人选、预算方案
- 队长选择、副队长选择、特殊芯片使用时机
- 赛程难度、FDR(赛程难度评级)、赛程安排、难易赛程
- 周赛截止时间、比分、排名、平均数据
- 阵容管理、球队构成、阵型
- 球队分析:势头、预期进球差值、防守漏洞、进攻火力
- 轮换组合、差异化人选、性价比人选
Quick Start
快速开始
1. Check Data Freshness
1. 检查数据新鲜度
bash
sqlite3 ~/.fplcopilot/fplcopilot.db "SELECT * FROM sync_metadata;"If the database doesn't exist or data is stale, sync first.
bash
sqlite3 ~/.fplcopilot/fplcopilot.db "SELECT * FROM sync_metadata;"若数据库不存在或数据过期,请先同步数据。
2. Sync Data
2. 同步数据
bash
SYNC="${CLAUDE_PLUGIN_ROOT}/skills/fpl-copilot/references/sync.sh"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)
$SYNC bootstrap # 同步球队、周赛信息、约600名球员(约5秒)
$SYNC fixtures # 同步全部380场赛程(约2秒)
On demand — single player's match history
按需同步 — 单个球员的赛事历史
$SYNC player 328 # e.g., Salah's detailed GW-by-GW stats
$SYNC player 328 # 例如:萨拉赫的详细逐周数据
Batch — all players' histories (slow, ~60s, rate-limited)
批量同步 — 所有球员的历史数据(较慢,约60秒,受速率限制)
$SYNC player-stats
$SYNC player-stats
Everything at once
同步全部数据
$SYNC all
$SYNC all
Bypass freshness checks
跳过新鲜度检查强制同步
$SYNC bootstrap --force
undefined$SYNC bootstrap --force
undefined3. Query and Analyze
3. 查询与分析
bash
undefinedbash
undefinedAll queries go through sqlite3
所有查询通过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.sqlite3 ~/.fplcopilot/fplcopilot.db "SELECT web_name, position, form, total_points, now_cost FROM players ORDER BY form DESC LIMIT 10;"
请阅读`references/analysis.md`了解计算公式和SQL查询示例。
请阅读`references/squad.md`了解阵容管理、持久化格式及多阵容支持。Output Format: HTML vs Markdown
输出格式: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.
许多FPL输出内容天生具有空间性或需要颜色编码——比如阵型、FDR矩阵、转会对比。对于这类内容,请生成独立的HTML报告而非Markdown表格。对于快速查询和一次性回答,使用Markdown格式即可。
When to output HTML
何时输出HTML
| Output type | Format | Template |
|---|---|---|
| Squad view (formation, bench, totals) | HTML | |
| Fixture difficulty matrix (teams × next N GWs) | HTML | |
| Transfer comparison (out → in, deltas) | HTML | |
| Captain ranking with reasoning | HTML | |
| Gameweek strategy report (squad + fixtures + recs) | 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.
| 输出类型 | 格式 | 模板 |
|---|---|---|
| 阵容视图(阵型、替补、总计) | HTML | |
| 赛程难度矩阵(球队 × 接下来N周) | HTML | |
| 转会对比(转出→转入、差值) | HTML | |
| 队长排名及理由 | HTML | |
| 周赛策略报告(阵容+赛程+建议) | HTML | |
| 单一数据查询(如“萨拉赫的状态如何?”) | Markdown | — |
| 简短分析(如“本周是否让哈兰德替补?”) | Markdown | — |
| 截止时间、身价变化、单行回答 | Markdown | — |
| 3行以内的SQL查询结果 | Markdown | — |
判断准则:如果用户会反复查看、分享或视觉扫描内容→使用HTML;如果用户只是快速浏览→使用Markdown。
Universal rules for HTML output
HTML输出通用规则
- Single self-contained file. No build step. CSS in
.html, JS in<style>, SVG inlined.<script> - Vanilla HTML/CSS/JS only. No Tailwind, no shadcn, no external CDN, no web fonts.
- Mobile responsive. Include . Layout survives a phone viewport.
<meta name="viewport" content="width=device-width, initial-scale=1"> - Save to . Create the directory with
~/.fplcopilot/reports/{YYYY-MM-DD}-{slug}.htmlif missing.mkdir -p - Tell the user the path after saving. On macOS, offer to view in their default browser.
open <path> - Adapt the template, don't write from scratch. Read the matching file in , replace the placeholder data with real values from SQL, save the result.
templates/
Before generating any HTML report, read for color tokens, typography, the team-color table, the sortable-table snippet, and the list of anti-patterns to avoid.
references/html-output.md- 生成单一独立的文件。无需构建步骤,CSS内嵌于
.html,JS内嵌于<style>,SVG内嵌到文件中。<script> - 仅使用原生HTML/CSS/JS。禁止使用Tailwind、shadcn、外部CDN或网络字体。
- 适配移动端。需包含,确保布局在手机视口中正常显示。
<meta name="viewport" content="width=device-width, initial-scale=1"> - 保存路径:。若目录不存在,使用
~/.fplcopilot/reports/{YYYY-MM-DD}-{slug}.html创建。mkdir -p - 告知用户路径:保存后需告知用户文件路径。在macOS系统中,可建议使用在默认浏览器中打开。
open <path> - 基于模板修改,而非从零编写:阅读目录下的对应模板文件,将占位数据替换为SQL查询得到的真实数据,然后保存结果。
templates/
生成任何HTML报告前,请阅读,了解颜色标记、排版、球队颜色表、可排序表格代码片段及需避免的反模式。
references/html-output.mdReference Docs
参考文档
Read these BEFORE answering questions in their domain:
| Doc | When to Read |
|---|---|
| Understanding FPL API endpoints and data structure |
| Computing metrics (VAPM, projected points, FDR, momentum, etc.) |
| Squad persistence, management, multi-squad, scoring rules |
| Understanding database tables and columns |
| Styling rules, color tokens, team colors, anti-patterns for HTML reports |
在回答对应领域的问题前,请先阅读以下文档:
| 文档 | 阅读时机 |
|---|---|
| 了解FPL API端点和数据结构时 |
| 计算指标(VAPM、预计得分、FDR、势头等)时 |
| 了解阵容持久化、管理、多阵容支持及得分规则时 |
| 了解数据库表和列结构时 |
| 了解HTML报告的样式规则、颜色标记、球队颜色及反模式时 |
Squad Persistence
阵容持久化
Squads are stored as markdown files in — one file per squad. This enables multi-squad support (user's own team, friends' teams, draft plans).
~/.fplcopilot/squads/Proactive persistence rules — the agent MUST follow these:
- On squad identification: When the user shares their squad (screenshot, text, or any format), immediately save it to . Ask for a name if unclear.
~/.fplcopilot/squads/ - 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.
- On conversation start: If the user asks about "my squad" or "my team", check for existing squad files first. List available squads if multiple exist.
~/.fplcopilot/squads/ - On analysis: After generating a strategy report or analysis, update the squad file's Notes section with key takeaways.
- 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.
- File naming: Use kebab-case slugs derived from the squad name (e.g., ,
my-fpl-team.md,daves-team.md).wildcard-draft.md
Read for the full markdown format specification.
references/squad.md阵容以Markdown文件形式存储于目录下——每个阵容对应一个文件。这支持多阵容管理(用户自己的球队、朋友的球队、 draft方案)。
~/.fplcopilot/squads/主动持久化规则——助手必须遵守:
- 识别阵容时:当用户分享其阵容(截图、文本或任何格式),立即将其保存到目录。若名称不明确,请询问用户。
~/.fplcopilot/squads/ - 阵容变更时:当用户进行转会、更换队长、使用特殊芯片或任何方式修改阵容,确认变更后立即更新对应的阵容文件。
- 对话开始时:若用户询问“我的阵容”或“我的球队”,先检查目录下的现有阵容文件。若存在多个阵容,列出所有可用选项。
~/.fplcopilot/squads/ - 分析完成时:生成策略报告或分析后,将关键结论更新到阵容文件的Notes部分。
- 多阵容支持:用户可能讨论多个阵容(自己的、朋友的、draft方案)。每个阵容对应独立文件,用户可通过名称指定要操作的阵容。
- 文件命名:使用由阵容名称派生的短横线分隔格式(kebab-case),例如、
my-fpl-team.md、daves-team.md。wildcard-draft.md
请阅读了解完整的Markdown格式规范。
references/squad.mdAgent Rules
助手规则
- Always check freshness before answering data questions. If shows stale data (bootstrap > 6h, fixtures on match day > 2h), run the sync script first.
sync_metadata - Always check for saved squads when the user asks about "my squad/team". Read before asking the user to re-share.
~/.fplcopilot/squads/ - Never guess player IDs. Look up by name:
sql
-- 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; - Price units: is in 0.1m units.
now_cost= £13.0m. Always display as130.£X.Xm - Position codes: GKP, DEF, MID, FWD (mapped from API's 1, 2, 3, 4).
- Status codes: =available,
a=doubtful,d=injured,i=suspended,s=unavailable.u - FDR scale: 1 (very easy) to 5 (very hard).
- Normalize by price when comparing players: value = points / (cost in millions).
- Fetch player detail on demand: Only run when the user asks about a specific player's match-by-match performance. Don't batch-fetch unless explicitly needed.
sync.sh player <id> - Proactively persist squads: Always save/update squad files after any squad-related interaction. Never rely on conversation context alone.
- Generate HTML for spatial outputs: Any request that maps to a template in — "plan gameweek" / "next gameweek team" →
templates/; "show/view my squad", formation, bench →gameweek-report.html; "compare transfer", out → in →squad-view.html; "captain pick" with reasoning →transfer-comparison.html; fixture run / FDR matrix →captain-ranking.html— MUST produce the HTML file (saved tofixture-matrix.html) and report the path with an~/.fplcopilot/reports/{YYYY-MM-DD}-{slug}.htmlhint on macOS. Markdown is only for one-line / single-stat lookups, short reasoning, deadlines, price changes, or ≤3-row SQL results.open <path>
- 回答数据类问题前务必检查新鲜度:若显示数据过期(bootstrap数据超过6小时,比赛日的赛程数据超过2小时),先运行同步脚本。
sync_metadata - 用户询问“我的阵容/球队”时务必检查已保存的阵容:先读取目录,再要求用户重新分享。
~/.fplcopilot/squads/ - 绝不猜测球员ID:通过名称查询:
sql
-- 先尝试精确匹配web_name,再模糊匹配web_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; - 身价单位:单位为0.1百万英镑。
now_cost= £13.0m。显示时需格式化为130。£X.Xm - 位置代码:GKP(门将)、DEF(后卫)、MID(中场)、FWD(前锋)(对应API中的1、2、3、4)。
- 状态代码:=可用,
a=存疑,d=受伤,i=停赛,s=不可用。u - FDR等级:1(极易)至5(极难)。
- 对比球员时需按身价归一化:性价比 = 得分 / 身价(百万英镑)。
- 按需获取球员详情:仅当用户询问特定球员的逐场表现时,运行。除非明确需要,否则不要批量获取。
sync.sh player <id> - 主动持久化阵容:任何与阵容相关的交互完成后,务必保存/更新阵容文件。绝不依赖对话上下文。
- 空间类输出需生成HTML:任何对应目录中模板的请求——比如“规划周赛”/“下周阵容”→
templates/;“查看我的阵容”、阵型、替补→gameweek-report.html;“对比转会”、转出→转入→squad-view.html;“队长选择”及理由→transfer-comparison.html;赛程走势/FDR矩阵→captain-ranking.html——必须生成HTML文件(保存至fixture-matrix.html),并告知用户文件路径,在macOS系统中可附带~/.fplcopilot/reports/{YYYY-MM-DD}-{slug}.html的提示。Markdown仅用于单行/单一数据查询、简短分析、截止时间、身价变化或≤3行的SQL查询结果。open <path>