| name | problem-analysis |
| description | 数模赛题分析与经典方法检索。分析赛题结构、识别子问题、检索经典建模方法。当用户说'分析赛题'、'problem analysis'、'赛题解读'时使用。 |
| argument-hint | ["competition-problem"] |
| allowed-tools | Bash(*), Read, Glob, Grep, WebSearch, WebFetch, Write, Agent |
赛题分析与方法检索
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