wps-pivot

wps-pivot is a skill for Claude Code from Bwkyd/wps-skills. It costs 102 tokens per session (2,024 once invoked), scanned A, original, MIT.

A guide and result generator for pivot tables, which group spreadsheet data and calculate summaries such as totals, averages, or counts.

In plain words
What is it for?
Use it to count people by department, total sales by month and product, calculate average prices by salesperson, or make similar cross-tabulated summaries.
Why use it?
It explains which columns to use when pivot-table controls are unfamiliar, so you can answer questions about grouped data more easily.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to count people by department, total sales by month and product, calculate average prices by salesperson, or make similar cross-tabulated summaries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bwkyd/wps-skills/wps-pivot
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Bwkyd/wps-skills --skill wps-pivot
Clone the repo
git clone --depth 1 https://github.com/Bwkyd/wps-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for wps-pivot

README.md
[![agentmods](https://agentmods.dev/badge/skills/bwkyd/wps-skills/wps-pivot/github.svg)](https://agentmods.dev/skills/bwkyd/wps-skills/wps-pivot)
Your own site
<a href="https://agentmods.dev/skills/bwkyd/wps-skills/wps-pivot"><img src="https://agentmods.dev/badge/skills/bwkyd/wps-skills/wps-pivot/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for wps-pivot

Your own site · 80×15
<a href="https://agentmods.dev/skills/bwkyd/wps-skills/wps-pivot"><img src="https://agentmods.dev/badge/skills/bwkyd/wps-skills/wps-pivot.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,024 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00102 $0.02024
Opus 5 $0.00051 $0.01012
Sonnet 5 $0.00020 $0.00405
Haiku 4.5 $0.00010 $0.00202

Measured 10d ago against content hash 380ba02f4ad6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

wps-pivot scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/wps-pivot/SKILL.md · 220 lines

How it starts

The opening of the file, as written. The whole thing — 220 lines — stays where its author put it; the contents beside it link to each section on GitHub.

数据透视表助手

用人话解释透视表 → 帮你拖对字段 → 生成结果。

"透视表就是:按X分组,算Y的汇总。" 就这么简单。

When to Use

  • 需要按分类汇总数据
  • 不知道透视表怎么用
  • 需要交叉分析(如:各部门各月销售额)
  • 用户说"帮我做透视表""按XX汇总"

When NOT to Use

  • 简单求和/计数 → 使用 wps-formula
  • 图表可视化 → 使用 wps-chart

透视表一句话理解

透视表 = 按【行标签】分组,计算【值字段】的【汇总方式】

例子:
  "按部门统计人数"
  → 行标签=部门,值=姓名,汇总=计数

  "各月份各产品的销售额合计"
  → 行标签=月份,列标签=产品,值=销售额,汇总=求和

  "每个销售员的平均单价"
  → 行标签=销售员,值=单价,汇总=平均值

字段拖放指南

┌─────────────────────────────────────┐
│  你的数据有哪些列?                  │
│                                     │
│  分类列(文本)→ 拖到【行】或【列】  │
│    如:部门、月份、产品、地区        │
│                                     │
│  数值列(数字)→ 拖到【值】          │
│    如:金额、数量、分数              │
│                                     │
│  筛选列(可选)→ 拖到【筛选】        │
│    如:年份、状态                    │
└─────────────────────────────────────┘

常见搭配:
┌──────────────┬──────┬──────┬────────┐
│ 需求         │ 行   │ 列   │ 值     │
├──────────────┼──────┼──────┼────────┤
│ 各部门人数   │ 部门 │ -    │ 计数   │
│ 月度销售趋势 │ 月份 │ -    │ 求和   │
│ 部门×月份    │ 部门 │ 月份 │ 求和   │
│ 产品占比     │ 产品 │ -    │ 求和%  │
└──────────────┴──────┴──────┴────────┘

工作流程

Step 1: 理解数据和需求

确认:

  • 数据有哪些列
  • 想按什么分组
  • 想看什么数值(合计/平均/计数)
  • 是否需要交叉分析

Step 2: 用openpyxl生成透视结果

from openpyxl import Workbook, load_workbook
from openpyxl.styles import Font, Alignment, PatternFill, Border, Side
from collections import defaultdict
import os

def create_pivot(data_path, row_field, value_field,
                 agg='sum', col_field=None, output_path=None):
    """生成透视表结果"""
    wb = load_workbook(data_path)
    ws = wb.active

    # 读取数据
    headers = [cell.value for cell in ws[1]]
    row_idx = headers.index(row_field)
    val_idx = headers.index(value_field)
    col_idx = headers.index(col_field) if col_field else None

    # 聚合
    if col_field:
        pivot = defaultdict(lambda: defaultdict(list))
        col_values = set()
        for row in ws.iter_rows(min_row=2, values_only=True):
            r_key = row[row_idx]
            c_key = row[col_idx]
            val = float(row[val_idx] or 0)
            pivot[r_key][c_key].append(val)
            col_values.add(c_key)
        col_values = sorted(col_values)
    else:
        pivot = defaultdict(list)
        for row in ws.iter_rows(min_row=2, values_only=True):
            r_key = row[row_idx]
            val = float(row[val_idx] or 0)
            pivot[r_key].append(val)

    # 聚合函数
    agg_funcs = {
        'sum': sum,
        'avg': lambda x: sum(x)/len(x) if x else 0,
        'count': len,
        'max': max,
        'min': min,
    }
    func = agg_funcs.get(agg, sum)

    # 写入结果
    wb_out = Workbook()
    ws_out = wb_out.active
    ws_out.title = "透视结果"

    header_fill = PatternFill('solid', fgColor='2C3E50')
    header_font = Font(name='微软雅黑', size=11, bold=True, color='FFFFFF')

    if col_field:
        # 交叉透视
        ws_out.cell(row=1, column=1, value=row_field).font = header_font
        ws_out.cell(row=1, column=1).fill = header_fill
        for ci, cv in enumerate(col_values, 2):
            ws_out.cell(row=1, column=ci, value=cv).font = header_font
            ws_out.cell(row=1, column=ci).fill = header_fill
        ws_out.cell(row=1, column=len(col_values)+2, value='合计').font = header_font
        ws_out.cell(row=1, column=len(col_values)+2).fill = header_fill

        for ri, (rk, cols) in enumerate(sorted(pivot.items()), 2):
            ws_out.cell(row=ri, column=1, value=rk)
            row_total = 0
            for ci, cv in enumerate(col_values, 2):
                val = func(cols.get(cv, [0]))
                ws_out.cell(row=ri, column=ci, value=round(val, 2))
                row_total += val
            ws_out.cell(row=ri, column=len(col_values)+2, value=round(row_total, 2))
    else:
        ws_out.cell(row=1, column=1, value=row_field).font = header_font
        ws_out.cell(row=1, column=1).fill = header_fill
        ws_out.cell(row=1, column=2, value=f'{value_field}({agg})').font = header_font
        ws_out.cell(row=1, column=2).fill = header_fill

        for ri, (rk, vals) in enumerate(sorted(pivot.items()), 2):
            ws_out.cell(row=ri, column=1, value=rk)
            ws_out.cell(row=ri, column=2, value=round(func(vals), 2))

    if not output_path:
        output_path = '透视结果.xlsx'
    wb_out.save(output_path)
    return os.path.abspath(output_path)

Read the full file on GitHub · 220 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 220 lines · 102 tokens per session scan A 380ba02f4ad6

Subscribe to this mod's changes

wps-pivot is a skill published in the GitHub repository Bwkyd/wps-skills (7 stars, last pushed 4mo ago), licensed MIT. It adds 102 tokens to every session and 2,024 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

xlsx

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or…

lingxling/awesome-skills-cn · 201 tokens

xlsx

Create, edit, analyze, or convert Excel spreadsheets (.xlsx, .xlsm, .xltx) where the workbook file is the primary deliverable. Use for formulas, formatting, financial models, multi-sheet workbooks, and tabular cleanup exported to Excel. Also applies to .csv/.tsv when the user wants spreadsheet output. Do NOT use for…

K-Dense-AI/scientific-agent-skills · 94 tokens

document-generation

Generate Word (.docx), Excel (.xlsx) and PowerPoint (.pptx) documents and fill existing PDF forms, from real NetClaw data, with per-element provenance and no fabrication. Use when someone needs a deliverable rather than an answer — a change record to attach to a CR, an audit workbook for a compliance reviewer, a…

automateyournetwork/netclaw · 91 tokens

dgn-to-excel

Convert DGN files (v7-v8) to Excel databases. Extract elements, levels, and properties from infrastructure CAD files.

datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction · 32 tokens

dwg-to-excel

Convert AutoCAD DWG files (1983-2026) to Excel databases using DwgExporter CLI. Extract layers, blocks, attributes, and geometry data without Autodesk licenses.

datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction · 42 tokens

ifc-to-excel

Convert IFC files (2x3, 4x1, 4x3) to Excel databases using IfcExporter CLI. Extract BIM data, properties, and geometry without proprietary software.

datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction · 45 tokens