用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Bwkyd/wps-skills --skill wps-salary命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | wps-salary |
| description | 工资条计算。根据薪资数据计算五险一金和个人所得税, 生成规范的工资条Excel,支持批量生成。 用于帮助HR和财务处理薪资。当用户提到工资条、个税、五险一金时触发。 Salary slip and tax calculator. |
| license | MIT |
| user-invocable | true |
| argument-hint | [薪资数据/需求描述] |
| allowed-tools | Read, Grep, Glob, Bash, Write, Edit |
| metadata | {"author":"BWKYD","title":"工资条计算","description_zh":"根据薪资计算五险一金和个税,生成规范的工资条","tags":["工资条","薪资","个税","五险一金","WPS"],"version":"1.0.2","license":"MIT"} |
薪资数据 → 个税计算 → 规范工资条 → 批量生成。HR和财务的必备工具。
wps-financial-reportwps-attendance累计应纳税所得额 税率 速算扣除数
≤36,000 3% 0
36,000-144,000 10% 2,520
144,000-300,000 20% 16,920
300,000-420,000 25% 31,920
420,000-660,000 30% 52,920
660,000-960,000 35% 85,920
>960,000 45% 181,920
起征点:5,000元/月
专项扣除:五险一金个人部分
专项附加扣除:子女教育1000/月、继续教育400/月、
大病医疗据实、住房贷款1000/月、住房租金800-1500/月、
赡养老人2000/月(独生)
标准工资条结构:
┌─────────────────────────────────────────┐
│ XX公司工资条 2026年3月 │
├─────────┬───────────┬──────────────────┤
│ 姓名 │ 张三 │ 部门:技术部 │
│ 工号 │ EMP001 │ 岗位:高级工程师 │
├─────────┴───────────┴──────────────────┤
│ 【应发项目】 │
│ 基本工资 岗位工资 绩效奖金 加班费│
│ 8,000 4,000 2,000 500 │
│ 应发合计:14,500 │
├────────────────────────────────────────┤
│ 【扣除项目】 │
│ 养老8% 医疗2% 失业0.5% 公积金12% │
│ 1,160 290 72.5 1,740 │
│ 个人所得税:145.88 │
│ 扣除合计:3,408.38 │
├────────────────────────────────────────┤
│ 实发工资:11,091.62 │
└────────────────────────────────────────┘
from openpyxl import Workbook, load_workbook
from openpyxl.styles import Font, Alignment, Border, Side, PatternFill
from datetime import datetime
import os
class SalaryCalculator:
"""薪资计算器"""
# 个税累进税率
TAX_BRACKETS = [
(36000, 0.03, 0),
(144000, 0.10, 2520),
(300000, 0.20, 16920),
(420000, 0.25, 31920),
(660000, 0.30, 52920),
(960000, 0.35, 85920),
(float('inf'), 0.45, 181920),
]
# 五险一金比例(个人部分,各地不同,这是通用参考)
INSURANCE_RATES = {
'养老': 0.08,
'医疗': 0.02,
'失业': 0.005,
'公积金': 0.12,
}
def __init__(self, base=5000, special_deduction=0):
self.threshold = base # 起征点
self.special_deduction = special_deduction # 专项附加扣除
():
result = {}
name, rate .INSURANCE_RATES.items():
result[name] = (base_salary * rate, )
result[] = ((result.values()), )
result
():
():
limit, rate, deduction .TAX_BRACKETS:
income <= limit:
(income * rate - deduction, )
tax_ytd = _calc(taxable_income_ytd)
tax_prev = _calc(taxable_income_prev_ytd)
((tax_ytd - tax_prev, ), )
():
insurance = .calc_insurance(insurance_base)
taxable = gross - insurance[] - .threshold - .special_deduction
taxable = (taxable, )
taxable_ytd = prev_taxable_ytd + taxable
tax = .calc_tax(taxable_ytd, prev_taxable_ytd)
net = (gross - insurance[] - tax, )
{
: gross,
: insurance,
: taxable,
: tax,
: (insurance[] + tax, ),
: net,
}
():
wb_data = load_workbook(data_path)
ws_data = wb_data.active
wb_out = Workbook()
ws = wb_out.active
ws.title =
calc = SalaryCalculator()
row =
headers = [cell.value cell ws_data[]]
data_row ws_data.iter_rows(min_row=, values_only=):
emp = ((headers, data_row))
gross = (emp.get(, ) )
base = (emp.get(, gross) gross)
result = calc.calc_monthly(gross, base, (year_month[-:]))
_write_slip(ws, row, emp, result, year_month)
row +=
wb_out.save(output_path)
os.path.abspath(output_path)
():
thin = Side(style=)
border = Border(left=thin, right=thin, top=thin, bottom=thin)
header_fill = PatternFill(, fgColor=)
header_font = Font(name=, size=, bold=, color=)
body_font = Font(name=, size=)
r = start_row
ws.merge_cells(start_row=r, start_column=, end_row=r, end_column=)
cell = ws.cell(row=r, column=,
value=
)
cell.font = header_font
cell.fill = header_fill
cell.alignment = Alignment(horizontal=)
r +=
items = [
(, emp.get(, )),
(, emp.get(, )),
(, emp.get(, )),
(, result[]),
(, result[][]),
(, result[]),
(, result[]),
(, result[]),
]
col, (label, val) (items, ):
ws.cell(row=r, column=col, value=label).font = Font(
name=, size=, bold=)
ws.cell(row=r, column=col).border = border
ws.cell(row=r+, column=col, value=val).font = body_font
ws.cell(row=r+, column=col).border = border
ws.cell(row=r+, column=col).number_format =
// JSA: 薪资表→工资条转换
function SalaryToSlips() {
var ws = Application.ActiveSheet;
var lastRow = ws.Cells(ws.Rows.Count, 1).End(-4162).Row;
var lastCol = ws.Cells(1, ws.Columns.Count).End(-4159).Column;
var newWs = Application.Sheets.Add();
newWs.Name = "工资条";
var outRow = 1;
for (var i = 2; i <= lastRow; i++) {
// 复制表头
for (var j = 1; j <= lastCol; j++) {
newWs.Cells(outRow, j).Value2 = ws.Cells(1, j).Value2;
newWs.Cells(outRow, j).Font.Bold = true;
}
outRow++;
// 复制数据
for (var j = 1; j <= lastCol; j++) {
newWs.Cells(outRow, j). = ws.(i, j).;
}
outRow++;
outRow++;
}
.( + (lastRow - ) + );
}
# 生成工资条
/wps-salary 帮我把这个薪资表生成工资条格式,方便打印发给员工
# 计算个税
/wps-salary 月薪15000,社保基数12000,公积金12%,算一下到手多少
# 批量生成
/wps-salary 用salary_data.xlsx生成每个人独立的工资条