中文说明在前,英文说明在后。
thesis-format-repair 是一个面向 Codex 的论文格式修复 skill,用于“先读规范,再改文档”的论文排版修复流程。
它适合处理这类任务:
- 已有学校论文格式手册、模板或样例
- 已有待修复的论文
.docx - 目标是按规范修正格式,而不是凭经验猜学校要求
这个 skill 的核心思路是:
- 先从格式规范中提取明确规则
- 再分析目标论文的结构与
.docx实现细节 - 最后做最小化、可验证的格式修复
- 读取论文格式手册、模板或样例文档
- 将规范条款整理成结构化规则
- 区分
required和inferred规则 - 按固定顺序修复论文格式
- 尽量保留原始正文内容、引用、书签和元数据
- 输出修复报告,说明改了什么、为什么改、哪些地方仍需人工复核
- 读取高校毕业论文格式规范
- 按论文手册修复现有
.docx - 基于模板或样例统一论文版式
- 检查页眉、页脚、页码、标题层级、摘要、目录、参考文献等格式问题
这个 skill 的标准流程分为 6 步:
- 收集输入材料
- 从规范中提取规则
- 分析目标论文结构
- 制定修复计划
- 执行确定性的格式修复
- 输出修复报告
它强调“规范优先”,避免把经验判断误当成学校明确要求。
SKILL.md
agents/openai.yaml
references/report-schema.md
references/rule-schema.md
scripts/extract_docx_paragraphs.py
SKILL.md:skill 主定义和完整工作流agents/openai.yaml:skill 使用的 agent 配置references/rule-schema.md:规范条款转结构化规则的参考格式references/report-schema.md:修复报告的参考格式scripts/extract_docx_paragraphs.py:从.docx规范文档中提取非空段落的脚本
先从格式规范文档中提取段落:
python scripts/extract_docx_paragraphs.py <spec.docx>如果规范较长,可以先按关键词筛选:
python scripts/extract_docx_paragraphs.py <spec.docx> --grep "<keywords>"之后结合:
references/rule-schema.md整理格式规则references/report-schema.md输出修复报告
- 以用户提供的规范为准
- 不凭记忆臆造学校格式要求
- 明确标记
required和inferred - 优先做最小化、定点式修改
- 不随意改写论文内容
- 无法确认的部分不宣称“完全符合规范”
这个 skill 预期会配合 minimax-docx skill 一起使用,用于:
- 分析文档结构
- 检查节、样式、页眉页脚、页码
- 在简单 CLI 修改不够稳妥时执行更安全的 OpenXML 修复
一次典型运行通常会产出:
- 修复后的论文
.docx,默认尽量保留原文件并输出副本 - 结构化规则摘要
- 修复报告,说明已应用规则、跳过项、校验过程和人工复核点
这个仓库用于单独发布和维护 thesis-format-repair skill,方便版本管理、分享和复用。
本仓库使用 Apache-2.0 许可证,详见 LICENSE 文件。
thesis-format-repair is a Codex skill for specification-first thesis formatting repair.
It is built for workflows where you have:
- a thesis formatting handbook, template, or sample document
- a target thesis
.docx - a request to repair formatting without inventing institution-specific rules
The skill follows a simple idea:
- extract explicit formatting requirements from the source specification
- analyze the target thesis structure and
.docximplementation details - apply minimal, deterministic, and verifiable repairs
- Reads a handbook, template, or sample thesis as the formatting authority
- Converts explicit clauses into a structured rule set
- Separates
requiredrules frominferredrules - Repairs thesis formatting in a controlled order
- Preserves thesis content unless the task explicitly requires content edits
- Produces a repair report with applied changes, skipped items, validations, and manual review points
- reading a university thesis formatting specification
- repairing a graduation thesis layout based on a handbook
- adjusting an existing
.docxthesis to match institutional rules - checking headers, footers, page numbering, heading hierarchy, abstracts, TOC, and references
The standard workflow has six steps:
- Gather the input artifacts.
- Extract rules from the specification.
- Analyze the target thesis structure.
- Build a repair plan.
- Apply deterministic repairs.
- Produce a repair report.
This workflow keeps explicit handbook rules ahead of guesswork.
SKILL.md
agents/openai.yaml
references/report-schema.md
references/rule-schema.md
scripts/extract_docx_paragraphs.py
SKILL.md: main skill definition and end-to-end workflowagents/openai.yaml: agent configuration used by the skillreferences/rule-schema.md: schema for turning handbook clauses into structured rulesreferences/report-schema.md: schema for writing the final repair reportscripts/extract_docx_paragraphs.py: helper script for extracting non-empty paragraphs from a.docxspecification
Extract text from the specification document:
python scripts/extract_docx_paragraphs.py <spec.docx>If the specification is long, narrow it first:
python scripts/extract_docx_paragraphs.py <spec.docx> --grep "<keywords>"Then use:
references/rule-schema.mdto build the rule setreferences/report-schema.mdto write the repair summary
- Use the provided specification as the source of truth.
- Do not invent school-specific formatting rules from memory.
- Mark rules as
requiredorinferred. - Prefer minimal, targeted
.docxedits. - Preserve original thesis content, citations, bookmarks, and metadata unless the task says otherwise.
- Do not claim full compliance when some sections or rules cannot be verified.
This skill is intended to work with the minimax-docx skill for:
- structure inspection
- section and style analysis
- header/footer and page-number handling
- safer OpenXML-based repairs when simple CLI edits are not enough
A typical run should produce:
- a repaired thesis
.docx, usually as a sibling copy - a structured rule summary
- a repair report listing applied rules, skipped changes, validations, and manual review items
This repository packages the full thesis-format-repair skill so it can be versioned, shared, and reused independently.
This repository is licensed under Apache-2.0. See LICENSE for details.