shanghai-social-security-calc

Shanghai social security payment calculator (five insurances for enterprise employees): calculates actual contribution amounts for Shanghai enterprise employees' five insurances; supports clamping any contribution base to prescribed upper and lower limits and splits amounts into employee and employer contributions; outputs itemized details and can generate a visual PNG image.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "shanghai-social-security-calc" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-877589b1d52f39f9ce334bb21d48eb507d988a10c0c897e6cc31e40aef421830. Verify the upstream source and version against https://skillhub.cn/skills/mayishebao/mayishebao02 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Shanghai social security payment calculator (five insurances for enterprise employees): calculates actual contribution amounts for Shanghai enterprise employees' five insurances; supports clamping any contribution base to prescribed upper and lower limits and splits amounts into employee and employer contributions; outputs itemized details and can generate a visual PNG image.

0 Downloads

Introduction source: third_party · mayishebao · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: shanghai-social-security-calc
description: "上海社保缴费测算(企业职工五险)。当用户需要计算上海社保实际缴纳金额、输入上海社保基数要求拆分个人与企业缴纳、或要求生成社保缴费信息图时触发。支持任意基数自动按上下限 clamp,输出分项明细与可视化 PNG 图片。"
agent_created: true

上海社保缴费测算(企业职工五险)

概述

根据用户提供的上海社保缴费基数,按照上海市现行政策比例计算各项险种的个人缴纳金额与企业缴纳金额,并生成一张清晰的信息图 PNG。

覆盖范围:养老保险、医疗保险(含生育保险)、失业保险、工伤保险(不含公积金)。

触发场景

  • 用户提到「上海社保」「上海社保计算」「社保基数」「社保缴费」等关键词并提供或询问基数。
  • 用户要求「帮我算一下上海社保」「基数 X 元交多少社保」「蚂蚁社保上海计算」等。
  • 用户要求输出图片/信息图展示社保缴费明细。

工作流

Step 1:解析��户输入的缴费基数

从用户消息中提取数值作为缴费基数(元/月)。常见表达方式:

用户说 提取基数
「基数 15000」 15000
「工资 12000 的社保」 12000
「帮我算一下 20000 基数」 20000
「上海社保最低标准」 使用下限默认值

若无法提取有效数字,向用户确认:「请提供您的上海社保缴费基数(元/月),我来帮您计算。」

Step 2:运行计算脚本

使用受管虚拟环境中的 Python 执行 scripts/calc_shanghai_ss.py:

PY="/Users/corey/.workbuddy/binaries/python/envs/default/bin/python"
$PY <SKILL_DIR>/scripts/calc_shanghai_ss.py <基数> [--injury <工伤比例>]

参数说明:

  • <基数>:必填,数字(元/月)。脚本会自动 clamp 到上下限 [7384, 36921]。
  • --injury:可选,工伤保险单位比例(默认 0.002 即 0.2%)。如用户有具体行业档位可传入。

脚本输出包含:

  • 实��缴费基数(clamp 后)
  • 各险种 个人/企业 金额
  • 个人合计、企业合计、总计
  • 合计比例

Step 3:生成信息图

运行出图脚本,将计算结果渲染为 PNG:

$PY <SKILL_DIR>/scripts/make_image.py --base <基数> [--injury <工伤比例>] --out <输出路径.png>

建议输出路径放在当前工作目录下,文件名格式 shanghai_ss_<基数>.png。

依赖说明:脚本依赖 matplotlib + pillow。首次运行时会尝试自动安装到受管虚拟环境;若安装失败需手动执行 pip install matplotlib pillow。

Step 4:呈现结果

  1. 向用户简要汇报关键数据(2-3 行即可):

    • 实际缴费基数
    • 个人每月缴纳 ¥X
    • 企业每月缴纳 ¥Y
    • 合计 ¥Z / 月
  2. 通过 present_files 展示生成的 PNG 图片。

  3. 如用户追问某项细节(如「为什么医疗是 9%?」),参考 references/rates.md 或 references/rates.json 中的政策依据作答。

资源文件

references/rates.json(权威数据源)

机器可读的 JSON 文件,包含所有缴费比例、基数上下限、默认参数。修改比例或基数时只改此文件,脚本会自动读取最新值。

关键字段:

  • base.min / base.max:基数下限/上限
  • rates.*.unit / .person:各险种单位/个人比例
  • defaults.work_injury_rate:默认工伤比例

references/rates.md(人工阅读版)

rates.json 的人类友好文档版,含政策依据来源和计算口径说明。仅供人工查阅,不参与计算逻辑。

scripts/calc_shanghai_ss.py

纯 Python 计算引擎,无外部依赖。读取 rates.json → clamp → 计算 → 输出文本或 JSON。

scripts/make_image.py

matplotlib 信息图渲染器。调用 calc_shanghai_ss.compute() → 绘制标题带 + 汇总卡片 + 分项柱状图 + 说明 → 输出 PNG。

更新维护

每年 7 月上海市公布新社平工资后,更新 references/rates.json 中 base.min 和 base.max 即可。比例变动时同步更新 rates.* 字段。

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 解决上海企业职工社保缴费测算这一明确刚需场景
  • 功能闭环完整,支持计算+可视化输出,显著提升用户效率
Trigger Precision90/100

Highlights

  • 触发词覆盖全面且边界清晰,支持多种用户表达变体
Structure and Standards90/100

Highlights

  • 工作流步骤清晰,含完整示例和出口条件,frontmatter规范完整
Execution Reliability85/100

Highlights

  • 脚本路径明确,参数处理健壮(自动clamp),依赖说明完整
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 65

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.