@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.
- package/dist/cli.js +125 -51
- package/package.json +1 -1
- package/template/core/CHANGELOG.md +73 -0
- package/template/core/engine/cli.mjs +6 -0
- package/template/core/engine/commands/_shared.mjs +9 -2
- package/template/core/engine/commands/deploy.mjs +3 -3
- package/template/core/engine/commands/dev.mjs +25 -2
- package/template/core/engine/commands/doctor.mjs +229 -0
- package/template/core/engine/commands/pdf.mjs +3 -3
- package/template/core/engine/commands/preview.mjs +4 -4
- package/template/core/engine/commands/upgrade.mjs +117 -0
- package/template/core/package.json +3 -1
- package/template/core/vite.config.ts +26 -11
- package/template/packs/academic-paper/document/chapters/01-introduction/content/01-introduction.mdx +21 -0
- package/template/packs/academic-paper/document/chapters/02-methods/content/01-methods.mdx +30 -0
- package/template/packs/academic-paper/document/chapters/03-results-and-discussion/content/01-results.mdx +29 -0
- package/template/packs/academic-paper/document/chapters/04-acknowledgment/content/01-acknowledgment.mdx +12 -0
- package/template/packs/academic-paper/document/chapters/05-references/content/01-references.mdx +27 -0
- package/template/packs/academic-paper/document/index.tsx +107 -0
- package/template/packs/academic-paper/document/openpress.config.mjs +26 -0
- package/template/packs/academic-paper/document/theme/page-surfaces/cover.css +267 -0
- package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/chapters/03-agent-skills-contributors/content/01-agent-skills-contributors.mdx +2 -3
- package/template/packs/editorial-monograph/document/components/ChapterOpenerVisual/index.tsx +76 -0
- package/template/packs/editorial-monograph/document/components/Page.tsx +27 -0
- package/template/packs/editorial-monograph/document/components/TokenSwatchGrid/index.tsx +46 -0
- package/template/packs/editorial-monograph/document/components/TokenSwatchGrid/style.css +63 -0
- package/template/packs/editorial-monograph/document/components/TypeSpecimen/index.tsx +38 -0
- package/template/packs/editorial-monograph/document/components/TypeSpecimen/style.css +111 -0
- package/template/packs/editorial-monograph/document/design.md +279 -0
- package/template/packs/editorial-monograph/document/media/README.md +13 -0
- package/template/packs/editorial-monograph/document/theme/README.md +11 -0
- package/template/packs/editorial-monograph/document/theme/base/page-contract.css +505 -0
- package/template/packs/editorial-monograph/document/theme/base/print.css +93 -0
- package/template/packs/editorial-monograph/document/theme/base/typography.css +336 -0
- package/template/packs/editorial-monograph/document/theme/fonts.css +3 -0
- package/template/packs/editorial-monograph/document/theme/page-surfaces/back-cover.css +43 -0
- package/template/packs/editorial-monograph/document/theme/page-surfaces/chapter-opener.css +205 -0
- package/template/packs/editorial-monograph/document/theme/page-surfaces/toc.css +139 -0
- package/template/packs/editorial-monograph/document/theme/patterns/_chart-frame.css +49 -0
- package/template/packs/editorial-monograph/document/theme/patterns/figure-grid.css +68 -0
- package/template/packs/editorial-monograph/document/theme/patterns/table-utilities.css +66 -0
- package/template/packs/editorial-monograph/document/theme/shell/reader-controls.css +761 -0
- package/template/packs/editorial-monograph/document/theme/tokens.css +80 -0
- package/template/packs/editorial-monograph/openpress.config.mjs +5 -0
- package/template/core/.turbo/turbo-test.log +0 -341
- package/template/skills/chinese-ai-writing-polish/SKILL.md +0 -195
- package/template/skills/claude-document/SKILL.md +0 -66
- package/template/skills/editorial-monograph/SKILL.md +0 -73
- package/template/skills/openpress/SKILL.md +0 -114
- package/template/skills/openpress/references/cli-commands.md +0 -31
- package/template/skills/openpress/references/local-review.md +0 -43
- package/template/skills/openpress-deploy/SKILL.md +0 -69
- package/template/skills/openpress-deploy/references/cloudflare-pages.md +0 -51
- package/template/skills/openpress-design/SKILL.md +0 -51
- package/template/skills/openpress-design/references/pdf-safe-css.md +0 -29
- package/template/skills/openpress-design/references/responsive-fixed-layout.md +0 -48
- package/template/skills/openpress-design/references/theme-and-components.md +0 -77
- package/template/skills/openpress-diagram-drawing/SKILL.md +0 -44
- package/template/skills/openpress-diagram-drawing/references/diagram-patterns.md +0 -93
- package/template/skills/openpress-document-hierarchy/SKILL.md +0 -81
- package/template/skills/openpress-document-hierarchy/agents/openai.yaml +0 -4
- package/template/skills/openpress-document-hierarchy/references/data-structures-outline.md +0 -115
- package/template/skills/openpress-init/SKILL.md +0 -84
- package/template/skills/openpress-style-pack-contributor/SKILL.md +0 -62
- package/template/skills/openpress-style-pack-contributor/references/starter-contract.md +0 -49
- package/template/skills/openpress-update/SKILL.md +0 -88
- package/template/skills/openpress-writing/SKILL.md +0 -68
- package/template/skills/openpress-writing/references/source-and-writing-rules.md +0 -120
- package/template/skills/teaching-notes-writing/SKILL.md +0 -54
- package/template/skills/teaching-notes-writing/references/programming.md +0 -65
- package/template/skills/teaching-notes-writing/references/teaching-patterns.md +0 -60
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/components/ChapterOpenerVisual/index.tsx +0 -0
- /package/template/{skills/claude-document/starter → packs/academic-paper}/document/components/Page.tsx +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/components/TokenSwatchGrid/index.tsx +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/components/TokenSwatchGrid/style.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/components/TypeSpecimen/index.tsx +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/components/TypeSpecimen/style.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/design.md +0 -0
- /package/template/{skills/claude-document/starter → packs/academic-paper}/document/media/README.md +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/README.md +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/base/page-contract.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/base/print.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/base/typography.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/fonts.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/page-surfaces/back-cover.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/page-surfaces/chapter-opener.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/page-surfaces/toc.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/patterns/_chart-frame.css +0 -0
- /package/template/{skills/claude-document/starter → packs/academic-paper}/document/theme/patterns/figure-grid.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/patterns/table-utilities.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/shell/reader-controls.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/document/theme/tokens.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/academic-paper}/openpress.config.mjs +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/chapters/01-document-shape/chapter.tsx +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/chapters/01-document-shape/content/01-document-shape.mdx +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/chapters/02-review-loop/chapter.tsx +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/chapters/02-review-loop/content/01-review-loop.mdx +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/components/ChapterOpenerVisual.tsx +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/claude-document}/document/components/Page.tsx +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/design.md +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/index.tsx +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/claude-document}/document/media/README.md +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/openpress.config.mjs +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/README.md +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/base/page-contract.css +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/base/print.css +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/base/typography.css +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/fonts.css +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/page-surfaces/back-cover.css +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/page-surfaces/chapter-opener.css +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/page-surfaces/cover.css +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/page-surfaces/toc.css +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/patterns/_chart-frame.css +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/claude-document}/document/theme/patterns/figure-grid.css +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/patterns/table-utilities.css +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/shell/reader-controls.css +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/document/theme/tokens.css +0 -0
- /package/template/{skills/claude-document/starter → packs/claude-document}/openpress.config.mjs +0 -0
- /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
- /package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/chapters/02-workflow/content/01-workflow.mdx +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/chapters/04-validation-deploy/content/01-validation-deploy.mdx +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/index.tsx +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/openpress.config.mjs +0 -0
- /package/template/{skills/editorial-monograph/starter → packs/editorial-monograph}/document/theme/page-surfaces/cover.css +0 -0
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: claude-document
|
|
3
|
-
description: Use when starting or applying a warm Claude-like A4 document style pack for polished notes, briefs, specs, research summaries, learning material, or structured working documents.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Claude Document
|
|
7
|
-
|
|
8
|
-
An open-press style pack for Claude-like working documents: warm paper, generous fixed pages, deep blue-gray headings, serif display titles, structured tables, concise figures, and calm editorial rhythm.
|
|
9
|
-
|
|
10
|
-
This is a **local style pack**. It is not an Anthropic brand package and should not imply official Claude or Anthropic affiliation.
|
|
11
|
-
|
|
12
|
-
## Visual Signature
|
|
13
|
-
|
|
14
|
-
- **Surface**: A4 fixed pages with a warm paper texture and subtle vertical rhythm.
|
|
15
|
-
- **Type**: serif display headings, sans body text, monospace code.
|
|
16
|
-
- **Color**: deep blue-gray ink, muted blue labels, warm hairlines, restrained block backgrounds.
|
|
17
|
-
- **Content components**: tables, figure captions, code blocks when needed, optional full-page chapter openers.
|
|
18
|
-
- **Pagination**: fixed page ratio; overflow is a content/component problem, not a reason to let pages grow.
|
|
19
|
-
|
|
20
|
-
## Suitable For
|
|
21
|
-
|
|
22
|
-
- polished working notes;
|
|
23
|
-
- product briefs, specs, and research summaries;
|
|
24
|
-
- learning material and internal documentation;
|
|
25
|
-
- public documents that need a calm, Claude-like editorial surface.
|
|
26
|
-
|
|
27
|
-
## Not Suitable For
|
|
28
|
-
|
|
29
|
-
- marketing landing pages;
|
|
30
|
-
- slide decks or 16:9 talks without changing page geometry tokens;
|
|
31
|
-
- dashboards or interactive app documentation.
|
|
32
|
-
|
|
33
|
-
## Related Packs
|
|
34
|
-
|
|
35
|
-
- `editorial-monograph` — hairline-driven, more formal long-form (whitepapers, monographs, academic-leaning). Choose it when the document is heavier and needs IBM-Carbon-style restraint instead of warm Claude tone.
|
|
36
|
-
|
|
37
|
-
## Apply To A Workspace
|
|
38
|
-
|
|
39
|
-
Use `openpress` to initialize a workspace with pack name `claude-document`. This skill only defines the pack's visual scope and starter content; `openpress` owns the command surface and validation workflow.
|
|
40
|
-
|
|
41
|
-
After applying, use `openpress` for source-boundary and command decisions. Typical editable source areas are:
|
|
42
|
-
|
|
43
|
-
- `document/index.tsx` — cover, TOC shell, back cover, metadata;
|
|
44
|
-
- `document/chapters/**/*.mdx` — content;
|
|
45
|
-
- `document/theme/tokens.css` — color, typography, spacing, page geometry;
|
|
46
|
-
- `document/design.md` — public style contract that future agents follow.
|
|
47
|
-
|
|
48
|
-
Content rules (table captions, figure numbering, etc.) live in `openpress-writing`; this skill does not redefine them.
|
|
49
|
-
|
|
50
|
-
## Do / Don't
|
|
51
|
-
|
|
52
|
-
Do:
|
|
53
|
-
|
|
54
|
-
- Keep figures focused on one concept, decision, or relationship.
|
|
55
|
-
- Prefer semantic figures, tables, and concise prose over decorative blocks.
|
|
56
|
-
- Keep chapter openers optional and use them only when major sections benefit from a book-like divider.
|
|
57
|
-
|
|
58
|
-
Don't:
|
|
59
|
-
|
|
60
|
-
- Put private names, customer data, deployment secrets, or project-specific author data in the starter.
|
|
61
|
-
- Shrink text below readable print size to hide overflow.
|
|
62
|
-
- Add large decorative gradients, dark sci-fi backgrounds, or brand-heavy visual noise.
|
|
63
|
-
|
|
64
|
-
## Deep Rules
|
|
65
|
-
|
|
66
|
-
The detailed rules live in `starter/document/design.md`. Once the pack is copied into a workspace, that file becomes the project-level design contract for both users and agents.
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: editorial-monograph
|
|
3
|
-
description: Use when starting or applying a quiet, hairline-driven A4 editorial style pack for long-form monographs, reports, proposals, whitepapers, product specs, or academic documents.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Editorial Monograph
|
|
7
|
-
|
|
8
|
-
A document style for **嚴肅長文**——日系簡約 + IBM Carbon hairline 風格的衍生,適合產品提案書、白皮書、研究報告、規格文件等需要 A4 印製、章節結構清楚、長段閱讀的場合。
|
|
9
|
-
|
|
10
|
-
This is a **style-pack skill**: it ships SKILL rules plus a runnable `starter/` document workspace (React/MDX entry, theme, design doc, sample chapters). Use `openpress` to initialize a workspace with pack name `editorial-monograph`; this skill does not own the command surface.
|
|
11
|
-
|
|
12
|
-
## Visual Signature
|
|
13
|
-
|
|
14
|
-
- **Type**: serif 章首(Noto Serif TC / Source Han Serif TC)+ sans body(IBM Plex Sans / PingFang TC)
|
|
15
|
-
- **Lines**: 1px hairline + dotted underline for links;不用 box-shadow / gradient
|
|
16
|
-
- **Color**: 黑白灰主體 + 三色 status accent(warn / success / info)+ chart palette(gold / coral / dark)
|
|
17
|
-
- **Layout**: A4 固定版面、章首占整頁、TOC 帶頁碼但不顯示 footer、可選章節 mini cover、figure / table 自動編號
|
|
18
|
-
- **Chapter numbering**: default `01 / 02 / 2.1`(pagination + CSS `::before`);可改 `一、二、(一)` 或 `Chapter 1 / §1.1`,token 與 selector 在 starter 內 `theme/base/typography.css` 與 `design.md` 的 Typography Scale / Chapter & Section Numbering 段
|
|
19
|
-
|
|
20
|
-
## Suitable For
|
|
21
|
-
|
|
22
|
-
- product proposal / business plan
|
|
23
|
-
- whitepaper / spec / requirements doc
|
|
24
|
-
- academic monograph / long-form research report
|
|
25
|
-
- editorial-format business report
|
|
26
|
-
|
|
27
|
-
## Not Suitable For
|
|
28
|
-
|
|
29
|
-
- slide deck(請改 page-geometry tokens 至 16:9 或另用 deck-oriented style pack)
|
|
30
|
-
- poster / one-pager
|
|
31
|
-
- marketing landing page
|
|
32
|
-
|
|
33
|
-
## Related Packs
|
|
34
|
-
|
|
35
|
-
- `claude-document` — warmer paper, Claude-like rhythm. Choose it when the document is closer to a working brief / spec / note than a formal monograph.
|
|
36
|
-
|
|
37
|
-
## Apply To A Workspace
|
|
38
|
-
|
|
39
|
-
Use `openpress` to initialize a target workspace with this pack. Then:
|
|
40
|
-
|
|
41
|
-
1. Fill `title` / `subtitle` / `organization` in `openpress.config.mjs` and `document/index.tsx`.
|
|
42
|
-
2. Ask `openpress` to choose the validation/export/render commands needed to confirm the workspace is healthy.
|
|
43
|
-
3. Use `openpress` for the source-boundary decision; typical editable source areas are `document/chapters/**/*.mdx` for content, `document/index.tsx` for cover/TOC/back-cover, and `document/theme/tokens.css` for visual tokens.
|
|
44
|
-
|
|
45
|
-
Content rules (table captions, figure numbering, etc.) live in `openpress-writing`; this skill does not redefine them.
|
|
46
|
-
|
|
47
|
-
## Do / Don't
|
|
48
|
-
|
|
49
|
-
**Do:**
|
|
50
|
-
|
|
51
|
-
- 換 brand color:改 `tokens.css` 內 `--openpress-chart-gold` 或新增 `--openpress-brand-accent`
|
|
52
|
-
- 換字體:改 `--openpress-font-serif` / `--openpress-font-body` 的字體棧;需要跨 mobile / iPad 穩定時,同步更新 `theme/fonts.css` 載入 webfont,不要只靠 `local(...)`
|
|
53
|
-
- 加新 page kind(divider / appendix-cover):在 `theme/page-surfaces/` 新增 CSS;已有 `chapter-opener` 可作書籍/教材章節 mini cover
|
|
54
|
-
- 換編號樣式(一、二、 or §1.1):改 `theme/base/typography.css` 的 `::before content`,搭 `@counter-style`
|
|
55
|
-
- 改 page 尺寸(B5 / Letter / 投影片):改 `tokens.css` 的 `--openpress-page-width` / `--openpress-page-height` / `--openpress-page-margin`
|
|
56
|
-
|
|
57
|
-
**Don't:**
|
|
58
|
-
|
|
59
|
-
- 不要把 inline emphasis color 改成自由色票(破壞語意系統);新狀態色票要先補 `--openpress-status-*` token 再用
|
|
60
|
-
- 不要在 `theme/base/typography.css` 內放單一 chart / specimen 的 CSS(那是 `document/components/<name>/` 的責任)
|
|
61
|
-
- 不要為了 dense 內容把字級縮太小;A4 body 正文不應低於 9.5pt
|
|
62
|
-
- 不要把 hairline 改成 2px 以上實線;style pack 的氣質就靠線細
|
|
63
|
-
|
|
64
|
-
## 深入設計規則
|
|
65
|
-
|
|
66
|
-
editorial-monograph 不單獨維護一份 reference/ 文件——所有規格都寫在 `starter/document/design.md` 內,跟著 starter 一起拷貝到 workspace 後變成該專案的 design document:
|
|
67
|
-
|
|
68
|
-
- 第 1 節 風格目標與使用場景 — 目標 / 適用場景 / 角色定義
|
|
69
|
-
- 第 2 節 Tokens — typography / color / spacing / page geometry / inline emphasis / chapter & section numbering
|
|
70
|
-
- 第 3 節 Components — page surfaces / text components / tables / figures / charts
|
|
71
|
-
- 第 4 節 CSS 權責
|
|
72
|
-
|
|
73
|
-
Agent 套用 skill 後,這份檔案就成為該專案 `document/design.md` 的內容;之後 user 想客製,直接改 design.md,不用回頭改 skill。
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: openpress
|
|
3
|
-
description: Use when operating a open-press workspace or framework checkout through CLI commands, discovering project status, validating/exporting/rendering/PDF output, inspecting structure/issues, searching or safely replacing source text, managing pending @openpress-comment markers, or deciding which open-press skill owns a task.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# open-press Core
|
|
7
|
-
|
|
8
|
-
open-press owns the tool surface and delivery boundaries. **Use this skill first** when the task involves the CLI, workspace status, generated output, or deciding which specialist skill should take over.
|
|
9
|
-
|
|
10
|
-
This skill is also the **single source of truth** for the source vs generated boundary. Other skills reference this section instead of re-listing paths.
|
|
11
|
-
|
|
12
|
-
## Responsibilities
|
|
13
|
-
|
|
14
|
-
- Choose safe open-press CLI commands.
|
|
15
|
-
- Define the canonical source vs framework vs generated path boundary (see below).
|
|
16
|
-
- Inspect workspace state before broad edits.
|
|
17
|
-
- Open and manage the local workbench review loop.
|
|
18
|
-
- Manage `@openpress-comment` markers (list, apply, resolve, clear).
|
|
19
|
-
- Route domain work to the owning skill.
|
|
20
|
-
- Require verification before declaring output ready.
|
|
21
|
-
|
|
22
|
-
## Skill Routing
|
|
23
|
-
|
|
24
|
-
open-press skills fall into three categories:
|
|
25
|
-
|
|
26
|
-
1. **System operation skills**: how to operate open-press itself. `openpress` is the main entry point; lifecycle helpers cover init, update, and deploy.
|
|
27
|
-
2. **Writing skills**: content strategy, suggested skeletons, language, tone, genre rules. They do not own CLI commands or validation depth.
|
|
28
|
-
3. **Style pack skills**: reusable visual starters under `skills/<pack>/starter/`. They do not own workspace operation.
|
|
29
|
-
|
|
30
|
-
| Skill | Owns |
|
|
31
|
-
| --- | --- |
|
|
32
|
-
| `openpress` | CLI, inspect/search/replace, source/generated boundary, validation/export/render/PDF command choice, `@openpress-comment` operations, skill routing |
|
|
33
|
-
| `openpress-init` | First-time intake conversation, style-pack recommendation, metadata gathering, running `init`, handing off to writing/design |
|
|
34
|
-
| `openpress-update` | Release upgrade flow: pulling new framework, CHANGELOG-driven migrations, post-upgrade verification |
|
|
35
|
-
| `openpress-writing` | Reader-facing content, narrative, captions, factual boundaries, portable writing skill loading |
|
|
36
|
-
| `openpress-document-hierarchy` | H1/H2/H3/H4 model, TOC depth, reader outline, appendix placement |
|
|
37
|
-
| `openpress-design` | Workspace visual system: `document/theme/`, `document/components/`, PDF-safe layout |
|
|
38
|
-
| `openpress-diagram-drawing` | Diagram semantics: nodes, arrows, labels, states, figure text |
|
|
39
|
-
| `openpress-deploy` | Deploy config, preflight, dry run, public publish confirmation |
|
|
40
|
-
| `openpress-style-pack-contributor` | Bundled packs under `skills/<pack>/starter/` (the upstream design, not workspace consumption) |
|
|
41
|
-
| Portable writing skills (`chinese-ai-writing-polish`, `teaching-notes-writing`, …) | Language, tone, genre, learner-facing rules. Loaded via `openpress-writing` |
|
|
42
|
-
|
|
43
|
-
## Source Boundary (canonical)
|
|
44
|
-
|
|
45
|
-
Edit source, not generated output. **This list is the single authoritative version**; other skills link here.
|
|
46
|
-
|
|
47
|
-
| Layer | Paths | Edit? |
|
|
48
|
-
| --- | --- | --- |
|
|
49
|
-
| Workspace source | `openpress.config.mjs`, `document/index.tsx`, `document/chapters/`, `document/design.md`, `document/theme/`, `document/components/`, `document/media/` | yes — domain skills |
|
|
50
|
-
| Skill / pack source | `skills/<pack>/SKILL.md`, `skills/<pack>/starter/**`, other skill files under `skills/` | yes — `openpress-style-pack-contributor` for packs; skill maintainers for own skill |
|
|
51
|
-
| Framework | `engine/`, `src/`, `tests/`, `docs/superpowers/`, `vite.config.ts`, `tsconfig.json`, `index.html` | yes — framework agents only |
|
|
52
|
-
| Generated | `public/openpress/`, `dist-react/`, `.deploy/`, `.openpress/` | **never hand-edit** |
|
|
53
|
-
|
|
54
|
-
If a workspace lacks `document/index.tsx`, run `node engine/cli.mjs migrate-to-react` before broad structural rewrites.
|
|
55
|
-
|
|
56
|
-
If `memory/AGENTS.md` exists, read it before framework-level `AGENTS.md`; it usually marks a downstream document workspace where `document/` is git-ignored project content, not source you commit upstream.
|
|
57
|
-
|
|
58
|
-
## Workflow
|
|
59
|
-
|
|
60
|
-
1. Orient: read `AGENTS.md`, `memory/AGENTS.md` if present, and the relevant specialist skill.
|
|
61
|
-
2. Inspect before broad edits with `inspect --json`, `search --json`, or `rg`.
|
|
62
|
-
3. Route domain work to the owning skill instead of duplicating its rules.
|
|
63
|
-
4. Edit only source paths in the owning area (see boundary table).
|
|
64
|
-
5. Verify with the narrowest command that proves the claim.
|
|
65
|
-
|
|
66
|
-
## Starting A New Workspace
|
|
67
|
-
|
|
68
|
-
Route to `openpress-init` for the intake conversation. The CLI itself is:
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
node engine/cli.mjs init <target> --skill <pack-name>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Style packs are auto-discovered from `skills/<pack>/SKILL.md` where `starter/` exists.
|
|
75
|
-
|
|
76
|
-
## Updating An Existing Workspace
|
|
77
|
-
|
|
78
|
-
Route to `openpress-update` for release-driven upgrades.
|
|
79
|
-
|
|
80
|
-
## @openpress-comment Operations
|
|
81
|
-
|
|
82
|
-
Pending `@openpress-comment` markers are source markers, not UI-only notes. Apply them as small source edits close to the marker, then remove the marker only after the comment is resolved or explicitly cleared.
|
|
83
|
-
|
|
84
|
-
Scope:
|
|
85
|
-
|
|
86
|
-
- List, apply, resolve, clear markers.
|
|
87
|
-
- Edit only the source file containing the marker (paths follow the Source Boundary table above).
|
|
88
|
-
- Route domain-heavy rewrites to the owning skill (writing / hierarchy / design / diagram).
|
|
89
|
-
- Do not rewrite unrelated sections while resolving one comment.
|
|
90
|
-
|
|
91
|
-
Operations:
|
|
92
|
-
|
|
93
|
-
| Need | Action |
|
|
94
|
-
| --- | --- |
|
|
95
|
-
| See pending comments | `rg "@openpress-comment" document -n` |
|
|
96
|
-
| Apply one comment | Edit nearby source, then delete that marker line |
|
|
97
|
-
| Clear one without applying | Delete that marker line only after the user asks |
|
|
98
|
-
| Clear all comments | Use the comments tab or delete all marker lines only after explicit confirmation |
|
|
99
|
-
| Comment is ambiguous | Ask for clarification and leave the marker in place |
|
|
100
|
-
|
|
101
|
-
After applying, run `npm run openpress:validate`; also run `npm run openpress:render` when layout, visual output, or React/MDX structure changed.
|
|
102
|
-
|
|
103
|
-
Common mistakes: do not clear a marker just because it was read; do not batch unrelated rewrites under one comment.
|
|
104
|
-
|
|
105
|
-
## When To Read References
|
|
106
|
-
|
|
107
|
-
- Read `references/cli-commands.md` when choosing commands, using search/replace, or explaining verification depth.
|
|
108
|
-
- Read `references/local-review.md` when opening the workbench, using Document/Design System/Project views, or coordinating visual review before export/deploy.
|
|
109
|
-
|
|
110
|
-
## Safety Rules
|
|
111
|
-
|
|
112
|
-
- Preview broad replacements before applying them.
|
|
113
|
-
- Do not publish without explicit user confirmation naming the target (handled by `openpress-deploy`).
|
|
114
|
-
- Do not claim render, PDF, or deploy readiness without fresh command output.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# open-press CLI Commands
|
|
2
|
-
|
|
3
|
-
Prefer package scripts in the framework checkout. Use direct `node engine/cli.mjs ...` when a downstream workspace lacks scripts or when a command has no script wrapper.
|
|
4
|
-
|
|
5
|
-
| Need | Command |
|
|
6
|
-
| --- | --- |
|
|
7
|
-
| Top-level usage | `node engine/cli.mjs --help` |
|
|
8
|
-
| Migrate legacy Markdown workspace to React/MDX | `node engine/cli.mjs migrate-to-react . --dry-run` |
|
|
9
|
-
| Validate structure and delivery gates | `npm run openpress:validate` |
|
|
10
|
-
| Export source to open-press JSON | `npm run openpress:export` |
|
|
11
|
-
| Build React reader | `npm run openpress:render` |
|
|
12
|
-
| Open local workbench | `npm run dev` |
|
|
13
|
-
| Preview production build | `npm run openpress:preview` |
|
|
14
|
-
| Generate PDF | `npm run openpress:pdf` |
|
|
15
|
-
| Inspect structure/issues as JSON | `node engine/cli.mjs inspect . --json` |
|
|
16
|
-
| Search public source text | `node engine/cli.mjs search . "<query>" --json` |
|
|
17
|
-
| Search all workspace source classes | `node engine/cli.mjs search . "<query>" --json --scope all` |
|
|
18
|
-
| List pending inspector comments | `rg "@openpress-comment" document -n` |
|
|
19
|
-
| Preview replacement without writing | `node engine/cli.mjs replace . "<from>" "<to>" --json` |
|
|
20
|
-
| Apply replacement after preview | `node engine/cli.mjs replace . "<from>" "<to>" --apply` |
|
|
21
|
-
| Dry-run deploy workflow | `npm run openpress:deploy:dry-run` |
|
|
22
|
-
| Publish after confirmation | use `openpress-deploy` |
|
|
23
|
-
|
|
24
|
-
Command notes:
|
|
25
|
-
|
|
26
|
-
- `search` and `replace` default to `--scope content`.
|
|
27
|
-
- Add `--scope all` to also include `document/design.md`, component, media, and theme source.
|
|
28
|
-
- Add `--case-sensitive` only when casing matters.
|
|
29
|
-
- `replace` previews by default and writes only with `--apply`.
|
|
30
|
-
- `replace` does not touch code blocks unless `--include-code` is provided.
|
|
31
|
-
- Per-command `--help` is not implemented yet; use top-level usage and command error messages.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Local Review
|
|
2
|
-
|
|
3
|
-
open-press local review is the human feedback loop before PDF or public deploy.
|
|
4
|
-
|
|
5
|
-
## Workflow
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm run openpress:export
|
|
9
|
-
npm run dev
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
Use the URL printed by Vite. It is usually:
|
|
13
|
-
|
|
14
|
-
```txt
|
|
15
|
-
http://127.0.0.1:5173/?dev=1
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
If `5173` is occupied, use the fallback port reported by the dev server.
|
|
19
|
-
|
|
20
|
-
## Workbench Views
|
|
21
|
-
|
|
22
|
-
- **Document**: reader-facing document.
|
|
23
|
-
- **Design System**: visual rules and specimens.
|
|
24
|
-
- **Project**: source inventory, components, media, and status.
|
|
25
|
-
|
|
26
|
-
After source edits:
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
npm run openpress:export
|
|
30
|
-
npm run openpress:validate
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
For renderer-sensitive visual, bookmark, or layout changes, also run:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npm run openpress:render
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Safety Rules
|
|
40
|
-
|
|
41
|
-
- A local preview is not deploy approval.
|
|
42
|
-
- Do not hand-edit generated output to fix preview issues.
|
|
43
|
-
- If preview is blank or stale, inspect export status, dev server output, and browser console before changing source content.
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: openpress-deploy
|
|
3
|
-
description: Use when preparing, configuring, checking, staging, or publishing a open-press document to public hosting, especially Cloudflare Pages, deploy setup, deploy buttons, deploy status, public release checks, or safe deployment workflow.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# open-press Deploy
|
|
7
|
-
|
|
8
|
-
open-press deploy owns the public-release gate. Use it only when the user asks to configure, inspect, dry-run, or publish a open-press document.
|
|
9
|
-
|
|
10
|
-
## Responsibilities
|
|
11
|
-
|
|
12
|
-
- Inspect deploy config in `openpress.config.mjs`.
|
|
13
|
-
- Check target adapter, staging source, project name, and confirmation settings.
|
|
14
|
-
- Run deploy preflight and dry runs.
|
|
15
|
-
- Keep secrets out of source files.
|
|
16
|
-
- Require explicit confirmation before publishing.
|
|
17
|
-
- Report public URL and PDF URL after successful deploy.
|
|
18
|
-
|
|
19
|
-
## Boundaries
|
|
20
|
-
|
|
21
|
-
- `openpress` owns generic CLI usage, non-deploy validation, local review, and the source/generated boundary.
|
|
22
|
-
- `openpress-writing` and `openpress-design` own document content and visual readiness.
|
|
23
|
-
- This skill owns public target confirmation and deploy execution.
|
|
24
|
-
|
|
25
|
-
## Public Deploy Rule
|
|
26
|
-
|
|
27
|
-
Never publish without a clear confirmation that names the target project.
|
|
28
|
-
|
|
29
|
-
Good confirmation shape:
|
|
30
|
-
|
|
31
|
-
```txt
|
|
32
|
-
This will publish the current open-press build to Cloudflare Pages project `<projectName>` from `<deploy.source>`.
|
|
33
|
-
Do you want me to deploy now?
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Preflight
|
|
37
|
-
|
|
38
|
-
Before real deploy, run the commands that prove the output is ready:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npm run openpress:export
|
|
42
|
-
npm run openpress:validate
|
|
43
|
-
npm run openpress:render
|
|
44
|
-
npm run openpress:pdf
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Also scan public-facing source for unfinished markers:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
rg "\\[TODO:|\\[FIX:|\\[DRAFT:" document/chapters document/design.md
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Deploy Commands
|
|
54
|
-
|
|
55
|
-
Dry run:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
npm run openpress:deploy:dry-run
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Publish after explicit confirmation:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
npm run openpress:deploy -- --confirm
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## When To Read References
|
|
68
|
-
|
|
69
|
-
- Read `references/cloudflare-pages.md` when creating or repairing Cloudflare Pages config, project setup, Wrangler auth expectations, or UI deploy-button behavior.
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# Cloudflare Pages Deploy
|
|
2
|
-
|
|
3
|
-
## Config Shape
|
|
4
|
-
|
|
5
|
-
Write confirmed deploy settings into `openpress.config.mjs`:
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
deploy: {
|
|
9
|
-
adapter: "cloudflare-pages",
|
|
10
|
-
source: ".deploy/<name>",
|
|
11
|
-
projectName: "<cloudflare-pages-project>",
|
|
12
|
-
commitDirty: false,
|
|
13
|
-
requiresConfirmation: true,
|
|
14
|
-
}
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Prefer an explicit `deploy.projectName`. If it is missing, ask the user to confirm the project name before writing config or creating a Cloudflare Pages project.
|
|
18
|
-
|
|
19
|
-
## Setup Workflow
|
|
20
|
-
|
|
21
|
-
1. Discover the workspace and load open-press config.
|
|
22
|
-
2. Confirm the document is intended for public hosting.
|
|
23
|
-
3. Inspect deploy config and derive the target:
|
|
24
|
-
- use explicit `deploy.projectName`;
|
|
25
|
-
- otherwise use a user-confirmed slug;
|
|
26
|
-
- do not invent and write a public target silently.
|
|
27
|
-
4. Ask whether to create a new Cloudflare Pages project or use an existing one.
|
|
28
|
-
5. Verify Wrangler auth outside source control.
|
|
29
|
-
6. Run dry run before real deploy.
|
|
30
|
-
|
|
31
|
-
If creating a new project, ask before running:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npx wrangler pages project create <projectName> --production-branch main
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Secrets
|
|
38
|
-
|
|
39
|
-
Do not write API tokens or secrets into open-press config, Markdown, `design.md`, or skill files.
|
|
40
|
-
|
|
41
|
-
## UI Deploy Button Contract
|
|
42
|
-
|
|
43
|
-
A UI deploy button is a review surface over the CLI workflow. It should:
|
|
44
|
-
|
|
45
|
-
- show target, source, and status before publishing;
|
|
46
|
-
- block when `deploy.projectName` is missing;
|
|
47
|
-
- require confirmation before posting to the deploy endpoint;
|
|
48
|
-
- call the same CLI-backed deploy path;
|
|
49
|
-
- show success URL, PDF URL, failure output, and dirty status.
|
|
50
|
-
|
|
51
|
-
It must not create a second hidden deployment behavior.
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: openpress-design
|
|
3
|
-
description: Use when designing or revising open-press visual systems, page rhythm, print/PDF-safe CSS, figure/table/chart presentation, covers, style packs, or document component recipes.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# open-press Design
|
|
7
|
-
|
|
8
|
-
open-press design owns the **workspace visual system** — the CSS and components that live in a user's `document/` after a pack has been initialized. It decides how the document looks while keeping fixed-layout, mobile, and PDF output stable.
|
|
9
|
-
|
|
10
|
-
## Responsibilities
|
|
11
|
-
|
|
12
|
-
- Choose typography, color, spacing, page rhythm, covers, figures, tables, and chart treatment.
|
|
13
|
-
- Edit `document/theme/`, `document/design.md`, and `document/components/` in a workspace.
|
|
14
|
-
- Decide when dense prose should become a reusable visual component.
|
|
15
|
-
- Keep `document/design.md` public-readable so users and agents can review the same rules.
|
|
16
|
-
- Preserve React reader output as the public reading surface; PDF is an export artifact.
|
|
17
|
-
|
|
18
|
-
## Boundaries (by path, not by topic)
|
|
19
|
-
|
|
20
|
-
| Path | Owner |
|
|
21
|
-
| --- | --- |
|
|
22
|
-
| `document/theme/`, `document/components/`, `document/design.md` (workspace) | **this skill** |
|
|
23
|
-
| `skills/<pack>/starter/document/theme/`, `…/components/`, `…/design.md` (upstream pack) | `openpress-style-pack-contributor` |
|
|
24
|
-
| `engine/`, `src/` (framework rendering) | framework agents only |
|
|
25
|
-
|
|
26
|
-
Other domain skills:
|
|
27
|
-
|
|
28
|
-
- `openpress-writing` owns claims, prose, audience, and captions as language.
|
|
29
|
-
- `openpress-diagram-drawing` owns diagram semantics; this skill owns visual skin.
|
|
30
|
-
- `openpress-deploy` owns public release.
|
|
31
|
-
|
|
32
|
-
Source paths follow `openpress` > Source Boundary.
|
|
33
|
-
|
|
34
|
-
## Hard Rules
|
|
35
|
-
|
|
36
|
-
- Avoid uncontrolled overflow into headers, footers, or fixed pages.
|
|
37
|
-
- Do not depend on local-only fonts when public, iPad, or PDF-stable output matters.
|
|
38
|
-
- Keep page-surface CSS, generic patterns, and component CSS in their owning layers.
|
|
39
|
-
|
|
40
|
-
## Workflow
|
|
41
|
-
|
|
42
|
-
1. Read `document/design.md` before changing theme or components.
|
|
43
|
-
2. Edit source CSS/components only (see `openpress` > Source Boundary).
|
|
44
|
-
3. Use `openpress` to choose validation depth.
|
|
45
|
-
4. For renderer-sensitive changes, ask `openpress` which render/inspect/local-review verification is needed before declaring the design ready.
|
|
46
|
-
|
|
47
|
-
## When To Read References
|
|
48
|
-
|
|
49
|
-
- Read `references/theme-and-components.md` before moving CSS layers, extracting components, changing `document/design.md`, or localizing page-surface defaults.
|
|
50
|
-
- Read `references/pdf-safe-css.md` before changing fixed page geometry, print behavior, or overflow-sensitive CSS.
|
|
51
|
-
- Read `references/responsive-fixed-layout.md` before changing mobile, tablet, zoom, spread, or responsive behavior.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# PDF-Safe CSS Notes
|
|
2
|
-
|
|
3
|
-
Use this reference when editing open-press CSS that affects fixed pages, PDF output, or renderer stability.
|
|
4
|
-
|
|
5
|
-
## Prefer
|
|
6
|
-
|
|
7
|
-
- fixed page geometry;
|
|
8
|
-
- container-relative type scales;
|
|
9
|
-
- explicit image dimensions or max dimensions;
|
|
10
|
-
- `break-inside: avoid` only for blocks that must stay together;
|
|
11
|
-
- table and figure captions outside the media object;
|
|
12
|
-
- CSS variables for theme values.
|
|
13
|
-
|
|
14
|
-
## Avoid
|
|
15
|
-
|
|
16
|
-
- viewport-width type for fixed-format content;
|
|
17
|
-
- uncontrolled `position: absolute` near footer/header;
|
|
18
|
-
- large nested cards;
|
|
19
|
-
- transform-based layout where measurement matters;
|
|
20
|
-
- SVG text for document copy unless the visual must be one fixed asset;
|
|
21
|
-
- mobile RWD changes that alter canonical PDF layout.
|
|
22
|
-
|
|
23
|
-
## PDF Export
|
|
24
|
-
|
|
25
|
-
PDF output is an export artifact. Do not embed the browser's built-in PDF viewer as the primary open-press reading surface; it introduces a second toolbar, second page model, and inconsistent navigation. The deployed reader should remain open-press-owned DOM.
|
|
26
|
-
|
|
27
|
-
## Design Skill Boundary
|
|
28
|
-
|
|
29
|
-
PDF-safe does not mean visually conservative. It means the chosen design must survive measurement, pagination, and rendering.
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Responsive Fixed-Layout Notes
|
|
2
|
-
|
|
3
|
-
Use this reference when editing open-press styles that affect mobile, tablet, zoom, spread mode, or responsive behavior.
|
|
4
|
-
|
|
5
|
-
## Core Principle
|
|
6
|
-
|
|
7
|
-
open-press pages have canonical page geometry. Responsive behavior should scale the page and surrounding workspace, not re-author the document for every viewport.
|
|
8
|
-
|
|
9
|
-
A deployed open-press reader should stay DOM-rendered and open-press-owned. Do not embed the browser PDF viewer to solve responsive problems; that adds a second reader UI and breaks the intended workspace model.
|
|
10
|
-
|
|
11
|
-
## Page Rules
|
|
12
|
-
|
|
13
|
-
- Keep one canonical width/height ratio for each page.
|
|
14
|
-
- Use CSS variables for page dimensions and derive scale from the available stage size.
|
|
15
|
-
- On narrow viewports, show one page at a time and scale the page down.
|
|
16
|
-
- On wide viewports, spread mode may show two pages if both fit without clipping.
|
|
17
|
-
- Preserve page order, anchors, bookmarks, figure indexes, and page numbers across breakpoints.
|
|
18
|
-
- do not reflow document copy into a different editorial structure on mobile.
|
|
19
|
-
|
|
20
|
-
## SVG Rules
|
|
21
|
-
|
|
22
|
-
- Inline SVG charts must keep a stable `viewBox` and use CSS `aspect-ratio` that matches that viewBox.
|
|
23
|
-
- SVG figures should use `display: block`, `max-width: 100%`, `height: auto`, and `overflow: visible`.
|
|
24
|
-
- Scale the SVG as one fixed graphic within the canonical page; do not reflow labels, legends, or axes per breakpoint.
|
|
25
|
-
- External SVG assets used through `<img>` should be constrained like other images: fixed frame, `object-fit: contain`, and explicit max dimensions.
|
|
26
|
-
|
|
27
|
-
## Workspace Rules
|
|
28
|
-
|
|
29
|
-
- The React open-press workbench shell may be responsive: side panels can collapse, navigation can become denser, and controls may hide secondary metadata.
|
|
30
|
-
- The document page itself should not change its typography hierarchy, captions, table structure, or figure composition just because the viewport changed.
|
|
31
|
-
- If text becomes too small on mobile, prefer pinch/zoom or horizontal-safe page scaling over rewriting the document layout.
|
|
32
|
-
- Keep a single scroll owner per viewport mode. Avoid nested vertical scrollbars between body, stage, and page.
|
|
33
|
-
|
|
34
|
-
## Avoid
|
|
35
|
-
|
|
36
|
-
- viewport-width font sizing inside fixed pages;
|
|
37
|
-
- mobile-specific page content order;
|
|
38
|
-
- breakpoints that alter canonical page pagination;
|
|
39
|
-
- iframe-based PDF readers as the central stage;
|
|
40
|
-
- CSS transforms that leave hit targets, bookmarks, or scroll sync using stale geometry.
|
|
41
|
-
|
|
42
|
-
## Acceptance Checklist
|
|
43
|
-
|
|
44
|
-
- Desktop, tablet, and mobile all show the same page count.
|
|
45
|
-
- Bookmark clicks land on the same logical page across breakpoints.
|
|
46
|
-
- Figures and tables retain captions and do not overflow.
|
|
47
|
-
- The page is scaled or positioned by the workspace, not redesigned by the viewport.
|
|
48
|
-
- There is no embedded browser PDF toolbar inside the open-press reader.
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# Theme And Component Boundaries
|
|
2
|
-
|
|
3
|
-
## Theme Layers
|
|
4
|
-
|
|
5
|
-
Use theme layers by responsibility:
|
|
6
|
-
|
|
7
|
-
| Layer | Owns |
|
|
8
|
-
| --- | --- |
|
|
9
|
-
| `document/theme/tokens.css` | variables only: colors, fonts, type scale, spacing, chart colors, shared numeric tokens |
|
|
10
|
-
| `document/theme/fonts.css` and `fonts/` | font-face sources copied to `/openpress/fonts.css` and `/openpress/fonts/` |
|
|
11
|
-
| `document/theme/base/` | global page contract, typography, figures, tables, captions, TOC, print safeguards |
|
|
12
|
-
| `document/theme/page-surfaces/` | whole-page layouts such as cover, TOC, optional chapter openers, back cover, divider pages |
|
|
13
|
-
| `document/theme/patterns/` | reusable document-wide class patterns |
|
|
14
|
-
| `document/theme/shell/` | exported reader controls around the document |
|
|
15
|
-
| `document/components/<name>/style.css` | instance-scoped component CSS |
|
|
16
|
-
|
|
17
|
-
Do not put page-surface or component-specific CSS in `base/typography.css`.
|
|
18
|
-
|
|
19
|
-
## Component Extraction
|
|
20
|
-
|
|
21
|
-
Prefer React components when a visual block has structured sub-elements, repeats with different props, or would otherwise become a large inline HTML island.
|
|
22
|
-
|
|
23
|
-
Component shape:
|
|
24
|
-
|
|
25
|
-
```txt
|
|
26
|
-
document/components/ComponentName.tsx
|
|
27
|
-
document/components/ComponentName/
|
|
28
|
-
index.tsx # default-exported React component
|
|
29
|
-
style.css # optional component-scoped CSS
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Use PascalCase component names so MDX can call them directly:
|
|
33
|
-
|
|
34
|
-
```mdx
|
|
35
|
-
<ProcessDiagram title="Deploy flow" steps={["Validate", "Render", "Deploy"]} />
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Props live in TypeScript types or interfaces next to the component. Do not add sidecar renderer, schema, data, or custom element bridge files.
|
|
39
|
-
|
|
40
|
-
Keep image grids inline when pagination owns their page-break behavior. Do not extract foundational page surfaces such as cover/back-cover/chapter-opener unless the design system does it as a coordinated React page-surface change.
|
|
41
|
-
|
|
42
|
-
## Page Surface Chrome
|
|
43
|
-
|
|
44
|
-
The renderer owns page chrome policy. Theme CSS should style the contract, not invent per-document footer hacks:
|
|
45
|
-
|
|
46
|
-
| Page kind | Theme surface | Footer |
|
|
47
|
-
| --- | --- | --- |
|
|
48
|
-
| `cover` | `page-surfaces/cover.css` | off |
|
|
49
|
-
| `toc` | `page-surfaces/toc.css` | off |
|
|
50
|
-
| `chapter-opener` | `page-surfaces/chapter-opener.css` when the pack supports book-like dividers | off |
|
|
51
|
-
| `content` | `base/typography.css` and patterns/components | on |
|
|
52
|
-
| `back-cover` | `page-surfaces/back-cover.css` | off |
|
|
53
|
-
|
|
54
|
-
Use `.reader-page.no-footer .page-frame` for layout rows when a surface has no footer. Do not leave empty footer text or hide meaningful generated page numbers with one-off selectors.
|
|
55
|
-
|
|
56
|
-
## Design Document Source
|
|
57
|
-
|
|
58
|
-
`document/design.md` is a single public-readable design brief. It should describe the same theme the document actually uses:
|
|
59
|
-
|
|
60
|
-
- typography hierarchy and scale;
|
|
61
|
-
- cover, TOC, optional chapter-opener, chapter, and back-cover direction;
|
|
62
|
-
- paragraphs, lists, quotes, callouts;
|
|
63
|
-
- image, image-grid, chart, table, caption, and dense-content stress cases.
|
|
64
|
-
|
|
65
|
-
Caption wording and numbering belong to `openpress-writing` and the renderer. Design may style `figcaption`, `caption`, and `[data-openpress-caption]`, but should not require authors to maintain figure/table numbers or duplicate caption text inside visuals.
|
|
66
|
-
|
|
67
|
-
Do not create a second hidden design brief unless the user explicitly asks for a sandbox.
|
|
68
|
-
|
|
69
|
-
## Localization Defaults
|
|
70
|
-
|
|
71
|
-
open-press engine does not embed a complete language system. Audit these per document:
|
|
72
|
-
|
|
73
|
-
- frontmatter `title:` on cover, TOC, and back cover;
|
|
74
|
-
- `theme/tokens.css` font stacks;
|
|
75
|
-
- `theme/base/typography.css` chapter and section numbering rules.
|
|
76
|
-
|
|
77
|
-
Workbench UI strings in `src/openpress/` are application UI and belong to framework work, not document styling.
|