赛题分析与方法检索
Competition problem: $ARGUMENTS
Constants
- METHOD_LIBRARY — Local directory containing reference materials (past solutions, method notes). Check these paths in order:
data/ in the current project directory
reference/ in the current project directory
- Custom path specified by user in
CLAUDE.md under ## Method Library
- MAX_LOCAL_REFS = 10 — Maximum number of local reference files to scan. If more are found, prioritize by filename relevance to the problem.
- SEARCH_DEPTH = standard — When
deep, perform extended web search for similar competition problems and classic methods. When standard (default), focus on the most relevant methods and past solutions.
💡 Overrides:
/problem-analysis "赛题" — method library: ~/my_refs/ — custom reference path
/problem-analysis "赛题" — sources: local — only search local references
/problem-analysis "赛题" — sources: web — only search the web (skip local)
/problem-analysis "赛题" — sources: local, web — search local + web
/problem-analysis "赛题" — search depth: deep — extended search for similar problems and methods
Data Sources
This skill checks multiple sources in priority order. All are optional — if a source is not configured or not available, skip it silently.
Source Selection
Parse $ARGUMENTS for a — sources: directive:
- If
— sources: is specified: Only search the listed sources (comma-separated). Valid values: local, web, all.
- If not specified: Default to
all — search every available source in priority order.
Examples:
/problem-analysis "赛题描述" → all (default)
/problem-analysis "赛题描述" — sources: all → all (default)
/problem-analysis "赛题描述" — sources: local → local references only
/problem-analysis "赛题描述" — sources: web → web search only
/problem-analysis "赛题描述" — sources: local, web → local + web
Source Table
| Priority |
Source |
ID |
How to detect |
What it provides |
| 1 |
Local references |
local |
Glob: data/**/*.*, reference/**/*.* |
赛题数据文件、参考资料、过往优秀论文 |
| 2 |
Web search |
web |
Always available (WebSearch) |
数模优秀论文库、CNKI、经典教材方法、赛题案例库 |
Graceful degradation: If no local references exist, the skill still works via web search alone.
Workflow
Step 0a: 读取赛题与数据
- 读取赛题描述: 从
$ARGUMENTS 或 PROBLEM_BRIEF.md 获取完整赛题文本
- 扫描数据文件: 检查
data/ 目录下的数据文件(.csv, .xlsx, .txt 等)Glob: data/**/*.{csv,xlsx,xls,txt,dat,json}
- 初步数据概览: 对每个数据文件,快速提取:
- 文件名、大小、行数/列数
- 列名/字段名
- 数据类型和基本统计量
- 识别赛题类型: 判断属于哪一类数模问题(优化、预测、评价、分类、调度、博弈等)
📋 赛题数据是建模的基础——先理解数据结构,再决定建模方法。
Step 0b: 扫描本地参考资料
检查用户是否已有相关参考资料:
Locate references: Check METHOD_LIBRARY paths for reference files
Glob: reference/**/*.{pdf,md,txt,docx}, data/**/*.{pdf,md,txt}
Filter by relevance: Match filenames and content against the competition problem. Skip clearly unrelated files.
Summarize relevant references: For each relevant file (up to MAX_LOCAL_REFS):
- Read content (first 3 pages for PDFs)
- Extract: title, core method, applicability to current problem
- Flag references that are directly related vs tangentially related
Build local knowledge base: Compile summaries into a "references you already have" section. This becomes the starting point — web search fills the gaps.
📚 If no local references are found, skip to Step 1. If the user has relevant materials, the web search can be more targeted (focus on what's missing).
Step 1: 检索经典方法与类似赛题 (external)
- Use WebSearch to find classic modeling methods for this type of problem
- Search for: 数模竞赛优秀论文, CNKI 数学建模, 经典教材方法, 赛题案例库
- Focus on: (1) classic textbook methods, (2) past competition winning solutions, (3) applicable mathematical techniques
- De-duplicate: Skip methods already found in local references
Web search strategy (multi-query):
Query 1: "[问题类型] 数学建模方法" (e.g., "优化问题 数学建模方法")
Query 2: "[关键词] 数学建模竞赛 优秀论文" (e.g., "交通流 数学建模竞赛 优秀论文")
Query 3: "[问题类型] mathematical modeling approach" (English search for international methods)
Query 4: "CUMCM/MCM [类似赛题关键词]" (search for similar past competition problems)
For each search, extract:
- Method name and category (统计/优化/微分方程/图论/机器学习/模拟)
- Key references or textbook sources
- Applicability to the current problem
- Complexity and implementation difficulty
Method categorization:
Organize found methods into a 方法地图 (method map):
| Category |
Methods |
Applicability |
Difficulty |
| 统计分析 |
回归分析, 时间序列, 主成分分析... |
|
|
| 优化方法 |
线性规划, 整数规划, 动态规划... |
|
|
| 微分方程 |
ODE, PDE, 差分方程... |
|
|
| 图论/网络 |
最短路, 网络流, 图着色... |
|
|
| 机器学习 |
分类, 聚类, 神经网络... |
|
|
| 模拟仿真 |
Monte Carlo, 元胞自动机, Agent-based... |
|
|
Step 2: 分析赛题结构
For each sub-problem identified, extract:
- 问题类型: 属于哪类数学问题(优化/预测/评价/分类/调度/博弈等)
- 关键变量: 决策变量、参数、约束条件
- 数据需求: 需要哪些数据,现有数据是否满足
- 可行方法: 基于 Step 1 的方法地图,列出候选方法
- 难点: 该子问题的主要建模难点
Step 3: 综合分析
- Group methods by problem type and applicability
- Identify which methods are most suitable for each sub-problem
- Find potential innovation points (方法组合、改进、创新应用)
- Assess data-method compatibility (数据是否支持所选方法)
Step 4: Output
Save as PROBLEM_ANALYSIS.md:
| 子问题 | 问题类型 | 候选方法 | 推荐方法 | 难度 | 创新空间 |
|--------|---------|---------|---------|------|---------|
Plus a narrative analysis (3-5 paragraphs) covering:
- 赛题整体解读
- 子问题之间的逻辑关系
- 推荐的建模路线(主方法 + 备选方法)
- 潜在的创新点和加分项
Include a simple reference list for methods and sources consulted.
Step 5: Save
- Save
PROBLEM_ANALYSIS.md to the project root
- Update any reference materials in
reference/
- Log the analysis in project memory for downstream skills
Key Rules
- Always cite method sources (textbook, past competition paper, or reference)
- Distinguish between classic methods (well-established) and novel approaches (higher risk, higher reward)
- Be honest about limitations of each method for this specific problem
- Note which methods are commonly used in award-winning papers for similar problems
- Never fail because local references are missing — always fall back gracefully to web search
- Prioritize methods that match the available data and time constraints of the competition
1---2name: problem-analysis3description: 数模赛题分析与经典方法检索。分析赛题结构、识别子问题、检索经典建模方法。当用户说'分析赛题'、'problem analysis'、'赛题解读'时使用。4---56# 赛题分析与方法检索78Competition problem: $ARGUMENTS910## Constants1112- **METHOD_LIBRARY** — Local directory containing reference materials (past solutions, method notes). Check these paths in order:13 1. `data/` in the current project directory14 2. `reference/` in the current project directory15 3. Custom path specified by user in `CLAUDE.md` under `## Method Library`16- **MAX_LOCAL_REFS = 10** — Maximum number of local reference files to scan. If more are found, prioritize by filename relevance to the problem.17- **SEARCH_DEPTH = standard** — When `deep`, perform extended web search for similar competition problems and classic methods. When `standard` (default), focus on the most relevant methods and past solutions.1819> 💡 Overrides:20> - `/problem-analysis "赛题" — method library: ~/my_refs/` — custom reference path21> - `/problem-analysis "赛题" — sources: local` — only search local references22> - `/problem-analysis "赛题" — sources: web` — only search the web (skip local)23> - `/problem-analysis "赛题" — sources: local, web` — search local + web24> - `/problem-analysis "赛题" — search depth: deep` — extended search for similar problems and methods2526## Data Sources2728This skill checks multiple sources **in priority order**. All are optional — if a source is not configured or not available, skip it silently.2930### Source Selection3132Parse `$ARGUMENTS` for a `— sources:` directive:33- **If `— sources:` is specified**: Only search the listed sources (comma-separated). Valid values: `local`, `web`, `all`.34- **If not specified**: Default to `all` — search every available source in priority order.3536Examples:37```38/problem-analysis "赛题描述" → all (default)39/problem-analysis "赛题描述" — sources: all → all (default)40/problem-analysis "赛题描述" — sources: local → local references only41/problem-analysis "赛题描述" — sources: web → web search only42/problem-analysis "赛题描述" — sources: local, web → local + web43```4445### Source Table4647| Priority | Source | ID | How to detect | What it provides |48|----------|--------|----|---------------|-----------------|49| 1 | **Local references** | `local` | `Glob: data/**/*.*, reference/**/*.*` | 赛题数据文件、参考资料、过往优秀论文 |50| 2 | **Web search** | `web` | Always available (WebSearch) | 数模优秀论文库、CNKI、经典教材方法、赛题案例库 |5152> **Graceful degradation**: If no local references exist, the skill still works via web search alone.5354## Workflow5556### Step 0a: 读取赛题与数据57581. **读取赛题描述**: 从 `$ARGUMENTS` 或 `PROBLEM_BRIEF.md` 获取完整赛题文本592. **扫描数据文件**: 检查 `data/` 目录下的数据文件(.csv, .xlsx, .txt 等)60 ```61 Glob: data/**/*.{csv,xlsx,xls,txt,dat,json}62 ```633. **初步数据概览**: 对每个数据文件,快速提取:64 - 文件名、大小、行数/列数65 - 列名/字段名66 - 数据类型和基本统计量674. **识别赛题类型**: 判断属于哪一类数模问题(优化、预测、评价、分类、调度、博弈等)6869> 📋 赛题数据是建模的基础——先理解数据结构,再决定建模方法。7071### Step 0b: 扫描本地参考资料7273检查用户是否已有相关参考资料:74751. **Locate references**: Check METHOD_LIBRARY paths for reference files76 ```77 Glob: reference/**/*.{pdf,md,txt,docx}, data/**/*.{pdf,md,txt}78 ```79802. **Filter by relevance**: Match filenames and content against the competition problem. Skip clearly unrelated files.81823. **Summarize relevant references**: For each relevant file (up to MAX_LOCAL_REFS):83 - Read content (first 3 pages for PDFs)84 - Extract: title, core method, applicability to current problem85 - Flag references that are directly related vs tangentially related86874. **Build local knowledge base**: Compile summaries into a "references you already have" section. This becomes the starting point — web search fills the gaps.8889> 📚 If no local references are found, skip to Step 1. If the user has relevant materials, the web search can be more targeted (focus on what's missing).9091### Step 1: 检索经典方法与类似赛题 (external)92- Use WebSearch to find classic modeling methods for this type of problem93- Search for: 数模竞赛优秀论文, CNKI 数学建模, 经典教材方法, 赛题案例库94- Focus on: (1) classic textbook methods, (2) past competition winning solutions, (3) applicable mathematical techniques95- **De-duplicate**: Skip methods already found in local references9697**Web search strategy** (multi-query):9899```100Query 1: "[问题类型] 数学建模方法" (e.g., "优化问题 数学建模方法")101Query 2: "[关键词] 数学建模竞赛 优秀论文" (e.g., "交通流 数学建模竞赛 优秀论文")102Query 3: "[问题类型] mathematical modeling approach" (English search for international methods)103Query 4: "CUMCM/MCM [类似赛题关键词]" (search for similar past competition problems)104```105106For each search, extract:107- Method name and category (统计/优化/微分方程/图论/机器学习/模拟)108- Key references or textbook sources109- Applicability to the current problem110- Complexity and implementation difficulty111112**Method categorization**:113114Organize found methods into a **方法地图** (method map):115| Category | Methods | Applicability | Difficulty |116|----------|---------|--------------|------------|117| 统计分析 | 回归分析, 时间序列, 主成分分析... | | |118| 优化方法 | 线性规划, 整数规划, 动态规划... | | |119| 微分方程 | ODE, PDE, 差分方程... | | |120| 图论/网络 | 最短路, 网络流, 图着色... | | |121| 机器学习 | 分类, 聚类, 神经网络... | | |122| 模拟仿真 | Monte Carlo, 元胞自动机, Agent-based... | | |123124### Step 2: 分析赛题结构125For each sub-problem identified, extract:126- **问题类型**: 属于哪类数学问题(优化/预测/评价/分类/调度/博弈等)127- **关键变量**: 决策变量、参数、约束条件128- **数据需求**: 需要哪些数据,现有数据是否满足129- **可行方法**: 基于 Step 1 的方法地图,列出候选方法130- **难点**: 该子问题的主要建模难点131132### Step 3: 综合分析133- Group methods by problem type and applicability134- Identify which methods are most suitable for each sub-problem135- Find potential innovation points (方法组合、改进、创新应用)136- Assess data-method compatibility (数据是否支持所选方法)137138### Step 4: Output139Save as `PROBLEM_ANALYSIS.md`:140141```142| 子问题 | 问题类型 | 候选方法 | 推荐方法 | 难度 | 创新空间 |143|--------|---------|---------|---------|------|---------|144```145146Plus a narrative analysis (3-5 paragraphs) covering:1471. 赛题整体解读1482. 子问题之间的逻辑关系1493. 推荐的建模路线(主方法 + 备选方法)1504. 潜在的创新点和加分项151152Include a simple reference list for methods and sources consulted.153154### Step 5: Save155- Save `PROBLEM_ANALYSIS.md` to the project root156- Update any reference materials in `reference/`157- Log the analysis in project memory for downstream skills158159## Key Rules160- Always cite method sources (textbook, past competition paper, or reference)161- Distinguish between classic methods (well-established) and novel approaches (higher risk, higher reward)162- Be honest about limitations of each method for this specific problem163- Note which methods are commonly used in award-winning papers for similar problems164- **Never fail because local references are missing** — always fall back gracefully to web search165- Prioritize methods that match the available data and time constraints of the competition