@open-press/cli 0.3.0 → 0.6.0

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 (124) hide show
  1. package/dist/cli.js +125 -51
  2. package/package.json +1 -1
  3. package/template/core/CHANGELOG.md +73 -0
  4. package/template/core/engine/cli.mjs +6 -0
  5. package/template/core/engine/commands/_shared.mjs +9 -2
  6. package/template/core/engine/commands/deploy.mjs +3 -3
  7. package/template/core/engine/commands/dev.mjs +25 -2
  8. package/template/core/engine/commands/doctor.mjs +229 -0
  9. package/template/core/engine/commands/pdf.mjs +3 -3
  10. package/template/core/engine/commands/preview.mjs +4 -4
  11. package/template/core/engine/commands/upgrade.mjs +117 -0
  12. package/template/core/package.json +3 -1
  13. package/template/core/vite.config.ts +26 -11
  14. package/template/packs/academic-paper/document/chapters/01-introduction/content/01-introduction.mdx +21 -0
  15. package/template/packs/academic-paper/document/chapters/02-methods/content/01-methods.mdx +30 -0
  16. package/template/packs/academic-paper/document/chapters/03-results-and-discussion/content/01-results.mdx +29 -0
  17. package/template/packs/academic-paper/document/chapters/04-acknowledgment/content/01-acknowledgment.mdx +12 -0
  18. package/template/packs/academic-paper/document/chapters/05-references/content/01-references.mdx +27 -0
  19. package/template/packs/academic-paper/document/index.tsx +107 -0
  20. package/template/packs/academic-paper/document/openpress.config.mjs +26 -0
  21. package/template/packs/academic-paper/document/theme/page-surfaces/cover.css +267 -0
  22. package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/chapters/03-agent-skills-contributors/content/01-agent-skills-contributors.mdx +2 -3
  23. package/template/packs/editorial-monograph/document/components/ChapterOpenerVisual/index.tsx +76 -0
  24. package/template/packs/editorial-monograph/document/components/Page.tsx +27 -0
  25. package/template/packs/editorial-monograph/document/components/TokenSwatchGrid/index.tsx +46 -0
  26. package/template/packs/editorial-monograph/document/components/TokenSwatchGrid/style.css +63 -0
  27. package/template/packs/editorial-monograph/document/components/TypeSpecimen/index.tsx +38 -0
  28. package/template/packs/editorial-monograph/document/components/TypeSpecimen/style.css +111 -0
  29. package/template/packs/editorial-monograph/document/design.md +279 -0
  30. package/template/packs/editorial-monograph/document/media/README.md +13 -0
  31. package/template/packs/editorial-monograph/document/theme/README.md +11 -0
  32. package/template/packs/editorial-monograph/document/theme/base/page-contract.css +505 -0
  33. package/template/packs/editorial-monograph/document/theme/base/print.css +93 -0
  34. package/template/packs/editorial-monograph/document/theme/base/typography.css +336 -0
  35. package/template/packs/editorial-monograph/document/theme/fonts.css +3 -0
  36. package/template/packs/editorial-monograph/document/theme/page-surfaces/back-cover.css +43 -0
  37. package/template/packs/editorial-monograph/document/theme/page-surfaces/chapter-opener.css +205 -0
  38. package/template/packs/editorial-monograph/document/theme/page-surfaces/toc.css +139 -0
  39. package/template/packs/editorial-monograph/document/theme/patterns/_chart-frame.css +49 -0
  40. package/template/packs/editorial-monograph/document/theme/patterns/figure-grid.css +68 -0
  41. package/template/packs/editorial-monograph/document/theme/patterns/table-utilities.css +66 -0
  42. package/template/packs/editorial-monograph/document/theme/shell/reader-controls.css +761 -0
  43. package/template/packs/editorial-monograph/document/theme/tokens.css +80 -0
  44. package/template/packs/editorial-monograph/openpress.config.mjs +5 -0
  45. package/template/core/.turbo/turbo-test.log +0 -341
  46. package/template/skills/chinese-ai-writing-polish/SKILL.md +0 -195
  47. package/template/skills/claude-document/SKILL.md +0 -66
  48. package/template/skills/editorial-monograph/SKILL.md +0 -73
  49. package/template/skills/openpress/SKILL.md +0 -114
  50. package/template/skills/openpress/references/cli-commands.md +0 -31
  51. package/template/skills/openpress/references/local-review.md +0 -43
  52. package/template/skills/openpress-deploy/SKILL.md +0 -69
  53. package/template/skills/openpress-deploy/references/cloudflare-pages.md +0 -51
  54. package/template/skills/openpress-design/SKILL.md +0 -51
  55. package/template/skills/openpress-design/references/pdf-safe-css.md +0 -29
  56. package/template/skills/openpress-design/references/responsive-fixed-layout.md +0 -48
  57. package/template/skills/openpress-design/references/theme-and-components.md +0 -77
  58. package/template/skills/openpress-diagram-drawing/SKILL.md +0 -44
  59. package/template/skills/openpress-diagram-drawing/references/diagram-patterns.md +0 -93
  60. package/template/skills/openpress-document-hierarchy/SKILL.md +0 -81
  61. package/template/skills/openpress-document-hierarchy/agents/openai.yaml +0 -4
  62. package/template/skills/openpress-document-hierarchy/references/data-structures-outline.md +0 -115
  63. package/template/skills/openpress-init/SKILL.md +0 -84
  64. package/template/skills/openpress-style-pack-contributor/SKILL.md +0 -62
  65. package/template/skills/openpress-style-pack-contributor/references/starter-contract.md +0 -49
  66. package/template/skills/openpress-update/SKILL.md +0 -88
  67. package/template/skills/openpress-writing/SKILL.md +0 -68
  68. package/template/skills/openpress-writing/references/source-and-writing-rules.md +0 -120
  69. package/template/skills/teaching-notes-writing/SKILL.md +0 -54
  70. package/template/skills/teaching-notes-writing/references/programming.md +0 -65
  71. package/template/skills/teaching-notes-writing/references/teaching-patterns.md +0 -60
  72. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/components/ChapterOpenerVisual/index.tsx +0 -0
  73. /package/template/{skills/claude-document/starter → packs/academic-paper}/document/components/Page.tsx +0 -0
  74. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/components/TokenSwatchGrid/index.tsx +0 -0
  75. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/components/TokenSwatchGrid/style.css +0 -0
  76. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/components/TypeSpecimen/index.tsx +0 -0
  77. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/components/TypeSpecimen/style.css +0 -0
  78. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/design.md +0 -0
  79. /package/template/{skills/claude-document/starter → packs/academic-paper}/document/media/README.md +0 -0
  80. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/README.md +0 -0
  81. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/base/page-contract.css +0 -0
  82. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/base/print.css +0 -0
  83. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/base/typography.css +0 -0
  84. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/fonts.css +0 -0
  85. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/page-surfaces/back-cover.css +0 -0
  86. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/page-surfaces/chapter-opener.css +0 -0
  87. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/page-surfaces/toc.css +0 -0
  88. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/patterns/_chart-frame.css +0 -0
  89. /package/template/{skills/claude-document/starter → packs/academic-paper}/document/theme/patterns/figure-grid.css +0 -0
  90. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/patterns/table-utilities.css +0 -0
  91. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/shell/reader-controls.css +0 -0
  92. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/tokens.css +0 -0
  93. /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/openpress.config.mjs +0 -0
  94. /package/template/{skills/claude-document/starter → packs/claude-document}/document/chapters/01-document-shape/chapter.tsx +0 -0
  95. /package/template/{skills/claude-document/starter → packs/claude-document}/document/chapters/01-document-shape/content/01-document-shape.mdx +0 -0
  96. /package/template/{skills/claude-document/starter → packs/claude-document}/document/chapters/02-review-loop/chapter.tsx +0 -0
  97. /package/template/{skills/claude-document/starter → packs/claude-document}/document/chapters/02-review-loop/content/01-review-loop.mdx +0 -0
  98. /package/template/{skills/claude-document/starter → packs/claude-document}/document/components/ChapterOpenerVisual.tsx +0 -0
  99. /package/template/{skills/editorial-monograph/starter → packs/claude-document}/document/components/Page.tsx +0 -0
  100. /package/template/{skills/claude-document/starter → packs/claude-document}/document/design.md +0 -0
  101. /package/template/{skills/claude-document/starter → packs/claude-document}/document/index.tsx +0 -0
  102. /package/template/{skills/editorial-monograph/starter → packs/claude-document}/document/media/README.md +0 -0
  103. /package/template/{skills/claude-document/starter → packs/claude-document}/document/openpress.config.mjs +0 -0
  104. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/README.md +0 -0
  105. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/base/page-contract.css +0 -0
  106. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/base/print.css +0 -0
  107. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/base/typography.css +0 -0
  108. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/fonts.css +0 -0
  109. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/page-surfaces/back-cover.css +0 -0
  110. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/page-surfaces/chapter-opener.css +0 -0
  111. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/page-surfaces/cover.css +0 -0
  112. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/page-surfaces/toc.css +0 -0
  113. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/patterns/_chart-frame.css +0 -0
  114. /package/template/{skills/editorial-monograph/starter → packs/claude-document}/document/theme/patterns/figure-grid.css +0 -0
  115. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/patterns/table-utilities.css +0 -0
  116. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/shell/reader-controls.css +0 -0
  117. /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/tokens.css +0 -0
  118. /package/template/{skills/claude-document/starter → packs/claude-document}/openpress.config.mjs +0 -0
  119. /package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/chapters/01-product-and-use-cases/content/01-product-and-use-cases.mdx +0 -0
  120. /package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/chapters/02-workflow/content/01-workflow.mdx +0 -0
  121. /package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/chapters/04-validation-deploy/content/01-validation-deploy.mdx +0 -0
  122. /package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/index.tsx +0 -0
  123. /package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/openpress.config.mjs +0 -0
  124. /package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/theme/page-surfaces/cover.css +0 -0
@@ -0,0 +1,80 @@
1
+ :root {
2
+ /* 深色 chrome(navbar / sidebar / app background) */
3
+ --openpress-color-app-bg: #161616;
4
+ --openpress-color-border-subtle: #393939;
5
+ --openpress-color-border-strong: #6f6f6f;
6
+ --openpress-color-text-on-dark: #f4f4f4;
7
+ --openpress-color-text-secondary: #c6c6c6;
8
+ --openpress-color-text-placeholder: #8d8d8d;
9
+ --openpress-color-focus: #0f62fe;
10
+
11
+ /* 文件本身(白底文件、墨色內文) */
12
+ --openpress-color-document: #ffffff;
13
+ --openpress-color-ink: #161616;
14
+ --openpress-color-muted: #6f6f6f;
15
+ --openpress-color-line: #e0e0e0;
16
+ --openpress-color-soft-line: #f4f4f4;
17
+
18
+ /* 表格狀態符號 */
19
+ --openpress-color-green: #24a148;
20
+
21
+ /* 圖表 palette(柔和暖色系)
22
+ * 用於 data-foundation、milestone-roadmap、cost-donut、revenue-line-chart 等元件。
23
+ * 排序由淺到深,可以對應 phase / tier 的進階感:
24
+ * gold (起始 / current) → coral (中期) → coral-deep (後期) → dark (anchor / 成熟)
25
+ */
26
+ --openpress-chart-gold: #FFB000;
27
+ --openpress-chart-coral: #FF6A4D;
28
+ --openpress-chart-coral-deep: #C9522B;
29
+ --openpress-chart-dark: #1F2328;
30
+ --openpress-chart-cream: #FFF3DB;
31
+ --openpress-chart-warm-gray: #B0A89A;
32
+
33
+ /* 對應的背景 tint(較飽和、用於 phase / tier 卡片) */
34
+ --openpress-chart-gold-bg: rgba(255, 176, 0, 0.20);
35
+ --openpress-chart-coral-bg: rgba(255, 106, 77, 0.16);
36
+ --openpress-chart-coral-deep-bg: rgba(201, 82, 43, 0.14);
37
+ --openpress-chart-dark-bg: rgba(31, 35, 40, 0.09);
38
+
39
+ /* 對應的中等飽和邊框色(配合 background tint) */
40
+ --openpress-chart-gold-border: rgba(255, 176, 0, 0.55);
41
+ --openpress-chart-coral-border: rgba(255, 106, 77, 0.5);
42
+ --openpress-chart-coral-deep-border: rgba(201, 82, 43, 0.42);
43
+ --openpress-chart-dark-border: rgba(31, 35, 40, 0.28);
44
+
45
+ /* Status — 文件內行內語意強調色(warn / success / info),
46
+ * 用於 <span class="status-warn|status-success|status-info">。
47
+ * 避免按色相命名(accent-gold 之類)以強制走語意。 */
48
+ --openpress-status-warn: #C9522B;
49
+ --openpress-status-success: #5C8C4F;
50
+ --openpress-status-info: #4A6B8A;
51
+
52
+ /* 字型 */
53
+ --openpress-font-body: "IBM Plex Sans", "PingFang TC", "Noto Sans TC", "Hiragino Sans", "Microsoft JhengHei", sans-serif;
54
+ --openpress-font-serif: "Noto Serif TC", "Songti TC", "Source Han Serif TC", "PMingLiU", serif;
55
+ --openpress-font-mono: "SFMono-Regular", "Menlo", "Consolas", monospace;
56
+
57
+ /* 字級(固定 pt 用於小元素;標題改用 container queries 算) */
58
+ --openpress-text-sm: 9.5pt;
59
+ --openpress-text-md: 10.5pt;
60
+
61
+ /* 行距 */
62
+ --openpress-leading-body: 1.72;
63
+ --openpress-leading-table: 1.45;
64
+
65
+ /* 間距系統(mm 為主、適合 print 與 A4 視覺節奏) */
66
+ --openpress-space-1: 2mm;
67
+ --openpress-space-2: 4mm;
68
+ --openpress-space-3: 6mm;
69
+ --openpress-space-4: 9mm;
70
+ --openpress-space-5: 13mm;
71
+
72
+ /* Page geometry — A4 預設。
73
+ * 換成 B5 / Letter / 16:9 投影片時改這三條,其他 CSS 與 page-contract `@page`
74
+ * 都會跟著走。注意:@page size 改用 length pair 時,PDF 與瀏覽器 print 都會吃。 */
75
+ --openpress-page-width: 210mm;
76
+ --openpress-page-height: 297mm;
77
+ --openpress-page-aspect-ratio: 210 / 297;
78
+ --openpress-page-height-ratio: calc(297 / 210);
79
+ --openpress-page-margin: 18mm;
80
+ }
@@ -0,0 +1,5 @@
1
+ // editorial-monograph starter — root marker for a nested React/MDX open-press workspace.
2
+ export default {
3
+ documentDir: "document",
4
+ config: "document/openpress.config.mjs",
5
+ };
@@ -1,341 +0,0 @@
1
-
2
- > @open-press/core@0.2.0 test /Users/quan/Desktop/QDoc Playgorund/data structure note/packages/core
3
- > pnpm run test:node && pnpm run test:react
4
-
5
-
6
- > @open-press/core@0.2.0 test:node /Users/quan/Desktop/QDoc Playgorund/data structure note/packages/core
7
- > node --test tests/*.test.mjs
8
-
9
- TAP version 13
10
- # Subtest: cli pdf and deploy dry runs use workspace config
11
- ok 1 - cli pdf and deploy dry runs use workspace config
12
- ---
13
- duration_ms: 1898.54
14
- ...
15
- # Subtest: static server serves workspace pdf and exposes deployment status
16
- ok 2 - static server serves workspace pdf and exposes deployment status
17
- ---
18
- duration_ms: 459.933375
19
- ...
20
- # Subtest: deploy gate validates public adapters require confirmation
21
- ok 3 - deploy gate validates public adapters require confirmation
22
- ---
23
- duration_ms: 860.309125
24
- ...
25
- # Subtest: validate supports machine-readable issue report JSON
26
- ok 4 - validate supports machine-readable issue report JSON
27
- ---
28
- duration_ms: 872.810334
29
- ...
30
- # Subtest: validate warns when React source still contains pending openpress comments
31
- ok 5 - validate warns when React source still contains pending openpress comments
32
- ---
33
- duration_ms: 867.950458
34
- ...
35
- # Subtest: validate reports React pagination overflow warnings from exported document metadata
36
- ok 6 - validate reports React pagination overflow warnings from exported document metadata
37
- ---
38
- duration_ms: 867.326666
39
- ...
40
- # Subtest: inspect dry run describes render and browser inspection steps
41
- ok 7 - inspect dry run describes render and browser inspection steps
42
- ---
43
- duration_ms: 733.269791
44
- ...
45
- # Subtest: export copies theme font stylesheet and font files for nested workspaces
46
- ok 8 - export copies theme font stylesheet and font files for nested workspaces
47
- ---
48
- duration_ms: 1151.318875
49
- ...
50
- # Subtest: export supports chapter-opener pages as no-footer page surfaces
51
- ok 9 - export supports chapter-opener pages as no-footer page surfaces
52
- ---
53
- duration_ms: 1118.779584
54
- ...
55
- # Subtest: export includes katex stylesheet and font assets for latex math
56
- ok 10 - export includes katex stylesheet and font assets for latex math
57
- ---
58
- duration_ms: 1114.688208
59
- ...
60
- # Subtest: inspection source scan reads React MDX chapters when document/index.tsx is present
61
- ok 11 - inspection source scan reads React MDX chapters when document/index.tsx is present
62
- ---
63
- duration_ms: 94.999084
64
- ...
65
- # Subtest: overflow measurements become page warnings with source metadata
66
- ok 12 - overflow measurements become page warnings with source metadata
67
- ---
68
- duration_ms: 0.838333
69
- ...
70
- # Subtest: project asset endpoint renames media and updates document references
71
- ok 13 - project asset endpoint renames media and updates document references
72
- ---
73
- duration_ms: 176.032333
74
- ...
75
- # Subtest: project asset endpoint refuses to delete referenced media
76
- ok 14 - project asset endpoint refuses to delete referenced media
77
- ---
78
- duration_ms: 81.165209
79
- ...
80
- # Subtest: project asset endpoint renames component support directory and literal references
81
- ok 15 - project asset endpoint renames component support directory and literal references
82
- ---
83
- duration_ms: 62.403042
84
- ...
85
- # Subtest: project asset endpoint creates a source comment from the asset dialog
86
- ok 16 - project asset endpoint creates a source comment from the asset dialog
87
- ---
88
- duration_ms: 48.93275
89
- ...
90
- # Subtest: insertCommentMarker writes a JSX marker before the selected MDX block line
91
- ok 17 - insertCommentMarker writes a JSX marker before the selected MDX block line
92
- ---
93
- duration_ms: 37.651084
94
- ...
95
- # Subtest: insertCommentMarker rejects paths outside editable React document sources
96
- ok 18 - insertCommentMarker rejects paths outside editable React document sources
97
- ---
98
- duration_ms: 5.009083
99
- ...
100
- # Subtest: listCommentMarkers returns decoded pending comments from editable React sources
101
- ok 19 - listCommentMarkers returns decoded pending comments from editable React sources
102
- ---
103
- duration_ms: 222.229375
104
- ...
105
- # Subtest: clearCommentMarkers removes one or all pending comments
106
- ok 20 - clearCommentMarkers removes one or all pending comments
107
- ---
108
- duration_ms: 135.881
109
- ...
110
- # Subtest: updateCommentMarker updates an existing source marker without duplicating it
111
- ok 21 - updateCommentMarker updates an existing source marker without duplicating it
112
- ---
113
- duration_ms: 44.983834
114
- ...
115
- # Subtest: handleCommentRequest accepts React inspector targets and writes source markers
116
- ok 22 - handleCommentRequest accepts React inspector targets and writes source markers
117
- ---
118
- duration_ms: 4.229959
119
- ...
120
- # Subtest: handleCommentRequest updates pending comments through PATCH
121
- ok 23 - handleCommentRequest updates pending comments through PATCH
122
- ---
123
- duration_ms: 50.044709
124
- ...
125
- # Subtest: handleCommentRequest lists and clears pending comments
126
- ok 24 - handleCommentRequest lists and clears pending comments
127
- ---
128
- duration_ms: 55.842959
129
- ...
130
- # Subtest: handleCommentRequest rejects unsupported methods
131
- ok 25 - handleCommentRequest rejects unsupported methods
132
- ---
133
- duration_ms: 0.326792
134
- ...
135
- # Subtest: scopeChapterCss prefixes ordinary selectors and nested media rules
136
- ok 26 - scopeChapterCss prefixes ordinary selectors and nested media rules
137
- ---
138
- duration_ms: 5.827334
139
- ...
140
- # Subtest: buildChapterScopedCss reads chapter styles in discovery order
141
- ok 27 - buildChapterScopedCss reads chapter styles in discovery order
142
- ---
143
- duration_ms: 30.566
144
- ...
145
- # Subtest: discovers React document chapters and component scopes from filesystem structure
146
- ok 28 - discovers React document chapters and component scopes from filesystem structure
147
- ---
148
- duration_ms: 63.16425
149
- ...
150
- # Subtest: discovers React workspace using normalized config path overrides
151
- ok 29 - discovers React workspace using normalized config path overrides
152
- ---
153
- duration_ms: 7.797125
154
- ...
155
- # Subtest: loadReactDocumentEntry loads document/index.tsx and normalizes config defaults
156
- ok 30 - loadReactDocumentEntry loads document/index.tsx and normalizes config defaults
157
- ---
158
- duration_ms: 190.757833
159
- ...
160
- # Subtest: loadReactDocumentEntry maps manifest path overrides into normalized config
161
- ok 31 - loadReactDocumentEntry maps manifest path overrides into normalized config
162
- ---
163
- duration_ms: 43.071958
164
- ...
165
- # Subtest: loadReactDocumentEntry rejects obvious top-level side effects before import
166
- ok 32 - loadReactDocumentEntry rejects obvious top-level side effects before import
167
- ---
168
- duration_ms: 18.955959
169
- ...
170
- # Subtest: loadReactDocumentEntry rejects side-effect imports and top-level browser or file IO
171
- ok 33 - loadReactDocumentEntry rejects side-effect imports and top-level browser or file IO
172
- ---
173
- duration_ms: 20.809917
174
- ...
175
- # Subtest: Vite and TypeScript expose React document import aliases
176
- ok 34 - Vite and TypeScript expose React document import aliases
177
- ---
178
- duration_ms: 9.857875
179
- ...
180
- # Subtest: exportReactDocument writes a reader document from React shell pages and MDX chapters
181
- ok 35 - exportReactDocument writes a reader document from React shell pages and MDX chapters
182
- ---
183
- duration_ms: 208.410208
184
- ...
185
- # Subtest: exportReactDocument paginates MDX by measured block groups and rerenders page subtrees
186
- ok 36 - exportReactDocument paginates MDX by measured block groups and rerenders page subtrees
187
- ---
188
- duration_ms: 58.566208
189
- ...
190
- # Subtest: exportReactDocument injects static table-of-contents entries from rendered headings
191
- ok 37 - exportReactDocument injects static table-of-contents entries from rendered headings
192
- ---
193
- duration_ms: 65.722958
194
- ...
195
- # Subtest: exportDocument delegates to React export when document/index.tsx is present
196
- ok 38 - exportDocument delegates to React export when document/index.tsx is present
197
- ---
198
- duration_ms: 77.547709
199
- ...
200
- # Subtest: compileMdx renders MDX with stable block ids and component wrappers
201
- ok 39 - compileMdx renders MDX with stable block ids and component wrappers
202
- ---
203
- duration_ms: 18.214959
204
- ...
205
- # Subtest: compileMdx rejects import declarations in chapter prose
206
- ok 40 - compileMdx rejects import declarations in chapter prose
207
- ---
208
- duration_ms: 0.331958
209
- ...
210
- # Subtest: compileMdx can render only selected block ids for pagination subtrees
211
- ok 41 - compileMdx can render only selected block ids for pagination subtrees
212
- ---
213
- duration_ms: 7.782041
214
- ...
215
- # Subtest: compileMdx rejects inline JSX components inside prose
216
- ok 42 - compileMdx rejects inline JSX components inside prose
217
- ---
218
- duration_ms: 0.939334
219
- ...
220
- # Subtest: compileMdx renders GitHub-flavored markdown tables as table elements
221
- ok 43 - compileMdx renders GitHub-flavored markdown tables as table elements
222
- ---
223
- duration_ms: 5.05425
224
- ...
225
- # Subtest: compileMdx converts TableCaption components into table captions
226
- ok 44 - compileMdx converts TableCaption components into table captions
227
- ---
228
- duration_ms: 7.21325
229
- ...
230
- # Subtest: compileMdx renders inline LaTeX math without treating braces as MDX expressions
231
- ok 45 - compileMdx renders inline LaTeX math without treating braces as MDX expressions
232
- ---
233
- duration_ms: 13.443666
234
- ...
235
- # Subtest: compileMdx renders display LaTeX math as a paginable block
236
- ok 46 - compileMdx renders display LaTeX math as a paginable block
237
- ---
238
- duration_ms: 38.801375
239
- ...
240
- # Subtest: compileMdx treats a whole-line double-dollar formula as display math
241
- ok 47 - compileMdx treats a whole-line double-dollar formula as display math
242
- ---
243
- duration_ms: 12.7585
244
- ...
245
- # Subtest: paginateMeasuredBlocks groups measured block ids without splitting atomic blocks
246
- ok 48 - paginateMeasuredBlocks groups measured block ids without splitting atomic blocks
247
- ---
248
- duration_ms: 0.982167
249
- ...
250
- # Subtest: paginateMeasuredBlocks keeps an overlong block atomic and emits an overflow warning
251
- ok 49 - paginateMeasuredBlocks keeps an overlong block atomic and emits an overflow warning
252
- ---
253
- duration_ms: 0.219083
254
- ...
255
- # Subtest: measureBlocksInChromium derives safe height from rendered page body when no fixed height is configured
256
- ok 50 - measureBlocksInChromium derives safe height from rendered page body when no fixed height is configured
257
- ---
258
- duration_ms: 229.745917
259
- ...
260
- # Subtest: buildReactMeasurementCss includes real theme, component and chapter scoped CSS
261
- ok 51 - buildReactMeasurementCss includes real theme, component and chapter scoped CSS
262
- ---
263
- duration_ms: 35.629459
264
- ...
265
- # Subtest: reader page registry reports same-index DOM replacements
266
- ok 52 - reader page registry reports same-index DOM replacements
267
- ---
268
- duration_ms: 55.891958
269
- ...
270
- # Subtest: page route serializes and validates reader page hashes
271
- ok 53 - page route serializes and validates reader page hashes
272
- ---
273
- duration_ms: 20.061375
274
- ...
275
- # Subtest: reader runtime leaves touch gestures to scrolling instead of page turns
276
- ok 54 - reader runtime leaves touch gestures to scrolling instead of page turns
277
- ---
278
- duration_ms: 3.51525
279
- ...
280
- # Subtest: search emits source match JSON with file, line, column and preview
281
- ok 55 - search emits source match JSON with file, line, column and preview
282
- ---
283
- duration_ms: 1006.144209
284
- ...
285
- # Subtest: replace preview reports changes without writing files
286
- ok 56 - replace preview reports changes without writing files
287
- ---
288
- duration_ms: 822.123458
289
- ...
290
- # Subtest: replace apply writes prose matches and skips fenced code by default
291
- ok 57 - replace apply writes prose matches and skips fenced code by default
292
- ---
293
- duration_ms: 818.346291
294
- ...
295
- # Subtest: search reads React MDX chapter content when document/index.tsx is present
296
- ok 58 - search reads React MDX chapter content when document/index.tsx is present
297
- ---
298
- duration_ms: 825.881375
299
- ...
300
- # Subtest: replace applies to React MDX chapter content when document/index.tsx is present
301
- ok 59 - replace applies to React MDX chapter content when document/index.tsx is present
302
- ---
303
- duration_ms: 829.073666
304
- ...
305
- # Subtest: search all includes React document entry and chapter implementation sources
306
- ok 60 - search all includes React document entry and chapter implementation sources
307
- ---
308
- duration_ms: 826.43775
309
- ...
310
- 1..60
311
- # tests 60
312
- # suites 0
313
- # pass 60
314
- # fail 0
315
- # cancelled 0
316
- # skipped 0
317
- # todo 0
318
- # duration_ms 10037.053417
319
-
320
- > @open-press/core@0.2.0 test:react /Users/quan/Desktop/QDoc Playgorund/data structure note/packages/core
321
- > vitest run
322
-
323
-
324
-  RUN  v4.1.7 /Users/quan/Desktop/QDoc Playgorund/data structure note/packages/core
325
-
326
- ✓ tests/openpress-composer-mentions.test.ts (4 tests) 6ms
327
- ✓ tests/openpress-react-document-metadata.test.ts (3 tests) 6ms
328
- ✓ tests/openpress-frame-scheduler.test.ts (3 tests) 10ms
329
- ✓ tests/openpress-project-mentions.test.ts (1 test) 261ms
330
- ✓ tests/openpress-pagination.test.ts (11 tests) 179ms
331
- ✓ tests/openpress-core-primitives.react.test.tsx (4 tests) 52ms
332
- ✓ tests/openpress-bookmarks.react.test.tsx (4 tests) 145ms
333
- ✓ tests/openpress-renderer.react.test.tsx (2 tests) 258ms
334
- ✓ tests/openpress-inspector.react.test.tsx (13 tests) 105ms
335
- ✓ tests/reader-runtime.react.test.tsx (7 tests) 367ms
336
-
337
-  Test Files  10 passed (10)
338
-  Tests  52 passed (52)
339
-  Start at  14:37:54
340
-  Duration  1.56s (transform 947ms, setup 0ms, import 1.82s, tests 1.39s, environment 7.26s)
341
-
@@ -1,195 +0,0 @@
1
- ---
2
- name: chinese-ai-writing-polish
3
- description: Use when producing or editing Traditional Chinese professional content, especially business, product, proposal, report, pitch, website, documentation, or marketing copy that may contain AI-like sentence patterns, empty contrast phrasing, vague transformation slogans, exaggerated claims, or repetitive polished-but-thin language.
4
- ---
5
-
6
- # 中文 AI 語句避雷 Writing Skill
7
-
8
- 這是一個 **portable writing skill**:可獨立使用,也可由 `openpress-writing` 載入。當輸出語言為繁體中文的專業內容時,本 skill 提供句型、用詞、表格文字、被動句、反向句的判斷規則。
9
-
10
- ## 與其他 Skill 的關係
11
-
12
- - 在 open-press 文件中,由 `openpress-writing` 在繁體中文內容時載入。
13
- - 若同時載入多個 portable writing skill(如本 skill + `teaching-notes-writing`),衝突解決依 `openpress-writing` 內的優先順序。
14
- - 本 skill 不規範 open-press 的 source 路徑、CLI、驗證、輸出、部署或 style pack 套用流程;系統操作一律回到 `openpress` 分流,再由它決定是否交給其他 openpress-* skill。
15
-
16
- ## 目標
17
-
18
- 產出專業、可用、可交付的中文內容。優先保留事實、判斷、對象、行動與結果;避免用看似漂亮但資訊量低的 AI 腔句型填補內容。
19
-
20
- ## 核心原則
21
-
22
- - 直接說明主張,不用戲劇化轉折包裝薄弱論點。
23
- - 用具體名詞、動詞、情境與結果取代抽象口號。
24
- - 每段只承擔一個重點:對象、問題、做法、效果要清楚。
25
- - 能量化就量化;不能量化就說清楚觀察依據。
26
- - 避免過度承諾。沒有證據時,不寫「最佳」「顛覆」「重新定義」「革命性」。
27
- - 寫給讀者要做的決策,不寫給文字本身好看。
28
- - 反向說法只作為少量 hook 使用;一般段落應直接說產品做了什麼,讓讀者第一秒掌握重點。
29
- - 表格文字要像表格,不要像段落。欄位名稱已經交代語意時,儲存格避免重複「驗證」「支援」「已完成」「用於」等附帶動詞,優先保留名詞、數據、狀態與結果。
30
- - 避免同一小節反覆提及相同主詞。段落開頭已建立產品、公司或創辦人時,後續句子可用「產品」「平台」「團隊」「這項規劃」承接,或在語意清楚時省略主詞。
31
-
32
- ## 高風險 AI 腔句型
33
-
34
- | 避免句型 | 問題 | 改寫方向 |
35
- | --- | --- | --- |
36
- | 這不是 A,而是 B | 用對比製造深度,但常沒有新增資訊;若太常使用,讀者第一秒抓不到重點 | 直接說 B 的具體功能、價值或差異;只有在需要與差異很大的系統做對比時,才可作為 hook 使用 |
37
- | 不只是 A,更是 B | 結構老套,容易把兩個空泛名詞堆在一起 | 拆成「目前能做什麼」與「因此帶來什麼結果」 |
38
- | 把每一次的 A 都變成 B | 過度願景化,缺少執行機制 | 說明每次 A 發生時,系統或流程實際記錄、判斷、提醒、產出什麼 |
39
- | 讓 X 不再只是 Y | 轉折感強但資訊密度低 | 直接描述 X 現在新增的能力或使用情境 |
40
- | 從 A 到 B,全面升級 | 範圍過大,缺少可驗證細節 | 列出升級的項目、使用者感受到的變化、限制條件 |
41
- | 重新定義 A | 宣稱過大,通常無法證明 | 改成「改善 A 中的某個具體環節」 |
42
- | 打造一個有溫度的 A | 抽象且常見,難以落地 | 寫出哪個互動、回饋或服務讓使用者感受到差異 |
43
- | 賦能、賦予、開啟新篇章 | 商業套話,容易顯得空泛 | 改成「支援」「協助」「提供」「降低」「縮短」「提升」 |
44
- | 在這個快速變動的時代 | 開場空泛,與主題連結弱 | 直接進入讀者面臨的具體問題 |
45
- | 真正的 A,不是 B,而是 C | 像演講稿金句,不像專業說明 | 改成可被檢驗的判斷或標準 |
46
- | 每一個 A,都值得被 B | 情緒化且泛用 | 指出哪些 A 需要 B,以及原因 |
47
- | 透過 A,讓 B 更 C | 過度依賴「透過」「讓」串句 | 改成主詞明確的動作句:「A 會整理 B,並標示 C」 |
48
- | 讓 X 可以被/能被 Y | 被動句包裝,主詞與責任不清,容易寫成「讓資料能被使用」「讓問題可以被看見」這類空泛句 | 改成主詞明確的主動句:「系統整理 X,供 Y 使用」「教師可用 X 判斷 Y」 |
49
- | X 可以被/能被 Y | 過度使用被動語態,讀者難以判斷誰執行動作、產出什麼結果 | 改成「誰使用 X 做什麼」或「系統如何處理 X」 |
50
-
51
- ## 改寫方法
52
-
53
- 1. 找出句子的實際意思:這句話到底要說功能、差異、願景、成果,還是情緒?
54
- 2. 刪掉套語骨架:移除「不是...而是...」「不只是...更是...」「把每一次...都變成...」。
55
- 3. 補上具體資訊:誰在什麼情境下,做了什麼,得到什麼結果。
56
- 4. 檢查證據強度:若沒有資料支持,就降低語氣,改成「有助於」「可協助」「目標是」。
57
- 5. 用短句收斂:一句話只放一個主要判斷,避免連續堆疊抽象名詞。
58
-
59
- ## 主詞延續規則
60
-
61
- 中文商業文件不需要每一句都重複產品名或公司名。當小節標題、段落第一句或前一句已經建立主詞,後續句子應自然承接。
62
-
63
- | 避免寫法 | 問題 | 建議寫法 |
64
- | --- | --- | --- |
65
- | `QJudge 目前是一人公司……因此 QJudge 現階段雖然以一人公司形態推進……` | 同一資訊重複兩次,讀者會覺得段落在原地打轉 | 第一段交代現況,後段改寫為「現階段雖然團隊規模小,但產品不是孤立開發。」 |
66
- | `QJudge 的組織化不會……QJudge 會……QJudge 需要……` | 產品名過度重複,語氣僵硬 | `組織化不會……後續會……下一階段需要……` |
67
- | `本產品支援……本產品提供……本產品能夠……` | 每句都重啟主詞,段落節奏笨重 | 第一處保留產品名,後續用「系統」「平台」「功能」或直接接動作 |
68
-
69
- 判斷標準:
70
-
71
- - 同一段出現同一產品名超過 2 次,先檢查是否可省略或替換。
72
- - 若前一句已明確說明主詞,下一句不要再用相同名詞開頭。
73
- - 主詞替換應服務清楚度,不要為了變化而使用模糊代稱;讀者會誤解時才保留完整主詞。
74
- - 結論句可回到產品名,但不應重複前文已講過的狀態或背景。
75
-
76
- ## 表格文字規則
77
-
78
- 表格的欄位名稱已經提供上下文,儲存格應減少完整句與重複動詞,讓讀者快速掃描。
79
-
80
- | 避免寫法 | 問題 | 建議寫法 |
81
- | --- | --- | --- |
82
- | 規模:`60 人受測` | 欄位已寫「規模」,`受測` 多餘 | `60 人` |
83
- | 已驗證能力:`驗證程式上機等特殊題型也能在線上完成作答與監考` | 欄位已寫「已驗證能力」,開頭再寫「驗證」重複 | `程式上機等特殊題型可在線上完成作答與監考` |
84
- | 平台開發狀態:`已支援正式課程建立考試` | 狀態欄已有「已上線」,備註再寫「已支援」冗餘 | `正式課程考試建立;多題型作答介面` |
85
- | 備註:`可用於考前到場簽到、身分確認與考生狀態整理` | `可用於` 不增加資訊 | `考前到場簽到、身分確認與考生狀態整理` |
86
-
87
- 判斷標準:
88
-
89
- - 欄位叫「規模」時,儲存格只放數字與單位。
90
- - 欄位叫「狀態」時,儲存格只放狀態,不再補「目前」「已經」。
91
- - 欄位叫「能力」「功能」「備註」時,儲存格用名詞片語或短句,不用完整說明段。
92
- - 同一列若需要補充因果或限制,移到表格前後段落,不塞進儲存格。
93
-
94
- ## 反向說法使用邊界
95
-
96
- 「不是 A,而是 B」「不只是 A,更是 B」這類反向句,不應作為常規說明段落的開頭。它會先要求讀者理解一個被否定的對象,再等待真正主張出現,容易讓評審或讀者第一秒抓不到重點。
97
-
98
- 可使用的情境:
99
-
100
- - **對比差異很大的系統**:例如需要說明 QJudge 與 LMS、Google Forms、一般題庫或 OJ 平台的根本差異。
101
- - **段落 hook**:用一句話打開對比,但下一句必須立刻接具體差異,例如功能、流程、資料、責任邊界或使用者行為。
102
- - **避免連續使用**:同一章節若已用過一次反向句,後續段落應改用正向敘述。
103
-
104
- 不建議的情境:
105
-
106
- - **說明產品功能時**:直接寫系統要求使用者做什麼、系統記錄什麼、產出什麼結果。
107
- - **說明願景時**:直接寫未來要支援的題型、資料流或評量方式,不要用金句包裝。
108
- - **說明價值時**:直接寫降低多少人力、縮短哪個流程、保留哪些紀錄。
109
-
110
- 判斷標準:如果刪掉「不是 A」後,句子仍然能直接說清楚 B 的功能或價值,就應該刪掉反向開頭。
111
-
112
- ## 改寫範例
113
-
114
- ### 例 1:產品定位
115
-
116
- 避免:
117
-
118
- > 這不是一個解題平台,而是一個陪伴學生持續成長的學習夥伴。
119
-
120
- 建議:
121
-
122
- > QJudge 會記錄學生的提交紀錄、錯誤類型與修正歷程,讓學生回看自己的卡點,也讓教師掌握班級常見問題。
123
-
124
- ### 例 2:學習歷程
125
-
126
- 避免:
127
-
128
- > 把每一次練習都變成成長的契機。
129
-
130
- 建議:
131
-
132
- > 每次練習後,系統會保留題目、提交結果、錯誤訊息與修改紀錄,方便學生比較前後版本並整理弱點。
133
-
134
- ### 例 3:商業提案
135
-
136
- 避免:
137
-
138
- > 我們不只是提供工具,更是協助教育現場重新定義程式學習。
139
-
140
- 建議:
141
-
142
- > 我們提供自動批改、作業派發、學習紀錄與班級分析,協助教師減少批改時間,並更早發現學生的共同錯誤。
143
-
144
- ### 例 4:網站文案
145
-
146
- 避免:
147
-
148
- > 在 AI 快速發展的時代,打造更智慧、更有溫度的學習體驗。
149
-
150
- 建議:
151
-
152
- > 學生提交程式後,系統會即時回傳測資結果與錯誤提示;教師可在後台查看完成率、錯誤分布與個別進度。
153
-
154
- ## 可用句型
155
-
156
- - `X 是給 [使用者] 在 [情境] 中完成 [任務] 的 [產品類型]。`
157
- - `[功能] 會在 [觸發時機] 自動 [動作],供 [使用者] [具體行動]。`
158
- - `相較於 [既有做法],[方案] 減少了 [成本或阻力],並保留 [必要能力]。`
159
- - `這項設計解決的是 [具體問題],不是泛稱的 [抽象願景]。`
160
- - `目前版本支援 [能力 A]、[能力 B]、[能力 C];尚未涵蓋 [限制]。`
161
- - `若目標是 [決策或成果],建議優先呈現 [證據或指標]。`
162
-
163
- ## 用字偏好
164
-
165
- - 優先使用:支援、協助、提供、記錄、整理、比對、標示、提醒、降低、縮短、提升、追蹤、檢視。
166
- - 謹慎使用:打造、賦能、顛覆、革新、重新定義、全方位、沉浸式、無縫、前所未有、有溫度。
167
- - 避免連續使用抽象名詞:體驗、價值、願景、場景、生態系、解決方案、影響力。
168
- - 專業內容應使用繁體中文與台灣常用語感;避免不必要的簡體詞與翻譯腔。
169
-
170
- ## 英文技術術語處理
171
-
172
- 不要為了「全中文」而強硬翻譯英文技術術語。判斷標準:
173
-
174
- | 情境 | 處理方式 |
175
- | --- | --- |
176
- | 業界已普及、讀者一看就懂的英文詞 | 直接保留英文,例如 `edge case`、`spec`、`rubric`、`pipeline`、`SOP`、`KPI`、`API`、`OAuth` |
177
- | 存在更精準、不引起誤會的中文說法 | 用中文,例如「鑑別度」「採購週期」「監考流程」 |
178
- | 直譯結果晦澀或失準 | 用英文,或改寫情境描述(例:`edge case` 不要硬翻成「邊角案例」,可寫「教學現場的例外事件」或「平常想不到的特殊情境」) |
179
- | 同一份文件中已先出現英文原詞 | 後續沿用英文,不要混用兩種譯名 |
180
-
181
- 判斷時優先看「讀者第一秒抓到意思」與「精準度」,而不是「中英文比例」。專業讀者(評審、業界)對常見英文術語的辨識度通常高於彆扭的直譯。
182
-
183
- ## 交付前檢查
184
-
185
- - 是否出現「這不是...而是...」「不只是...更是...」「把每一次...都變成...」或其變體?
186
- - 是否出現「讓 X 可以被/能被 Y」「X 可以被/能被 Y」「資料被使用」這類被動包裝句?
187
- - 若使用反向說法,是否是為了和差異很大的系統做對比?下一句是否立刻接具體差異?
188
- - 每段是否至少有一個明確主詞與一個具體動作?
189
- - 形容詞是否能被證據支持?不能支持就刪掉或降級。
190
- - 是否用功能、流程、數據、限制取代口號?
191
- - 讀者看完是否知道下一步可以判斷、操作或相信什麼?
192
-
193
- ## 使用規則
194
-
195
- 當輸出中文內容時,先以本 Skill 掃描草稿。若草稿含有高風險 AI 腔句型,必須改寫為具體、可驗證、可交付的版本;除非使用者明確要求保留宣傳式、演講式或高度修辭化的語氣。