/percentage-calculation
根据文件行数动态切换大文件处理策略(Parquet转换),通过逐行扫描或列匹配提取关键指标并计算占比、均值等统计量,最终输出结构化Excel报告及可视化图表。
$ npx -y skills add OpenSenseNova/SenseNova-Skills --skill percentage-calculation --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/percentage-calculation
Context preview
The summary Claude sees to decide when to auto-load this skill.
根据文件行数动态切换大文件处理策略(Parquet转换),通过逐行扫描或列匹配提取关键指标并计算占比、均值等统计量,最终输出结构化Excel报告及可视化图表。
SKILL.md
percentage-calculation.SKILL.mdname: dynamic-percentage-and-large-file-analysis
description: "根据文件行数动态切换大文件处理策略(Parquet转换),通过逐行扫描或列匹配提取关键指标并计算占比、均值等统计量,最终输出结构化Excel报告及可视化图表。"
Skill Steps
> This sub-skill covers one capability of the Excel workflow. For reading/counting/Parquet optimization, see the parent workflow SKILL.md.
Step1 在数据中动态定位关键字段,通过逐行扫描匹配关键词提取数值,并进行条件筛选与占比计算。
key_values = {}
target_col = None
value_col = 'target_value_col'
# 动态查找目标分类列
for col in df_analysis.columns:
if 'keyword1' in col.lower() or 'keyword2' in col.lower():
target_col = col
break
# 通用字段查找逻辑:逐行扫描匹配关键词并提取首个正数
for idx, row in df_analysis.iterrows():
row_str = str(row.values)
if '指标A' in row_str and '指标A' not in key_values:
for val in row.values:
if isinstance(val, (int, float)) and val > 0:
key_values['指标A'] = val
break
if '指标B' in row_str and '指标B' not in key_values:
for val in row.values:
if isinstance(val, (int, float)) and val > 0:
key_values['指标B'] = val
break
# 条件筛选与统计
if target_col and '特定类别' in df_analysis[target_col].unique():
df_filtered = df_analysis[df_analysis[target_col] == '特定类别']
if value_col in df_filtered.columns:
df_filtered[value_col] = pd.to_numeric(df_filtered[value_col], errors='coerce')
avg_val = df_filtered[value_col].mean()
print(f"特定类别平均值 = {avg_val:.2f}")
# 计算占比
if '指标A' in key_values and '指标B' in key_values:
percentage = (key_values['指标A'] / key_values['指标B']) * 100
print(f"指标A占指标B的百分比: {percentage:.2f}%")Step2 将计算结果保存为结构化表格文件(.xlsx),并在输出中提供可追溯的下载链接。
output_path = "output_analysis_result.xlsx"
os.makedirs(os.path.dirname(output_path), exist_ok=True)
result_data = {
'项目': ['指标A', '指标B', '占比'],
'数值': [key_values.get('指标A', 0), key_values.get('指标B', 0), f"{percentage:.2f}%" if 'percentage' in locals() else "N/A"]
}
df_result = pd.DataFrame(result_data)
with pd.ExcelWriter(output_path, engine='openpyxl') as writer:
df_result.to_excel(writer, sheet_name='汇总结果', index=False)
print(f"结果已保存到: {output_path}")
print(f"下载链接: [点击下载结果表格]({output_path})")Step3 配置中文字体并生成高分辨率的可视化图表(如饼图),展示占比分析结果。
import matplotlib.pyplot as plt
import matplotlib
# 配置中英文字体,防止图表中文乱码
matplotlib.rcParams['font.sans-serif'] = ['SimHei', 'DejaVu Sans', 'WenQuanYi Zen Hei']
matplotlib.rcParams['axes.unicode_minus'] = False
if 'percentage' in locals():
# 图表美化与高分辨率设置
plt.figure(figsize=(8, 6), dpi=120)
labels = ['指标A', '其他']
sizes = [percentage, 100 - percentage]
colors = ['#ff9999', '#66b3ff']
plt.pie(sizes, labels=labels, colors=colors, autopct='%1.1f%%', startangle=90)
plt.title('核心指标占比分析')
plt.axis('equal')
chart_path = "percentage_chart.png"
plt.savefig(chart_path, bbox_inches='tight')
print(f"图表已保存至: {chart_path}")
print(f"图表下载链接: [点击下载可视化图表]({chart_path})")Read more
name: dynamic-percentage-and-large-file-analysis description: "根据文件行数动态切换大文件处理策略(Parquet转换),通过逐行扫描或列匹配提取关键指标并计算占比、均值等统计量,最终输出结构化Excel报告及可视化图表。"
Skill Steps
> This sub-skill covers one capability of the Excel workflow. For reading/counting/Parquet optimization, see the parent workflow SKILL.md.
Step1 在数据中动态定位关键字段,通过逐行扫描匹配关键词提取数值,并进行条件筛选与占比计算。
key_values = {}
target_col = None
value_col = 'target_value_col'
# 动态查找目标分类列
for col in df_analysis.columns:
if 'keyword1' in col.lower() or 'keyword2' in col.lower():
target_col = col
break
# 通用字段查找逻辑:逐行扫描匹配关键词并提取首个正数
for idx, row in df_analysis.iterrows():
row_str = str(row.values)
if '指标A' in row_str and '指标A' not in key_values:
for val in row.values:
if isinstance(val, (int, float)) and val > 0:
key_values['指标A'] = val
break
if '指标B' in row_str and '指标B' not in key_values:
for val in row.values:
if isinstance(val, (int, float)) and val > 0:
key_values['指标B'] = val
break
# 条件筛选与统计
if target_col and '特定类别' in df_analysis[target_col].unique():
df_filtered = df_analysis[df_analysis[target_col] == '特定类别']
if value_col in df_filtered.columns:
df_filtered[value_col] = pd.to_numeric(df_filtered[value_col], errors='coerce')
avg_val = df_filtered[value_col].mean()
print(f"特定类别平均值 = {avg_val:.2f}")
# 计算占比
if '指标A' in key_values and '指标B' in key_values:
percentage = (key_values['指标A'] / key_values['指标B']) * 100
print(f"指标A占指标B的百分比: {percentage:.2f}%")Step2 将计算结果保存为结构化表格文件(.xlsx),并在输出中提供可追溯的下载链接。
output_path = "output_analysis_result.xlsx"
os.makedirs(os.path.dirname(output_path), exist_ok=True)
result_data = {
'项目': ['指标A', '指标B', '占比'],
'数值': [key_values.get('指标A', 0), key_values.get('指标B', 0), f"{percentage:.2f}%" if 'percentage' in locals() else "N/A"]
}
df_result = pd.DataFrame(result_data)
with pd.ExcelWriter(output_path, engine='openpyxl') as writer:
df_result.to_excel(writer, sheet_name='汇总结果', index=False)
print(f"结果已保存到: {output_path}")
print(f"下载链接: [点击下载结果表格]({output_path})")Step3 配置中文字体并生成高分辨率的可视化图表(如饼图),展示占比分析结果。
import matplotlib.pyplot as plt
import matplotlib
# 配置中英文字体,防止图表中文乱码
matplotlib.rcParams['font.sans-serif'] = ['SimHei', 'DejaVu Sans', 'WenQuanYi Zen Hei']
matplotlib.rcParams['axes.unicode_minus'] = False
if 'percentage' in locals():
# 图表美化与高分辨率设置
plt.figure(figsize=(8, 6), dpi=120)
labels = ['指标A', '其他']
sizes = [percentage, 100 - percentage]
colors = ['#ff9999', '#66b3ff']
plt.pie(sizes, labels=labels, colors=colors, autopct='%1.1f%%', startangle=90)
plt.title('核心指标占比分析')
plt.axis('equal')
chart_path = "percentage_chart.png"
plt.savefig(chart_path, bbox_inches='tight')
print(f"图表已保存至: {chart_path}")
print(f"图表下载链接: [点击下载可视化图表]({chart_path})")The SenseNova model family plugs directly into agent runtimes such as OpenClaw and hermes-agent, with the skills in this repository extending the models with concrete, end-to-end office capabilities.
Repo: OpenSenseNova/SenseNova-Skills
Other skills on sensenova-skills.
- /sn-da-excel-workflow
Excel 数据分析多步编排器。覆盖:(1) 读取多 Sheet Excel 文件并统计行数,(2) 大文件检测(≥10k 行自动 Parquet 优化),(3) 数据清洗(缺失值、文本标准化、无效字符),(4) 条件筛选与分类提取,(5) 跨 Sheet 统计聚合,(6) 导出 Excel/CSV 并提供下载链接。覆盖从数据读取到报告生成全流程,按步骤编排 capability 子 skill。**遇到以下任一情况就主动使用本 skill,不要自行写几行 pandas 就回答**:①用户出现触发词:Excel 分析 / 表格分析 / 数据分析 /
Open skill - /category-coloring
当Excel文件总行数超过1万行时,通过转换为Parquet格式提升读取性能,提取目标指标并计算最大值,最后将结果输出为Excel并对特定行进行高亮标注。
Open skill - /duplicate-value-coloring
对比Excel多表中的特定系数并对异常值进行颜色标记。
Open skill - /outlier-coloring
识别 Excel 中的超限数值与错误单元格并进行高亮标注。
Open skill - /threshold-cell-coloring
根据Excel总行数自动切换Parquet加速读取,计算特定维度的时间序列平均值,并使用openpyxl输出带有条件格式(如低于均值标绿)和自定义样式的分析报告。
Open skill - /top-value-coloring
根据数据规模动态选择处理策略,对多表数据进行合并、统计筛选,并利用 openpyxl 实现关键指标的自动化样式高亮与格式化导出。
Open skill

