# Thesis Moe Archive

> Thesis MOE Archive (毕业论文检查材料归档)

- Skill: `hanxing-ai/thesis-moe-archive` (Agent Skill, multi-file: 6 files)
- Install (CLI): `npx skillmds@latest add hanxing-ai/thesis-moe-archive`
- Raw SKILL.md: https://api.skillmd.com/api/skills/hanxing-ai/thesis-moe-archive/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: hanxing-AI (https://skillmd.com/u/hanxing-ai)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/hanxing-ai/thesis-moe-archive

---


# Thesis MOE Archive (毕业论文检查材料归档)

Package each student's graduation materials into the Ministry of Education
(MOE) thesis-check deliverables. Portable: all heavy lifting is done by the
bundled scripts in `scripts/` (Python 3 + pypdf only). No platform-specific
tools are required.

## Deliverables (per student)

`PREFIX` is the MOE year code for the current review round, format
`<YYYY>_XX_<5-digit school code>_<6-digit major code>`. This skill embeds no
institution code: if the user has not provided it, ask before generating any
file, then reuse the same value for the whole batch. `ID` = student number
(digits, no separators), `NAME` = student name, `ID+NAME` = number and name
concatenated directly.

| Output | Contents |
|--------|----------|
| `{PREFIX}_{ID}_LW.pdf` | Thesis PDF (convert Word first if needed) |
| `{PREFIX}_{ID}_CL.zip` | Exactly 4 PDFs inside:<br>① `{PREFIX}_{ID}{NAME}_开题报告.pdf`<br>② `{PREFIX}_{ID}{NAME}_中期检查.pdf`<br>③ `{PREFIX}_{ID}{NAME}_结题报告.pdf`<br>④ `{PREFIX}_{ID}{NAME}_开题+中期+结题.pdf` (merged in order: opening → mid-term → final) |
| `{PREFIX}_{ID}_CCBG.pdf` | Plagiarism-check report PDF |

Output to the same directory as the student's source files, unless the user
says otherwise. NEVER modify or overwrite the user's original files.

## Workflow

### 1. Inventory inputs first

Identify, per student, five material types: thesis, opening report (开题),
mid-term check (中期), final report (结题), plagiarism report (查重).

- Heuristics: file-name keywords (论文/LW, 开题, 中期, 结题, 查重/重复率/检测报告);
  when ambiguous, read page 1 text of the PDF to confirm the type.
- `ID` = a run of 8–12 digits; `NAME` = the adjacent Chinese characters.
  **Use the exact characters from the actual file names** — users often
  mis-type a character when speaking (e.g. says 张三 but the file says 张叁).
- If any type is missing, STOP and list what is missing; ask the user how to
  proceed (e.g. skip CCBG for now). Never guess or substitute another file.
- If one type has multiple files, list them and let the user choose.

### 2. Normalize everything to PDF

- PDFs: use as-is.
- Word (.doc/.docx): `python scripts/word_to_pdf.py input.docx -o output.pdf`
  (tries MS Word via docx2pdf, then LibreOffice). On `MISSING_BACKEND`, ask
  the user to export the PDF themselves; do not skip silently.
- Other formats (CAJ, WPS…): try the same script or report honestly.

### 3. Merge the three reports

```bash
python scripts/merge_pdfs.py \
    -o "{PREFIX}_{ID}{NAME}_开题+中期+结题.pdf" \
    "{PREFIX}_{ID}{NAME}_开题报告.pdf" \
    "{PREFIX}_{ID}{NAME}_中期检查.pdf" \
    "{PREFIX}_{ID}{NAME}_结题报告.pdf"
```

The script verifies the merged page count equals the sum of inputs and exits
non-zero on mismatch. Order is fixed: 开题 → 中期 → 结题.

### 4. Build the CL zip

```bash
python scripts/make_cl_zip.py \
    -o "{PREFIX}_{ID}_CL.zip" \
    "{PREFIX}_{ID}{NAME}_开题报告.pdf" \
    "{PREFIX}_{ID}{NAME}_中期检查.pdf" \
    "{PREFIX}_{ID}{NAME}_结题报告.pdf" \
    "{PREFIX}_{ID}{NAME}_开题+中期+结题.pdf"
```

The script re-opens the zip and prints its namelist for verification.

### 5. Rename LW / CCBG

Copy (never move) the thesis PDF to `{PREFIX}_{ID}_LW.pdf` and the
plagiarism report to `{PREFIX}_{ID}_CCBG.pdf`.

### 6. Verify and report

Per student, confirm: merged page counts match; the zip contains exactly the
4 expected PDFs with character-exact names; every deliverable exists. Finish
with a summary table: ID / name / LW / CL(4 files) / CCBG / page check /
missing items or anomalies.

### 7. Batch behavior

For many students, process one at a time; a failure on one student must not
block the others. Report all results together at the end.

## Notes

- If an output file with the same name already exists, ask the user before
  overwriting.
- On Windows consoles, if Chinese output looks garbled, prefix commands with
  `PYTHONIOENCODING=utf-8`.
- Dependencies: `pip install pypdf` (required); `pip install docx2pdf`
  (optional, for Word→PDF via MS Word) or a LibreOffice install.

