P

Pkg Paper Rewriter Claw

CLAWHUB · Unverified

Academic writing style toolkit, bilingual CN/EN: AI flavor scan and style-pattern self-check reports (scan reports are detection only), deterministic text cleanup (model artifacts, punctuation, filler phrases), integrity guardrails (numbers, DOIs, PMIDs, terminology must survive untouched), and agent-guided style naturalization for clearer, more natural academic prose (de-templating, de-translationese, rhythm, concreteness). Built for scholars whose formal writing reads stiff, templated or machine-flavored — especially non-native (ESL) authors. Includes AIGC-disclosure compliance checks (China 2025-09 labeling rules) and academic-integrity guardrails: this tool improves writing quality for self-review; it does not help misrepresent authorship, conceal required AI disclosure, or defeat integrity review. 100% local, zero upload, Python stdlib only. Related: paper-polisher-pro (broad polishing), pubmed-verifier, cite-holmes, academic-figures, cn-med-oa, doc-holmes.

62
Rank
84
Safety
970
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 970 downloads reported by the source. Last updated 10/12/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17dagtwyk21qs6vpz98bzcrh1853t29:paper-rewriter
  1. Install using `clawhub skill install s17dagtwyk21qs6vpz98bzcrh1853t29:paper-rewriter` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/docsor1212/paper-rewriter before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-docsor1212-paper-rewriter/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

160,000 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: paper-rewriter
description: >
  Academic writing style toolkit, bilingual CN/EN: AI flavor scan and style-pattern
  self-check reports (scan reports are detection only), deterministic text cleanup
  (model artifacts, punctuation, filler phrases), integrity
  guardrails (numbers, DOIs, PMIDs, terminology must survive untouched), and
  agent-guided style naturalization for clearer, more natural academic prose
  (de-templating, de-translationese, rhythm, concreteness). Built for scholars whose
  formal writing reads stiff, templated or machine-flavored — especially non-native
  (ESL) authors. Includes AIGC-disclosure compliance checks (China 2025-09 labeling
  rules) and academic-integrity guardrails: this tool improves writing quality for
  self-review; it does not help misrepresent authorship, conceal required AI
  disclosure, or defeat integrity review. 100% local, zero upload, Python stdlib
  only. Related: paper-polisher-pro (broad polishing), pubmed-verifier, cite-holmes,
  academic-figures, cn-med-oa, doc-holmes.
allowed-tools:
  - Read
  - Write
  - Bash
  - Glob
  - Grep
---

# Academic Style Toolkit (paper-rewriter)

Bilingual (CN/EN) style naturalization for academic & medical writing: find stiff,
templated or machine-flavored patterns, clean mechanical debris, revise for clarity
and natural register — with integrity guardrails on every step.

> **Routing in one line**: grammar/fluency/journal-format polish → use a polisher
> (paper-polisher-pro); de-templating, model-residue cleanup, AI-flavor style
> self-check and rewriting → this tool. Need both? Polish first, then run this pipeline.

## Feature status (v3.2.0)

| Feature | Status | Since |
|---|---|---|
| detect / transform / verify / compare / pipeline | Stable | v1.0 |
| Section-aware scanning (`--structure`) | Stable | v1.7 |
| `.docx` direct input; 50MB file guard; read retry | Stable | v1.3–1.8 |
| Sentence-level rewrite plan (`plan.py`) | Stable | v2.2 |
| User-learned term guards (`learn_guards.py`) | Stable | v2.2 |
| `--exit-verdict` machine exit codes (detect/compare/pipeline) | Stable | v2.3 |
| Deterministic deep polish (`--deep`), handling hints, scan time budget | Stable | v2.4 |
| Centralized error layer (`CliError` + handling hints), batch retry, per-step timeout | Stable | v2.5 |
| Scale envelope: 800K-char chunks (2K overlap) · 50MB file cap · 120s step budget | — | — |
| Style profile (`stylecheck.py`: per-paragraph quantified guide audit) | Stable | v2.6 |
| Best-practices handbook (7 real scenarios), stylecheck `--html`, `--terms auto` | Stable | v2.7 |
| PDF extraction confidence self-report (`read_text_ex`, detect/pipeline annotation) — calibrated on 200 real-world PDFs, see `references/pdf_confidence.md` | Experimental | v2.8 |
| Term guard variant groups (`check_terms --pack cardiovascular` — 8 domains, 27 groups / 55 variants, groups may hold >2 forms e.g. HF/心力衰竭/心衰; nesting-safe) | Stable | v3.0 / v3.1 |
| Stats panel in style profile (`stylechec

README.md

# paper-rewriter

[![GitHub Stars](https://img.shields.io/github/stars/docsor1212/paper-rewriter?style=social&label=Star)](https://github.com/docsor1212/paper-rewriter)

Bilingual (CN/EN) style naturalization for academic & medical writing: find stiff,
templated or machine-flavored patterns, clean mechanical debris, revise for clarity
and natural register — with integrity guardrails on every step.

Deterministic cleanup (model artifacts, punctuation, filler), style-pattern
self-check reports (local heuristic, detection only), sentence-level rewrite
planning, a deterministic deep-polish mode, and a whole-document integrity guard
(numbers, DOIs, PMIDs, terminology must survive untouched). 100% local, zero
upload, Python standard library only.

## Install / Quick Start

Install via your skill manager (skills CLI / ClawHub / SkillHub), or clone this
repository and run the scripts directly with Python 3 (no dependencies):

```bash
# one command: self-check -> cleanup -> revision brief -> integrity guard
python scripts/pipeline.py draft.txt -o out.txt --terms terms.txt

# or step by step
python scripts/detect.py draft.txt            # style-pattern self-check
python scripts/transform.py draft.txt -o step1.txt
python scripts/verify.py draft.txt step1.txt  # integrity guard (exit 0/1/2)

# full guide, boundaries and agent invocation protocol
cat SKILL.md
```

**China mirror (ModelScope 魔搭)**: <https://modelscope.cn/skills/Docsor/paper-rewriter> — if you find this skill useful, a like there helps others find it.

## Integrity guardrails

Permitted: polishing your own drafts; aligning AI-assisted text with your voice
where disclosure is allowed or required. Not permitted: misrepresenting
authorship, concealing required AI disclosure, or defeating integrity review —
the toolkit refuses that framing. See `references/compliance.md`.

_meta.json

{
  "ownerId": "kn7b6sjwend7cwwmhf7mdg1wzx82dfbf",
  "slug": "paper-rewriter",
  "version": "3.2.0",
  "publishedAt": 1791652581686
}

references/api.md

# API 参考(程序化集成)

> 供想在 Python 内直接调用核心函数的用户/agent。所有函数纯标准库、零网络。
> CLI 优先场景请直接用命令行(见 SKILL.md);本文档面向需要嵌入自己管线的人。

## hxt_core

```python
import sys
sys.path.insert(0, "<技能目录>/scripts")
import hxt_core
```

### hxt_core.scan(text, lang=None, profile="academic") → dict

风格特征扫描(≤1MB 文本)。

- `text`:str,待扫文本(必填)
- `lang`:`"zh"|"en"|"mix"|None`——None 时自动检测
- `profile`:`"academic"`(默认,论文口径)| `"general"`(八股/公文信号 ×0.4)
- 返回:`{"score": int 0-100, "level": "低|中|高|极高", "critical_hit": bool,
  "lang": str, "profile": str, "units": float, "sentences": int,
  "categories": {cat: {"label", "count", "weight", "samples", "auto_fixable"}},
  "guards_applied": [...], "stats": {"burstiness_cv", "connector_density", ...},
  "suggestions": [{"from", "to"}], "honest_note"}`

```python
r = hxt_core.scan("这个方案为业务赋能,打法清晰。")
print(r["score"], r["level"], r["categories"].get("zh_jargon", {}).get("count"))
```

### hxt_core.scan_chunked(text, lang=None, profile="academic") → dict

超大文本分块扫描(>1MB 自动启用;CLI 的 detect/pipeline 对 >1MB 输入自动走本函数)。
返回结构同 scan,额外带 `"chunked": 块数`;跨块边界的结构信号可能少量漏检(报告标注)。

### hxt_core.read_text(path, max_mb=50.0) → str

健壮文本读取:大小上限 / 二进制 NUL 检测 / BOM 剥离 / 乱码占比守卫 / .docx 直读。
失败抛 `ValueError`(消息含处置建议)或 `OSError`。

```python
try:
    text = hxt_core.read_text("稿件.docx")
except ValueError as e:
    print("输入不合规:", e)
```

### hxt_core.build_suggestions(orig, scan_result, guide) → str

把 scan 结果转为修订建议工作单(markdown 字符串:类别/样本/处理原则/指南锚点)。
`guide` 传指南相对路径(如 `references/style_guide_zh.md`)。

### hxt_core.verify_integrity 相关

完整性守卫的函数入口在 `verify.verify(orig, new, terms=None, max_len_change=25.0,
max_cjk_shift=0.12) -> {"ok": bool, "violations": [...], "warnings": [...], "stats": {...}}`
(`import verify as vf`)。退出码契约只属于 CLI 层。

## transform / extract_terms / verify(CLI 模块复用)

| 函数 | 说明 |
|---|---|
| `transform.load_fixes(lang=None, aggressive=False)` | 返回 (rx, repl, note, guards) 修复列表 |
| `transform.apply_auto_fixes(text, fixes)` | 应用机械修复(带术语守卫),返回 (text, applied) |
| `transform.drop_flagged_sentences(text)` | 客套句/截止声明整句删除(覆盖律+数字保护),返回 (text, removed) |
| `extract_terms.extract(orig, min_count=2, cap=40)` | 术语候选抽取,返回 [(term, count, kind)] |
| `verify.load_terms(path)` | 术语表加载(BOM/守卫内建) |

所有函数零网络、零环境变量、只读写调用方显式传入的路径。

## plan / learn_guards(v2.2.0 新增)

| 函数/入口 | 说明 |
|---|---|
| `hxt_core._chunk_spans(text, max_chars=800_000, overlap=2000)` | 分块切点(含重叠窗起点),scan_chunked 缝合的底层 |
| `hxt_core.scan_chunked(text, ..., max_chars, overlap)` | 分块扫描(重叠缝合口径);小分块参数便于测试 |
| `hxt_core.clear_pattern_cache()` | 清词表缓存(learn_guards 写守卫后同进程生效用) |
| `hxt_core.verdict_exit_code(score, critical_hit, verify_ok=None)` | --exit-verdict 机器退出码(0/1/3/4),detect/compare/pipeline 共用 |
| `hxt_core.build_hints(text, r, profile)` | 处置建议引擎(v2.4.0):critical/plan/learn_guards/--profile general 四类提示 |
| `transform.deep_polish(text)` | 确定性深改(v2.4.0):句首八股删除+排除式连接合并,返回 (text, ops) |
| `hxt_core.scan(..., time_budget=120.0)` | 墙钟预算(v2.4.0):超时抛 ValueError 带拆分建议;`SCAN_TIME_BUDGET` 为缺省常量 |
| `hxt_core.CliError(msg, 

references/best_practices.md

# 最佳实践手册(Best Practices)——按场景组织的端到端工作法

> 与 pitfalls.md(23 条错误用法)互补:这份手册按**真实场景**组织,每个场景给
> 标准命令序列、预期输出形态、该场景特有的避坑点。所有分数与档位均为本地
> 启发式口径,非任何外部检测分数。

## 场景 1:期刊投稿前的自查(最常见)

**目标**:投稿前把模板腔降下来,同时确保一个数据都没动。

```bash
# 1. 术语表先行(医学/生科稿件必做——守卫的弹药)
python scripts/extract_terms.py manuscript.txt -o terms.txt
#   人工过一遍 terms.txt:删掉普通词、补上缩写变体(如 Myc 与 MYC 都要)

# 2. 一键管线出底稿
python scripts/pipeline.py manuscript.txt -o clean.txt --terms terms.txt

# 3. agent 深改(按 style_guide_zh/en 七步法,重点看 plan 排出的 P0 句)
python scripts/plan.py clean.txt -o plan.md        # 句级优先级队列+预算投影
#   ……按 plan.md 逐句深改,产出 revised.txt……

# 4. 量化验收(改前 vs 改后画像差值)
python scripts/stylecheck.py clean.txt revised.txt --compare

# 5. 守卫+复核(铁闸:exit 0 才算过)
python scripts/verify.py manuscript.txt revised.txt --terms terms.txt
python scripts/compare.py manuscript.txt revised.txt
```

**本场景避坑**:改稿时最常见的 FAIL 是缩写次数被压低(如 IRAK4 从 12 次
引述删到 11 次)——守卫连「缩写出现次数」都守;这不是误报,把引述补回自然
位置即可。投稿版务必保留 AI 使用披露(如期刊要求)——本报告不能替代披露。

## 场景 2:学位论文(长文档、分章处理)

**目标**:几万字的论文不塞给单次扫描——按章处理,报告才可读。

```bash
# 长文先看结构
python scripts/detect.py thesis.md --structure
# 按章拆分后逐章走场景 1 流程;方法/结果章的固定句式会被自动降权,
# 不要因为「方法章分数高」就回去改方法章的表述——那是文体常态。
```

**本场景避坑**:学位论文的摘要常是「结构式摘要」(目的/方法/结果/结论带
冒号标签)——冒号后带内容的行不会被误判为章节标题,放心。中文摘要与
英文 Abstract 分开处理,语言口径各自更准。

## 场景 3:回复审稿人(revision letter)

**目标**:response letter 语气自然、逐条回应,但**引用的审稿意见原文一字不能动**。

```bash
# 只对"自己的回应"部分跑管线;审稿意见原文用手动引用块隔开
python scripts/pipeline.py my_response.txt -o clean.txt --terms terms.txt
```

**本场景避坑**:response letter 里复制粘贴的审稿意见会被当作改写对象——
把原文放进引用块(> 前缀)并在深改时跳过;verify 的数字守卫会拦住大部分
误伤(审稿意见里的数据句被动过会 exit 1),但别依赖守卫兜底,先分好区域。

## 场景 4:批量处理(课题组/编辑部)

**目标**:一个目录的稿件先摸底再逐篇精修。

```bash
# 摸底:全目录扫描(JSON 便于汇总)
python scripts/detect.py --batch ./submissions --json > overview.json
# 逐篇精修只挑高分的;批量清理用 pipeline --batch 出 CSV 台账
python scripts/pipeline.py --batch ./submissions -o batch_report.csv
```

**本场景避坑**:批量模式不生成 --html/--track/--suggestions(见输出提示);
需要报告的稿子单跑。批量二遍重试会自动救回瞬时失败的文件
(detect --batch --json 的 retried 字段;pipeline 的 CSV 在 integrity 列标注
「已重试 1 次」),两遍都失败的文件如实标注,人工看一眼即可。

## 场景 5:CI/agent 门禁(自动化集成)

**目标**:改稿质量卡进自动化流程,机器判定不达标就拦截。

```bash
# 全档门禁(0=干净 1=完整性 FAIL 3=需深改 4=模型残留)
python scripts/pipeline.py orig.txt --rewrite new.txt --terms terms.txt --exit-verdict
# JSON 里拿同源字段
python scripts/pipeline.py orig.txt --rewrite new.txt --json | jq .exit_verdict
```

**本场景避坑**:批量 + `--exit-verdict` 是 fail-closed——目录里有扫描失败的
文件门禁不予放行:错误文件贡献退出码 2,最终退出码取各文件最坏值(可为
2/3/4),必为非零(宁可拦错不可放错;CI 断言请用「非 0」而非「==2」)。预算投影(plan.py)是线性
近似,只用于排序,不要写进 CI 断言。

## 场景 6:误报治理(领域术语被误判)

**目标**:正当术语不再每次都被计分,且升级词表不丢。

```bash
# 从真实语料提取上下文固化守卫(中英双语口径)
python scripts/learn_guards.py from-text 抓手 机械样本.txt
python scripts/learn_guards.py add 抓手 --before "机械,装置" --after "采用,夹持"
python scripts/learn_guards.py test "装配平台的机械抓手采用气驱动设计。"
```

**本场景避坑**:守卫是上下文豁免不是整词洗白(营销语境的「抓手」照常计分);
守卫存 `scripts/user_guards.json`,升级词表不丢。给 agent 的术语守卫固化
后,把 `learn_guards.py list` 的输出贴进稿件交接说明,团队共享口径。

## 场景 7:中文投稿的标点与格式

**目标**:半角标点/Markdown 残留一次清干净,不误伤小数和文献著录。

``

Sponsored

Ads related to Pkg Paper Rewriter Claw and adjacent AI workflows.