Install any skill in seconds. Free to start, no credit card required.
Get Started Free →识别 Excel 中的超限数值与错误单元格并进行高亮标注。
.claude/skills/opensensenova-excel-outlier-detection-and-highlighting/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | -15% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 82% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 35% | 0% |
> This sub-skill covers one capability of the Excel workflow. For reading/counting/Parquet optimization, see the parent workflow SKILL.md.
Step1 使用正则表达式提取限值,并结合上下文逻辑识别总传热系数超限的行。
pythonimport re exceed_rows = [] target_col = 0 # 假设特征列在第一列 value_col = 8 # 假设数值列在第九列 for i, row in df.iterrows(): row_str = str(row.iloc[target_col]) if pd.notna(row.iloc[target_col]) else "" # 正则表达式精准提取限值,例如 "限值0.5" if '限值' in row_str: match = re.search(r'限值([\d.]+)', row_str) if match: current_limit = float(match.group(1)) # 识别计算结果行并进行对比 if '共计' in row_str: try: actual_val = float(row.iloc[value_col]) # 向上回溯寻找结构名称(实战技巧:遍历还原上下文) structure_name = "未知结构" for j in range(i-1, max(0, i-15), -1): prev_val = str(df.iloc[j, 0]) if any(kw in prev_val for kw in ['系数', '围护']): structure_name = prev_val break # 提取最近的限值进行对比 limit_val = None for j in range(i-1, max(0, i-15), -1): check_str = ' '.join([str(x) for x in df.iloc[j, :] if pd.notna(x)]) limit_match = re.search(r'限值([\d.]+)', check_str) if limit_match: limit_val = float(limit_match.group(1)) break if limit_val and actual_val > limit_val: exceed_rows.append({ 'row_index': i, 'name': structure_name, 'value': actual_val, 'limit': limit_val, 'diff': actual_val - limit_val }) except (ValueError, TypeError): continue
Step2 遍历指定 Sheet 查找包含 '#DIV/' 等异常错误的单元格,并记录坐标。
python# 针对特定 Sheet(如 Sheet3)检测公式错误 ws_error = wb['Sheet3'] error_cells = [] for row in ws_error.iter_rows(min_row=1, max_row=ws_error.max_row): for cell in row: if cell.value is not None: val_str = str(cell.value) # 识别 Excel 除零错误或其他异常标识 if '#DIV/' in val_str: error_cells.append({ 'coord': cell.coordinate, 'val': cell.value })
Step3 对识别出的超限行和异常单元格进行红色高亮标注,并保存结果。
pythonfrom openpyxl.styles import PatternFill # 定义红色填充样式 red_fill = PatternFill(start_color='FF0000', end_color='FF0000', fill_type='solid') # 标注超限行(注意:Excel 行号 = pandas 索引 + 1) # 假设在第一个 Sheet 中标注 ws_main = wb[wb.sheetnames[0]] for item in exceed_rows: excel_row = item['row_index'] + 1 for col in range(1, ws_main.max_column + 1): ws_main.cell(row=excel_row, column=col).fill = red_fill # 标注异常单元格 for err in error_cells: ws_error[err['coord']].fill = red_fill output_path = "highlighted_report.xlsx" wb.save(output_path)
Step4 汇总超限数据生成分析报告,并提供下载链接。
python# 创建汇总 DataFrame summary_df = pd.DataFrame(exceed_rows) if not summary_df.empty: summary_df['Excel行号'] = summary_df['row_index'] + 1 summary_df = summary_df[['Excel行号', 'name', 'value', 'limit', 'diff']] summary_df.columns = ['行号', '结构名称', '实测值', '限值', '超出值'] summary_path = "outlier_summary.xlsx" summary_df.to_excel(summary_path, index=False) # 输出下载链接格式 print(f"处理完成。结果文件:{output_path}") print(f"汇总报告:{summary_path}")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 5,590 | 15,608 | +179% | 1 | 1 | 0% | 394 | 3,907 | +892% | 0 | 0 | — |
case-02 | fail→fail | 28,933 | 10,962 | -62% | 1 | 1 | 0% | 6,215 | 3,589 | -42% | 0 | 0 | — |
case-03 | fail→fail | 8,800 | 6,949 | -21% | 1 | 1 | 0% | 1,654 | 2,567 | +55% | 0 | 0 | — |
case-04 | fail→pass | 17,697 | 8,154 | -54% | 1 | 1 | 0% | 3,110 | 2,646 | -15% | 0 | 0 | — |
case-09 | fail→pass | 5,983 | 2,186 | -63% | 1 | 1 | 0% | 831 | 1,510 | +82% | 0 | 0 | — |
case-05 | fail→pass | 8,577 | 10,030 | +17% | 1 | 1 | 0% | 1,551 | 1,831 | +18% | 0 | 0 | — |
case-06 | fail→fail | 7,908 | 5,095 | -36% | 1 | 1 | 0% | 1,597 | 2,149 | +35% | 0 | 0 | — |
case-07 | fail→fail | 11,510 | 9,479 | -18% | 1 | 1 | 0% | 1,620 | 2,918 | +80% | 0 | 0 | — |
case-08 | fail→pass | 6,675 | 1,824 | -73% | 1 | 1 | 0% | 1,212 | 1,385 | +14% | 0 | 0 | — |
case-10 | fail→pass | 6,705 | 4,086 | -39% | 1 | 1 | 0% | 1,356 | 1,835 | +35% | 0 | 0 | — |
case-11 | fail→pass | 10,626 | 2,352 | -78% | 1 | 1 | 0% | 1,769 | 1,492 | -16% | 0 | 0 | — |
case-12 | fail→pass | 16,193 | 5,214 | -68% | 1 | 1 | 0% | 2,482 | 2,091 | -16% | 0 | 0 | — |
case-13 | fail→pass | 14,098 | 2,255 | -84% | 1 | 1 | 0% | 2,429 | 1,549 | -36% | 0 | 0 | — |
case-14 | fail→pass | 20,066 | 3,402 | -83% | 1 | 1 | 0% | 2,611 | 1,708 | -35% | 0 | 0 | — |
case-15 | fail→pass | 2,631 | 2,391 | -9% | 1 | 1 | 0% | 365 | 1,547 | +324% | 0 | 0 | — |
case-16 | pass→pass | 7,309 | 3,225 | -56% | 1 | 1 | 0% | 1,290 | 1,763 | +37% | 0 | 0 | — |
case-17 | pass→pass | 7,220 | 3,656 | -49% | 1 | 1 | 0% | 1,253 | 1,739 | +39% | 0 | 0 | — |
case-18 | fail→pass | 12,919 | 9,913 | -23% | 1 | 1 | 0% | 1,882 | 3,033 | +61% | 0 | 0 | — |
case-19 | fail→pass | 5,068 | 1,825 | -64% | 1 | 1 | 0% | 761 | 1,492 | +96% | 0 | 0 | — |
case-20 | pass→pass | 12,994 | 10,510 | -19% | 1 | 1 | 0% | 2,786 | 3,236 | +16% | 0 | 0 | — |
case-21 | pass→pass | 9,827 | 6,210 | -37% | 1 | 1 | 0% | 1,677 | 2,541 | +52% | 0 | 0 | — |
case-22 | pass→pass | 8,742 | 6,123 | -30% | 1 | 1 | 0% | 1,750 | 2,332 | +33% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +55 percentage points is the difference between those two pass rates over the 21 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.