Skip to content

Commit d958420

Browse files
committed
Add style presets, Mermaid, and AIGC workflow support
1 parent 31c75c8 commit d958420

22 files changed

Lines changed: 2272 additions & 311 deletions

README.md

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# software-thesis-docx
22

3-
Build and refine software-thesis DOCX workflows from real project repositories.
3+
Build and refine thesis-ready `DOCX` workflows from real software project repositories.
44

55
Chinese documentation: [README.zh-CN.md](README.zh-CN.md)
66

@@ -29,11 +29,21 @@ After installing, restart Codex to pick up new skills.
2929
## Try It
3030

3131
```text
32-
Use $software-thesis-docx to turn my software project repo into a structured thesis manifest and generate a DOCX.
33-
Use $software-thesis-docx to replace thesis figures by caption without changing Word layout.
34-
Use $software-thesis-docx to normalize in-text citations and terminology in an existing DOCX.
32+
Use $software-thesis-docx to turn my project repo into a structured thesis manifest and generate a DOCX with the built-in academic preset.
33+
Use $software-thesis-docx to read my school Word template, extract a custom style preset, and build the thesis in that format.
34+
Use $software-thesis-docx to generate Mermaid architecture and sequence diagrams for my thesis from the repository structure.
35+
Use $software-thesis-docx to run an AIGC risk check on my thesis DOCX and only rewrite the flagged single-run paragraphs if I approve it.
3536
```
3637

38+
## What It Adds
39+
40+
- A built-in academic formatting preset derived from a real thesis layout sample, without shipping the original private document
41+
- Runtime extraction of custom style presets from uploaded or provided `.docx` templates
42+
- Manifest-driven DOCX build with optional `formatting` config
43+
- Mermaid request contracts for architecture, sequence, ER, state, gantt, class, and mind-map diagrams
44+
- Optional rigorous-writing subagent mode for complex thesis tasks, default off
45+
- Local AIGC risk checking and conservative paragraph-level reduction workflow, default off
46+
3747
## Compatibility
3848

3949
- Codex: supported now
@@ -44,8 +54,14 @@ Use $software-thesis-docx to normalize in-text citations and terminology in an e
4454

4555
- Root-level distribution files: `README`, release notes, and one-click installers
4656
- The actual reusable skill at `skills/software-thesis-docx/`
47-
- Three parameterized DOCX tools for build, figure replacement, and paragraph rewrites
48-
- Public examples and methodology docs for adapting the workflow to another thesis project
57+
- Five reusable DOCX-oriented scripts:
58+
- `build_docx_from_manifest.py`
59+
- `extract_docx_style_preset.py`
60+
- `replace_images_by_caption.py`
61+
- `rewrite_paragraphs.py`
62+
- `check_aigc_risk.py`
63+
- Public examples for manifests, workflow options, Mermaid requests, image maps, and paragraph rewrites
64+
- Reference docs for formatting presets, Mermaid planning, option intake, AIGC review, and repo-to-thesis workflow
4965

5066
## Repository Layout
5167

@@ -71,35 +87,41 @@ Inside that folder you will find:
7187
- `SKILL.md`
7288
- `agents/openai.yaml`
7389
- `assets/examples/`
90+
- `assets/presets/`
7491
- `references/`
7592
- `scripts/`
7693
- `requirements.txt`
7794

7895
## Documentation
7996

8097
- [Codex quick start](docs/codex-quickstart.md)
98+
- [v0.3.0 release notes](docs/releases/v0.3.0.md)
8199
- [v0.2.0 release notes](docs/releases/v0.2.0.md)
82100
- [v0.1.0 release notes](docs/releases/v0.1.0.md)
83101

84102
## Design Principles
85103

86104
- Ground the thesis in repository facts before drafting prose
87105
- Keep content in structured inputs instead of hardcoding thesis text in Python
106+
- Separate formatting from content through built-in or extracted style presets
88107
- Prefer caption-based figure replacement over position-based image replacement
89108
- Prefer exact paragraph rewrites when Word layout fidelity matters
90-
- Validate visually after meaningful DOCX mutations
109+
- Keep Mermaid generation and AIGC review opt-in, not forced defaults
91110

92111
## Limits
93112

113+
- Mermaid support currently generates code and file outputs, not rendered images or automatic DOCX insertion
94114
- The paragraph rewrite tool only handles exact full-paragraph matches
95115
- Mixed-format, multi-run paragraphs should be inspected before automated edits
96-
- Institution-specific formatting rules may require manifest or style extensions
116+
- The AIGC checker is a local heuristic pass, not a guarantee of any third-party score
117+
- Institution-specific formatting rules may still require manifest or preset extensions
97118

98119
## Roadmap
99120

100-
- Add an OpenCode-compatible packaging and installation path
101-
- Add a Claude Code-compatible prompt and repository layout guide
102-
- Add cross-runtime smoke tests across Codex, OpenCode, and Claude Code
121+
- Add OpenCode-compatible packaging and installation paths
122+
- Add Claude Code-compatible prompt and repository layout guidance
123+
- Add shared smoke tests across Codex, OpenCode, and Claude Code
124+
- Expand style extraction for more complex school templates with richer front matter
103125

104126
## License
105127

README.zh-CN.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,21 @@ irm https://raw.githubusercontent.com/Jonnys-Li/software-thesis-docx-skill/main/
2929
## 快速试用
3030

3131
```text
32-
Use $software-thesis-docx to turn my software project repo into a structured thesis manifest and generate a DOCX.
33-
Use $software-thesis-docx to replace thesis figures by caption without changing Word layout.
34-
Use $software-thesis-docx to normalize in-text citations and terminology in an existing DOCX.
32+
Use $software-thesis-docx to turn my project repo into a structured thesis manifest and generate a DOCX with the built-in academic preset.
33+
Use $software-thesis-docx to read my school Word template, extract a custom style preset, and build the thesis in that format.
34+
Use $software-thesis-docx to generate Mermaid architecture and sequence diagrams for my thesis from the repository structure.
35+
Use $software-thesis-docx to run an AIGC risk check on my thesis DOCX and only rewrite the flagged single-run paragraphs if I approve it.
3536
```
3637

38+
## 这次新增了什么
39+
40+
- 一个内置的学术论文编排 preset,来源于真实排版样本,但不公开原始私有文档
41+
- 运行时从用户提供的 `.docx` 模板中抽取自定义样式 preset
42+
- 支持 `formatting` 配置的 manifest 驱动 DOCX 构建
43+
- 面向论文插图的 Mermaid 请求契约,支持架构图、时序图、ER 图、状态图、甘特图、类图和脑图
44+
- 可选的严谨写作 subagent 模式,默认关闭
45+
- 本地 AIGC 风险检查与保守的定向降重流程,默认关闭
46+
3747
## 兼容性
3848

3949
- Codex:当前已适配
@@ -44,8 +54,14 @@ Use $software-thesis-docx to normalize in-text citations and terminology in an e
4454

4555
- 根目录分发文件:`README`、版本说明、一键安装脚本
4656
- 真实可复用的 skill:`skills/software-thesis-docx/`
47-
- 3 个参数化 DOCX 工具:生成、按图注换图、精确段落改写
48-
- 公开示例与方法论文档,便于迁移到其他论文项目
57+
- 5 个可复用脚本:
58+
- `build_docx_from_manifest.py`
59+
- `extract_docx_style_preset.py`
60+
- `replace_images_by_caption.py`
61+
- `rewrite_paragraphs.py`
62+
- `check_aigc_risk.py`
63+
- 公开示例:manifest、workflow options、Mermaid 请求、图片映射、段落改写
64+
- 方法论文档:格式 preset、Mermaid、交互 intake、AIGC 评估、repo-to-thesis 工作流
4965

5066
## 仓库结构
5167

@@ -71,35 +87,41 @@ https://github.com/Jonnys-Li/software-thesis-docx-skill/tree/main/skills/softwar
7187
- `SKILL.md`
7288
- `agents/openai.yaml`
7389
- `assets/examples/`
90+
- `assets/presets/`
7491
- `references/`
7592
- `scripts/`
7693
- `requirements.txt`
7794

7895
## 文档
7996

8097
- [Codex 快速上手](docs/codex-quickstart.zh-CN.md)
98+
- [v0.3.0 版本说明](docs/releases/v0.3.0.md)
8199
- [v0.2.0 版本说明](docs/releases/v0.2.0.md)
82100
- [v0.1.0 版本说明](docs/releases/v0.1.0.md)
83101

84102
## 方法原则
85103

86104
- 先基于代码仓库事实,再组织论文内容
87105
- 把内容放进结构化输入,而不是把正文硬编码进 Python
106+
- 通过内置或抽取出的 style preset 把内容和排版分离
88107
- 图片替换优先按图注定位,不按“第几张图”这种脆弱逻辑
89108
- 文本改写优先整段精确匹配,减少对 Word 格式的破坏
90-
- 每次重要 DOCX 变更后都做一次可视化校验
109+
- Mermaid 与 AIGC 评估都是显式开关,不默认强制开启
91110

92111
## 使用边界
93112

113+
- Mermaid 当前只负责生成代码或 `.mmd` 文件,不负责自动渲染图片或自动插入 DOCX
94114
- 段落改写脚本只适合“整段全文精确命中”的场景
95115
-`run`、混合格式、修订痕迹较多的段落需要先人工检查
96-
- 学校格式要求如果更特殊,通常需要扩展 manifest 或样式逻辑
116+
- AIGC 检测是本地启发式评估,不承诺对齐第三方平台分值
117+
- 学校格式要求如果更特殊,通常需要扩展 manifest 或 preset 逻辑
97118

98119
## 下一步
99120

100121
- 增加 OpenCode 兼容的打包与安装方式
101122
- 增加 Claude Code 的接入方式与提示词约定
102123
- 增加跨运行时 smoke test,覆盖 Codex、OpenCode、Claude Code
124+
- 增强复杂学校模板的样式抽取与前置页支持
103125

104126
## 许可证
105127

docs/codex-quickstart.md

Lines changed: 61 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,41 @@ The installed skill directory should contain:
3030

3131
- `SKILL.md`
3232
- `agents/openai.yaml`
33-
- `scripts/`
34-
- `references/`
3533
- `assets/examples/`
34+
- `assets/presets/`
35+
- `references/`
36+
- `scripts/`
3637
- `requirements.txt`
3738

3839
The important part is that `SKILL.md` stays at the root of the installed skill.
3940

40-
## 3. Use The Skill In Codex
41+
## 3. What The Skill Now Supports
42+
43+
- manifest-driven thesis DOCX generation
44+
- caption-based image replacement
45+
- exact paragraph rewrites for layout-safe terminology or citation cleanup
46+
- built-in academic style preset
47+
- custom style preset extraction from `.docx` templates
48+
- Mermaid planning contracts
49+
- optional subagent rigorous-writing mode
50+
- optional AIGC risk checking and conservative reduction workflow
51+
52+
## 4. Use The Skill In Codex
4153

4254
Ask Codex to use the skill explicitly:
4355

4456
```text
45-
Use $software-thesis-docx to generate a thesis-ready DOCX workflow from my software project repository.
57+
Use $software-thesis-docx to build my thesis DOCX workflow from my software repository and ask me whether to use the default preset, Mermaid generation, subagents, and AIGC checks.
4658
```
4759

4860
Typical prompts:
4961

50-
- `Use $software-thesis-docx to turn my project repo into a structured thesis manifest and generate a DOCX.`
51-
- `Use $software-thesis-docx to replace thesis figures by caption without changing Word layout.`
52-
- `Use $software-thesis-docx to normalize in-text citations and terminology in an existing DOCX.`
62+
- `Use $software-thesis-docx to turn my project repo into a structured thesis manifest and generate a DOCX with the built-in preset.`
63+
- `Use $software-thesis-docx to read my Word template, extract a style preset, and build the thesis in that format.`
64+
- `Use $software-thesis-docx to generate Mermaid flowchart and sequenceDiagram code for my thesis based on the repo architecture.`
65+
- `Use $software-thesis-docx to run an AIGC risk review on my thesis DOCX and only rewrite the flagged single-run paragraphs after showing me the report.`
5366

54-
## 4. Optional Dependency Step
67+
## 5. Optional Dependency Step
5568

5669
If your Python environment does not already include the required libraries:
5770

@@ -61,16 +74,41 @@ python3 -m pip install -r "$HOME/.codex/skills/software-thesis-docx/requirements
6174

6275
If you use a custom `CODEX_HOME`, replace the path accordingly.
6376

64-
## 5. Run The Scripts Directly
77+
## 6. Run The Scripts Directly
6578

66-
Build from a manifest:
79+
Build from the bundled example manifest:
6780

6881
```bash
6982
python3 "$HOME/.codex/skills/software-thesis-docx/scripts/build_docx_from_manifest.py" \
7083
--manifest "$HOME/.codex/skills/software-thesis-docx/assets/examples/thesis_manifest.example.json" \
7184
--output /tmp/example-thesis.docx
7285
```
7386

87+
Extract a preset from a school template:
88+
89+
```bash
90+
python3 "$HOME/.codex/skills/software-thesis-docx/scripts/extract_docx_style_preset.py" \
91+
--input school-template.docx \
92+
--output /tmp/style-preset.json
93+
```
94+
95+
Build with that preset:
96+
97+
```bash
98+
python3 "$HOME/.codex/skills/software-thesis-docx/scripts/build_docx_from_manifest.py" \
99+
--manifest thesis_manifest.json \
100+
--style-preset /tmp/style-preset.json \
101+
--output /tmp/custom-thesis.docx
102+
```
103+
104+
Run the AIGC risk checker:
105+
106+
```bash
107+
python3 "$HOME/.codex/skills/software-thesis-docx/scripts/check_aigc_risk.py" \
108+
--input thesis.docx \
109+
--output /tmp/aigc-risk-report.json
110+
```
111+
74112
Replace images by caption:
75113

76114
```bash
@@ -89,7 +127,17 @@ python3 "$HOME/.codex/skills/software-thesis-docx/scripts/rewrite_paragraphs.py"
89127
--replacements "$HOME/.codex/skills/software-thesis-docx/assets/examples/rewrites.example.json"
90128
```
91129

92-
## 6. Current Scope
130+
## 7. Advanced Config Contracts
131+
132+
Bundled examples:
133+
134+
- `assets/examples/thesis_manifest.example.json`
135+
- `assets/examples/thesis_workflow_options.example.json`
136+
- `assets/examples/mermaid_requests.example.json`
137+
- `assets/examples/image_map.example.json`
138+
- `assets/examples/rewrites.example.json`
139+
140+
## 8. Current Scope
93141

94142
This repository currently ships the Codex-compatible skill layout only.
95143

@@ -102,5 +150,7 @@ Planned next steps:
102150
## Troubleshooting
103151

104152
- If Codex does not discover the skill, confirm the install path and make sure `SKILL.md` is at the root.
153+
- If the builder output looks wrong, check whether the manifest is using the right `formatting.mode`.
154+
- If preset extraction is weak, confirm the source `.docx` actually contains the semantic roles you expect.
105155
- If image replacement fails, check that each target caption exactly matches the caption text in the DOCX.
106156
- If paragraph rewriting fails, confirm the paragraph is a single-run exact match.

0 commit comments

Comments
 (0)