| name | report-generator |
| description | Use when a user uploads or references a report template and wants a new report written in Markdown, especially when the final deliverable must also be a DOCX file. |
Report Generator
Overview
Create a Markdown report that follows the user's uploaded template, enforce strict Markdown outline rules, then convert the validated Markdown file to DOCX with Pandoc.
Workflow
- Inspect the uploaded report template before drafting.
- Identify its title, section hierarchy, required fields, tables, terminology, tone, and expected level of detail.
- Preserve the template's logical structure unless the user explicitly requests changes.
- Treat template placeholders as fields to complete, not text to copy blindly.
- For DOCX or PDF templates, extract the text and inspect rendered pages when layout affects the report structure.
- Gather the report content from the user's prompt, uploaded source material, and available workspace files.
- Do not invent facts, dates, metrics, conclusions, or citations.
- Mark genuinely missing information clearly and concisely when it cannot be derived.
- Draft the report as a
.md file.
- Use ATX headings such as
#, ##, and ### for report sections.
- Use Markdown tables when the template contains tabular information.
- Use paragraphs for ordinary explanatory content.
- Use ordered Markdown lists for every sequence, procedure, itemization, and outline.
- Validate the Markdown file before conversion:
python3 "$SKILL_DIR/scripts/validate_report.py" report.md
- Fix every reported violation and run the validator again until it exits successfully.
- Convert the Markdown file to DOCX with Pandoc:
pandoc report.md --from=gfm --to=docx --output=report.docx
- When the uploaded template is a DOCX file and its Word styles should be reused, pass it as the reference document:
pandoc report.md --from=gfm --to=docx --reference-doc=template.docx --output=report.docx
- Confirm that both the
.md and .docx files exist before reporting completion.
Markdown Rules
- Do not use unordered lists.
- Do not start list items with
-, +, or *.
- Do not use bullet glyphs such as
•, ▪, ◦, or · as list markers.
- Convert every itemization into an ordered Markdown list or prose.
- Do not use horizontal rules or standalone separators such as
---, ***, or ___.
- Markdown table delimiter rows such as
| --- | --- | are allowed.
- Make every sequence number Markdown-recognizable.
- Use
1., 2., 3. and similar ordered-list markers followed by a space.
- Do not use forms such as
一、, (一), (1), 1、, 1), A., ①, or 第一章 as list markers.
- Use nested ordered lists for hierarchical outlines.
- Indent each child level under its parent.
- Keep every level as a Markdown ordered list.
1. 一级事项
1. 二级事项
1. 三级事项
2. 第二个二级事项
2. 第二个一级事项
- Do not use YAML frontmatter in the report because its
--- delimiters violate the separator rule.
Quality Checks
- Verify that the report follows the template's section order and required fields.
- Verify that headings, lists, tables, and paragraphs render correctly as Markdown.
- Verify that no unsupported numbering style remains in visible report content.
- Verify that the DOCX opens successfully and contains the complete report.
Resources
- Use
scripts/validate_report.py to enforce the required Markdown syntax before Pandoc conversion.