@taloswork/ose-shared 0.1.10 → 0.1.12

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 (126) hide show
  1. package/package.json +3 -3
  2. package/skills/document/SKILL.md +143 -215
  3. package/skills/document/art-directions/base.css +27 -2
  4. package/skills/document/art-directions/cinematic-depth.css +3 -1
  5. package/skills/document/art-directions/collage-paper.css +5 -1
  6. package/skills/document/art-directions/editorial-cut.css +5 -1
  7. package/skills/document/art-directions/geometric-pop.css +6 -0
  8. package/skills/document/art-directions/gradient-mesh.css +5 -1
  9. package/skills/document/art-directions/illustrated-doodle.css +5 -0
  10. package/skills/document/art-directions/luxury-ornament.css +4 -1
  11. package/skills/document/art-directions/maximalist-blocks.css +6 -0
  12. package/skills/document/art-directions/technical-grid.css +4 -0
  13. package/skills/document/assets/fonts/fonts.json +2 -2
  14. package/skills/document/assets/pdf-fonts/NotoSansSC-PDF-Bold.ttf +0 -0
  15. package/skills/document/assets/pdf-fonts/NotoSansSC-PDF-Regular.ttf +0 -0
  16. package/skills/document/assets/pdf-fonts/OFL.txt +93 -0
  17. package/skills/document/assets/pdf-fonts/README.md +35 -0
  18. package/skills/document/assets/tessdata/LICENSE-Apache-2.0.txt +202 -0
  19. package/skills/document/assets/tessdata/README.md +21 -0
  20. package/skills/document/assets/tessdata/chi_sim.traineddata.gz +0 -0
  21. package/skills/document/assets/tessdata/eng.traineddata.gz +0 -0
  22. package/skills/document/bin/deck-build.cjs +2311 -41
  23. package/skills/document/bin/deck-chart.cjs +762 -0
  24. package/skills/document/bin/deck-plan.cjs +802 -0
  25. package/skills/document/bin/deck-qa.cjs +984 -249
  26. package/skills/document/bin/deck-scenario.cjs +1346 -0
  27. package/skills/document/bin/doc-convert.cjs +130 -39
  28. package/skills/document/bin/doc-fill.cjs +73121 -170
  29. package/skills/document/bin/doc-gen.cjs +625 -68
  30. package/skills/document/bin/doc-run.cjs +162 -24
  31. package/skills/document/bin/doc-scan.cjs +13 -0
  32. package/skills/document/bin/doc-text.cjs +13 -0
  33. package/skills/document/bin/doc-validate.cjs +718 -23
  34. package/skills/document/bin/doc-xml.cjs +9 -5
  35. package/skills/document/bin/docx-annotate.cjs +95 -19
  36. package/skills/document/bin/fontkit.cjs +1 -0
  37. package/skills/document/bin/html2pptx.cjs +1372 -121
  38. package/skills/document/bin/ocr-worker.cjs +1 -0
  39. package/skills/document/bin/ocr.cjs +131 -40
  40. package/skills/document/bin/pdf-form.cjs +674 -177
  41. package/skills/document/bin/pdf-images.cjs +13 -0
  42. package/skills/document/bin/pdf-ops.cjs +634 -199
  43. package/skills/document/bin/pdf-render.cjs +19 -3
  44. package/skills/document/bin/pdf-tables.cjs +13 -0
  45. package/skills/document/bin/pptx-clone.cjs +3 -3
  46. package/skills/document/bin/pptx-slide.cjs +3 -3
  47. package/skills/document/bin/xlsx-query.cjs +192 -61
  48. package/skills/document/bin-reference.md +56 -33
  49. package/skills/document/content-pipeline.md +129 -242
  50. package/skills/document/deck-design.md +355 -638
  51. package/skills/document/layouts/README.md +46 -33
  52. package/skills/document/layouts/capacity.json +1 -0
  53. package/skills/document/layouts/slots.json +1 -1
  54. package/skills/document/layouts/toc-panel.tpl +1 -1
  55. package/skills/document/motion/README.md +3 -2
  56. package/skills/document/office.md +3 -3
  57. package/skills/document/packs/board-brief/backdrop.html +2 -0
  58. package/skills/document/packs/board-brief/pack.css +2 -1
  59. package/skills/document/packs/mckinsey-photo/backdrop.html +2 -0
  60. package/skills/document/packs/mckinsey-photo/pack.css +2 -1
  61. package/skills/document/packs/press-room/backdrop.html +2 -0
  62. package/skills/document/packs/press-room/pack.css +2 -1
  63. package/skills/document/packs/prismatic-3d/backdrop.html +2 -0
  64. package/skills/document/packs/prismatic-3d/pack.css +4 -1
  65. package/skills/document/pdf.md +53 -49
  66. package/skills/document/rewrite.md +241 -308
  67. package/skills/document/scenarios.json +1290 -0
  68. package/skills/document/scenarios.schema.json +103 -0
  69. package/skills/document/styles/README.md +15 -25
  70. package/skills/document/styles/_contract-defaults.css +25 -1
  71. package/skills/document/styles/anthropic/skin.css +6 -3
  72. package/skills/document/styles/apple/skin.css +4 -3
  73. package/skills/document/styles/bistro-warm/backdrop.html +2 -0
  74. package/skills/document/styles/bistro-warm/skin.css +4 -1
  75. package/skills/document/styles/black-gold/skin.css +6 -5
  76. package/skills/document/styles/bold-clash/backdrop.html +2 -0
  77. package/skills/document/styles/bold-clash/skin.css +2 -1
  78. package/skills/document/styles/branding/skin.css +4 -4
  79. package/skills/document/styles/campus-teal/backdrop.html +2 -0
  80. package/skills/document/styles/campus-teal/skin.css +2 -1
  81. package/skills/document/styles/cinereel/skin.css +7 -3
  82. package/skills/document/styles/clinic-care/backdrop.html +2 -0
  83. package/skills/document/styles/clinic-care/skin.css +2 -1
  84. package/skills/document/styles/cool/skin.css +6 -5
  85. package/skills/document/styles/dark-glass/backdrop.html +2 -0
  86. package/skills/document/styles/dark-glass/skin.css +2 -1
  87. package/skills/document/styles/gov-brief/backdrop.html +2 -0
  88. package/skills/document/styles/gov-brief/skin.css +2 -1
  89. package/skills/document/styles/grid-tech/backdrop.html +2 -0
  90. package/skills/document/styles/grid-tech/skin.css +2 -1
  91. package/skills/document/styles/hand-drawn/skin.css +3 -3
  92. package/skills/document/styles/ivory-gold/skin.css +7 -6
  93. package/skills/document/styles/legal-slate/backdrop.html +2 -0
  94. package/skills/document/styles/legal-slate/skin.css +2 -1
  95. package/skills/document/styles/magazine-ink/skin.css +4 -3
  96. package/skills/document/styles/mckinsey/skin.css +2 -1
  97. package/skills/document/styles/memphis/backdrop.html +2 -0
  98. package/skills/document/styles/memphis/skin.css +2 -1
  99. package/skills/document/styles/mono/skin.css +6 -2
  100. package/skills/document/styles/neon-cyber/backdrop.html +2 -0
  101. package/skills/document/styles/neon-cyber/skin.css +2 -1
  102. package/skills/document/styles/olive-gold/skin.css +7 -6
  103. package/skills/document/styles/organic-earth/backdrop.html +2 -0
  104. package/skills/document/styles/organic-earth/skin.css +2 -1
  105. package/skills/document/styles/pastel-saas/backdrop.html +2 -0
  106. package/skills/document/styles/pastel-saas/skin.css +2 -1
  107. package/skills/document/styles/portfolio-noir/backdrop.html +2 -0
  108. package/skills/document/styles/portfolio-noir/skin.css +2 -1
  109. package/skills/document/styles/retro-press/backdrop.html +2 -0
  110. package/skills/document/styles/retro-press/skin.css +2 -1
  111. package/skills/document/styles/sport-arena/backdrop.html +2 -0
  112. package/skills/document/styles/sport-arena/skin.css +4 -1
  113. package/skills/document/styles/swiss-grid/skin.css +10 -5
  114. package/skills/document/styles/wedding-blush/backdrop.html +2 -0
  115. package/skills/document/styles/wedding-blush/skin.css +4 -1
  116. package/skills/document/theme-system.md +85 -77
  117. package/skills/document/themes/README.md +7 -5
  118. package/skills/document/vision.md +8 -5
  119. package/skills/document/xlsx.md +15 -25
  120. package/skills/cozy-static-svg/SKILL.md +0 -76
  121. package/skills/cozy-static-svg/references/approved-preview.png +0 -0
  122. package/skills/cozy-static-svg/references/cross-platform.md +0 -73
  123. package/skills/cozy-static-svg/references/moon_keeps_watch.svg +0 -229
  124. package/skills/cozy-static-svg/references/style-anchor.md +0 -271
  125. package/skills/cozy-static-svg/scripts/artkit.py +0 -321
  126. package/skills/cozy-static-svg/scripts/to_png.py +0 -333
@@ -1,102 +1,110 @@
1
1
  # Theme V2 — composable deck design system
2
2
 
3
- Theme V2 separates five decisions that the old pack model coupled together:
3
+ This file is the single source for **which entries take Theme V2, what it adds, and
4
+ the spec fields that control it**. Theme V2 separates five decisions:
4
5
 
5
6
  1. **Theme** (`style`) — palette, typography, background and family identity.
6
- 2. **Component profile** — cards, metrics, pricing, quotes, tables, badges and data UI.
7
- 3. **Media style** — product/device, editorial photo, collage, illustration or cinematic treatment.
8
- 4. **Art direction** — large color fields, pattern language, decorative geometry and page atmosphere.
9
- 5. **Layout + recipe** — content geometry per slide and narrative order per deck.
10
-
11
- `theme-system.json` binds every existing catalog id to one component profile, one
12
- default media style and one art direction. A deck can override only the media treatment;
13
- art direction remains part of the Theme identity and layout selection stays separate.
14
-
15
- Component profiles: `clean`, `glass`, `editorial`, `poster`, `organic`, `luxury`.
16
- They alter radius, border weight, depth, surface behavior, label typography and emphasis
17
- patterns across the full semantic component contract (cards, KPI, proof, pricing, quote,
18
- table, chart, workflow, funding and CTA).
19
-
20
- Media styles: `clean-product`, `device-stage`, `editorial-photo`, `cutout-collage`,
21
- `illustrated`, `cinematic`, `spatial-3d`. They can be changed independently for a deck or
22
- a bespoke page while the Theme's color, type, background and component grammar remain.
23
-
24
- Art directions: `geometric-pop`, `gradient-mesh`, `editorial-cut`, `collage-paper`,
25
- `illustrated-doodle`, `cinematic-depth`, `luxury-ornament`, `technical-grid`,
26
- `maximalist-blocks`. The renderer injects a decoration-only backdrop canvas for these
27
- profiles. Each uses the selected family's full `--c1`…`--c4` ramp rather than only its
28
- accent, so Theme differences include composition and motif—not merely hue.
7
+ 2. **Component profile** — `clean` · `glass` · `editorial` · `poster` · `organic` ·
8
+ `luxury`: radius, border weight, depth, surfaces, labels and emphasis across the
9
+ semantic components (cards, KPI, proof, pricing, quote, table, chart, workflow,
10
+ funding, CTA).
11
+ 3. **Media style** — `clean-product` · `device-stage` · `editorial-photo` ·
12
+ `cutout-collage` · `illustrated` · `cinematic` · `spatial-3d`. The only layer a deck
13
+ may override (`mediaStyle` / `--media-style`); colour, type, background and component
14
+ grammar stay the Theme's.
15
+ 4. **Art direction** — `geometric-pop` · `gradient-mesh` · `editorial-cut` ·
16
+ `collage-paper` · `illustrated-doodle` · `cinematic-depth` · `luxury-ornament` ·
17
+ `technical-grid` · `maximalist-blocks`: a decoration-only backdrop canvas that uses
18
+ the family's whole `--c1`…`--c4` ramp. Part of the Theme identity — not overridable.
19
+ 5. **Layout + recipe** — content geometry per slide (layouts/README.md) and narrative
20
+ order per deck (`recipes/`). Never chosen by the Theme.
21
+
22
+ `theme-system.json` binds every catalog id to one component profile, one default media
23
+ style and one art direction.
24
+
25
+ ## Which entries take it — classic-v1 vs V2
26
+
27
+ - Entries in a `catalog.json` collection with `renderMode:"classic-v1"` (today
28
+ `original-13`, frozen at commit `7306d8e5`; its `entryIds` are the list) render V1: omit `themeVersion`, `mediaStyle`, `decorRhythm`, per-slide
29
+ `scene`/`decorDensity` and every layout in `layouts/profiles.json.themeV2Layouts`;
30
+ render with `--style <id>` and never `--theme-v2`. `deck-build` (exit 64) and
31
+ `html2pptx` reject the attempt. They keep current bug/font/contrast fixes; samples and
32
+ fidelity baselines are V1.
33
+ - Every other newly authored deck sets `"themeVersion":2` and renders with
34
+ `--style <id> --theme-v2 [--media-style <id>]`. `--theme-v2` needs a catalog id
35
+ (not an explicit style directory or a user style); `--media-style` needs `--theme-v2`.
36
+ - The ten `themeV2Layouts` use the semantic component contract and require
37
+ `themeVersion:2`; every older layout works in both. `themeVersion:2` never changes
38
+ which layout a slide uses.
39
+ - Under `--theme-v2` html2pptx does not auto-pick a shared backdrop variant (the art
40
+ direction owns the backdrop); an explicit `--backdrop` still wins.
29
41
 
30
42
  ## Page scenes and deck rhythm
31
43
 
32
- `deck-build` maps each slide intent to one visual scene: `hero`, `content`, `data`,
33
- `media` or `closing`. The scene controls which art-direction motifs remain visible;
34
- `decorDensity` (`low`, `medium`, `high`) controls their combined intensity. With the
35
- default `decorRhythm:"auto"`, adjacent high-intensity pages are softened, long medium
36
- runs receive a low beat, and repeated scenes cycle deterministic motif variants.
37
-
38
- Authors normally provide only `intent`. Use a per-slide `scene` or `decorDensity` only
39
- for a deliberate override. Set top-level `decorRhythm:"steady"` to keep the intent
40
- profile's density unchanged. These fields require `themeVersion:2` and never select or
41
- rewrite a layout.
44
+ `deck-build` maps each slide's `intent` to one scene — `hero`, `content`, `data`,
45
+ `media` or `closing` — which decides the art-direction motifs shown; `decorDensity`
46
+ (`low`/`medium`/`high`) sets their intensity. With the default `decorRhythm:"auto"`,
47
+ adjacent high-intensity pages are softened, long medium runs get a low beat and
48
+ repeated scenes cycle motif variants. Normally give only `intent`; a per-slide `scene`
49
+ or `decorDensity` is a deliberate override, and top-level `decorRhythm:"steady"` keeps
50
+ each intent's density. These fields require `themeVersion:2` and never pick a layout.
42
51
 
43
52
  ```json
44
53
  {
45
- "style": "cool",
54
+ "style": "neon-cyber",
46
55
  "scenario": "发布会",
47
56
  "themeVersion": 2,
48
- "decorRhythm": "auto",
49
57
  "mediaStyle": "device-stage",
50
58
  "layoutPack": "none",
51
59
  "slides": [
52
- {"intent":"problem", "layout":"pitch-problem", "slots":{}},
53
- {"intent":"product-demo", "layout":"product-device", "slots":{}}
60
+ {"intent": "problem", "layout": "pitch-problem", "slots": {
61
+ "eyebrow": "THE PROBLEM", "title": "对账每月吃掉财务团队一周", "stat": "38h", "stat_label": "每月人工对账", "stat_note": "50 家受访客户中位数",
62
+ "point1_title": "数据分散", "point1_body": "银行、ERP、表格三处来源",
63
+ "point2_title": "规则靠人记", "point2_body": "例外处理无沉淀",
64
+ "point3_title": "出错难追溯", "point3_body": "审计时逐笔翻查",
65
+ "footer": "", "pageno": ""}},
66
+ {"intent": "product-demo", "layout": "product-device", "slots": {
67
+ "eyebrow": "PRODUCT", "title": "一键完成三方对账", "body": "接入银行流水与 ERP,规则自动匹配,例外进入待办",
68
+ "feature1": "自动匹配 95% 流水", "feature2": "例外一键分派", "feature3": "全程留痕可审计",
69
+ "media_label": "", "screen_title": "对账工作台", "screen_note": "",
70
+ "footer": "", "pageno": ""}}
54
71
  ]
55
72
  }
56
73
  ```
57
74
 
58
- `deck-build` emits the matching render command:
75
+ Every slot is filled (`""` blanks one on purpose): an omitted slot renders the layout's
76
+ demo copy and `deck-build` warns. The build result's `next` is the matching render
77
+ command:
59
78
 
60
79
  ```sh
61
- html2pptx deck.html out.pptx --style cool --theme-v2 --media-style device-stage
80
+ html2pptx deck.html out.pptx --style neon-cyber --theme-v2 --media-style device-stage
62
81
  ```
63
82
 
83
+ ## Layout selection and packs
84
+
85
+ Match content to layouts through `layouts/profiles.json` (intent → candidates, density,
86
+ item cap, media requirement) — `deck-plan` does it for you. `deck-build` warns when an
87
+ explicit layout is outside the intent's candidates and errors on an unknown intent.
88
+
89
+ `layoutPack` is independent of the Theme. `kind:"pack"` entries (`packs/README.md`)
90
+ ship same-name signature layouts: a spec that omits `layoutPack` keeps the legacy
91
+ behaviour (a pack style implicitly uses them); new specs state `layoutPack:"<pack>"`
92
+ or `"none"` (shared layouts only).
93
+
94
+ `recipes/` hold pitch narratives as roles, not fixed pages, so one story renders in
95
+ any Theme.
96
+
64
97
  ## Compatibility
65
98
 
66
- - Existing `{style:"cool"}` specs and `html2pptx --style cool` calls remain V1 and
67
- render exactly as before.
68
- - `catalog.json` collection `original-13` freezes the initial roster at commit
69
- `7306d8e5` with `renderMode:"classic-v1"`. Those entries keep current bug/font/contrast
70
- fixes but reject `themeVersion:2`, `--theme-v2`, media overrides, scene controls and
71
- Theme V2-only layouts. Their samples and fidelity cover baselines are rendered in V1.
72
- - `themeVersion:2` adds component, media and art-direction layers; it does not change
73
- the selected layout.
74
- - Existing `{style:"press-room"}` keeps the legacy implicit same-name layout pack.
75
- New specs should state `layoutPack:"press-room"` or `layoutPack:"none"` explicitly.
76
- - `--theme <theme.json>` is a different legacy document recolor path and is not Theme V2.
77
-
78
- ## Content-first layout selection
79
-
80
- Use `layouts/profiles.json`. Match `intent`, then check density, item capacity and media
81
- requirement before selecting a candidate. `deck-build` warns when a slide's explicit
82
- layout is outside the candidate list and errors on unknown intents. It never forces a
83
- layout merely because a visual Theme was selected.
84
-
85
- The ten layouts listed in `themeV2Layouts` use the new semantic component contract and
86
- therefore require `themeVersion:2`; `deck-build` rejects a V1 attempt before writing HTML.
87
- All pre-existing layouts remain valid in both V1 and V2.
88
-
89
- Pitch recipes live in `recipes/`. They describe narrative roles, not fixed visual pages,
90
- so the same fundraising story can render in a clean consulting Theme, neon product Theme
91
- or editorial Theme without changing its content contract.
92
-
93
- ## Coverage and provenance
94
-
95
- The 18 pitch intents cover problem, solution, product, market, competition, business
96
- model, pricing, traction, go-to-market, economics, financials, proof, team, ask and close.
97
- The visual archetypes are clean-room abstractions informed by broad category patterns,
98
- including the SlidesCarnival pitch-deck index: geometric color fields, gradient/3D depth,
99
- editorial cropping, paper collage, illustration/doodles, ornament, grids and maximalist
100
- blocks. Do not copy third-party template assets or page geometry. SlidesCarnival templates
101
- are CC BY 4.0 and embedded photos may carry separate licenses; importing an actual template
102
- requires preserving attribution and asset credits.
99
+ - `{style:"<id>"}` without `themeVersion`, and `html2pptx --style <id>` without
100
+ `--theme-v2`, stay V1 and render exactly as before.
101
+ - `--theme <theme.json>` is the legacy document-recolor path, not Theme V2, and it does
102
+ not repaint a `--style` deck (the skin's tokens win).
103
+
104
+ ## Provenance
105
+
106
+ The 18 pitch intents (problem … ask, close) and the visual archetypes are clean-room
107
+ abstractions of broad category patterns (incl. the SlidesCarnival index). Do not copy
108
+ third-party template assets or page geometry; SlidesCarnival templates are CC BY 4.0
109
+ and their photos may carry separate licenses — importing one requires keeping
110
+ attribution and asset credits.
@@ -9,14 +9,14 @@
9
9
 
10
10
  | 主题 | 配对家族 | 基调 | 适用场景 |
11
11
  |---|---|---|---|
12
- | **cool-tech**(默认) | `cool` | 深海军蓝 + 蓝青辉光(深色 deck) | 科技/发布/pitch/keynote —— 默认酷炫 |
12
+ | **cool-tech** | `cool` | 深海军蓝 + 蓝青辉光(深色 deck) | 科技/发布/pitch/keynote |
13
13
  | **apple-keynote** | `apple` | 纯黑 + 单色近白(深色 deck) | 产品发布、keynote、极简演示:超大字、大留白、无彩色 |
14
14
  | **mckinsey-consulting** | `mckinsey` | 白底 + 深藏青 + 克制亮蓝 | 咨询/战略汇报、评审、董事会;**报告/docx 默认** |
15
15
  | **anthropic-clay** | `anthropic` | 奶油底 + 赤陶珊瑚(暖) | AI/产品、温暖人文品牌、研究分享:衬线标题、有深度 |
16
16
  | **black-gold** | `black-gold` | 纯黑 + 金辉光 + 衬线金字 | 金融/年报/路演/奢侈品/高端商务 |
17
17
  | **hand-drawn** | `hand-drawn` | 纸感 + 手绘描边 + 马克笔色 | 创意/头脑风暴/教学/工作坊 |
18
18
  | **mono** | `mono` | 纯白 + 黑灰 + 细线 + 大留白 | 极简/高端/设计;**clean/light 默认** |
19
- | **warm-editorial** | `warm` | 奶油 + 陶土橙 + 衬线 | 品牌/咨询/报告暖调 |
19
+ | **warm-editorial** | —(无同名 deck 风格) | 奶油 + 陶土橙 + 衬线 | 品牌/咨询/报告暖调 |
20
20
  | **ivory-gold** | `ivory-gold` | 奶油底 + 青铜金 Anton 粗体大写标题 + 黑色反色区块 | 奢华极简/品牌手册/路演/高端零售 |
21
21
  | **cinereel** | `cinereel` | 黑底/照片底 + 白色 Anton 粗体大写(无色相)+ 常驻胶片取景框 | 影视/创意作品集/音乐传媒行业/幕后花絮 |
22
22
  | **magazine-ink** | `magazine-ink` | 瓷白底 + 靛蓝 Noto Serif SC 衬线大标题 + 无阴影无卡片盒 | 人文分享/行业观察/商业发布/杂志感演讲 |
@@ -26,9 +26,11 @@
26
26
  白纸 + 品牌色标题。具名"风格"主题只设 `fonts.heading`(Latin 标题生效、CJK 自动回退,
27
27
  正文留空走引擎栈保 CJK)。
28
28
 
29
- **用户自建主题放 `themes/custom/`**(资源更新永不触碰;选型时优先查它),文件名
30
- kebab-case、带 `bestFor`。确认过的偏好写入 agent memory,下次直接用(见 rewrite.md
31
- "Picking a theme")。
29
+ **用户自建主题保存到 `$TALOS_DOC_STYLES_DIR/themes/<名>.json`**(kebab-case、带
30
+ `bestFor`),之后用 `--theme <名>` 按名字套用。这是用户自己的风格目录,跨会话保留、所有
31
+ 专家共用;**不要写进 skill 目录**——它是带完整性校验的安装包,内容一变就会被隔离重装,
32
+ 写进去的文件随之丢失。确认过的偏好写入 agent memory,下次直接用(见 rewrite.md
33
+ "Themes" 的 Choosing with the user)。
32
34
 
33
35
  > 更多纯配色变体(arctic-frost / ocean-depths / golden-hour / chinese-ink 等 17 套)已
34
36
  > **退役到 `apps/admin/data/deck-template-backup/retired-themes/`** —— 它们只是同布局换色,
@@ -6,8 +6,9 @@ loses.
6
6
 
7
7
  ## Steps
8
8
 
9
- 1. `bin/pdf-render file.pdf <pages>` — `<pages>` is a single page (`4`) or a
10
- range (`2-6`). It writes PNGs and prints their paths.
9
+ 1. `bin/pdf-render.cjs file.pdf <pages> [scale]` — `<pages>` is `4`, `2-6`, `3,7-8`
10
+ or `all`; PNGs land beside the PDF (`<stem>_p<N>.png`) and their paths are printed.
11
+ Keep the default scale `2` for formulas and fine print; `1` is enough for layout.
11
12
  2. Look at each PNG. For:
12
13
  - **Formulas** → transcribe to LaTeX from the image.
13
14
  - **Tables** → read the table structure directly; report values row/column.
@@ -25,9 +26,11 @@ render that page here and read it visually instead.
25
26
  When the model has **no** image modality but the page is scanned, OCR the raster
26
27
  instead of guessing:
27
28
 
28
- 1. `bin/pdf-render file.pdf <page>` → PNG.
29
- 2. `bin/ocr <page.png> [lang]` → `{ text, confidence }`. Report low confidence
30
- honestly. Set `$TALOS_TESSDATA` to a dir to cache/serve language data offline.
29
+ 1. `bin/pdf-render.cjs file.pdf <page>` → PNG.
30
+ 2. `bin/ocr.cjs <page.png> [lang]` → `{ text, confidence }` (`lang` default `eng`).
31
+ Report low confidence honestly. Chinese: `chi_sim` (or `chi_sim+eng` for mixed
32
+ text; `chi_tra` traditional). `eng` and `chi_sim` are bundled and work offline;
33
+ other languages download once into `$TALOS_TESSDATA`.
31
34
 
32
35
  Prefer vision when it is available — OCR loses layout and struggles with
33
36
  formulas. Use OCR only as the text-only fallback.
@@ -7,7 +7,7 @@ files.
7
7
  ## Steps
8
8
 
9
9
  1. `bin/xlsx-query file.xlsx --summary` → per-sheet shape (name, row/col counts,
10
- headers). Decide which sheet + column the question is about.
10
+ `headerRow`, headers). Decide which sheet + column the question is about.
11
11
  2. Aggregate: `bin/xlsx-query file.xlsx --agg <sheet> <column> <op>` where `op` ∈
12
12
  `sum | avg | min | max | count | count-nonempty`. `<column>` may be a header
13
13
  label or a 1-based index.
@@ -16,31 +16,21 @@ files.
16
16
 
17
17
  ## Notes / boundaries
18
18
 
19
- - Non-numeric cells are ignored by `sum/avg/min/max`; `value:null` means no
20
- numeric cells qualified — report that rather than guessing 0.
19
+ - The header row is detected: the first mostly-text row (of the first ~10) whose next
20
+ row has numbers, so a title row above the table is skipped — check `headerRow`;
21
+ `--header-row N` (1-based sheet row) overrides it.
22
+ - `--agg` leaves total rows out — a cell reading 合计 / 总计 / 小计 / Total / Subtotal /
23
+ Sum, or a `SUM` over the same column — and lists them in `excludedRows`;
24
+ `--include-totals` keeps them.
25
+ - Numbers: numeric cells use their stored value (a cell shown as `15%` is 0.15). In
26
+ text cells `¥ ¥ $ € £`, commas, spaces and a trailing `元` are stripped; `15%` → 0.15,
27
+ `(300)` → −300. Sums/averages are rounded to 15 significant digits (no `0.1+0.2` noise).
28
+ - Non-numeric cells are ignored by `sum/avg/min/max` and listed in `skippedCells`
29
+ (first 20; `skippedCellCount` is the total); `value:null` means no numeric cells
30
+ qualified — report that rather than guessing 0.
21
31
  - A missing/misnamed column returns `value:null` with `colIdx:-1`; check headers
22
32
  first via `--summary`.
23
- - Currency/percent strings (`$1,200`, `15%`) are coerced to numbers.
24
33
  - For pivots or multi-column math beyond these ops, read rows with `--sample`
25
34
  and compute in a short script, or ask for the specific cut.
26
-
27
- ## Writing formulas (the repair loop — mandatory)
28
-
29
- When you GENERATE or EDIT a spreadsheet, use live formulas (`"=SUM(A2:A9)"`),
30
- never precomputed values — the file must recalculate when the user edits data.
31
- Then close the loop:
32
-
33
- 1. `bin/xlsx-recalc.cjs out.xlsx out.xlsx` — evaluates every formula and caches
34
- results (openpyxl-class writers leave them blank).
35
- 2. The output's `errors` array must be **empty**. Any `#DIV/0!`, `#REF!`, `#N/A`
36
- → fix the formula (guard divisors with IF, correct the range) and re-run
37
- recalc. **Never deliver a spreadsheet with formula errors**, and never
38
- "fix" one by replacing the formula with a hardcoded value.
39
-
40
- ## Known engine limits (HyperFormula vs LibreOffice recalc)
41
-
42
- `xlsx-recalc` covers ~400 functions — all common math/stat/text/date/lookup.
43
- Known gaps vs a full Excel/LibreOffice engine: some exotic financial functions
44
- and dynamic-array spilling. If recalc reports `#NAME?` on a function you know is
45
- valid Excel, that is an engine limit — say so and compute that cell's value via
46
- `xlsx-query`/script instead of guessing.
35
+ - **Generating or editing** a workbook (formulas, the `xlsx-recalc` repair loop) →
36
+ rewrite.md "Formulas".
@@ -1,76 +0,0 @@
1
- ---
2
- name: cozy-static-svg
3
- description: "手工编写纯静态 SVG 插画:柔和渐变、圆润主体、舒适留白,可配温柔短句或贴题的唐宋诗词;色系自由、默认明快。适用于手绘 SVG、静态插画、治愈插画、诗词配图、沿用上次画风、再画一张等请求。"
4
- ---
5
-
6
- # 温柔静态 SVG 插画
7
-
8
- ## 使用依据与范围
9
-
10
- 用户以《月亮替你值夜班》为准,认可这套画风、精细度与制作流程;要求**手写直出原生 SVG、不转 PNG**:以速查表约束画风,以质检脚本守住最后质量。
11
-
12
- - 认可原作:`references/moon_keeps_watch.svg`;风格参考:`references/approved-preview.png`。
13
- - **速查与配方(每幅开画前必读)**:`references/style-anchor.md`。
14
- - **跨平台速查**:`references/cross-platform.md`(macOS / Windows 命令对照、字体差异、转 PNG、故障对照)。
15
- - **脚本(两平台共用同一份,不写死绝对路径)**:`scripts/artkit.py` 质检(结构校验+画风合规报告,秒级,不出图、不转 PNG;文件 / 目录 / 通配符都收,纯标准库);`scripts/to_png.py` 转 PNG(仅在用户明确要 PNG 时用,跨平台自动挑后端)。
16
- - 首幅或题材类型首次出现时,可对照原作与风格参考复习一次;之后速查表+质检即可。
17
- - 固定的是画风、方法、完成度,不是题材;不要每张重复同一主体、结构或坐标;成批出图按速查表的「题材轮换」主动错开。
18
- - 拼接已有作品用 image-layout 技能,保持原图,不要用简化重绘冒充。
19
- - 不改动原作母版;每次新建独立文件。
20
-
21
- ## 提速工作流(默认按此执行)
22
-
23
- 1. **一句话定创意**:主体姿态+环境结构+主光源位置。用户给了内容就直接用,不追问低风险细节。
24
- 2. **读速查表**:`references/style-anchor.md`(画风、硬底线、题材轮换、配方与清单都在里面)。
25
- 3. **手写整幅 SVG**:一次写全;defs+use 复用重复小元素;落盘前按速查表「开画前自查清单」过一遍。
26
- 4. **一条命令质检**:
27
-
28
- ```bash
29
- python3 scripts/artkit.py 作品.svg # macOS / Linux
30
- py -3 scripts\artkit.py 作品.svg # Windows
31
- ```
32
-
33
- 参数给目录或通配符即为批量(如 `python3 scripts/artkit.py .`),通配符由脚本自己展开,
34
- 两个平台写法一致;细节见 `references/cross-platform.md`。
35
- 报告含结构、圆角裁切、引用、字体、调色清单、文案清单;**无 ✗ 才算过**。不通过就用 edit 精准修复(只动需要动的坐标 / 路径 / 层级),再跑一次;成功报告留着核对文案与调色。
36
- 5. **交付**:`present_file` 直出原生 SVG;预览、脚本不交付。质检报告核对过后,回复里用温柔、贴合画面意境的一两句话介绍这幅画,**严禁输出“质检通过、直出原生 SVG”这类生硬的技术汇报**。
37
-
38
- - **成批出图**:先按顺序写完所有 SVG,再用一条命令批量质检(传目录或通配符即可),逐个按报告核对。
39
- - **不拆子 agent**:画 SVG 全程自己完成,不派子 agent、不并行外发。逐张手写、逐张落盘、最后统一质检;成批也是串行画完再批量质检,不用子 agent 分担画面。
40
- - **默认不渲染、不转 PNG**:直接交付原生 SVG。
41
- - 不调用生图模型替代手绘;不把位图包进 SVG。
42
-
43
- ## 画风与底线(细节与配方见速查表)
44
-
45
- **画风(长什么样)**
46
- - 情绪:安静、柔软、温暖、有一点生活趣味;每张只讲一个看得懂的小故事。
47
- - 形状:手写贝塞尔与基础几何,圆润自然;大形先成立,细节克制;不以元素数量代替质量。
48
- - 构图:默认 1200×900;舒服的留白;远/中/近与承托面分层;全幅圆角由最外层 clipPath 统一裁切(含文字)。
49
- - 光与渐变:渐变过渡自然、层次分明、主光源统一(暖灯 / 冷月 / 落日 / 晨雾 / 日间自然光皆可)。
50
-
51
- **硬底线(不可让步,详见速查表)**
52
- - 明度均衡:不设固定色板——每幅按题材与情绪自由发挥、可多变;保持整幅协调;**默认明快,亮调与中间调为主,深色夜景只做少数**(原作那套夜色不是默认值)。
53
- - 对比度:明快不等于发飘——亮底要有深色锚点,深底要有大面积亮部;整幅留一处明确的明暗落差,且集中在少数区域。
54
- - 文字可读性:按文字所在区域的实际底色选色(不是按整幅平均色);亮底深字、暗底亮字;字号越小对比要求越高;脸、轮廓、文字对比必须清楚。详见速查表的「文字可读性」。
55
- - 题材轮换:连续两张不同类型,每 4 张覆盖三类以上,同一母题最多两次。详见速查表的「题材轮换」。
56
-
57
- **文案与落款**
58
- - 上限:最多标题+一句温柔注脚(+少量落款);字体栈含中文系统回退。
59
- - 诗词版:画面相宜时左下角可改题一首贴题的唐宋诗词(诗句两行+出处一行),此时**去掉右下小字**,全图五处文字(左上标题、右上落款、左下诗句与出处);标题写自己的话、诗句引原典,两者不重复。结构与对比照速查表的「诗词版」。
60
- - 落款名不写死:按当前使用者的称呼填写;不确定就改用中性落款(如「晚安」),宁可无名字也不要猜错。详见速查表的「落款名:按使用者替换,不要照抄」。
61
-
62
- **技术与可访问性**
63
- - 含命名空间;显式 width/height/viewBox;`role="img"` 与 `aria-labelledby`;title/desc 如实;纯静态、纯矢量、自包含(无动画 / 脚本 / 外链 / 位图)。
64
-
65
- ## 交付前质量核对
66
-
67
- - 质检报告无 ✗:结构、圆角裁切(全部内容在框内)、引用、字体栈、静态底线。
68
- - 文字可读性已核对:各处文字(标题、注脚、诗词、落款、小字)在其底色上都能轻松读出来;没有低对比或横跨明暗交界的句子。
69
- - 对比度已核对:有一处明确的明暗落差,且集中在少数区域,没有整幅发飘或处处高对比。
70
- - 落款名已核对:是当前使用者的称呼,或中性落款;没有照抄示例里的名字。
71
- - 若用了诗词版:五处文字齐全(左上标题、右上落款、左下诗句与出处),右下无小字。
72
- - 成批时题材轮换已核对:连续两张不同类型,母题未超两次。
73
- - 整幅用色协调统一(色系自由、可多变);文案逐句核对无错字、无残缺句。
74
- - 自查清单已勾完;最终交付 = 质检通过的最新版原生 SVG。
75
-
76
-
@@ -1,73 +0,0 @@
1
- # 跨平台速查(macOS / Windows / Linux)
2
-
3
- 这套技能本体是「手写 SVG 文本 + 纯标准库 Python 脚本」,没有平台依赖。
4
- 真正需要按系统调整的只有两件事:**质检命令怎么写**、**转 PNG 用什么工具**。
5
-
6
- ## 一、质检命令
7
-
8
- 脚本 `scripts/artkit.py` 只用 Python 标准库(需 **Python 3.9+**),两个平台都能跑。
9
- 参数支持**文件 / 目录 / 通配符**——目录会递归找全部 `.svg`;通配符由脚本自己展开,
10
- 所以 PowerShell 不必先替命令展开 `*.svg`,两边的写法才真正一致。
11
-
12
- | 场景 | macOS / Linux | Windows |
13
- | --- | --- | --- |
14
- | 单张 | `python3 scripts/artkit.py 作品.svg` | `py -3 scripts\artkit.py 作品.svg` |
15
- | 整批(当前目录) | `python3 scripts/artkit.py .` | `py -3 scripts\artkit.py .` |
16
- | 整批(通配符) | `python3 scripts/artkit.py "out/*.svg"` | `py -3 scripts\artkit.py "out\*.svg"` |
17
- | 严格模式 | 加 `--strict`(提示也算不合格) | 同左 |
18
-
19
- - Windows 上用 `py -3` 最稳;若装了新版 Python 且 PATH 里有 `python`,也可用 `python scripts\artkit.py`。
20
- - 脚本已强制 UTF-8 输出,中文报告在 PowerShell / cmd 里不会乱码;个别老终端若仍乱码,先跑 `chcp 65001`。
21
- - 退出码:0 通过,1 有不合格项 —— 可接进任何平台的脚本里做关卡。
22
-
23
- ## 二、转 PNG(默认不做,用户明确要才做)
24
-
25
- 默认工作流是**直出原生 SVG,不转 PNG**。用户明确要 PNG 时用 `scripts/to_png.py`,
26
- 它自动探测本机可用的后端,两个平台命令一致:
27
-
28
- ```bash
29
- python3 scripts/to_png.py 作品.svg # macOS / Linux
30
- py -3 scripts\to_png.py 作品.svg # Windows
31
- python3 scripts/to_png.py --scale 2 . # 整目录,2 倍图
32
- python3 scripts/to_png.py -o out 作品目录 # 指定输出目录
33
- ```
34
-
35
- 后端优先级:`rsvg-convert` → `inkscape` → `cairosvg` → `chrome/edge`(找不到可用的会给出安装提示)。
36
- 也可以 `--backend inkscape` 手动指定。
37
-
38
- | 后端 | macOS | Windows | 备注 |
39
- | --- | --- | --- | --- |
40
- | rsvg-convert | `brew install librsvg` | MSYS2 `pacman -S mingw-w64-x86_64-librsvg` | 与手绘流程同源,首选 |
41
- | Inkscape | `brew install --cask inkscape` | 官网安装包(自带你丢命令行) | 图形界面顺手可编辑 |
42
- | cairosvg | `pip install cairosvg` | 同左(wheel 自带 cairo) | 纯 Python 路线 |
43
- | chrome / edge | 系统已有 Chrome/Edge 即可 | 系统自带 Edge 即可 | 零安装兜底,`--backend chrome` |
44
-
45
- - 默认**保留透明底**(画风四角是圆角);要白底加 `--background FFFFFF`。
46
- - 不指定尺寸时按 SVG 原始宽高输出(默认画布 1200×900),`--scale 2` 得 2400×1800。
47
- - 不要用「截图整个屏幕」的方式凑 PNG;也不要把位图塞回 SVG。
48
-
49
- ## 三、字体差异(唯一会看出区别的地方)
50
-
51
- 字体栈固定为 `'PingFang SC','Noto Sans CJK SC','Microsoft YaHei',sans-serif`:
52
-
53
- - macOS → **苹方**(PingFang SC);Windows → **微软雅黑**(Microsoft YaHei);两者都不会掉成方块。
54
- - 字形与字宽略有差异(雅黑略宽、笔画更方),同一句话两平台占宽差几个百分点。
55
- 本套画风标题与注脚都留了大片留白,**不会溢出画布**;做像素级对齐要求极高的活儿时,
56
- 要么目标平台上装苹方(字体授权自行确认),要么把文字转成路径(代价:以后不能改文案)。
57
- - Linux 上若两者都没有,装 `fonts-noto-cjk` 即可命中第二顺位。
58
-
59
- ## 四、常见问题对照
60
-
61
- | 现象 | 处理 |
62
- | --- | --- |
63
- | `python3: command not found`(Windows) | 改用 `py -3`;或到 python.org 装新版并勾选 Add to PATH |
64
- | PowerShell 报找不到 `*.svg` | 参数用目录 `.`,或给通配符加引号 `"out\*.svg"`,脚本会自己展开 |
65
- | 报告中文乱码 | 脚本已强制 UTF-8;老终端再执行 `chcp 65001` |
66
- | `rsvg-convert` 不存在(Windows) | 用 `--backend inkscape` 或 `--backend chrome`(系统自带 Edge) |
67
- | PNG 四角是透明格子 | 正常,画风就是圆角;要白底加 `--background FFFFFF` |
68
- | 提示缺少 Python 版本 | 需 3.9+(用到 `str.removesuffix`),脚本会直接告诉你当前版本 |
69
-
70
- ## 五、底线
71
-
72
- - 交付物永远是**质检通过的原生 SVG**;PNG 只是复制品,改图只改 SVG 源文件。
73
- - 两个平台跑同一份 `scripts/`,不各自维护两套;路径一律相对技能目录,不写死绝对路径。