wps-jsa-macro

wps-jsa-macro is a skill for Claude Code from Bwkyd/wps-skills. It costs 106 tokens per session (3,144 once invoked), scanned A, original, MIT.

A script-writing helper for WPS Office macros, which are small programs that automate repeated actions. WPS uses JavaScript-based JSA macros rather than Excel VBA.

In plain words
What is it for?
Use it to automate batch renaming, form filling, spreadsheet calculations, formatting, and other repeated WPS Office operations.
Why use it?
It saves time on repetitive document, spreadsheet, or presentation work and helps avoid using the wrong macro language.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to automate batch renaming, form filling, spreadsheet calculations, formatting, and other repeated WPS Office operations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bwkyd/wps-skills/wps-jsa-macro
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-jsa-macro
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-jsa-macro

README.md
[![agentmods](https://agentmods.dev/badge/skills/bwkyd/wps-skills/wps-jsa-macro/github.svg)](https://agentmods.dev/skills/bwkyd/wps-skills/wps-jsa-macro)
Your own site
<a href="https://agentmods.dev/skills/bwkyd/wps-skills/wps-jsa-macro"><img src="https://agentmods.dev/badge/skills/bwkyd/wps-skills/wps-jsa-macro/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-jsa-macro

Your own site · 80×15
<a href="https://agentmods.dev/skills/bwkyd/wps-skills/wps-jsa-macro"><img src="https://agentmods.dev/badge/skills/bwkyd/wps-skills/wps-jsa-macro.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,144 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.00106 $0.03144
Opus 5 $0.00053 $0.01572
Sonnet 5 $0.00021 $0.00629
Haiku 4.5 $0.00011 $0.00314

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

Security

Grade A, and why

wps-jsa-macro 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 12d 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-jsa-macro/SKILL.md · 356 lines

How it starts

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

WPS 宏生成器

生成 WPS Office JSA(JavaScript for Applications) 宏脚本。

核心原则:WPS 宏 ≠ VBA。WPS 使用 JavaScript 语法,API 虽与 VBA 相似但有重要差异。 绝对不要输出 VBA 代码。

When to Use

  • 用户需要在WPS中自动化重复操作
  • 用户说"帮我写一个WPS宏"
  • 用户需要批量处理WPS文档/表格/演示
  • 用户需要在WPS表格中自动填充、计算、格式化
  • 用户提到JSA、WPS脚本

When NOT to Use

  • 用户明确说 Excel VBA → 提醒用户WPS不支持VBA,询问是否需要JSA版本
  • 用户需要生成独立文档 → 使用 docx-writer
  • 用户需要公文排版 → 使用 wps-gongwen
  • 需要的是 WPS 加载项(Add-in)开发 → 这是另一个话题

JSA vs VBA 关键差异

必须牢记这些差异,避免生成错误代码:

特性 VBA WPS JSA
语言 Visual Basic JavaScript
变量声明 Dim x As Integer var x = 0let x = 0
函数定义 Sub / Function function name()
字符串连接 & +
注释 ' 单引号 ///* */
数组索引 从1开始 从0开始(但集合类从1开始)
无返回值过程 Sub function(无区分)
For Each For Each x In col for (var i = 1; i <= col.Count; i++)
错误处理 On Error try...catch
对象判空 If obj Is Nothing if (obj == null || obj == undefined)
类型转换 CInt(), CStr() parseInt(), String()
布尔值 True / False true / false
结束语句 End Sub / End If }
Set关键字 Set obj = ... 不需要,直接 var obj = ...

JSA 核心 API 速查

全局对象

// 应用对象
Application              // WPS应用实例
Application.ActiveDocument  // 当前活动文档(文字)
Application.ActiveWorkbook  // 当前活动工作簿(表格)
Application.ActivePresentation // 当前活动演示

// 控制台输出(调试用)
Console.log("message")   // WPS宏编辑器控制台

// 对话框
Application.alert("消息")  // 类似 MsgBox

WPS 文字(Writer)

// 文档操作
var doc = Application.ActiveDocument
var docs = Application.Documents
docs.Open("/path/to/file.docx")
docs.Add()  // 新建文档

// 内容操作
var range = doc.Content           // 全文范围
var paras = doc.Paragraphs        // 段落集合
var para = doc.Paragraphs.Item(1) // 第1段(从1开始)
para.Range.Text                   // 段落文本
para.Range.Font.Name = "宋体"
para.Range.Font.Size = 12
para.Range.Font.Bold = true

// 查找替换
var find = doc.Content.Find
find.Text = "旧文本"
find.Replacement.Text = "新文本"
find.Execute(undefined, undefined, undefined, undefined, undefined,
             undefined, undefined, undefined, undefined, undefined, 2)
// 最后参数 2 = wdReplaceAll

// 表格
var table = doc.Tables.Item(1)
table.Cell(1, 1).Range.Text     // 第1行第1列
table.Rows.Count                // 行数
table.Columns.Count             // 列数

// 书签
var bm = doc.Bookmarks.Item("书签名")
bm.Range.Text = "填入内容"

// 保存
doc.Save()
doc.SaveAs("/path/to/new.docx")

Read the full file on GitHub · 356 lines

Files

What ships with it

2 files 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. 12d ago First seen · 356 lines · 106 tokens per session scan A f6d173cd4e30

Subscribe to this mod's changes

wps-jsa-macro is a skill published in the GitHub repository Bwkyd/wps-skills (8 stars, last pushed 4mo ago), licensed MIT. It adds 106 tokens to every session and 3,144 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

docx-template-translator

Adaptive conversion of LaTeX, PDF, or Markdown sources into a complete Word .docx that follows a user-supplied .docx template. Use when pandoc --reference-doc alone is not enough — for thesis, dissertation, report, or institutional Word formatting that needs cover pages, declarations, TOC, heading numbering, captions…

zouchenzhen/docx-template-translator-skill · 87 tokens

法律文件脱敏处理

A browser-based and Python tool for removing sensitive details from legal Word documents and restoring them later. It can replace information such as names, dates, prices, bank accounts and case numbers while preserving document formatting.

moyupeng0422/legal-doc-redactor · 128 tokens

note-organizer

Use this skill whenever the user wants to organize course materials, lecture notes, PPT/PDF/DOCX files, textbooks, personal notes, senior-student notes, historical exams, review questions, standards, manuals, or scattered study resources into a structured Markdown note library. Use it even when the user only says…

Renakoni/note-organizer · 228 tokens

exhibition-outline

A template for turning an exhibition plan into a three-page presentation outline. The pages cover the theme, its explanation and visitor story, and a detailed area-by-area display plan.

Amalia6767/curator-skills · 60 tokens

tender-analysis

A workflow for reviewing tender documents, which are formal project requests that describe requirements and bidding rules. It extracts project details, technical and business conditions, deadlines, scoring rules, risks, and questions for clarification.

Amalia6767/curator-skills · 85 tokens

docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when…

lingxling/awesome-skills-cn · 168 tokens