{"docs": ["name: excel-exporter\ndescription: >\n  MANDATORY: Use this skill for ANY Excel spreadsheet export or generation task.\n  Triggers: \"导出Excel\", \"下载Excel\", \"保存为Excel\", \"生成表格\", \"export excel\", \"save as xlsx\", \"转成Excel\", \"Excel报告\", \"生成xlsx\".\n  CRITICAL: NEVER write ad-hoc openpyxl/xlsxwriter code directly in task scripts. ALWAYS call export_excel.py via this skill.\n  Supports: multi-sheet, charts, cell formatting, Chinese content.\n  Do NOT use for: reading Excel files for data analysis (use direct openpyxl/xlrd read).\nversion: \"1.0\"\n\n# Excel 导出技能\n\n将结构化数据导出为 Microsoft Excel (.xlsx) 格式文件，支持多工作表、表头样式、数据格式化及中文内容。\n\n## CRITICAL RULES\n\n- MUST call `export_excel.py` for ALL Excel export requests; NEVER write ad-hoc openpyxl code\n- MUST ensure `sys.path` includes `/workspace/.local/lib/python3.11/site-packages` before importing openpyxl\n- Output Excel file MUST be saved to `/workspace/Document/PersonalDocuments/` (personal knowledge base)\n- ALWAYS confirm the output path returned by the script; NEVER fabricate a file path\n- Data MUST be passed as JSON format via `--data` parameter\n\n## 触发范围\n\n激活场景（MUST activate）：\n- 用户说\"导出Excel\"、\"下载Excel\"、\"保存为表格\"、\"生成xlsx\"\n- 用户要求将数据、报表输出为 Excel 格式\n\n## 使用方法\n\n调用 `/workspace/skills/excel-exporter/scripts/export_excel.py`，传入数据参数：\n\n```bash\npython3 /workspace/skills/excel-exporter/scripts/export_excel.py \\\n  --title \"表格标题\" \\\n  --data '[{\"姓名\":\"张三\",\"年龄\":25},{\"姓名\":\"李四\",\"年龄\":30}]' \\\n  --output \"/workspace/Document/PersonalDocuments/output.xlsx\"\n```\n\n## 依赖说明\n\n| 依赖包 | 版本 | 用途 |\n|--------|------|------|\n| openpyxl | 3.1.5 | Excel .xlsx 读写核心库 |\n| et-xmlfile | 2.0.0 | openpyxl 底层 XML 支持 |\n| xlrd | 2.0.2 | 读取旧版 .xls 文件 |\n| xlsxwriter | 3.2.9 | 高级 Excel 写入（图表支持） |\n\n依赖安装路径：`/workspace/.local/lib/python3.11/site-packages/`", "---\nname: pv-prediction-model\ndescription: PV power prediction model skill, providing functions to obtain weather information, list PV power prediction models, load models, perform PV power prediction, and calculate model evaluation parameters (MAE, RMSE, R², MAPE). Supports manual training for a single station, automatically generates HTML reports after evaluation, and requires secondary parameter confirmation before training.\ncompatibility: Requires Python 3.x and access to API http://47.96.16.84:5006\nreturn_format_specification:\n  preview_training_params:\n    format: \"&**&key1=value1|key2=value2|...|keyN=valueN&**&\"\n    description: \"Parameter preview return format, using | as a separator, wrapped in &**&, JSON format is NOT used\"\n    example: \"&**&stations=P2413|learning_rate=0.001|batch_size=64|max_epochs=100|hidden_dim=64|dropout=0.1|patience=15|train_ratio=0.7|start_time=2024-12-19 00:00:00|end_time=2025-08-10 23:45:00&**&\"\n  evaluate_model:\n    format: \"@@@@@<report_address>@@@@@\"\n    description: \"Evaluation report return format, using @@@@@ to wrap the report address\"\n    example: \"@@@@@/skills/report-generator/output/report_1234567890.html@@@@@\"\nmetadata:\n  author: Manus AI\n---\n\n# 【PV Prediction Model】\n\nThis skill is used for the complete evaluation process and single-station training function of photovoltaic (PV) power generation prediction models. It provides functions to obtain weather information, model lists, load models, perform PV power prediction, and calculate model evaluation parameters.\n\n---\n\n## ⚠️ Critical Rules\n\n- MUST: For model evaluation, model listing, prediction results, data comparison, and weather data, you must call `report-generator` to generate an HTML report.\n- MUST: Before training, you must call `handle_training_request.py` to preview all parameters and perform secondary parameter confirmation.\n- MUST: The training function must be triggered manually through conversation and will not be executed automatically.\n- MUST: The system will only start training after the user explicitly expresses the intention to confirm (e.g., \"Confirm parameters, start training\").\n- NEVER: The parameter preview return format strictly prohibits the use of JSON; it must strictly be `&**&key1=value1|key2=value2|...&**&` (using | as a separator and wrapped in &**&).\n\n---\n\n## When to Use\n\n### Handled by this skill\n\n- User asks about PV power generation prediction models, model evaluation, or calculating model parameters.\n- User requests to list all PV power prediction models.\n- User requests to execute PV power prediction or compare historical data with predicted data.\n- User requests to obtain weather forecast data.\n- User wants to perform model training for a single station.\n\n### Not handled by this skill (Hand over to other skills)\n\n- Power load forecasting related tasks → Hand over to `【load-forecasting】`\n- Pure report generation and formatting tasks (non-PV data) → Hand over to `【report-generator】`\n\n---\n\n## How to Execute\n\n> Execute the following steps in order. For each step, you MUST send a progress message before running the command.\n\n### Step 1: Select Template\n\n**FIRST**, send this message to the user:\n\n`【开始分析】正在理解需求，匹配数据视图与展示模板...`\n\n**THEN**, run:\n\n```bash\ncd /workspace/skills/report-generator && \\\npython3 scripts/step1_select.py --query \"{{USER_QUERY}}\" --data \"{}\"\n```\n\n*Replace `{{USER_QUERY}}` with the user's original question.*\n\nOutput example:\n\n```json\n{\n  \"status\": \"success\",\n  \"template_name\": \"dataTable\",\n  \"reason\": \"模型列表适合用表格形式展示\"\n}\n```\n\nPass to next step: `template_name` → `--template` in Step 3.\n\n---\n\n### Step 2: Execute Action\n\n**FIRST**, send this message to the user:\n\n`【数据处理】正在执行操作并获取数据...`\n\n**THEN**, run the appropriate command based on user request:\n\n**Get model list:**\n```bash\npython scripts/predict_and_evaluate.py --action list_models\n```\n\n**Evaluate model:**\n```bash\npython scripts/predict_and_evaluate.py --action evaluate_model --model_id \"{{MODEL_ID}}\"\n```\n\n**Preview training parameters (secondary confirmation):**\n```bash\npython scripts/handle_training_request.py --station_id \"{{STATION_ID}}\"\n```\n\n**Start training and monitor progress (ONLY after user confirmation):**\n```bash\npython scripts/train_station.py --action train_and_monitor --station_id \"{{STATION_ID}}\"\n```\n\n**Compare historical and predicted data:**\n```bash\npython scripts/compare_prediction.py --target_date \"{{TARGET_DATE}}\" --station_id \"{{STATION_ID}}\"\n```\n\n**Get weather forecast data:**\n```bash\npython scripts/get_weather_forecast.py --station_name \"{{STATION_NAME}}\" --forecast_days \"{{DAYS}}\"\n```\n\n**After Step 2, MUST immediately show the user:**\n- Explanation of intermediate results, such as the retrieved model list, evaluation metrics, or parameter preview.\n\n---\n\n### Step 3: Render HTML Report\n\n> Note: Parameter preview and starting training steps do not require report generation.\n\n**FIRST**, send this message to the user:\n\n`【报告生成】正在将结果渲染为可视化报告...`\n\n**THEN**, run:\n\n```bash\ncd /workspace/skills/report-generator && \\\npython3 scripts/step2_render.py \\\n  --query \"{{USER_QUERY}}\" \\\n  --template \"{{template_name from Step 1}}\" \\\n  --data \"{Output JSON data from Step 2}\"\n```\n\nOutput example:\n\n```json\n{\n  \"status\": \"success\",\n  \"message\": \"Report generated successfully\",\n  \"template\": \"dataTable\",\n  \"address\": \"/skills/report-generator/output/report_1773642266.html\",\n  \"summary\": \"共获取到2个光伏功率预测模型，其中best_model为最优模型。\"\n}\n```\n\n---\n\n## Usage Examples\n\n### Example 1: List all PV power prediction models and generate a report\n\n**User Query**: \"List all PV power prediction models\"\n\n**Execution Process**:\n1. **Step 1**: Call `step1_select.py --query \"列出所有光伏功率预测模型\" --data \"{}\"` to get the template name `dataTable`.\n2. **Step 2**: Call `predict_and_evaluate.py --action list_models` to get the model list.\n3. **Step 3**: Call `step2_render.py --query \"列出所有光伏功率预测模型\" --template \"dataTable\" --data \"{模型列表数据JSON}\"` to generate the final report.\n\n**Final Reply**:\nBased on the `summary` returned in Step 3, organize the final reply.\n```\n@@@@@/skills/report-generator/output/report_1773642266.html@@@@@\n\n#####%查看详细数据%￥点击上方链接查看完整的数据分析报告￥ %继续深入分析%￥基于当前数据进行更深度的挖掘￥ %导出报告%￥将当前报告导出为PDF或图片格式￥#####\n```\n\n### Example 2: Evaluate a PV power prediction model and generate a report\n\n**User Query**: \"Evaluate the performance of best_model\"\n\n**Execution Process**:\n1. **Step 1**: Call `step1_select.py --query \"评估光伏功率预测模型\" --data \"{\\\"model_id\\\": \\\"best_model\\\"}\"` to get the template name `dataTable`.\n2. **Step 2**: Call `predict_and_evaluate.py --action evaluate_model --model_id best_model` to get prediction and evaluation data.\n3. **Step 3**: Call `step2_render.py --query \"评估光伏功率预测模型\" --template \"dataTable\" --data \"{预测和评估数据JSON}\"` to generate the final report containing evaluation metrics.\n\n### Example 3: Preview training parameters (secondary confirmation)\n\n**User Query**: \"I want to train a model for station P1154\"\n\n**Execution Process**:\n1. **Step 2**: Call `handle_training_request.py --station_id P1154 --base_model_id P2113_20260324_150417 --learning_rate 0.001 --batch_size 64`.\n2. **Final Reply**: Return the formatted string like `&**&stations=P1154|learning_rate=0.001|batch_size=64|...&**&` directly. The system framework will automatically convert it into a table to display to the user and wait for confirmation.\n\n### Example 4: Start training after parameter confirmation and generate a report\n\n**User Query**: \"Confirm parameters, start training\" (User action after Example 3)\n\n**Execution Process**:\n1. **Step 1**: Call `step1_select.py --query \"训练光伏功率预测模型\" --data \"{\\\"station_id\\\": \\\"P1154\\\"}\"` to get the template name `lineChart`.\n2. **Step 2**: Call `train_station.py --action train_and_monitor --station_id P1154 --base_model_id P2113_20260324_150417 --learning_rate 0.001 --batch_size 64` to start training and monitor progress.\n3. **Step 3**: Call `step2_render.py --query \"训练光伏功率预测模型\" --template \"lineChart\" --data \"{训练结果数据JSON}\"` to generate the final report containing the training loss curve.\n\n### Example 5: Compare historical data with PV power prediction data and generate a report\n\n**User Query**: \"Compare historical and predicted data for station P2413 on 2026-03-30\"\n\n**Execution Process**:\n1. **Step 2**: Call `compare_prediction.py --target_date \"2026-03-30\" --station_id P2413` to get the comparison data.\n\n### Example 6: Get weather forecast data and generate a report\n\n**User Query**: \"Get weather forecast data for station P2413 for the next 2 days\"\n\n**Execution Process**:\n1. **Step 2**: Call `get_weather_forecast.py --station_name P2413 --forecast_days 2` to get the weather data.\n\n---\n\n## Final Reply Format\n\nYour final reply MUST have exactly three parts:\n\n**Part 1 — Data Analysis Summary (Mandatory, cannot be omitted)**\nBased on the `summary` field from the final script output, write a genuine data analysis in the user's language.\n**DO NOT** just write \"The report has been generated\"; you must actually analyze the data content.\n⚠️ CRITICAL: Write a brand-new analysis every time. **DO NOT reuse text from previous replies.**\n\n**Part 2 — Address Tag (Second to last line, fixed format)**\n```\n@@@@@/skills/report-generator/output/report_1773642266.html@@@@@\n```\n⚠️ Copy the `address` field value EXACTLY from script output. NO spaces around `@@@@@`.\n\n**Part 3 — Suggestions Tag (Last line, fixed format)**\n```\n#####%查看详细数据%￥点击上方链接查看完整的数据分析报告￥ %继续深入分析%￥基于当前数据进行更深度的挖掘￥ %导出报告%￥将当前报告导出为PDF或图片格式￥#####\n```\n\n---\n\n## Gotchas\n\n- Confusion between multi-station and single-station: Multiple stations can be evaluated simultaneously, but training must be performed for a single station.\n- Skipping parameter confirmation: It is strictly prohibited to skip the parameter confirmation step and start training directly; you must wait for explicit user consent.\n- Report format error: The report address format must strictly follow `@@@@@<report_address>@@@@@`.\n\n---\n\n## Bundled Resources\n\n- `scripts/predict_and_evaluate.py` — Executes PV power prediction model list retrieval and evaluation calculations.\n- `scripts/handle_training_request.py` — Handles user training requests and previews training parameters.\n- `scripts/train_station.py` — Performs PV power prediction model training for a single station.\n- `scripts/compare_prediction.py` — Compares historical data and predicted data for a specified date.\n- `scripts/get_weather_forecast.py` — Gets weather forecast data.\n\n> Read these files only when debugging. Normal execution does not require manual inspection.\n\n---\n\n## Error Handling\n\n- `\"status\": \"error\"` → Inform the user \"Service is temporarily unavailable, please try again later\", and output the content of the `message` field.\n- API call failure → Check the connection status of the API service `http://47.96.16.84:5006`.\n- User refuses to confirm parameters → Cancel the training task and ask the user if they need to adjust the parameters.", "---\nname: sms-notifier\ndescription: \"MANDATORY: When user selects '发送短信通知相关人员', you MUST execute query_contacts.py and display its returned contacts exactly as-is, including the original phone field. Never rewrite phone into '手机号缺失/不可用'.\"\n---\n# sms-notifier\n\n## 配置说明\n\n本 skill 的所有敏感配置（短信密钥、签名、模板等）统一从 workspace 根目录的 **`key.json`** 文件读取，**禁止在脚本中硬编码任何密钥**。\n\n`key.json` 路径：`/workspace/key.json`（容器内路径）\n\n`key.json` 结构示例：\n```json\n{\n  \"sms\": {\n    \"SMS_ACCESS_KEY_ID\": \"你的阿里云 AccessKey ID\",\n    \"SMS_ACCESS_KEY_SECRET\": \"你的阿里云 AccessKey Secret\",\n    \"SMS_SIGN_NAME\": \"你的短信签名\",\n    \"SMS_TEMPLATE_CODE\": \"SMS_xxxxxxxxx\",\n    \"SMS_ENDPOINT\": \"dysmsapi.aliyuncs.com\"\n  },\n  \"db_api\": {\n    \"API_URL\": \"http://your-db-api-host/getmysql\",\n    \"API_BASE_JDBC\": \"your_jdbc_datasource_name\"\n  }\n}\n```\n\n> 修改配置时，只需编辑 `key.json`，无需修改任何 Python 脚本。\n\n---\n\n## 关键规则\n\n当用户发送\"发送短信通知相关人员\"时，必须执行真实联系人查询脚本，并原样展示脚本返回结果。\n\n必须遵守以下规则：\n1. 必须执行：`python3 /workspace/skills/sms-notifier/scripts/query_contacts.py`\n2. 必须原样展示脚本返回的 `contacts` 数据。\n3. 必须原样展示 `phone` 字段，即使它是密文、哈希、掩码或其他非 11 位手机号形式。\n4. 可以补充说明 `phone_status` 或 `sendable` 的含义，但不能改写 `phone` 原值。\n5. 严禁把 `phone` 字段改写成\"手机号缺失/不可用\"。\n6. 严禁复用任何固定联系人示例名单。\n7. 严禁在未执行脚本时声称已查询联系人。\n\n## 联系人查询 SQL\n\n固定使用以下 SQL，由查询脚本执行：\n\n```sql\nSELECT ACCOUNT AS name, PHONE AS phone FROM SYS_USER WHERE DELETE_FLAG = 'NOT_DELETE' ORDER BY NAME\n```\n\n## 场景 A：用户发送\"发送短信通知相关人员\"\n\n必须执行：\n\n```bash\npython3 /workspace/skills/sms-notifier/scripts/query_contacts.py\n```\n\n输出要求：\n1. 只能返回脚本实时查询得到的联系人结果。\n2. 结果中的 `phone` 必须原样展示，不得替换成\"手机号缺失/不可用\"。\n3. 若 `sendable=false`，可以说明当前号码不可直接用于短信发送，但必须保留原始 `phone` 值。\n4. 若查询失败，必须明确返回查询失败原因，不得伪造联系人列表。\n\n## 场景 B：用户输入手机号或联系人姓名并要求发送短信\n\n必须调用：\n\n```bash\npython3 /workspace/skills/sms-notifier/scripts/sms_notifier.py --recipient \"目标手机号或联系人姓名\" --content \"短信内容\"\n```\n\n## 场景 C：联系人手机号不是明文手机号\n\n如果联系人 `phone` 是密文、哈希值、掩码值或其他非 11 位手机号格式：\n1. 必须原样返回该 `phone`。\n2. 可以说明\"当前号码不是可直接发送的明文手机号\"。\n3. 不得将其改写成\"手机号缺失/不可用\"。\n\n## 依赖说明\n\n本 skill 使用阿里云官方 Python SDK 发送短信，依赖已离线安装至容器内。\n\n| 依赖包 | 版本 | 用途 |\n|--------|------|------|\n| alibabacloud-dysmsapi20170525 | 4.5.0 | 短信发送核心 SDK |\n| alibabacloud-tea-openapi | 0.4.4 | OpenAPI 请求封装 |\n| alibabacloud-tea | 0.4.3 | 阿里云 Tea 框架基础库 |\n| alibabacloud-tea-util | 0.3.14 | 请求工具类 |\n| alibabacloud-credentials | 1.0.8 | 鉴权凭证管理 |\n| alibabacloud-openapi-util | 0.2.4 | OpenAPI 工具函数 |\n\n依赖安装路径：`/workspace/.local/lib/python3.11/site-packages/`\n\n使用前需在脚本中确保路径已加入 `sys.path`：\n```python\nimport sys\nsys.path.insert(0, '/workspace/.local/lib/python3.11/site-packages')\n```", "---\nname: pdf-exporter\ndescription: >\n  MANDATORY: Use this skill for ANY PDF export or generation task.\n  Triggers: \"导出PDF\", \"下载PDF\", \"保存为PDF\", \"生成PDF\", \"PDF版本\", \"export pdf\", \"save as pdf\", \"转成PDF\", \"PDF报告\".\n  CRITICAL: NEVER write ad-hoc reportlab/fpdf/canvas code to generate PDFs. ALWAYS call export_pdf.py via this skill.\n  This skill provides Chinese font support (wqy-microhei). Without it, Chinese text renders as black squares.\n  SUPPORTS AI analysis injection: Agent writes analysis text, passes via --analysis flag, skill inserts it as a dedicated chapter.\n  Do NOT use for: reading PDFs, merging PDFs, OCR, PDF form filling (use pdf skill instead).\nversion: \"1.2\"\n---\n\n# PDF 导出技能（含 AI 智能分析）\n\n将 HTML 报告导出为支持中文的 PDF 文件，并在报告末尾自动插入 Agent 生成的 AI 智能分析章节。\n\n## CRITICAL RULES\n\n- MUST call `export_pdf.py` for ALL PDF export requests; **NEVER write ad-hoc reportlab/fpdf/canvas code**\n- MUST use the bundled `wqy-microhei.ttc` font; **NEVER use Helvetica or other ASCII-only fonts** — they render Chinese as black squares\n- NEVER fabricate a PDF file path; ALWAYS use the actual `output_path` returned by the script\n- Output PDF MUST be saved to `/workspace/Document/PersonalDocuments/` (personal knowledge base)\n- ALWAYS include `--analysis` parameter with AI-generated analysis when exporting data reports\n- The `--analysis` value MUST be written in Chinese, supports Markdown: `##` for subheadings, `-` for bullet points\n\n## 触发范围\n\n**激活场景（MUST activate）：**\n- 用户说\"导出 PDF\"、\"下载 PDF\"、\"保存为 PDF\"、\"生成 PDF\"、\"PDF 版本\"、\"转成 PDF\"\n- 用户要求将某个 HTML 报告文件转换为 PDF\n- 用户说\"把报告发给我\"且当前有 HTML 报告文件\n- 任何需要生成 `.pdf` 文件的场景\n\n**排除场景（Do NOT activate）：**\n- 读取、解析、提取 PDF 内容 → 使用 `pdf` skill\n- 合并、拆分、旋转 PDF → 使用 `pdf` skill\n- PDF 表单填写 → 使用 `pdf` skill\n\n---\n\n## 执行流程\n\n### Step 1 — 生成 AI 分析内容\n\nFIRST, send the user this message:\n> 【正在生成 AI 智能分析】正在根据报告数据生成分析内容...\n\nTHEN: 根据已有的 HTML 报告数据（从上下文或 HTML 文件中提取关键数据），自行撰写 AI 分析文字。\n\n**分析内容应包含（根据数据类型选择适用项）：**\n- `## 数据概况`：用 1~2 句话总结核心指标（最大值、最小值、平均值、总量等）\n- `## 趋势分析`：描述数据的变化趋势（上升/下降/波动/平稳）\n- `## 异常识别`：指出明显偏高或偏低的数据点及可能原因\n- `## 优化建议`：基于数据给出 2~3 条可操作的具体建议\n\n**分析格式示例：**\n```\n## 数据概况\n本报告统计了园区 2 月份共 28 天的每日用电量，总用电量为 12,450 kWh，日均 444.6 kWh。\n\n## 趋势分析\n整体用电量呈先升后降趋势，2 月 10~15 日为用电高峰期，峰值达 680 kWh/天。\n\n## 异常识别\n- 2 月 14 日：用电量 680 kWh，较日均高出 53%，疑为设备满负荷运行所致\n- 2 月 22 日：用电量 180 kWh，较日均低 60%，疑为节假日停产\n\n## 优化建议\n- 建议在用电高峰期（10~15 日）错峰生产，降低峰时电费\n- 对 2 月 14 日异常用电进行排查，确认是否存在设备故障或浪费\n- 建议安装智能电表，实现分时段精细化用电管理\n```\n\nOutput: 将分析文字保存为变量 `ANALYSIS_TEXT`，传入 Step 2 的 `--analysis` 参数。\n\n---\n\n### Step 2 — 导出 PDF\n\nFIRST, send the user this message:\n> 【正在导出 PDF 报告】正在生成含 AI 分析的 PDF 文件，请稍候...\n\nTHEN run:\n```bash\npython3 /workspace/skills/pdf-exporter/scripts/export_pdf.py \\\n  --input  <html_file_path> \\\n  --output /workspace/Document/PersonalDocuments/<报告名称_时间戳>.pdf \\\n  --title  \"<报告标题>\" \\\n  --analysis \"<ANALYSIS_TEXT>\"\n```\n\n**参数说明：**\n\n| 参数 | 说明 | 示例 |\n|---|---|---|\n| `--input` | 输入 HTML 文件的绝对路径 | `/workspace/skills/sql-report-generator/output/report_xxx.html` |\n| `--output` | 输出 PDF 路径，**必须保存到** `/workspace/Document/PersonalDocuments/` | `/workspace/Document/PersonalDocuments/电力能耗趋势报告_1234567890.pdf` |\n| `--title` | PDF 标题（显示在文档首页），使用中文报告名称 | `\"电力能耗趋势报告\"` |\n| `--analysis` | Step 1 生成的 AI 分析文字，用引号包裹，内部换行用 `\\n` 表示 | `\"## 数据概况\\n总用电量 12,450 kWh...\"` |\n\n**Output（脚本输出 JSON）：**\n```json\n{\n  \"status\": \"success\",\n  \"message\": \"PDF 导出成功（含 AI 分析）\",\n  \"output_path\": \"/workspace/Document/PersonalDocuments/电力能耗趋势报告_1234567890.pdf\",\n  \"file_size_kb\": 45.2,\n  \"chinese_font\": true,\n  \"sections_count\": 12,\n  \"has_analysis\": true\n}\n```\n\n- `output_path`：生成的 PDF 文件路径，用于 Final Reply 中的地址标签\n- `chinese_font`：若为 `false` 说明字体文件缺失，需检查 `/workspace/skills/pdf-exporter/fonts/wqy-microhei.ttc`\n- `has_analysis`：若为 `false` 说明 `--analysis` 参数为空，AI 分析章节未插入\n- 若 `status` 为 `error`，读取 `message` 字段排查原因\n\n---\n\n## Final Reply Format\n\n成功导出后，回复格式如下：\n\n**Part 1 — 摘要**：2~3 句话说明 PDF 已生成，包含文件大小，并说明已保存至个人知识库，简要提及 AI 分析的核心结论。\n\n**Part 2 — 文件地址标签**：\n```\n@@@@@/Document/PersonalDocuments/<文件名>.pdf@@@@@\n```\n例如：`@@@@@/Document/PersonalDocuments/电力能耗趋势报告_1234567890.pdf@@@@@`\n\n**Part 3 — 建议标签（最后一行，格式固定）**：\n```\n#####%下载 PDF 报告%￥点击上方链接下载完整 PDF 报告（含 AI 智能分析）￥ %继续深入分析%￥基于当前数据进行更深度的挖掘￥ %导出其他格式%￥将报告导出为 Excel 或图片格式￥#####\n```\n\n---\n\n## Bundled Resources\n\n```\nskills/pdf-exporter/\n├── SKILL.md                    # 本文件（v1.2）\n├── scripts/\n│   └── export_pdf.py           # PDF 导出脚本（支持 --analysis 参数，中文、表格、标题层级）\n└── fonts/\n    └── wqy-microhei.ttc        # 文泉驿微米黑中文字体（5MB，支持简繁中文+日韩）\n```\n\n**依赖**：reportlab（已安装于 `/workspace/.local/lib/python3.11/site-packages`）\n\n---\n\n## Error Handling\n\n| 错误信息 | 原因 | 处理方式 |\n|---|---|---|\n| `reportlab 未安装` | reportlab 未安装到 `/workspace/.local` | 参考安装文档重新安装 reportlab |\n| `中文字体文件不存在` | `fonts/wqy-microhei.ttc` 缺失 | 检查 `/workspace/skills/pdf-exporter/fonts/wqy-microhei.ttc` 是否存在 |\n| `读取 HTML 文件失败` | HTML 文件路径错误或不存在 | 确认 `--input` 路径正确 |\n| `PDF 生成失败` | reportlab 内部错误 | 查看 stderr 输出获取详细错误信息 |\n\n---\n\n## Notes\n\n- `--analysis` 参数支持多行 Markdown 文字：`##` 开头为绿色小标题，`-` 开头为列表项，普通文字为正文段落\n- AI 分析章节使用绿色（`#0d6e4f`）主题色，与数据报告的蓝色（`#1677FF`）主题色区分，视觉上清晰分离\n- 分析末尾自动添加\"以上分析由 AI 自动生成，仅供参考\"免责声明及生成时间\n- 字体文件路径固定为 `/workspace/skills/pdf-exporter/fonts/wqy-microhei.ttc`，脚本自动查找，无需手动指定\n- PDF 输出文件名建议使用中文报告名称 + 时间戳，如 `电力能耗趋势报告_1234567890.pdf`\n- 脚本会自动从 HTML 中提取标题（h1~h4）、段落、表格；图表（Canvas/ECharts/SVG）无法转换，将被忽略\n- 所有导出的 PDF 统一保存至 `/workspace/Document/PersonalDocuments/`，方便用户在个人知识库中检索", "name: word-exporter\ndescription: >\n  MANDATORY: Use this skill for ANY Word document export or generation task.\n  Triggers: \"导出Word\", \"下载Word\", \"保存为Word\", \"生成Word文档\", \"export word\", \"save as docx\", \"转成Word\", \"Word报告\", \"生成docx\".\n  CRITICAL: NEVER write ad-hoc python-docx code directly in task scripts. ALWAYS call export_word.py via this skill.\n  This skill supports Chinese text rendering via lxml. Without it, complex formatting may fail.\n  Do NOT use for: reading Word files for content extraction (use direct python-docx read), merging documents.\nversion: \"1.0\"\n\n# Word 导出技能\n\n将结构化内容导出为 Microsoft Word (.docx) 格式文件，支持标题、段落、表格、列表等常见元素，并支持中文内容。\n\n## CRITICAL RULES\n\n- MUST call `export_word.py` for ALL Word export requests; NEVER write ad-hoc python-docx code\n- MUST ensure `sys.path` includes `/workspace/.local/lib/python3.11/site-packages` before importing docx\n- Output Word file MUST be saved to `/workspace/Document/PersonalDocuments/` (personal knowledge base)\n- ALWAYS confirm the output path returned by the script; NEVER fabricate a file path\n\n## 触发范围\n\n激活场景（MUST activate）：\n- 用户说\"导出Word\"、\"下载Word\"、\"保存为Word文档\"、\"生成docx\"\n- 用户要求将报告、表格、内容输出为 Word 格式\n\n## 使用方法\n\n调用 `/workspace/skills/word-exporter/scripts/export_word.py`，传入内容参数：\n\n```bash\npython3 /workspace/skills/word-exporter/scripts/export_word.py \\\n  --title \"文档标题\" \\\n  --content \"正文内容（支持Markdown格式）\" \\\n  --output \"/workspace/Document/PersonalDocuments/output.docx\"\n```\n\n## 依赖说明\n\n| 依赖包 | 版本 | 用途 |\n|--------|------|------|\n| python-docx | 1.2.0 | Word 文档生成核心库 |\n| lxml | 6.0.2 | XML 底层解析支持 |\n| typing_extensions | 4.15.0 | 类型注解支持 |\n\n依赖安装路径：`/workspace/.local/lib/python3.11/site-packages/`", "---\nname: load-forecasting\nversion: 1.0.0\ndescription: Power load forecasting model skill, providing functions to obtain load forecasting model lists, load models, perform quick load forecasting, and calculate load forecasting model evaluation parameters (MAE, RMSE, R², MAPE). Supports model training, automatically generates HTML reports after evaluation, and requires secondary parameter confirmation before training.\ncompatibility: Requires Python 3.x and access to API http://47.96.16.84:5005\nreturn_format_specification:\n  preview_training_params:\n    format: \"&**&key1=value1|key2=value2|...|keyN=valueN&**&\"\n    description: \"Parameter preview return format, using | as a separator, wrapped in &**&, JSON format is NOT used\"\n    example: \"&**&learning_rate=0.001|batch_size=32|max_epochs=100|window_size=96|hidden_size=128|num_layers=2|split_ratio=811|start_time=2024-01-01 00:00:00|end_time=2025-12-31 23:45:00&**&\"\n  evaluate_model:\n    format: \"@@@@@<report_address>@@@@@\"\n    description: \"Evaluation report return format, using @@@@@ to wrap the report address\"\n    example: \"@@@@@/skills/report-generator/output/report_1234567890.html@@@@@\"\nmetadata:\n  author: Manus AI\n---\n\n# 【Load Forecasting Model】\n\nThis skill is used for the complete evaluation process and model training function of power load forecasting models. It provides functions to obtain model lists, load models, perform quick load forecasting, and calculate evaluation parameters.\n\n---\n\n## ⚠️ Critical Rules\n\n- MUST: For model evaluation, model listing, prediction results, and data comparison, you must call `report-generator` to generate an HTML report.\n- MUST: Do not display the model path in the model list report.\n- MUST: Before training, you must call `handle_training_request.py` to preview all parameters and perform secondary parameter confirmation.\n- MUST: The training function must be triggered manually through conversation and will not be executed automatically.\n- MUST: The system will only start training after the user explicitly expresses the intention to confirm (e.g., \"Confirm parameters, start training\").\n- NEVER: The parameter preview return format strictly prohibits the use of JSON; it must strictly be `&**&key1=value1|key2=value2|...&**&` (using | as a separator and wrapped in &**&).\n\n---\n\n## When to Use\n\n### Handled by this skill\n\n- User asks about power load forecasting models, model evaluation, or calculating model parameters.\n- User requests to list all load forecasting models.\n- User requests to execute load forecasting or compare historical data with predicted data.\n- User wants to perform manual model training.\n\n### Not handled by this skill (Hand over to other skills)\n\n- PV power generation prediction related tasks → Hand over to `【pv-prediction-model】`\n- Pure report generation and formatting tasks (non-load data) → Hand over to `【report-generator】`\n\n---\n\n## How to Execute\n\n> Execute the following steps in order. For each step, you MUST send a progress message before running the command.\n\n### Step 1: Select Template\n\n**FIRST**, send this message to the user:\n\n`【开始分析】正在理解需求，匹配数据视图与展示模板...`\n\n**THEN**, run:\n\n```bash\ncd /workspace/skills/report-generator && \\\npython3 scripts/step1_select.py --query \"{{USER_QUERY}}\" --data \"{}\"\n```\n\n*Replace `{{USER_QUERY}}` with the user's original question.*\n\nOutput example:\n\n```json\n{\n  \"status\": \"success\",\n  \"template_name\": \"dataTable\",\n  \"reason\": \"模型列表适合用表格形式展示\"\n}\n```\n\nPass to next step: `template_name` → `--template` in Step 3.\n\n---\n\n### Step 2: Execute Action\n\n**FIRST**, send this message to the user:\n\n`【数据处理】正在执行操作并获取数据...`\n\n**THEN**, run the appropriate command based on user request:\n\n**Get model list:**\n```bash\npython scripts/predict_and_evaluate.py --action list_models\n```\n\n**Evaluate model:**\n```bash\npython scripts/predict_and_evaluate.py --action evaluate_model --model_id \"{{MODEL_ID}}\"\n```\n\n**Preview training parameters (secondary confirmation):**\n```bash\npython scripts/handle_training_request.py --learning_rate 0.001 --batch_size 32 --max_epochs 100\n```\n\n**Start training and monitor progress (ONLY after user confirmation):**\n```bash\npython scripts/train_station.py --action train_and_monitor --learning_rate 0.001 --batch_size 32 --max_epochs 100\n```\n\n**Compare historical and predicted data:**\n```bash\npython scripts/compare_prediction.py --target_date \"{{TARGET_DATE}}\" --model_name \"{{MODEL_NAME}}\"\n```\n\n**Execute load forecasting using a specific model:**\n```bash\npython scripts/load_forecast.py --model_name \"{{MODEL_NAME}}\"\n```\n\n**After Step 2, MUST immediately show the user:**\n- Explanation of intermediate results, such as the retrieved model list, evaluation metrics, or parameter preview.\n\n---\n\n### Step 3: Render HTML Report\n\n> Note: Parameter preview and starting training steps do not require report generation.\n\n**FIRST**, send this message to the user:\n\n`【报告生成】正在将结果渲染为可视化报告...`\n\n**THEN**, run:\n\n```bash\ncd /workspace/skills/report-generator && \\\npython3 scripts/step2_render.py \\\n  --query \"{{USER_QUERY}}\" \\\n  --template \"{{template_name from Step 1}}\" \\\n  --data \"{Output JSON data from Step 2}\"\n```\n\nOutput example:\n\n```json\n{\n  \"status\": \"success\",\n  \"message\": \"Report generated successfully\",\n  \"template\": \"dataTable\",\n  \"address\": \"/skills/report-generator/output/report_1773642266.html\",\n  \"summary\": \"共获取到3个负荷预测模型，其中best_model为最优模型。\"\n}\n```\n\n---\n\n## Usage Examples\n\n### Example 1: List all load forecasting models and generate a report\n\n**User Query**: \"List all load forecasting models\"\n\n**Execution Process**:\n1. **Step 1**: Call `step1_select.py --query \"列出所有负荷预测模型\" --data \"{}\"` to get the template name `dataTable`.\n2. **Step 2**: Call `predict_and_evaluate.py --action list_models` to get the model list.\n3. **Step 3**: Call `step2_render.py --query \"列出所有负荷预测模型\" --template \"dataTable\" --data \"{模型列表数据JSON}\"` to generate the final report.\n\n**Final Reply**:\nBased on the `summary` returned in Step 3, organize the final reply.\n```\n@@@@@/skills/report-generator/output/report_1773642266.html@@@@@\n\n#####%查看详细数据%￥点击上方链接查看完整的数据分析报告￥ %继续深入分析%￥基于当前数据进行更深度的挖掘￥ %导出报告%￥将当前报告导出为PDF或图片格式￥#####\n```\n\n### Example 2: Evaluate a load forecasting model and generate a report\n\n**User Query**: \"Evaluate the performance of best_model\"\n\n**Execution Process**:\n1. **Step 1**: Call `step1_select.py --query \"评估负荷预测模型\" --data \"{\\\"model_id\\\": \\\"best_model\\\"}\"` to get the template name `dataTable`.\n2. **Step 2**: Call `predict_and_evaluate.py --action evaluate_model --model_id best_model` to get prediction and evaluation data.\n3. **Step 3**: Call `step2_render.py --query \"评估负荷预测模型\" --template \"dataTable\" --data \"{预测和评估数据JSON}\"` to generate the final report containing evaluation metrics.\n\n### Example 3: Preview training parameters (secondary confirmation)\n\n**User Query**: \"I want to train a load forecasting model\"\n\n**Execution Process**:\n1. **Step 2**: Call `handle_training_request.py --learning_rate 0.001 --batch_size 32 --max_epochs 100`.\n2. **Final Reply**: Return the formatted string like `&**&learning_rate=0.001|batch_size=32|max_epochs=100|...&**&` directly. The system framework will automatically convert it into a table to display to the user and wait for confirmation.\n\n### Example 4: Start training after parameter confirmation\n\n**User Query**: \"Confirm parameters, start training\" (User action after Example 3)\n\n**Execution Process**:\n1. **Step 2**: Call `train_station.py --action train_and_monitor --learning_rate 0.001 --batch_size 32 --max_epochs 100` to start training and monitor progress.\n2. **Note**: This step does not require generating a report.\n\n### Example 5: Compare historical data with load forecasting data and generate a report\n\n**User Query**: \"Compare historical and predicted data for CNN-RBiLSTM model on 2026-03-30\"\n\n**Execution Process**:\n1. **Step 1**: Call `step1_select.py --query \"对比历史数据和负荷预测数据\" --data \"{\\\"target_date\\\": \\\"2026-03-30\\\", \\\"model_name\\\": \\\"CNN-RBiLSTM\\\"}\"` to get the template name `lineChartCompare`.\n2. **Step 2**: Call `compare_prediction.py --target_date \"2026-03-30\" --model_name \"CNN-RBiLSTM\"` to get the comparison data.\n3. **Step 3**: Call `step2_render.py --query \"对比历史数据和负荷预测数据\" --template \"lineChartCompare\" --data \"{对比数据JSON}\"` to generate the final report.\n\n### Example 6: Execute load forecasting using a specific model and generate a report\n\n**User Query**: \"Execute load forecasting using CNN-RBiLSTM model\"\n\n**Execution Process**:\n1. **Step 1**: Call `step1_select.py --query \"使用指定模型执行负荷预测\" --data \"{\\\"model_name\\\": \\\"CNN-RBiLSTM\\\"}\"` to get the template name `lineChart`.\n2. **Step 2**: Call `load_forecast.py --model_name \"CNN-RBiLSTM\"` to get the prediction results.\n3. **Step 3**: Call `step2_render.py --query \"使用指定模型执行负荷预测\" --template \"lineChart\" --data \"{预测数据JSON}\"` to generate the final report.\n\n---\n\n## Final Reply Format\n\nYour final reply MUST have exactly three parts:\n\n**Part 1 — Data Analysis Summary (Mandatory, cannot be omitted)**\nBased on the `summary` field from the final script output, write a genuine data analysis in the user's language.\n**DO NOT** just write \"The report has been generated\"; you must actually analyze the data content.\n⚠️ CRITICAL: Write a brand-new analysis every time. **DO NOT reuse text from previous replies.**\n\n**Part 2 — Address Tag (Second to last line, fixed format)**\n```\n@@@@@/skills/report-generator/output/report_1773642266.html@@@@@\n```\n⚠️ Copy the `address` field value EXACTLY from script output. NO spaces around `@@@@@`.\n\n**Part 3 — Suggestions Tag (Last line, fixed format)**\n```\n#####%查看详细数据%￥点击上方链接查看完整的数据分析报告￥ %继续深入分析%￥基于当前数据进行更深度的挖掘￥ %导出报告%￥将当前报告导出为PDF或图片格式￥#####\n```\n\n---\n\n## Gotchas\n\n- Path leakage: Do not display the model path in the model list report.\n- Skipping parameter confirmation: It is strictly prohibited to skip the parameter confirmation step and start training directly; you must wait for explicit user consent.\n- Report format error: The report address format must strictly follow `@@@@@<report_address>@@@@@`.\n\n---\n\n## Bundled Resources\n\n- `scripts/predict_and_evaluate.py` — Executes load forecasting model list retrieval and evaluation calculations.\n- `scripts/handle_training_request.py` — Handles user training requests and previews training parameters.\n- `scripts/train_station.py` — Performs load forecasting model training.\n- `scripts/compare_prediction.py` — Compares historical load data and predicted load data for a specified date.\n- `scripts/load_forecast.py` — Loads a model based on the model name and executes prediction.\n\n> Read these files only when debugging. Normal execution does not require manual inspection.\n\n---\n\n## Error Handling\n\n- `\"status\": \"error\"` → Inform the user \"Service is temporarily unavailable, please try again later\", and output the content of the `message` field.\n- API call failure → Check the connection status of the API service `http://47.96.16.84:5005`.\n- User refuses to confirm parameters → Cancel the training task and ask the user if they need to adjust the parameters.", "name: sql-report-generator\n\ndescription: \"MANDATORY: When user asks to query database, generate SQL, create data reports from views, OR asks any question about data counts/statistics/quantities (e.g. '有多少', '数量', '共有几个', '统计', '查看...有哪些'), you MUST: (1) read this SKILL.md, (2) execute the Python scripts in 3 steps. DO NOT answer data questions directly in chat. DO NOT generate SQL manually in chat. Generates HTML reports by querying database views. ⚠️ This skill OWNS all battery-related data queries EXCEPT fault/alarm records: battery group lists, battery counts, real-time status (SOC/voltage/current), charge/discharge statistics, availability, efficiency — ALL must use this skill.\"\n\n\\---\n\n\n\n\\# SQL Report Generator Skill\n\n\n\n\\## ⚠️ CRITICAL RULES - READ BEFORE ANYTHING ELSE\n\n\\*\\*YOU MUST EXECUTE THE 3 PYTHON SCRIPTS IN ORDER. NO EXCEPTIONS.\\*\\*\n\n\\- ❌ DO NOT generate SQL queries directly in the chat response\n\n\\- ❌ DO NOT skip any script execution\n\n\\- ❌ DO NOT reply with only a file path — you MUST include data analysis text first\n\n\\- ❌ DO NOT guess or fabricate the file path — ALWAYS use the exact `address` value from the script output\n\n\\- ✅ ALWAYS run the exec commands below step by step\n\n\\- ✅ \\*\\*CRITICAL: You MUST write a short status update to the user BEFORE running EACH script. This text will be streamed to the user's UI as a progress indicator.\\*\\*\n\n\\- ✅ ALWAYS write a data analysis summary BEFORE the address tag\n\n\\- ✅ The LAST TWO LINES of your final reply MUST be the `@@@@@` address tag followed by the `#####` suggestions tag\n\n\\- ✅ After completing all steps, you MUST append the full list of all executed script commands to the file `/workspace/skill/sql-report-generator/SKILL_commands.md`\n\n\\- ❌ **DO NOT reuse or copy analysis text from previous conversations, memory, or history** — ALWAYS generate a completely fresh analysis based on the CURRENT script execution's output and actual data values\n\n\\- ❌ **DO NOT assume the data is the same as last time** — even if the query is identical, the database may have new data; ALWAYS re-execute all 3 scripts and re-analyze the new results\n\n\n\n\\## When to Use\n\nUse this skill when:\n\n\\- User asks to query the database or generate SQL\n\n\\- User asks for data reports based on database views\n\n\\- User wants to visualize data from the database\n\n\\- User asks questions that require querying the system's data views\n\n\\- ⚠️ **User asks counting or statistics questions** — e.g. \"有多少\"、\"数量是多少\"、\"共有几个\"、\"统计一下\"、\"查看...有哪些\"、\"列出所有...\" — **MUST call this skill, DO NOT answer with a number directly in chat**\n\n\\- ⚠️ **Any question about device lists, equipment counts, data summaries, or entity enumeration** must use this skill to generate an HTML report, never a plain text answer\n\n\\- ⚠️ **蓄电池组相关查询（除告警/故障记录外）全部由本技能处理**，包括：蓄电池组列表、蓄电池组数量（\"有多少电池组\"）、蓄电池组基础信息、实时运行状态（SOC/电压/电流/功率）、日充放电统计、可用率、转换效率等 — **这些问题不属于 battery_anomaly_detector 的范围，必须走本技能的三步脚本流程生成 HTML 报告**\n\n\n\n\\## How to Execute\n\nThis skill requires executing 3 steps. \\*\\*Before running each step, you MUST write a short text to the user explaining what you are about to do. This text MUST start with the exact ` ⏳ ` format specified below.\\*\\*\n\n\n\n\\### Step 1: Select Template and Views\n\n\\*\\*FIRST\\*\\*, write this exact text to the user (do not use tool yet):\n\n`【正在分析问题】正在分析问题，选择数据视图和展示模板...`\n\n\n\n\\*\\*THEN\\*\\*, run this command:\n\n```bash\n\ncd /workspace/skill/sql-report-generator \\&\\& python3 scripts/step1\\_select.py --query \"{{USER\\_QUERY}}\"\n\n```\n\n\\*Replace `{{USER\\_QUERY}}` with the user's query text.\\*\n\n\n\nThe script will output a JSON like:\n\n```json\n\n{\"status\": \"success\", \"selected\\_views\": \\[\"视图名1\"], \"template\\_name\": \"barChart\", \"is\\_fixed\\_template\": false, \"reason\": \"...\"}\n\n```\n\n\n\nFor 园区概览 or 企业概览 queries, the output will include extra fields:\n\n```json\n\n{\"status\": \"success\", \"selected\\_views\": \\[], \"template\\_name\": \"dashboard\\_overview\", \"is\\_fixed\\_template\": true, \"fixed\\_template\\_type\": \"dashboard\\_overview\", \"date\\_type\": \"year\", \"date\": \"2025\", \"park\\_name\": \"XX园区\", \"enterprise\\_name\": null, \"reason\": \"...\"}\n\n```\n\n\\- `date\\_type`: `\"year\"` = 年度查询（用户说\"2025年\"），`\"month\"` = 月度查询（用户说\"2025年3月\"）\n\n\\- `date`: 年度时为 `\"2025\"`，月度时为 `\"2025-03\"`\n\n```\n\n\n\n\\### Step 2: Generate SQL and Query Database\n\n\\*\\*FIRST\\*\\*, write this exact text to the user:\n\n`【正在生产查询语句】 正在生成 SQL 查询语句并查询数据库...`\n\n\n\n\\*\\*THEN\\*\\*, run this command.\n\n\n\n\\*\\*⚠️ IMPORTANT: Check `is\\_fixed\\_template` from Step 1 output:\\*\\*\n\n\n\n\\*\\*If `is\\_fixed\\_template` is `false` (normal flow):\\*\\*\n\n```bash\n\ncd /workspace/skill/sql-report-generator \\&\\& python3 scripts/step2\\_query.py --query \"{{USER\\_QUERY}}\" --views \"{{selected\\_views\\_comma\\_separated}}\" --template \"{{template\\_name}}\" --is\\_fixed\\_template false\n\n```\n\n\n\n\\*\\*If `is\\_fixed\\_template` is `true` (园区概览 or 企业概览):\\*\\*\n\n```bash\n\ncd /workspace/skill/sql-report-generator \\&\\& python3 scripts/step2\\_query.py --query \"{{USER\\_QUERY}}\" --views \"\" --template \"{{template\\_name}}\" --is\\_fixed\\_template true --date\\_type \"{{date\\_type}}\" --date \"{{date}}\" --park\\_name \"{{park\\_name}}\" --enterprise\\_name \"{{enterprise\\_name}}\"\n\n```\n\n\\*Replace all `{{...}}` with values from Step 1 output. If a value is `null`, pass the string `\"None\"`.\\*\n\n\\*`--date\\_type` must be `\"year\"` or `\"month\"` exactly as returned by Step 1.\\*\n\n\n\nThe script will output a JSON like:\n\n```json\n\n{\"status\": \"success\", \"sql\": \"SELECT ...\", \"row\\_count\": 10, \"result\\_file\": \"/workspace/skill/sql-report-generator/output/temp\\_result\\_123.json\"}\n\n```\n\n\n\n\\*\\*After Step 2 completes, you MUST immediately write the following to the user (before running Step 3):\\*\\*\n\nExtract `sql` and `row\\_count` from the Step 2 JSON output, then write:\n\n\n\n\n\n\n\n\\- Replace `<row\\_count>` with the exact value of the `row\\_count` field from Step 2 output.\n\n\\- This message MUST be shown to the user before proceeding to Step 3.\n\n\n\n\\### Step 3: Render HTML Report\n\n\\*\\*FIRST\\*\\*, write this exact text to the user:\n\n`【正在渲染页面】 正在将查询结果渲染为图表报告...`\n\n\n\n\\*\\*THEN\\*\\*, run this command:\n\n```bash\n\ncd /workspace/skill/sql-report-generator \\&\\& python3 scripts/step3\\_render.py --query \"{{USER\\_QUERY}}\" --template \"{{template\\_name}}\" --result\\_file \"{{result\\_file}}\"\n\n```\n\n\\*Replace variables with the output from Step 2.\\*\n\n\n\nThe script will output a JSON at the end like:\n\n```json\n\n{\"status\": \"success\", \"message\": \"Report generated successfully\", \"template\": \"barChart\", \"address\": \"/skill/sql-report-generator/output/report\\_1773642266.html\", \"summary\": \"...\"}\n\n```\n\n\n\n\\---\n\n\n\n\\### Final Reply Format\n\nYour final reply MUST have exactly three parts:\n\n\n\n\\*\\*Part 1 — Data Analysis Summary（必须，不可省略）\\*\\*\n\nWrite a concise analysis in Chinese based on the `summary` field from the Step 3 script output, or expand on it if needed.\n\n\\*\\*禁止\\*\\*只写\"报告已生成\"之类的话，必须真正分析数据内容。\n\n⚠️ \\*\\*CRITICAL — FRESH ANALYSIS REQUIRED:\\*\\* You MUST write a brand new analysis every time based on the CURRENT execution results. **DO NOT copy, reuse, or paraphrase any analysis text from memory, previous sessions, or earlier replies in this conversation.** The data may have changed since last time. Treat every execution as if it is the first time.\n\n\n\n\\*\\*Part 2 — Address Tag（倒数第二行，格式固定）\\*\\*\n\nThe second-to-last line of your reply MUST be the `address` field value wrapped in `@@@@@`:\n\n```\n\n@@@@@/skill/sql-report-generator/output/report\\_1773642266.html@@@@@\n\n```\n\n⚠️ \\*\\*ADDRESS TAG FORMAT — ABSOLUTE RULES:\\*\\*\n\n\\- The path MUST be copied EXACTLY from the `address` field in the script JSON output\n\n\\- DO NOT fabricate, guess, or approximate the report filename\n\n\\- Output ONLY the plain file path between the two `@@@@@` markers\n\n\\- NO spaces between `@@@@@` and the path\n\n\n\n\\*\\*Part 3 — Optimization Suggestions Tag（最后一行，格式固定）\\*\\*\n\nThe very last line of your reply MUST be the optimization suggestions wrapped in `#####`.\n\n```\n\n\\#####%查看详细数据%￥点击上方链接查看完整的数据分析报告￥ %继续深入分析%￥基于当前数据进行更深度的挖掘￥ %导出报告%￥将当前报告导出为PDF或图片格式￥#####\n\n```\n\n\\*\\*Part 4 — Script Commands Log（每次执行后必须输出）\\*\\*\n\nAfter completing all steps, you MUST append the full list of all executed script commands to the file `/workspace/skill/sql-report-generator/commands/commands.txt` by running:\n\n```bash\ncat >> /workspace/skill/sql-report-generator/commands/commands.txt << 'EOF'\n\n## [{{YYYY-MM-DD HH:MM:SS}}] {{USER_QUERY}}\n\n# Step 1\ncd /workspace/skill/sql-report-generator && python3 scripts/step1_select.py --query \"{{USER_QUERY}}\"\n\n# Step 2\ncd /workspace/skill/sql-report-generator && python3 scripts/step2_query.py --query \"{{USER_QUERY}}\" --views \"{{selected_views}}\" --template \"{{template_name}}\" --is_fixed_template {{is_fixed_template}}\n\n# Step 3\ncd /workspace/skill/sql-report-generator && python3 scripts/step3_render.py --query \"{{USER_QUERY}}\" --template \"{{template_name}}\" --result_file \"{{result_file}}\"\nEOF\n```\n\n*Replace all `{{...}}` with the actual values used in this execution. Use the exact commands as run, including all parameters.*\n\n\n\n\\## Bundled Resources\n\nThis skill uses progressive disclosure. The following resources are available but should only be read if you need to debug or understand the internal workings:\n\n\\- `references/views\\_schema.md`: Documentation of all available database views and their columns.\n\n\\- `templates/\\*.md`: Documentation for each HTML template's required JSON structure.\n\n\\- `scripts/step1\\_select.py`, `step2\\_query.py`, `step3\\_render.py`: The execution scripts.", "name: report-generator\nversion: 1.0.0\n\ndescription: \"Generates HTML reports from external data using predefined templates. Accepts JSON data and outputs HTML visualization.\"\n---\n\n# Report Generator Skill\n\n## When to Use\nUse this skill when:\n- You have external data (from other skills) that needs to be visualized\n- You need to generate HTML reports from JSON data\n- You want to use predefined visualization templates for data presentation\n- Other skills (like load-forecasting and pv-prediction-model) require report generation for their outputs\n\n## 调用指南\n当其他skill需要生成报告时，必须按照以下步骤调用report-generator：\n\n### 步骤1：模板选择\n1. 向用户发送进度信息：`PROGRESS: ⏳ 正在分析数据，选择合适的可视化模板...`\n2. 调用 `step1_select.py` 脚本，根据用户查询和数据结构选择合适的可视化模板\n\n### 步骤2：生成报告\n1. 向用户发送进度信息：`PROGRESS: ⏳ 正在将数据渲染为图表报告...`\n2. 调用 `step2_render.py` 脚本，使用选定的模板渲染HTML报告\n\n### 步骤3：返回结果\n1. 分析脚本输出的 `summary` 字段，生成数据分析摘要\n2. 使用 `@@@@@` 包裹报告地址，作为倒数第二行\n3. 使用 `#####` 包裹优化建议，作为最后一行\n\n## How to Execute\n\n### Step 1: Select Template\n**FIRST**, write this exact text to the user (do not use tool yet):\n`PROGRESS: ⏳ 正在分析数据，选择合适的可视化模板...`\n\n**THEN**, run this command:\n```bash\ncd /workspace/skills/report-generator && python3 scripts/step1_select.py --query \"{{USER_QUERY}}\" --data \"{{DATA_JSON}}\"\n```\n*Replace `{{USER_QUERY}}` with the user's query text and `{{DATA_JSON}}` with the JSON data.*\n\nThe script will output a JSON like:\n```json\n{\"status\": \"success\", \"template_name\": \"barChart\", \"reason\": \"...\"}\n```\n\n### Step 2: Render HTML Report\n**FIRST**, write this exact text to the user:\n`PROGRESS: ⏳ 正在将数据渲染为图表报告...`\n\n**THEN**, run this command:\n```bash\ncd /workspace/skills/report-generator && python3 scripts/step2_render.py --query \"{{USER_QUERY}}\" --template \"{{template_name}}\" --data \"{{DATA_JSON}}\"\n```\n*Replace variables with the output from Step 1 and the original data.*\n\nThe script will output a JSON at the end like:\n```json\n{\"status\": \"success\", \"message\": \"Report generated successfully\", \"template\": \"barChart\", \"address\": \"/skills/report-generator/output/report_1773642266.html\", \"summary\": \"...\"}\n```\n\n---\n\n### Final Reply Format\nYour final reply MUST have exactly three parts:\n\n**Part 1 — Data Analysis Summary（必须，不可省略）**\nWrite a concise analysis in Chinese based on the `summary` field from the Step 2 script output, or expand on it if needed.\n**禁止**只写\"报告已生成\"之类的话，必须真正分析数据内容。\n\n**Part 2 — Address Tag（倒数第二行，格式固定）**\nThe second-to-last line of your reply MUST be the `address` field value wrapped in `@@@@@`:\n```\n@@@@@/skills/report-generator/output/report_1773642266.html@@@@@\n```\n⚠️ **ADDRESS TAG FORMAT — ABSOLUTE RULES:**\n- The path MUST be copied EXACTLY from the `address` field in the script JSON output\n- DO NOT fabricate, guess, or approximate the report filename\n- Output ONLY the plain file path between the two `@@@@@` markers\n- NO spaces between `@@@@@` and the path\n\n**Part 3 — Optimization Suggestions Tag（最后一行，格式固定）**\nThe very last line of your reply MUST be the optimization suggestions wrapped in `#####`:\n```\n#####%查看详细数据%￥点击上方链接查看完整的数据分析报告￥ %继续深入分析%￥基于当前数据进行更深度的挖掘￥ %导出报告%￥将当前报告导出为PDF或图片格式￥#####\n```\n\n## Bundled Resources\n- `templates/*.html`: HTML visualization templates\n- `templates/*.md`: Documentation for each HTML template's required JSON structure\n- `scripts/step1_select.py`, `step2_render.py`: The execution scripts"], "names": ["excel-exporter", "pv-prediction-model", "sms-notifier", "pdf-exporter", "word-exporter", "Load-Forecasting", "sql-report-generator", "report-generator"], "paths": ["/home/admin/.openclaw/workspace-216/skills/skill-router/skills/excel-exporter/SKILL.md", "/home/admin/.openclaw/workspace-216/skills/skill-router/skills/pv-prediction-model/SKILL.md", "/home/admin/.openclaw/workspace-216/skills/skill-router/skills/sms-notifier/SKILL.md", "/home/admin/.openclaw/workspace-216/skills/skill-router/skills/pdf-exporter/SKILL.md", "/home/admin/.openclaw/workspace-216/skills/skill-router/skills/word-exporter/SKILL.md", "/home/admin/.openclaw/workspace-216/skills/skill-router/skills/Load-Forecasting/SKILL.md", "/home/admin/.openclaw/workspace-216/skills/skill-router/skills/sql-report-generator/SKILL.md", "/home/admin/.openclaw/workspace-216/skills/skill-router/skills/report-generator/SKILL.md"]}