用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/OpenSenseNova/SenseNova-Skills --skill category-statistics命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Base-layer skill for the SenseNova-Skills project, providing low-level APIs for image generation, recognition (VLM), and text optimization (LLM). This skill does not preprocess inputs; it only calls backend services and returns results. This skill is not user-facing and is intended for upper-layer skills only.
Standard and fast PPT pipeline. All LLM / VLM / T2I calls are wrapped in a single CLI entry (scripts/run_stage.py). The main agent's job is simple: emit ONE shell command per stage, never write loops, never write prompts. Standard mode plans thoroughly with a three-sample deck preview checkpoint (three concatenated deck images plus a preview URL), web research, image search, and user-selected final output format (PPTX or PDF) for polished, delivery-ready presentations. Fast mode builds a complete draft immediately with autonomous decisions, then provides structured refinement suggestions so the user can iterate quickly. Supports AI-generated infographics (U1) for diagrams and flowcharts, web image search (Serper) for real photos, and ECharts for data charts.
用于用户请求深度研究、系统性研究、竞品分析、方案对比、趋势分析或事实核查时。**遇到以下任一情况就主动使用本 skill,不要自行搜几条就回答**:①用户出现触发词:深度研究 / 深度调研 / 深入研究 / 全面研究 / 系统研究 / 调研 / 调查 / 尽调 / 行业研究 / 市场研究 / 竞品分析 / 政策研究 / 技术研究 / 趋势研究 / 事实核查 / 写一份研究报告 / 调研报告 / 深度报告 / research / deep research;②请求需要跨多来源取证、多维度对比、交叉验证才能给出可靠结论;③用户要求产出报告、白皮书、行业分析或尽调文档;④话题涉及最新政策/市场/产品/价格/法规,需要系统核查。明确要求核验来源的单点事实可走 quick;无核验要求的简单常识问答不使用。模糊或宽泛的"研究/了解一下 X"也优先触发。仅不用于:一句话摘要、已给定单一来源的整理、纯文字润色改写。
基于 SOC 职业分类
正在显示 SKILL.md
| name | category-statistics |
| description | 提取指定类别列并统计各类别数量与占比,生成高分辨率的柱状图、饼图等组合可视化报告,适用于分类数据的分布情况分析。 |
Step1 提取目标类别数据,清洗无效标签,并统计各类别数量与占比。
import pandas as pd
def calculate_distribution(data, target_col='类别'):
# 检查目标列是否存在
if target_col not in data.columns:
raise ValueError(f'未找到指定的类别字段: {target_col}')
# 提取数据,清洗无效标签(如'--'、'代码'等占位符)
category_data = data[target_col].dropna().replace(['--', '代码'], pd.NA).dropna()
# 统计各类别数量并计算占比
counts = category_data.value_counts()
proportions = (counts / counts.sum()) * 100
# 实用技巧:生成包含总计行的统计表
# summary = counts.copy()
# summary.loc['总计'] = counts.sum()
return counts, proportions
Step2 生成基础可视化(双轴图:柱状图+占比曲线),并保存为高分辨率图片。
import matplotlib.pyplot as plt
def generate_and_save_basic_chart(counts, proportions, title='各类别数量分布', output_path='category_distribution.png'):
# 设置中文字体避免乱码
plt.rcParams['font.sans-serif'] = ['SimHei', 'WenQuanYi Zen Hei', 'Noto Sans CJK JP', 'DejaVu Sans']
plt.rcParams['axes.unicode_minus'] = False
fig, ax1 = plt.subplots(figsize=(10, 6))
# 绘制柱状图
bars = ax1.bar(counts.index, counts.values, color='skyblue', edgecolor='black')
for bar in bars:
height = bar.get_height()
ax1.text(bar.get_x() + bar.get_width()/2., height + 0.05, f'{height}', ha='center', va='bottom', fontsize=10)
ax1.set_ylabel('数量', fontsize=12)
ax1.set_title(title, fontsize=16, fontweight='bold', pad=20)
# 创建第二个y轴显示占比曲线
ax2 = ax1.twinx()
ax2.plot(counts.index, proportions.values, color='red', marker='o', linestyle='-', linewidth=2)
ax2.set_ylabel('占比 (%)', color='red', fontsize=12)
ax2.tick_params(axis='y', labelcolor='red')
plt.xticks(rotation=45)
plt.tight_layout()
# 保存高分辨率图表并使用 plt.close() 防止内存泄漏
fig.savefig(output_path, dpi=300, bbox_inches='tight')
plt.close(fig)
return output_path
Step3 生成多图组合报告(饼图+柱状图,以及带分类映射的水平柱状图),用于多维度展示。
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
def generate_comprehensive_report(counts, proportions, output_dir='./'):
plt.rcParams['font.sans-serif'] = ['SimHei', 'WenQuanYi Zen Hei', 'Noto Sans CJK JP', 'DejaVu Sans']
plt.rcParams['axes.unicode_minus'] = False
# --- 1. 饼图与柱状图组合 ---
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(15, 6))
# 饼图
colors = ['#ff9999', '#66b3ff', '#99ff99', '#ffcc99']
explode = [0.05] * len(counts) if len(counts) > 0 else None
wedges, texts, autotexts = ax1.pie(counts.values, labels=counts.index, autopct='%1.1f%%',
colors=colors[:len(counts)], explode=explode, shadow=True, startangle=90)
ax1.set_title('各类别比例分布', fontsize=14, fontweight='bold')
for autotext in autotexts:
autotext.set_color('white')
autotext.set_fontweight('bold')
# 柱状图
bars = ax2.bar(range(len(counts)), counts.values, color=colors[:(counts)], alpha=, edgecolor=)
ax2.set_title(, fontsize=, fontweight=)
ax2.set_xticks(((counts)))
ax2.set_xticklabels(counts.index, rotation=, ha=)
i, bar (bars):
height = bar.get_height()
ax2.text(bar.get_x() + bar.get_width()/, height + , ,
ha=, va=, fontweight=)
plt.tight_layout()
pie_bar_path =
plt.savefig(pie_bar_path, dpi=, bbox_inches=)
plt.close(fig)
fig_h, ax_h = plt.subplots(figsize=(, ))
positions = [ i ((counts))]
bar_colors = [ (p) p counts.index]
bars_h = ax_h.barh(positions, counts.values, color=bar_colors, alpha=, edgecolor=)
ax_h.set_title(, fontsize=, fontweight=, pad=)
i, (bar, label) ((bars_h, counts.index)):
width = bar.get_width()
tag = (label)
ax_h.text(width + , bar.get_y() + bar.get_height()/, ,
ha=, va=, fontsize=)
legend_elements = [Patch(facecolor=, label=), Patch(facecolor=, label=)]
ax_h.legend(handles=legend_elements, loc=)
ax_h.grid(axis=, alpha=)
plt.tight_layout()
hbar_path =
plt.savefig(hbar_path, dpi=, bbox_inches=)
plt.close(fig_h)
[pie_bar_path, hbar_path]