agent-skillsSAFE
Battle-tested agent skills for university planning & discipline construction: gongwen writing, proposal grilling, WPS-safe docx tracked changes, oversized-image reading, PDF-to-Markdown cleanup, Civil Code lookup & Dream of the Red Chamber corpus. Open Agent Skills spec — works with Claude Code & an
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
实战中沉淀的 Agent Skills,来自真实办公场景的反复使用与打磨,而非一次性生成。
聚焦场景:高校"发展规划与学科建设"条线——项目申报书、"十五五"规划、上会材料、制度修订、领导讲话。既服务同条线的同行,也欢迎任何想把 AI 用进公文写作的人。
不绑定特定产品:遵循开放的 Agent Skills 规范,SKILL.md + 脚本的结构可在 Claude Code、Claude 桌面版、WorkBuddy、CodeBuddy 等任何支持该规范的 agent 中直接使用;不支持的 agent 也可把 SKILL.md 当作操作手册直接投喂。
Skills
实践笔记
使用
把对应的 skill 文件夹复制到你的 agent skills 目录即可(例如 ~/.workbuddy/skills/ 或 Claude Code 的 ~/.claude/skills/)。每个文件夹内的 SKILL.md 是入口。
License
MIT
f718b044200fOBSERVED · 2026-10-13Install
Commands as the repository documents them. They are shown, not run.
pip install pypdf
Host compatibility
What the documentation claims. We have not run a compatibility test.
| Host | Status | Notes |
|---|---|---|
| claude-code | mentioned | |
| codex | mentioned | |
| copilot | mentioned |
What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
---
name: docx-track-changes-wps
description: This skill should be used when inserting tracked changes (修订模式 / redline revisions) into a .docx document with python-docx + lxml, especially for Chinese official documents that must open cleanly in WPS without the "rainbow spinner / 无响应" hang. Covers enabling trackChanges, placing w:ins insertions, avoiding the WPS infinite-loop pitfalls, and verifying the result.
---
# docx-track-changes-wps
Insert real, WPS-safe tracked changes into a Word `.docx` using python-docx plus direct `lxml` manipulation. Designed for Chinese official-document redline workflows (e.g. 报送"两个工作要点"修改意见、在发文稿上以"修订模式"标注修改/新增).
## When to use
- A user asks to "另存一份原文稿 / 打开修订模式 / 以修订模式把修改意见修订进去" on a `.docx`.
- The output must open in **WPS** (common in Chinese government / university environments) without hanging on a rainbow spinner.
- Revisions are "修改完善"(revise) or "新增"(add) — i.e. mostly insertions against an existing paragraph.
## Golden rule: prefer `w:ins` over `w:del`
For Chinese redline workflows the safest pattern is **insertion-only**: keep the original run text and insert the new text as a `w:ins` element right after the anchor run. Avoid `w:del` (deletions) wherever possible — `w:del` with `w:delText` and `w:rPrChange` is the single most common trigger of the WPS rainbow-loop hang. If a "replacement" is really "append a suffix", model it as an insertion after the original phrase, not as delete+insert.
## WPS rainbow-loop avoidance checklist (mandatory)
1. **Unique `w:id`** across the whole document (use a global counter, start high like 10001 to avoid clashing with any existing ids).
2. **Valid `w:date`** in ISO 8601 form, e.g. `2026-07-23T09:00:00Z`.
3. **`w:author`** present on every `w:ins`.
4. **Enable track changes properly**: in `word/settings.xml` add `<w:trackChanges w:val="true"/>` AND add `<w:rsidRoot w:val="..."/>` (reuse the existing `w:rsidRDefault` value if present, else a fixed 8-hex value). Missing `rsidRoot` while runs carry `w:rsidR` is a known WPS hang trigger.
5. **Inserted `w:r` carries NO `w:rPr`** (plain `<w:r><w:t>...</w:t></w:r>` inside the `w:ins`). An `rPr` that references a font/style not present can make WPS loop.
6. **Never touch the body-level `w:sectPr`** (it is a direct child of `w:body`, not inside the last paragraph) and never wrap the final section-break paragraph in `w:ins`/`w:del`.
7. Keep `w:t` text with `xml:space="preserve"` so leading/trailing spaces survive.
## Procedure
1. Copy the original `.docx` to a new filename first (keep the source pristine).
2. Open with python-docx; enable `trackChanges` + `rsidRoot` in `doc.settings.element`.
3. For each revision, locate the target paragraph and the anchor **run** that contains the boundary phrase. All runs in these docs typically have `style=None` (inherited paragraph font) — safe to copy or omit `rPr`.
4. Insert the new text as a `w:ins` element placed as a sibling right after the anchor run. If the boundary phrase ends mid-run, split the run at the offset (copy `rPr` to the new suffix run, set the original run's text to the prefix), then insert the `w:ins` between prefix and suffix.
5. `doc.save(...)` and verify (see below).
## Known pitfalls
- **Hidden characters in anchor phrases.** Chinese documents frequently embed `》(U+300B)`, ``(U+300C)`, `—(U+2014)` etc. inside what looks like plain text (e.g. `《...(2025—2027年)》` ends with `年)》。`). A literal anchor like `"年),"` will NOT match because of the hidden `》`. **Construct tricky anchors with explicit Unicode escapes** (`"年"+"\uFF09"+"\u300B"+"\uFF0C"`) and/or print `repr()` of the candidate run to confirm exact characters before matching.
- **python-docx `paragraph.text` omits `w:ins` content.** After editing, `paragraph.text` will NOT show inserted text (it only concatenates direct `w:r` children, not runs inside `w:ins`). To verify placement, parse `word/document.xml` and concatenate all descendant `w:t` (including those under `w:ins`/`w:del`).
- **Run boundaries**: a phrase often spans multiple runs (e.g. `"一院一策"` split as `一院`+`策`). Anchor on the run that *starts* with the phrase tail, or split at the run boundary, rather than assuming one run.
## Verification (always run after save)
- `zipfile.ZipFile(path).testzip()` is `None` (archive intact).
- `etree.fromstring(z.read('word/document.xml'))` parses (well-formed).
- `trackChanges` value is `true`; `rsidRoot` present.
- Count `w:ins` == expected, `w:del` == 0 (if insertion-only), `w:id` set is unique, each `w:ins` has author+date+inner `w:r`.
- For each target paragraph, full-text (incl. `w:ins`) contains the inserted keywords.
See `scripts/apply_track_changes.py` for a ready-to-use, WPS-safe implementation with an `apply(paragraph_index, anchor_phrase, insert_text)` helper.Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- declared (3 observation(s))
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (0)
No findings outside the package's declared scope.
Gates applied: no_behavioural_pass.
f718b044200ffull audit observations/trust-audit/skill/nannanpa__agent-skills.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-13 | f718b044200f | SAFE | B | 89 | first audit |
Questions
What does the agent-skills skill do?
Battle-tested agent skills for university planning & discipline construction: gongwen writing, proposal grilling, WPS-safe docx tracked changes, oversized-image reading, PDF-to-Markdown cleanup, Civil Code lookup & Dream of the Red Chamber corpus. Open Agent Skills spec — works with Claude Code & an
Is agent-skills safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can agent-skills access on my machine?
The audit observed that it reaches the network. Each of those is consistent with what it says it does. Secrets in the source: none found.
Which assistants does agent-skills work with?
Its documentation mentions claude-code, codex and copilot. That is what the text claims, not a compatibility test we ran.
How current is this page?
The grade is for one exact copy of the source (f718b044200f), read on 2026-10-13. The repository is watched, and a new audit runs when it changes — this is the first audit.