@nguyenphp/antigravity-marketing 1.0.18 → 1.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/README.md +186 -78
  2. package/package.json +4 -3
  3. package/templates/.agent/skills/marketing-report-expert/SKILL.md +70 -0
  4. package/templates/.agent/skills/minimax-docx/LICENSE +21 -0
  5. package/templates/.agent/skills/minimax-docx/SKILL.md +274 -0
  6. package/templates/.agent/skills/minimax-docx/assets/styles/academic_styles.xml +250 -0
  7. package/templates/.agent/skills/minimax-docx/assets/styles/corporate_styles.xml +284 -0
  8. package/templates/.agent/skills/minimax-docx/assets/styles/default_styles.xml +449 -0
  9. package/templates/.agent/skills/minimax-docx/assets/xsd/aesthetic-rules.xsd +470 -0
  10. package/templates/.agent/skills/minimax-docx/assets/xsd/business-rules.xsd +130 -0
  11. package/templates/.agent/skills/minimax-docx/assets/xsd/common-types.xsd +159 -0
  12. package/templates/.agent/skills/minimax-docx/assets/xsd/wml-subset.xsd +589 -0
  13. package/templates/.agent/skills/minimax-docx/references/cjk_typography.md +357 -0
  14. package/templates/.agent/skills/minimax-docx/references/cjk_university_template_guide.md +184 -0
  15. package/templates/.agent/skills/minimax-docx/references/comments_guide.md +191 -0
  16. package/templates/.agent/skills/minimax-docx/references/design_good_bad_examples.md +829 -0
  17. package/templates/.agent/skills/minimax-docx/references/design_principles.md +819 -0
  18. package/templates/.agent/skills/minimax-docx/references/openxml_element_order.md +308 -0
  19. package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part1.md +4061 -0
  20. package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part2.md +2820 -0
  21. package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part3.md +3381 -0
  22. package/templates/.agent/skills/minimax-docx/references/openxml_namespaces.md +82 -0
  23. package/templates/.agent/skills/minimax-docx/references/openxml_units.md +72 -0
  24. package/templates/.agent/skills/minimax-docx/references/scenario_a_create.md +284 -0
  25. package/templates/.agent/skills/minimax-docx/references/scenario_b_edit_content.md +295 -0
  26. package/templates/.agent/skills/minimax-docx/references/scenario_c_apply_template.md +456 -0
  27. package/templates/.agent/skills/minimax-docx/references/track_changes_guide.md +200 -0
  28. package/templates/.agent/skills/minimax-docx/references/troubleshooting.md +506 -0
  29. package/templates/.agent/skills/minimax-docx/references/typography_guide.md +294 -0
  30. package/templates/.agent/skills/minimax-docx/references/xsd_validation_guide.md +158 -0
  31. package/templates/.agent/skills/minimax-docx/scripts/doc_to_docx.sh +40 -0
  32. package/templates/.agent/skills/minimax-docx/scripts/docx_preview.sh +37 -0
  33. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli/MiniMaxAIDocx.Cli.csproj +19 -0
  34. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli/Program.cs +18 -0
  35. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/AnalyzeCommand.cs +147 -0
  36. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/ApplyTemplateCommand.cs +322 -0
  37. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/CreateCommand.cs +324 -0
  38. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/DiffCommand.cs +155 -0
  39. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/EditContentCommand.cs +487 -0
  40. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/FixOrderCommand.cs +108 -0
  41. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/MergeRunsCommand.cs +122 -0
  42. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/ValidateCommand.cs +107 -0
  43. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/MiniMaxAIDocx.Core.csproj +15 -0
  44. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/CommentSynchronizer.cs +169 -0
  45. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/ElementOrder.cs +80 -0
  46. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/NamespaceConstants.cs +42 -0
  47. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/RunMerger.cs +81 -0
  48. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/StyleAnalyzer.cs +81 -0
  49. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/TrackChangesHelper.cs +99 -0
  50. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/UnitConverter.cs +23 -0
  51. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples.cs +1832 -0
  52. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch1.cs +910 -0
  53. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch2.cs +999 -0
  54. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch3.cs +1048 -0
  55. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch4.cs +1038 -0
  56. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/CharacterFormattingSamples.cs +1020 -0
  57. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/DocumentCreationSamples.cs +1121 -0
  58. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/FieldAndTocSamples.cs +624 -0
  59. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/FootnoteAndCommentSamples.cs +675 -0
  60. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/HeaderFooterSamples.cs +838 -0
  61. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ImageSamples.cs +917 -0
  62. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ListAndNumberingSamples.cs +826 -0
  63. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ParagraphFormattingSamples.cs +1199 -0
  64. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/StyleSystemSamples.cs +1487 -0
  65. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/TableSamples.cs +1163 -0
  66. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/TrackChangesSamples.cs +595 -0
  67. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/CjkHelper.cs +39 -0
  68. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/FontDefaults.cs +24 -0
  69. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/PageSizes.cs +20 -0
  70. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/BusinessRuleValidator.cs +224 -0
  71. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/GateCheckValidator.cs +148 -0
  72. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/ValidationResult.cs +23 -0
  73. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/XsdValidator.cs +69 -0
  74. package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.slnx +4 -0
  75. package/templates/.agent/skills/minimax-docx/scripts/env_check.sh +196 -0
  76. package/templates/.agent/skills/minimax-docx/scripts/setup.ps1 +274 -0
  77. package/templates/.agent/skills/minimax-docx/scripts/setup.sh +504 -0
  78. package/templates/.agent/skills/minimax-multimodal-toolkit/SKILL.md +359 -0
  79. package/templates/.agent/skills/minimax-pdf/README.md +222 -0
  80. package/templates/.agent/skills/minimax-pdf/SKILL.md +201 -0
  81. package/templates/.agent/skills/minimax-pdf/design/design.md +381 -0
  82. package/templates/.agent/skills/minimax-pdf/scripts/cover.py +1579 -0
  83. package/templates/.agent/skills/minimax-pdf/scripts/fill_inspect.py +200 -0
  84. package/templates/.agent/skills/minimax-pdf/scripts/fill_write.py +242 -0
  85. package/templates/.agent/skills/minimax-pdf/scripts/make.sh +491 -0
  86. package/templates/.agent/skills/minimax-pdf/scripts/merge.py +112 -0
  87. package/templates/.agent/skills/minimax-pdf/scripts/palette.py +559 -0
  88. package/templates/.agent/skills/minimax-pdf/scripts/reformat_parse.py +374 -0
  89. package/templates/.agent/skills/minimax-pdf/scripts/render_body.py +1055 -0
  90. package/templates/.agent/skills/minimax-pdf/scripts/render_cover.cjs +111 -0
  91. package/templates/.agent/skills/minimax-xlsx/SKILL.md +138 -0
  92. package/templates/.agent/skills/minimax-xlsx/references/create.md +691 -0
  93. package/templates/.agent/skills/minimax-xlsx/references/edit.md +684 -0
  94. package/templates/.agent/skills/minimax-xlsx/references/fix.md +37 -0
  95. package/templates/.agent/skills/minimax-xlsx/references/format.md +768 -0
  96. package/templates/.agent/skills/minimax-xlsx/references/ooxml-cheatsheet.md +231 -0
  97. package/templates/.agent/skills/minimax-xlsx/references/read-analyze.md +97 -0
  98. package/templates/.agent/skills/minimax-xlsx/references/validate.md +772 -0
  99. package/templates/.agent/skills/minimax-xlsx/scripts/formula_check.py +422 -0
  100. package/templates/.agent/skills/minimax-xlsx/scripts/libreoffice_recalc.py +248 -0
  101. package/templates/.agent/skills/minimax-xlsx/scripts/shared_strings_builder.py +163 -0
  102. package/templates/.agent/skills/minimax-xlsx/scripts/style_audit.py +575 -0
  103. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_add_column.py +395 -0
  104. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_insert_row.py +274 -0
  105. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_pack.py +87 -0
  106. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_reader.py +362 -0
  107. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_shift_rows.py +396 -0
  108. package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_unpack.py +130 -0
  109. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/[Content_Types].xml +9 -0
  110. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/_rels/.rels +6 -0
  111. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/_rels/workbook.xml.rels +19 -0
  112. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/sharedStrings.xml +33 -0
  113. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/styles.xml +160 -0
  114. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/workbook.xml +30 -0
  115. package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/worksheets/sheet1.xml +70 -0
  116. package/templates/.agent/skills/pptx-generator/SKILL.md +249 -0
  117. package/templates/.agent/skills/pptx-generator/references/design-system.md +392 -0
  118. package/templates/.agent/skills/pptx-generator/references/editing.md +162 -0
  119. package/templates/.agent/skills/pptx-generator/references/pitfalls.md +112 -0
  120. package/templates/.agent/skills/pptx-generator/references/pptxgenjs.md +420 -0
  121. package/templates/.agent/skills/pptx-generator/references/slide-types.md +413 -0
  122. package/templates/.agent/skills/tutorial-video-expert/SKILL.md +88 -0
  123. package/templates/.agent/skills/ui-ux-pro-max/SKILL.md +170 -585
  124. package/templates/.agent/skills/vision-analysis/SKILL.md +174 -0
  125. package/templates/.agent/workflows/analyze.md +3 -0
  126. package/templates/.agent/workflows/brand-report.md +44 -0
  127. package/templates/.agent/workflows/report.md +49 -0
@@ -0,0 +1,201 @@
1
+ ---
2
+ name: minimax-pdf
3
+ description: >
4
+ Use this skill when visual quality and design identity matter for a PDF.
5
+ CREATE (generate from scratch): "make a PDF", "generate a report", "write a proposal",
6
+ "create a resume", "beautiful PDF", "professional document", "cover page",
7
+ "polished PDF", "client-ready document".
8
+ FILL (complete form fields): "fill in the form", "fill out this PDF",
9
+ "complete the form fields", "write values into PDF", "what fields does this PDF have".
10
+ REFORMAT (apply design to an existing doc): "reformat this document", "apply our style",
11
+ "convert this Markdown/text to PDF", "make this doc look good", "re-style this PDF".
12
+ This skill uses a token-based design system: color, typography, and spacing are derived
13
+ from the document type and flow through every page. The output is print-ready.
14
+ Prefer this skill when appearance matters, not just when any PDF output is needed.
15
+ license: MIT
16
+ metadata:
17
+ version: "1.0"
18
+ category: document-generation
19
+ ---
20
+
21
+ # minimax-pdf
22
+
23
+ Three tasks. One skill.
24
+
25
+ ## Read `design/design.md` before any CREATE or REFORMAT work.
26
+
27
+ ---
28
+
29
+ ## Route table
30
+
31
+ | User intent | Route | Scripts used |
32
+ |---|---|---|
33
+ | Generate a new PDF from scratch | **CREATE** | `palette.py` → `cover.py` → `render_cover.js` → `render_body.py` → `merge.py` |
34
+ | Fill / complete form fields in an existing PDF | **FILL** | `fill_inspect.py` → `fill_write.py` |
35
+ | Reformat / re-style an existing document | **REFORMAT** | `reformat_parse.py` → then full CREATE pipeline |
36
+
37
+ **Rule:** when in doubt between CREATE and REFORMAT, ask whether the user has an existing document to start from. If yes → REFORMAT. If no → CREATE.
38
+
39
+ ---
40
+
41
+ ## Route A: CREATE
42
+
43
+ Full pipeline — content → design tokens → cover → body → merged PDF.
44
+
45
+ ```bash
46
+ bash scripts/make.sh run \
47
+ --title "Q3 Strategy Review" --type proposal \
48
+ --author "Strategy Team" --date "October 2025" \
49
+ --accent "#2D5F8A" \
50
+ --content content.json --out report.pdf
51
+ ```
52
+
53
+ **Doc types:** `report` · `proposal` · `resume` · `portfolio` · `academic` · `general` · `minimal` · `stripe` · `diagonal` · `frame` · `editorial` · `magazine` · `darkroom` · `terminal` · `poster`
54
+
55
+ | Type | Cover pattern | Visual identity |
56
+ |---|---|---|
57
+ | `report` | `fullbleed` | Dark bg, dot grid, Playfair Display |
58
+ | `proposal` | `split` | Left panel + right geometric, Syne |
59
+ | `resume` | `typographic` | Oversized first-word, DM Serif Display |
60
+ | `portfolio` | `atmospheric` | Near-black, radial glow, Fraunces |
61
+ | `academic` | `typographic` | Light bg, classical serif, EB Garamond |
62
+ | `general` | `fullbleed` | Dark slate, Outfit |
63
+ | `minimal` | `minimal` | White + single 8px accent bar, Cormorant Garamond |
64
+ | `stripe` | `stripe` | 3 bold horizontal color bands, Barlow Condensed |
65
+ | `diagonal` | `diagonal` | SVG angled cut, dark/light halves, Montserrat |
66
+ | `frame` | `frame` | Inset border, corner ornaments, Cormorant |
67
+ | `editorial` | `editorial` | Ghost letter, all-caps title, Bebas Neue |
68
+ | `magazine` | `magazine` | Warm cream bg, centered stack, hero image, Playfair Display |
69
+ | `darkroom` | `darkroom` | Navy bg, centered stack, grayscale image, Playfair Display |
70
+ | `terminal` | `terminal` | Near-black, grid lines, monospace, neon green |
71
+ | `poster` | `poster` | White bg, thick sidebar, oversized title, Barlow Condensed |
72
+
73
+ Cover extras (inject into tokens via `--abstract`, `--cover-image`):
74
+ - `--abstract "text"` — abstract text block on the cover (magazine/darkroom)
75
+ - `--cover-image "url"` — hero image URL/path (magazine, darkroom, poster)
76
+
77
+ **Color overrides — always choose these based on document content:**
78
+ - `--accent "#HEX"` — override the accent color; `accent_lt` is auto-derived by lightening toward white
79
+ - `--cover-bg "#HEX"` — override the cover background color
80
+
81
+ **Accent color selection guidance:**
82
+
83
+ You have creative authority over the accent color. Pick it from the document's semantic context — title, industry, purpose, audience — not from generic "safe" choices. The accent appears on section rules, callout bars, table headers, and the cover: it carries the document's visual identity.
84
+
85
+ | Context | Suggested accent range |
86
+ |---|---|
87
+ | Legal / compliance / finance | Deep navy `#1C3A5E`, charcoal `#2E3440`, slate `#3D4C5E` |
88
+ | Healthcare / medical | Teal-green `#2A6B5A`, cool green `#3A7D6A` |
89
+ | Technology / engineering | Steel blue `#2D5F8A`, indigo `#3D4F8A` |
90
+ | Environmental / sustainability | Forest `#2E5E3A`, olive `#4A5E2A` |
91
+ | Creative / arts / culture | Burgundy `#6B2A35`, plum `#5A2A6B`, terracotta `#8A3A2A` |
92
+ | Academic / research | Deep teal `#2A5A6B`, library blue `#2A4A6B` |
93
+ | Corporate / neutral | Slate `#3D4A5A`, graphite `#444C56` |
94
+ | Luxury / premium | Warm black `#1A1208`, deep bronze `#4A3820` |
95
+
96
+ **Rule:** choose a color that a thoughtful designer would select for this specific document — not the type's default. Muted, desaturated tones work best; avoid vivid primaries. When in doubt, go darker and more neutral.
97
+
98
+ **content.json block types:**
99
+
100
+ | Block | Usage | Key fields |
101
+ |---|---|---|
102
+ | `h1` | Section heading + accent rule | `text` |
103
+ | `h2` | Subsection heading | `text` |
104
+ | `h3` | Sub-subsection (bold) | `text` |
105
+ | `body` | Justified paragraph; supports `<b>` `<i>` markup | `text` |
106
+ | `bullet` | Unordered list item (• prefix) | `text` |
107
+ | `numbered` | Ordered list item — counter auto-resets on non-numbered blocks | `text` |
108
+ | `callout` | Highlighted insight box with accent left bar | `text` |
109
+ | `table` | Data table — accent header, alternating row tints | `headers`, `rows`, `col_widths`?, `caption`? |
110
+ | `image` | Embedded image scaled to column width | `path`/`src`, `caption`? |
111
+ | `figure` | Image with auto-numbered "Figure N:" caption | `path`/`src`, `caption`? |
112
+ | `code` | Monospace code block with accent left border | `text`, `language`? |
113
+ | `math` | Display math — LaTeX syntax via matplotlib mathtext | `text`, `label`?, `caption`? |
114
+ | `chart` | Bar / line / pie chart rendered with matplotlib | `chart_type`, `labels`, `datasets`, `title`?, `x_label`?, `y_label`?, `caption`?, `figure`? |
115
+ | `flowchart` | Process diagram with nodes + edges via matplotlib | `nodes`, `edges`, `caption`?, `figure`? |
116
+ | `bibliography` | Numbered reference list with hanging indent | `items` [{id, text}], `title`? |
117
+ | `divider` | Accent-colored full-width rule | — |
118
+ | `caption` | Small muted label | `text` |
119
+ | `pagebreak` | Force a new page | — |
120
+ | `spacer` | Vertical whitespace | `pt` (default 12) |
121
+
122
+ **chart / flowchart schemas:**
123
+ ```json
124
+ {"type":"chart","chart_type":"bar","labels":["Q1","Q2","Q3","Q4"],
125
+ "datasets":[{"label":"Revenue","values":[120,145,132,178]}],"caption":"Q results"}
126
+
127
+ {"type":"flowchart",
128
+ "nodes":[{"id":"s","label":"Start","shape":"oval"},
129
+ {"id":"p","label":"Process","shape":"rect"},
130
+ {"id":"d","label":"Valid?","shape":"diamond"},
131
+ {"id":"e","label":"End","shape":"oval"}],
132
+ "edges":[{"from":"s","to":"p"},{"from":"p","to":"d"},
133
+ {"from":"d","to":"e","label":"Yes"},{"from":"d","to":"p","label":"No"}]}
134
+
135
+ {"type":"bibliography","items":[
136
+ {"id":"1","text":"Author (Year). Title. Publisher."}]}
137
+ ```
138
+
139
+ ---
140
+
141
+ ## Route B: FILL
142
+
143
+ Fill form fields in an existing PDF without altering layout or design.
144
+
145
+ ```bash
146
+ # Step 1: inspect
147
+ python3 scripts/fill_inspect.py --input form.pdf
148
+
149
+ # Step 2: fill
150
+ python3 scripts/fill_write.py --input form.pdf --out filled.pdf \
151
+ --values '{"FirstName": "Jane", "Agree": "true", "Country": "US"}'
152
+ ```
153
+
154
+ | Field type | Value format |
155
+ |---|---|
156
+ | `text` | Any string |
157
+ | `checkbox` | `"true"` or `"false"` |
158
+ | `dropdown` | Must match a choice value from inspect output |
159
+ | `radio` | Must match a radio value (often starts with `/`) |
160
+
161
+ Always run `fill_inspect.py` first to get exact field names.
162
+
163
+ ---
164
+
165
+ ## Route C: REFORMAT
166
+
167
+ Parse an existing document → content.json → CREATE pipeline.
168
+
169
+ ```bash
170
+ bash scripts/make.sh reformat \
171
+ --input source.md --title "My Report" --type report --out output.pdf
172
+ ```
173
+
174
+ **Supported input formats:** `.md` `.txt` `.pdf` `.json`
175
+
176
+ ---
177
+
178
+ ## Environment
179
+
180
+ ```bash
181
+ bash scripts/make.sh check # verify all deps
182
+ bash scripts/make.sh fix # auto-install missing deps
183
+ bash scripts/make.sh demo # build a sample PDF
184
+ ```
185
+
186
+ | Tool | Used by | Install |
187
+ |---|---|---|
188
+ | Python 3.9+ | all `.py` scripts | system |
189
+ | `reportlab` | `render_body.py` | `pip install reportlab` |
190
+ | `pypdf` | fill, merge, reformat | `pip install pypdf` |
191
+ | Node.js 18+ | `render_cover.js` | system |
192
+ | `playwright` + Chromium | `render_cover.js` | `npm install -g playwright && npx playwright install chromium` |
193
+
194
+ ---
195
+
196
+ ## 🤝 Collaborative Design
197
+
198
+ This skill is designed to work with **`ui-ux-pro-max`** and **`frontend-design`**.
199
+
200
+ - **Tokens**: Before running `make.sh`, use `ui-ux-pro-max` to derive the optimal `--accent` and `--type` based on the document's purpose.
201
+ - **Layout**: Use `frontend-design` to structure complex reporting sections (like social proof or feature deep-dives) before mapping them to tệp `content.json`.
@@ -0,0 +1,381 @@
1
+ # Design System
2
+
3
+ The aesthetic layer. Read this before touching any script.
4
+ This file answers "what should it look like and why."
5
+
6
+ ---
7
+
8
+ ## The one rule
9
+
10
+ Every design decision must be **rooted in the document's content and purpose**.
11
+ Dark teal + cream is not "professional". Serif + beige is not "elegant".
12
+ A color chosen because it fits the content will always outperform a color chosen
13
+ because it seems safe.
14
+
15
+ ---
16
+
17
+ ## Palette logic
18
+
19
+ `palette.py` takes a short content description and outputs `tokens.json`.
20
+ Here is the reasoning it applies:
21
+
22
+ ### Mood → base palette
23
+
24
+ | Content signal | Mood | Background | Accent | Text |
25
+ |---|---|---|---|---|
26
+ | Research, science, analysis | Authoritative | `#0F1F2E` deep ink | `#00B4A6` teal | `#F0EDE6` warm white |
27
+ | Business, strategy, finance | Confident | `#1C1C2B` near-black | `#E8A020` amber | `#F5F2EC` cream |
28
+ | Creative, portfolio, design | Expressive | `#1A0A2E` deep violet | `#FF6B6B` coral | `#FAF5FF` lavender white |
29
+ | Education, academic paper | Scholarly | `#FAFAF7` warm white | `#2C4A7C` navy | `#1A1A2E` dark |
30
+ | Healthcare, wellness | Calm | `#F5F9F8` pale mint | `#2D8B72` forest | `#1E3830` deep green |
31
+ | Resume / personal | Clean | `#FFFFFF` white | pick from content | `#111111` near-black |
32
+ | General / unknown | Neutral | `#F8F6F1` warm off-white | `#3D3D3D` dark gray | `#1A1A1A` black |
33
+ | Formal publications, annual reports | Magazine | `#F2F0EC` warm linen | `#1C3557` deep navy | `#0D1A2B` near-black |
34
+ | Premium/dark reports, tech reviews | Darkroom | `#151C27` deep navy | `#4A6FA5` steel blue | `#F0EDE6` warm white |
35
+ | Technical docs, developer reports | Terminal | `#0D1117` near-black | `#39D353` neon green | `#E6EDF3` cool white |
36
+ | Portfolios, creative, photography | Poster | `#FFFFFF` white | `#0A0A0A` near-black | `#0A0A0A` near-black |
37
+
38
+ ### Accent selection rules
39
+
40
+ - **One accent color only.** Using two accents splits visual energy.
41
+ - Accent appears on: cover geometric elements, section rules, callout left borders,
42
+ table header background, page header rule. Nowhere else.
43
+ - Accent must contrast with the cover background by at least 4.5:1 (WCAG AA).
44
+ - Do not default to blue. Blue is the most overused accent in AI-generated documents.
45
+
46
+ ### Color pairing anti-patterns (never use these)
47
+
48
+ | ❌ Avoid | Why |
49
+ |---|---|
50
+ | Purple gradient on white | The default AI aesthetic — immediately signals "generated" |
51
+ | Navy + gold | Overused corporate cliché |
52
+ | All-black background | Prints badly, feels aggressive |
53
+ | More than 3 colors in the system | Visual noise |
54
+ | Accent on body text | Destroys readability |
55
+
56
+ ---
57
+
58
+ ## Typography system
59
+
60
+ ### Font pairing logic
61
+
62
+ Two typefaces maximum. Always.
63
+
64
+ | Role | Criteria | Good choices (system-safe) |
65
+ |---|---|---|
66
+ | Display (cover title, H1) | Distinctive, strong contrast, high weight | Times New Roman, Georgia (serif) |
67
+ | Text (body, captions, UI) | Highly readable at 10–11pt | Helvetica, Arial (sans) |
68
+
69
+ Cover fonts are loaded live via `@import url(...)` in the cover HTML — Playwright
70
+ fetches them at render time, no local caching. Body pages always use system fonts
71
+ (Times-Bold / Helvetica) via ReportLab — consistent and offline-safe.
72
+
73
+ Pairs by mood (cover HTML only — body always uses system fonts):
74
+ - Authoritative: `Playfair Display` / `IBM Plex Sans`
75
+ - Confident: `Syne` / `Nunito Sans`
76
+ - Expressive: `Fraunces` / `Inter`
77
+ - Scholarly: `EB Garamond` / `Source Sans 3`
78
+ - Clean: `DM Serif Display` / `DM Sans`
79
+ - Restrained: `Cormorant Garamond` / `Jost`
80
+ - Bold: `Barlow Condensed` / `Barlow`
81
+ - Dynamic: `Montserrat` / `Montserrat`
82
+ - Classical: `Cormorant` / `Crimson Pro`
83
+ - Editorial: `Bebas Neue` / `Libre Franklin`
84
+ - Body fallback (always): `Times-Bold` / `Helvetica` (ReportLab system fonts)
85
+
86
+ ### Type scale
87
+
88
+ All sizes in points. This scale is used by `palette.py` to populate `tokens.json`.
89
+
90
+ | Token | Size | Leading | Usage |
91
+ |---|---|---|---|
92
+ | `display` | 54pt | 1.0 | Cover title |
93
+ | `h1` | 22pt | 1.3 | Section headings |
94
+ | `h2` | 15pt | 1.4 | Subsection headings |
95
+ | `h3` | 11.5pt | 1.5 | Sub-subsection |
96
+ | `body` | 10.5pt | 1.6 | Main prose |
97
+ | `caption` | 8.5pt | 1.4 | Figure/table captions |
98
+ | `meta` | 8pt | 1.3 | Header/footer text |
99
+
100
+ ### Spacing system
101
+
102
+ Margins and rhythm are what separate "looks designed" from "looks printed".
103
+
104
+ | Token | Value | Notes |
105
+ |---|---|---|
106
+ | `margin_outer` | 2.8cm | Left/right page margin |
107
+ | `margin_top` | 2.8cm | Top page margin |
108
+ | `margin_bottom` | 2.5cm | Bottom page margin |
109
+ | `section_gap` | 26pt | Space before H1 |
110
+ | `para_gap` | 8pt | Space after paragraph |
111
+ | `line_gap` | 17pt | Leading for body text |
112
+
113
+ Never use ReportLab's default margins (too tight). Always set explicitly.
114
+
115
+ ---
116
+
117
+ ## Cover design
118
+
119
+ The cover is the most important page. It determines whether a reader trusts the document.
120
+
121
+ ### Thirteen cover patterns
122
+
123
+ `cover.py` selects one based on `tokens.json["cover_pattern"]`.
124
+
125
+ **1. `fullbleed`** — used for: `report`, `general`
126
+ - Deep background fills 100% of page
127
+ - Title: large, left-aligned, upper 60% of page
128
+ - Accent: thin horizontal rule + top-right corner strip
129
+ - Dot-grid background texture (subtle, 8–10% opacity)
130
+ - Footer band: author + date metadata
131
+ - Fonts: Playfair Display / IBM Plex Sans
132
+
133
+ **2. `split`** — used for: `proposal`
134
+ - Left 42% panel: solid cover color, title + author
135
+ - Right 58%: off-white, dot-grid decoration
136
+ - Hard vertical dividing line in accent color
137
+ - No gradients — pure flat geometry
138
+ - Fonts: Syne / Nunito Sans
139
+
140
+ **3. `typographic`** — used for: `resume`, `academic`
141
+ - White/off-white background
142
+ - Name or title as oversized display type (60–80pt), left-aligned
143
+ - First word in accent color, remainder in dark
144
+ - Thin rule below title block
145
+ - Fonts: DM Serif Display / DM Sans (resume) · EB Garamond / Source Sans 3 (academic)
146
+
147
+ **4. `atmospheric`** — used for: `portfolio`
148
+ - Near-black background
149
+ - Soft radial glow in accent color (upper-right quadrant)
150
+ - Title centered-left, 2 lines max
151
+ - Short rule in accent below title
152
+ - Dot-grid texture at low opacity
153
+ - Fonts: Fraunces / Inter
154
+
155
+ **5. `minimal`** — used for: `minimal`
156
+ - Near-white background, 8px left accent bar is the only color
157
+ - Title in very large, light-weight display type (300 weight)
158
+ - Hairline rule, author + date as single muted line
159
+ - Nothing else — the bar does all the visual work
160
+ - Fonts: Cormorant Garamond / Jost
161
+
162
+ **6. `stripe`** — used for: `stripe`
163
+ - Page cut into three horizontal bands: accent / dark / light
164
+ - Top band: category label; middle: oversized title in white; bottom: metadata
165
+ - Hard edges, no gradients, no textures — newspaper / brand poster aesthetic
166
+ - Fonts: Barlow Condensed / Barlow
167
+
168
+ **7. `diagonal`** — used for: `diagonal`
169
+ - SVG polygon cuts page diagonally: dark upper-left, light lower-right
170
+ - Accent-colored edge line traces the diagonal cut
171
+ - Title on dark area, metadata on light area
172
+ - Fonts: Montserrat / Montserrat
173
+
174
+ **8. `frame`** — used for: `frame`
175
+ - White/cream background with an inset rectangular border (1.2px, 28px from edges)
176
+ - Accent strips inside top + bottom of frame; small accent corner squares
177
+ - Title centered in the frame space, centered alignment, classical weight
178
+ - Formal, timeless — annual reports, legal documents, academic papers
179
+ - Fonts: Cormorant / Crimson Pro
180
+
181
+ **9. `editorial`** — used for: `editorial`
182
+ - Ghost first-letter of title fills upper-right at 5% opacity — visual texture
183
+ - 5px accent top bar; full-width uppercase title in condensed weight
184
+ - Title all-caps, very large (80px), flush-left
185
+ - Footer rule + author/date metadata
186
+ - Fonts: Bebas Neue / Libre Franklin
187
+
188
+ **10. `magazine`** — used for: `magazine`
189
+ - Warm cream/linen background; fully centered, vertical stack layout
190
+ - Org/company name in small spaced caps + 2px accent rule beneath (top anchor)
191
+ - Large bold serif title (52px) centered; short accent rule under title
192
+ - Italic subtitle; optional `cover_image` URL renders as centered hero thumbnail
193
+ - Optional `abstract` field: justified text block with bold "Abstract:" label
194
+ - Author name in accent color (large, bold); date beneath
195
+ - Fonts: Playfair Display / EB Garamond
196
+
197
+ **11. `darkroom`** — used for: `darkroom`
198
+ - Same centered stack layout as `magazine` but deep navy background, white text
199
+ - Org name + rules in semi-transparent white; accent rules desaturated
200
+ - Hero image (if provided) gets `grayscale(20%) brightness(0.9)` filter
201
+ - Fonts: Playfair Display / EB Garamond
202
+
203
+ **12. `terminal`** — used for: `terminal`
204
+ - Near-black background; neon green accent; Space Mono monospace throughout
205
+ - Grid overlay: faint horizontal + vertical lines at 48px intervals (7% opacity)
206
+ - Status label top-left: green dot + `SYSTEM_REPORT // <date>`
207
+ - Title inside a bracket frame (border-left + border-top + pseudo-element corner)
208
+ - Subtitle prefixed with `>` in accent color
209
+ - Abstract text left; author block right; status bar at bottom (UTF-8 / Ln 1)
210
+ - Fonts: Space Mono / Space Mono
211
+
212
+ **13. `poster`** — used for: `poster`
213
+ - White background; thick 52px left sidebar in accent (typically near-black)
214
+ - Title: 96px, 900-weight, all-caps, condensed — the dominant visual element
215
+ - Subtitle in typewriter font below title; thin 2px rule as separator
216
+ - Author + meta in Courier Prime monospace beneath rule
217
+ - Optional `cover_image` rendered as 260×340 grayscale thumbnail, right-aligned
218
+ - Accent square icon block (lower-right) with white horizontal lines
219
+ - Fonts: Barlow Condensed / Courier Prime
220
+
221
+ ### Optional token: `cover_image`
222
+
223
+ Patterns `magazine`, `darkroom`, and `poster` accept an optional `cover_image`
224
+ token containing an absolute URL or `file://` path to an image.
225
+ The image renders via `<img src="...">` — Playwright fetches it at render time.
226
+ If omitted, the image area is simply skipped (layout adjusts gracefully).
227
+
228
+ ### Cover CSS requirements (critical for Playwright rendering)
229
+
230
+ These three rules must appear in every cover HTML file or the output will have
231
+ white borders / incorrect dimensions:
232
+
233
+ ```css
234
+ body { margin: 0; padding: 0; }
235
+ html, body { width: 794px; height: 1123px; overflow: hidden; }
236
+ ```
237
+
238
+ No `@page` rules needed — Playwright handles page size via the `pdf()` call.
239
+ Do NOT use CSS `background-image` for textures — use inline SVG or `<canvas>`.
240
+ Always use `position: absolute` + `z-index` for layered elements.
241
+
242
+ ### What always kills a cover
243
+
244
+ - Centered title on white background with a thin horizontal line underneath
245
+ - Gradient from one color to another (reads as PowerPoint, not print design)
246
+ - Drop shadows on text
247
+ - More than one accent color
248
+ - Emoji or icon fonts (fail silently on headless Chromium)
249
+
250
+ ---
251
+
252
+ ## Inner page rules
253
+
254
+ ### What "restraint" means in practice
255
+
256
+ Every design decision should remove something, not add something.
257
+ The page is done when there is nothing left to remove.
258
+
259
+ - Accent color appears on section rules only — not on headings, not on bullets
260
+ - No card components (bordered boxes with colored headers)
261
+ - No rounded corners on anything except callout boxes (4px max)
262
+ - No shadows anywhere
263
+ - Tables: header row in accent, alternating row tint, no grid lines except outer box
264
+ - Callout boxes: left border in accent (4px), very light tint background, no icon
265
+
266
+ ### Page header / footer
267
+
268
+ Header: document title (left, 7.5pt, muted) + accent rule (1.5pt, full width below)
269
+ Footer: author name (left, 7.5pt, muted) + page number (right, 7.5pt, muted) + light rule above
270
+
271
+ ---
272
+
273
+ ## Quality bar
274
+
275
+ A PDF passes if a designer would not be embarrassed to hand it to a client.
276
+ Concretely:
277
+
278
+ - Cover has a clear visual identity that is not "generic AI output"
279
+ - Body text is readable at arm's length without squinting
280
+ - Every page looks like it belongs to the same document
281
+ - No element bleeds off the edge or overlaps another
282
+ - Page numbers are present and correct
283
+ - The accent color appears fewer than 8 times per page on average
284
+
285
+ ---
286
+
287
+ ## Block type reference
288
+
289
+ All body blocks use the same token system — colors and fonts come from `tokens.json`, never hardcoded.
290
+
291
+ | Block | Rendering | Design notes |
292
+ |---|---|---|
293
+ | `h1` | 22pt heading + full-width accent rule below | KeepTogether with rule — heading never orphaned |
294
+ | `h2` | 15pt heading, dark text | No rule, no accent — visual hierarchy through size only |
295
+ | `h3` | 11.5pt bold, dark text | **No accent color** — accent on body headings violates the one-accent-location rule |
296
+ | `body` | 10.5pt justified, 17pt leading | Supports `<b>` `<i>` `<font>` markup |
297
+ | `bullet` | Body size with `•` prefix, 14pt indent | Use for unordered lists |
298
+ | `numbered` | Body size with `N.` prefix, hanging indent | Counter auto-resets on any non-numbered block — no manual numbering needed |
299
+ | `callout` | Accent left-border (4px) + light tint background | Max one callout per section — overuse kills impact |
300
+ | `table` | Accent header row, alternating row tint, outer box only | Supports `col_widths` (fractions, e.g. `[0.3, 0.5, 0.2]`) for custom column widths |
301
+ | `image` | Scaled to column width, preserving aspect ratio | Use `path` or `src`; always provide a `caption` |
302
+ | `figure` | Same as image, but caption auto-prefixed "Figure N:" | Figure counter increments across all `figure`, `chart`, `flowchart` blocks |
303
+ | `code` | Courier 8.5pt, accent left-border, light tint background | Supports optional `language` label (rendered above block) |
304
+ | `math` | Formula centered, optional right-aligned equation label | LaTeX syntax; matplotlib mathtext renderer |
305
+ | `chart` | Bar / line / pie chart rendered via matplotlib | Color palette derived from document accent; figure auto-numbered |
306
+ | `flowchart` | Process diagram with labeled arrows | Supports 4 node shapes; back-edges drawn as curved arcs |
307
+ | `bibliography` | Numbered reference list with hanging indent | Heading rendered as h2 + accent rule; items as `[N] text` |
308
+ | `divider` | Accent-colored 1.2pt rule with padding | Use sparingly — only for major thematic breaks |
309
+ | `caption` | 8.5pt muted text, centered | Appears below images/tables via field or explicit block |
310
+ | `pagebreak` | Force page break | — |
311
+ | `spacer` | Vertical whitespace | `pt` field (default 12) |
312
+
313
+ ### Math formula guidance
314
+
315
+ **Input syntax:** standard LaTeX math notation — `\frac{}{}`, `\int`, `\sum`, `\alpha`, `^`, `_`, etc.
316
+ **Rendering engine:** matplotlib mathtext — pure Python, no LaTeX compiler, no browser required.
317
+
318
+ | Syntax example | Rendered as |
319
+ |---|---|
320
+ | `E = mc^2` | Inline expression |
321
+ | `\frac{\sqrt{\pi}}{2}` | Fraction |
322
+ | `\int_0^\infty e^{-x^2} dx` | Integral |
323
+ | `\sum_{i=1}^{n} x_i` | Summation |
324
+ | `\alpha + \beta = \gamma` | Greek letters |
325
+
326
+ **Limitations:** matplotlib mathtext covers most common expressions but not advanced LaTeX environments (`align`, `cases`, `matrix`). Split complex multi-line proofs into multiple `math` blocks.
327
+
328
+ **Fallback:** if matplotlib is not installed, renders as `expression` in code style. Run `make.sh fix` to install.
329
+
330
+ **Equation labels:** `"label": "(1)"` — rendered right-aligned beside the formula.
331
+
332
+ ### Chart guidance
333
+
334
+ **Rendered entirely in Python** — no external chart services, image files, or internet required.
335
+
336
+ | chart_type | Use case | Required fields |
337
+ |---|---|---|
338
+ | `bar` | Comparing discrete categories | `labels`, `datasets` |
339
+ | `line` | Trends over time or ordered categories | `labels`, `datasets` |
340
+ | `pie` | Part-to-whole composition | `labels`, `datasets[0].values` |
341
+
342
+ - Colors are derived from the document accent for visual consistency — do not set custom colors.
343
+ - Multi-series: add multiple objects to `datasets`, each with a `label` and `values` array.
344
+ - Figure auto-numbering: set `"figure": true` (default) or `"figure": false` to suppress.
345
+
346
+ ### Flowchart guidance
347
+
348
+ **Node shapes:**
349
+
350
+ | shape | Use for |
351
+ |---|---|
352
+ | `rect` (default) | Process step |
353
+ | `diamond` | Decision / condition |
354
+ | `oval` or `terminal` | Start / End |
355
+ | `parallelogram` | Input / Output |
356
+
357
+ - Nodes are placed in input order (top to bottom). This controls the layout.
358
+ - Forward edges draw straight arrows; back-edges (to earlier nodes) draw curved arcs.
359
+ - Keep labels short (3–5 words max) — the diagram is A4-column-width at 78% scale.
360
+ - Figure auto-numbering applies same as chart.
361
+
362
+ ### Bibliography guidance
363
+
364
+ - `id` field is the reference label — use numbers ("1", "2") or alphanumeric ("Smith23").
365
+ - Text should be in a consistent citation style (APA, Chicago, etc.) — the renderer does not enforce style.
366
+ - The `title` field defaults to "References". Set `"title": ""` to suppress the heading.
367
+ - A `bibliography` block always starts with a new section heading + accent rule.
368
+
369
+ ### Image / figure guidance
370
+
371
+ - Preferred formats: PNG, JPEG
372
+ - Scaled down if wider than the text column; never scaled up
373
+ - `figure` blocks auto-number; `image` blocks do not — use `figure` for numbered figures
374
+ - If the file does not exist at render time, a `[Image not found]` placeholder is substituted
375
+
376
+ ### Code block guidance
377
+
378
+ - Preserves whitespace exactly — do not indent code in the JSON value
379
+ - Optional `language` field renders a small language label above the block (e.g., `"language": "python"`)
380
+ - No syntax highlighting (by design) — consistent with restraint principle
381
+ - Keep lines under ~90 characters for A4 column width