# Zafu Thesis Formatter

> >

- **Type:** Skill
- **Install:** `agentstack add skill-wjyxiaojiu-del-zafu-thesis-formatter-skill-zafu-thesis-formatter-skill`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [wjyxiaojiu-del](https://agentstack.voostack.com/s/wjyxiaojiu-del)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [wjyxiaojiu-del](https://github.com/wjyxiaojiu-del)
- **Source:** https://github.com/wjyxiaojiu-del/zafu-thesis-formatter-skill

## Install

```sh
agentstack add skill-wjyxiaojiu-del-zafu-thesis-formatter-skill-zafu-thesis-formatter-skill
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# ZAFU Thesis Formatter

Use this skill when a user asks to format, fix, or check a Zhejiang A&F University undergraduate thesis (.docx).

## Quick Start

```bash
# 从参考文档学习格式规则
python scripts/thesis_format.py learn 参考论文.docx rules.json

# 用规则修格式（输出 _formatted.docx）
python scripts/thesis_format.py apply 待修论文.docx rules.json

# 检查格式差异（不修改）
python scripts/thesis_format.py check 待修论文.docx rules.json
```

## Workflow

1. **learn**：从一篇格式正确的参考论文中提取格式规则（字体、字号、行距、缩进、对齐等），保存为 `rules.json`
2. **apply**：将规则应用到其他论文，自动修复：
   - 页面设置（A4、2.7cm 边距）
   - 目录标题和条目字体
   - 论文标题（保持原样）
   - 一/二/三/四级标题字体（楷体/黑体/宋体 + 字号 + 加粗）
   - 正文格式（宋体五号 + TNR + 首行缩进 + 两端对齐）
   - 摘要/关键词（标签黑体加粗，内容楷体）
   - 图/表按章节自动编号（图 X-Y、表 X-Y）
   - p<0.05 等统计标记自动斜体
   - TOC 样式修复（宋体 + TNR 五号）
3. **check**：对比文档与规则的差异，列出所有不符之处

## Format Rules

详见 [FORMAT_SPEC.md](FORMAT_SPEC.md)。

## Key Behaviors

- **跳过封面/声明**：只处理目录之后的内容
- **论文标题保留**：居中大字号段落不会被修改
- **标题识别**：支持 Word Heading 样式 + 编号模式（`1 标题`、`1.1 标题`、`1.1.1 标题`），有无空格都能识别
- **官方规则优先**：标题字体以 FORMAT_SPEC.md 为准，不完全依赖参考文档
- **摘要拆分字体**："摘要："用黑体加粗，内容用楷体
- **不强制刷新域**：避免损坏的域代码报错

## Requirements

- Python 3.8+
- `pip install python-docx`

## Limitations

- 封面格式不处理（保持原样）
- 公式内容不修改
- 三线表边框需人工确认
- 交叉引用域（REF 域）不自动创建，只检查引用编号是否匹配

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [wjyxiaojiu-del](https://github.com/wjyxiaojiu-del)
- **Source:** [wjyxiaojiu-del/zafu-thesis-formatter-skill](https://github.com/wjyxiaojiu-del/zafu-thesis-formatter-skill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-wjyxiaojiu-del-zafu-thesis-formatter-skill-zafu-thesis-formatter-skill
- Seller: https://agentstack.voostack.com/s/wjyxiaojiu-del
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
