基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/claude-office-skills/claude-wps-word-plugin --skill doc-core-api命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | doc-core-api |
| description | WPS Writer 核心 API 参考与代码规范 |
| tags | ["api","writer","core"] |
| context | {"always":true} |
| modes | ["agent","plan"] |
new Function(code)() 在 WPS Plugin Host 中同步执行Application, wpsvar 声明变量(不支持 let/const/箭头函数)Application.ActiveDocument // 当前文档 (Document)
Application.Selection // 当前选区 (Selection)
Document.Content // 全文 Range
Document.Paragraphs // 段落集合 Paragraphs
Document.Tables // 表格集合 Tables
Document.Sections // 节集合 Sections
Document.Bookmarks // 书签集合
Selection.Text // 读取/设置选区文本
Selection.TypeText(text) // 在光标处输入(替换选区)
Selection.InsertAfter(text) // 在选区后插入
Selection.InsertBefore(text) // 在选区前插入
Selection.MoveDown(unit, count) // 下移光标
Selection.MoveRight(unit, count) // 右移光标
Selection.Collapse(direction) // 收缩选区 (0=wdCollapseEnd, 1=wdCollapseStart)
Selection.WholeStory() // 选中全文
Selection.HomeKey(unit) // 移动到文档/行首
Selection.EndKey(unit) // 移动到文档/行尾
Range.Text // 读取/设置文本
Range.InsertAfter(text) // 在范围后插入
Range.InsertBefore(text) // 在范围前插入
Range.Start / Range.End // 起止字符位置
Range.Select() // 将此范围设为选区
Range.Delete() // 删除范围内容
Range.Font.Name = "微软雅黑"
Range.Font.Size = 14
Range.Font.Bold = true / false
Range.Font.Italic = true / false
Range.Font.Color = 0xFF0000 // BGR 颜色
Range.Font.Underline = 1 // wdUnderlineSingle
Range.ParagraphFormat.Alignment = 1 // 0=左, 1=居中, 2=右, 3=两端
Range.ParagraphFormat.LineSpacing = 24 // 行距 (磅)
Range.ParagraphFormat.SpaceBefore = 6
Range.ParagraphFormat.SpaceAfter = 6
Range.ParagraphFormat.FirstLineIndent = 24 // 首行缩进
Range.Style = "标题 1" // 设置样式
Document.Tables.Add(range, rows, cols)
Table.Cell(row, col).Range.Text = "文本"
Table.Rows.Add()
Table.Columns.Add()
Table.Cell(row, col).Merge(Table.Cell(row, col2))
if (!doc) return "无活动文档";