# Send 彩票分析助手 to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "lottery-analyzer",
    "name": "彩票分析助手",
    "source": "tencent",
    "type": "skill",
    "category": "数据分析",
    "sourceUrl": "https://clawhub.ai/larval-zz/lottery-analyzer",
    "canonicalUrl": "https://clawhub.ai/larval-zz/lottery-analyzer",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/lottery-analyzer",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=lottery-analyzer",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "scripts/analyze_lottery.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "lottery-analyzer",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T17:19:54.360Z",
      "expiresAt": "2026-05-07T17:19:54.360Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=lottery-analyzer",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=lottery-analyzer",
        "contentDisposition": "attachment; filename=\"lottery-analyzer-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "lottery-analyzer"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/lottery-analyzer"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/lottery-analyzer",
    "downloadUrl": "https://openagent3.xyz/downloads/lottery-analyzer",
    "agentUrl": "https://openagent3.xyz/skills/lottery-analyzer/agent",
    "manifestUrl": "https://openagent3.xyz/skills/lottery-analyzer/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/lottery-analyzer/agent.md"
  }
}
```
## Documentation

### 彩票分析助手

智能分析双色球和大乐透彩票数据，提供基于统计学的号码推荐和趋势分析。

### 支持彩票类型

双色球 (SSQ)：6个红球(1-33) + 1个蓝球(1-16)
大乐透 (DLT)：5个前区(1-35) + 2个后区(1-12)

### 1. 基本分析（使用现有数据文件）

查看之前生成的分析结果：

read /home/admin/worktemp/ssq_7plus2_analysis.json  # 双色球7+2复式
read /home/admin/worktemp/lottery_ssq_analysis.json  # 最新分析

### 2. 分析新的开奖数据

使用核心脚本分析Excel/CSV数据文件：

python3 ~/.openclaw/skills/lottery-analyzer/scripts/analyze_lottery.py ssq /path/to/data.xlsx 7+2

格式说明：

ssq / dlt：彩票类型
数据路径：Excel或CSV文件路径
格式：simple（单注）或 7+2（复式）

### 3. 对话式分析（推荐）

直接告诉需求，用Python脚本实时处理：

# 创建分析器
from lottery_analyzer import LotteryAnalyzer

# 初始化（双色球）
analyzer = LotteryAnalyzer('ssq')

# 加载Excel数据（跳过第一行表头）
analyzer.load_data('./data.xlsx', has_header=True)

# 提取最近50期数据
analyzer.extract_numbers(50)

# 生成统计
stats = analyzer.generate_statistics()

# 生成5组7+2复式推荐
recommendations = analyzer.generate_multiple_recommendations(5, '7+2')

# 保存结果
analyzer.analysis_results = {'statistics': stats, 'recommendations': recommendations}
analyzer.save_results('./lottery_ssq_analysis.json')

### Excel格式推荐

双色球Excel模板：

期号  红球号码        (表头行，可选)
26018   11  15  17  22  25  30  7
26017   1   3   5   18  29  32  4
...

大乐透Excel模板：

期号  前区号码    后区号码  (表头行，可选)
26018   5  12  18  25  28   3  9
26017   8  15  22  26  31   5  12
...

### CSV格式

期号,红1,红2,红3,红4,红5,红6,蓝
26018,11,15,17,22,25,30,7
26017,1,3,5,18,29,32,4

### 1. 统计分析

获取详细统计数据：

stats = analyzer.generate_statistics()

# 输出内容：
{
    'red': {
        'hot_numbers': [13, 9, 3, 5, 2, ...],   # 热号（前15）
        'cold_numbers': [21, 11, 16, ...],      # 冷号（前10）
        'avg_number': 16.0,                      # 平均数
        'median': 15.0,                          # 中位数
        'stdev': 9.8                            # 标准差
    },
    'blue': {
        'hot_numbers': [10, 4, 13, ...],
        'cold_numbers': [9, 11, 14, ...]
    },
    'sum': {
        'avg': 95.9,      # 平均和值
        'min': 46,        # 最小和值
        'max': 133        # 最大和值
    }
}

### 2. 模式识别

分析近期走势：

patterns = analyzer.analyze_patterns(10)  # 近10期

# 输出内容：
[
    {
        'consecutive': 1,      # 连号对数
        'odd_even': '3:3',     # 奇偶比例
        'big_small': '4:2',    # 大小比例
        'sum': 120,            # 和值
        'sum_range': '101-120' # 和值区间
    },
    ...
]

### 3. 智能推荐

多种推荐策略：

# 策略1：均衡推荐（热冷混合）
rec = analyzer.recommend_numbers(strategy='balanced', format_type='7+2')

# 策略2：热号策略（推荐高频号码）
rec = analyzer.recommend_numbers(strategy='hot', format_type='7+2')

# 策略3：冷号策略（博冷门回归）
rec = analyzer.recommend_numbers(strategy='cold', format_type='7+2')

# 策略4：连号策略（包含连号组合）
rec = analyzer.recommend_numbers(strategy='consecutive', format_type='7+2')

# 策略5：区间策略（覆盖多个数字区间）
rec = analyzer.recommend_numbers(strategy='segment', format_type='7+2')

### 7+2复式（双色球）

组合数：C(7,6) × C(2,1) = 7 × 2 = 14注
费用：14注 × 2元 = 28元
覆盖范围：7个红球中任选6个，2个蓝球中任选1个

### 7+2复式（大乐透）

组合数：C(7,5) × C(2,2) = 21 × 1 = 21注
费用：21注 × 2元 = 42元
覆盖范围：7个前区中任选5个，2个后区全选

### 6+2复式（双色球）

组合数：C(6,6) × C(2,1) = 1 × 2 = 2注
费用：2注 × 2元 = 4元
覆盖范围：6个红球全选，2个蓝球中任选1个

### 示例1：分析双色球并生成5组推荐

# 执行分析
cd ~/.openclaw/skills/lottery-analyzer
python3 scripts/analyze_lottery.py ssq ~/worktemp/ssq1-100.xlsx 7+2

# 查看结果
cat ~/worktemp/lottery_ssq_analysis.json

### 示例2：对话式实时分析

# 直接在对话中使用脚本
import sys
sys.path.insert(0, '/home/admin/.openclaw/skills/lottery-analyzer/scripts')
from analyze_lottery import LotteryAnalyzer

# 创建分析器
analyzer = LotteryAnalyzer('ssq')

# 加载数据
success, msg = analyzer.load_data('/home/admin/worktemp/ssq1-100.xlsx', has_header=True)

# 分析最近30期
analyzer.extract_numbers(30)

# 查看热号
print(f"热红球: {analyzer.red_freq.most_common(10)}")

# 生成推荐
recs = analyzer.generate_multiple_recommendations(5, '7+2')

# 格式化输出
for rec in recs:
    print(f"\\n第{rec['group']}组: {rec['strategy']}")
    print(f"红球: {' '.join(f'{n:02d}' for n in rec['red_balls'])}")
    print(f"蓝球: {' '.join(f'{n:02d}' for n in rec['blue_balls'])}")

### 输出文件位置

分析结果默认保存在：

/home/admin/worktemp/lottery_ssq_analysis.json   # 双色球
/home/admin/worktemp/lottery_dlt_analysis.json   # 大乐透

### 技术依赖

pandas（数据处理）
numpy（数值计算）
openpyxl（Excel支持）

依赖已预装，无需额外安装。

### 免责声明

本工具仅基于历史数据进行统计分析，不保证中奖。彩票本质是随机事件，请理性购彩，量力而行。

分析结果仅供娱乐和参考，切勿过度投入。

### 扩展功能

需要添加自定义分析时，直接在对话中使用Python：

# 自定义分析示例
from analyze_lottery import LotteryAnalyzer

analyzer = LotteryAnalyzer('ssq')
analyzer.load_data('./data.xlsx', has_header=True)
analyzer.extract_numbers(50)

# 自定义统计：计算特定数字出现间隔
for num in range(1, 34):
    occurrences = [i for i, n in enumerate(analyzer.all_red_numbers) if n == num]
    # 计算间隔...

脚本完全可扩展，你可以添加任何自定义分析逻辑。
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: larval-zz
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-30T17:19:54.360Z
- Expires at: 2026-05-07T17:19:54.360Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/lottery-analyzer)
- [Send to Agent page](https://openagent3.xyz/skills/lottery-analyzer/agent)
- [JSON manifest](https://openagent3.xyz/skills/lottery-analyzer/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/lottery-analyzer/agent.md)
- [Download page](https://openagent3.xyz/downloads/lottery-analyzer)