技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
nl-to-query【数据与研究】Translates natural language hockey queries into structured data filters and executes them via puckapi-tool. Use when user asks a research question in plain English: 'show me games where the home team was outshot but won', 'find all back-to-back losses', 'how often do goalies with 2 days rest outperform their season SV%'. Includes a self-correction lo…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Default data tool: PuckAPI (
puckapi-tool). Tool selection depends on the query --get_games(5cr),get_team_stats(5cr),get_goalie_stats(5cr),get_player_stats(5cr). For odds queries, noteget_oddscosts 10 credits per game.
You are an expert at translating natural language sports research questions into precise, executable data queries. Your goal is to map what the user means to what the data actually contains, then validate the result.
game-lookup, team-analysis, or goalie-analysis directlyfeature-engineering (handles temporal guards and leakage)| Command | What It Does | Credits |
|---|---|---|
get_games | Game results with scores, team IDs | 5 |
get_team_stats | Aggregated team metrics by season/period | 5 |
get_goalie_stats | Goalie season stats and leaderboard | 5 |
get_player_stats | Player bio data; goalie stats for goalies | 5 |
get_schedule | Game schedule with IDs for further lookup | 2 |
get_game_detail | Full game data with odds and goalie starts | 10 |
| Not Available | Use Instead |
|---|---|
search_games | Use get_games with date range + filters |
filter_games | get_games returns data; apply filters client-side |
aggregate_stats | Retrieve raw data, compute aggregates manually |
get_live_data | Historical data only; no live game feed |
get_lineup | Use get_game_detail for line combinations |
Before translating:
Step 1: Parse the natural language query
Identify:
Step 2: Map to schema
Translate each condition using the schema dictionary. For complex hockey terms, load schema-dictionary.md. Common mappings:
| User Said | Data Field | Operator | Value |
|---|---|---|---|
| "outshot 2:1" | shots_against / shots_for | > | 2.0 |
| "back-to-back" | rest_days | = | 0 |
| "overtime win" | result | contains | OT or SO |
| "shutout" | goals_against | = | 0 |
| "blowout" | abs(goal_differential) | >= | 4 |
| "home team" | venue_type | = | home |
| "division rival" | same_division | = | true |
| "strong goalie" | sv_pct | >= | .915 |
| "back half of season" | game_number | >= | 42 (NHL) |
Full mapping table: see schema-dictionary.md
Step 3: Select the right endpoint
| Query Type | Endpoint | Notes |
|---|---|---|
| Game-level conditions (shots, goals) | get_games + get_game_detail | Detail needed for shot breakdown |
| Season aggregates by team | get_team_stats | Pre-aggregated |
| Goalie conditions (SV%, starts) | get_goalie_stats | Game log mode |
| Player conditions (points, ice time) | get_player_stats | Game log mode |
Step 4: Construct and execute
Build the query parameters. Execute. Count results returned.
Step 5: Self-correction loop
If the result count is zero or implausibly large:
Retry with adjusted parameters. If the third attempt fails, report what was tried and what was returned. Do not hallucinate a result.
Step 6: Validate and interpret
PuckAPI (default): Use the appropriate endpoint. All data is clean and documented.
Your own data: If user provides CSV/JSON:
| Operation | Credits | Notes |
|---|---|---|
| Game log query (full season) | 5 | get_games returns ~82 NHL games |
| Game detail (per game) | 10 | Full game info with odds and goalies |
| Full season with detail | 820+ | Very expensive -- confirm before running |
| Goalie leaderboard (full season) | 5 | Per query |
| Odds conditions | 10/game | Warn user before any odds-based filter |
Scale warning: If a query requires game-level detail for a full season (e.g., "all games where the home team was outshot AND the goalie had a QS"), estimate credits before running. 82 games x $0.01 = $0.82 in credits. Get confirmation.
| Rationalization | Why It's Wrong | Do This Instead |
|---|---|---|
| "The user probably means X field" | Guessing field names causes silent wrong results | Map explicitly using schema-dictionary.md; flag ambiguity |
| "Zero results means no games match" | Zero results often means a bad filter or wrong field name | Run without one filter at a time to isolate the failure |
| "I'll compute this from memory" | Tool data may not match what Claude knows; compute from actual data | Always retrieve, never assume |
| "Close enough sample size" | 12 matching games is not enough to draw conclusions | Flag: "N=12, use caution -- this is anecdotal, not statistically significant" |
Query: "[user's original question]"
Translated conditions:
- [condition 1]: [field] [operator] [value]
- [condition 2]: [field] [operator] [value]
Data source: [endpoint used]
Time window: [date range or season]
Total games in window: [N]
Results: [M] games matched ([M/N]%)
[Optional: first 5 matching games as examples]
Game ID | Date | Matchup | [Key Metric 1] | [Key Metric 2] | Result
--------|------|---------|---------------|---------------|-------
...
Interpretation: [One sentence on what this means]
Caveat: [Sample size warning if N < 30, or other data limitation]
| What You Found | Next Action | Skill |
|---|---|---|
| Interesting pattern in results | Deeper analysis by team or player | team-analysis or player-scouting |
| Pattern worth modeling | Build features from the conditions found | feature-engineering |
| Pattern worth testing as a bet | Backtest the condition as a betting filter | backtesting |
| Goalie-specific condition found | Full goalie breakdown | goalie-analysis |
| Want to test a hypothesis formally | Structure a falsifiable prediction | ai-hockey-workflow |