---
name: materials-assembly
description: "Use this skill to assemble government office materials: attachment catalogs, merged PDF books, meeting packets, project申报材料, inspection evidence packs, and document bundles with ordered manifests. Use it when the user provides multiple Word/PDF/Excel files and wants a polished, traceable compiled package."
---

# Materials Assembly

Use this skill when the work is about packaging multiple files into a formal material set. It should produce a clear catalog and, when inputs are PDFs, a merged PDF.

## Default Deliverables

- `attachment_index.docx`: ordered catalog with file names, categories, notes, and source references.
- `merged.pdf`: merged PDF when all selected files are already PDFs or have been converted to PDFs first.
- Optional checksum or manifest when traceability matters.

## Script

By default, the script reads the system input manifest at `/inputs/manifest.json` and builds a catalog for all uploaded files:

```bash
python /skill/sys_materials-assembly/scripts/assemble_manifest.py \
  --index-docx /outputs/attachment_index.docx
```

For a custom order, category, or name, write a business manifest to `/work/materials_manifest.json`. The `path` values should come from `/inputs/manifest.json`, not guessed fixed filenames.

```bash
python /skill/sys_materials-assembly/scripts/assemble_manifest.py \
  --manifest /work/materials_manifest.json \
  --index-docx /outputs/attachment_index.docx \
  --merged-pdf /outputs/merged.pdf
```

Business manifest format:

```json
{
  "title": "项目申报材料汇编",
  "items": [
    {"path": "/inputs/0-cover.pdf", "name": "封面", "category": "主件"},
    {"path": "/inputs/1-proof.pdf", "name": "佐证材料", "category": "附件"}
  ]
}
```

## Assembly Rules

- Preserve the user's requested order.
- Do not silently omit missing files.
- Convert Office files to PDF first with `soffice` if a merged PDF is required.
- Keep the catalog as the source of truth for the package.
