@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,44 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: openpress-diagram-drawing
|
|
3
|
-
description: Use when drawing or revising open-press document diagrams, especially concept diagrams, comparison figures, process states, data-structure nodes, pointers, arrows, before/after states, linked lists, stacks, queues, trees, or memory relationship figures.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# open-press Diagram Drawing
|
|
7
|
-
|
|
8
|
-
This skill owns diagram semantics, not visual skin. It decides what the diagram should show and what text belongs inside the figure.
|
|
9
|
-
|
|
10
|
-
## Core Rule
|
|
11
|
-
|
|
12
|
-
Draw the relationship, not the explanation.
|
|
13
|
-
|
|
14
|
-
Figure bodies may contain only spatially meaningful information: object labels, pointer names, field names, axes, legends, short state labels, node values, `NULL`, and operation-order labels.
|
|
15
|
-
|
|
16
|
-
Move reasons, warnings, edge cases, teaching commentary, and interpretation into surrounding prose or captions.
|
|
17
|
-
|
|
18
|
-
## Responsibilities
|
|
19
|
-
|
|
20
|
-
- Choose whether a concept needs a diagram, table, code block, or prose.
|
|
21
|
-
- Define nodes, links, arrows, states, labels, and before/after relationships.
|
|
22
|
-
- Keep figure text lean and connected to position or direction.
|
|
23
|
-
- Prevent diagrams from containing answers, production notes, or caption-like sentences.
|
|
24
|
-
|
|
25
|
-
## Boundaries
|
|
26
|
-
|
|
27
|
-
- `openpress` owns validation/render command choice and the source/generated boundary.
|
|
28
|
-
- `openpress-design` owns visual skin, typography, CSS, and component implementation.
|
|
29
|
-
- `openpress-writing` owns the surrounding explanation and caption wording.
|
|
30
|
-
- `teaching-notes-writing` (loaded via `openpress-writing`) owns learner-facing practice flow.
|
|
31
|
-
|
|
32
|
-
## Workflow
|
|
33
|
-
|
|
34
|
-
1. Identify the diagram job: comparison, process state, relationship snapshot, before/after, operation sequence, traversal trace, or data representation.
|
|
35
|
-
2. Choose the surface:
|
|
36
|
-
- diagram for links, ownership, direction, state changes;
|
|
37
|
-
- table for dense comparisons or many trace rows;
|
|
38
|
-
- code block for exact syntax.
|
|
39
|
-
3. Draw from semantics first; let style follow.
|
|
40
|
-
4. Check whether the diagram can be understood without explanatory sentences inside the visual.
|
|
41
|
-
|
|
42
|
-
## When To Read References
|
|
43
|
-
|
|
44
|
-
- Read `references/diagram-patterns.md` for linked-list, circular-list, doubly-list, stack, queue, polynomial, sparse-structure, and tree drawing patterns.
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# Diagram Patterns
|
|
2
|
-
|
|
3
|
-
## Figure Text
|
|
4
|
-
|
|
5
|
-
Keep text inside a figure only when it anchors something spatial:
|
|
6
|
-
|
|
7
|
-
| Keep Inside | Move To Prose |
|
|
8
|
-
| --- | --- |
|
|
9
|
-
| `Before`, `After`, `插入前`, `插入後` | reasons a step matters |
|
|
10
|
-
| `first`, `top`, `prev`, `curr`, `next`, `NULL` | warnings and edge cases |
|
|
11
|
-
| field names, axis labels, legends | figure numbering or caption prose |
|
|
12
|
-
| short role labels | answers or hidden hints |
|
|
13
|
-
|
|
14
|
-
## Vocabulary
|
|
15
|
-
|
|
16
|
-
| Item | Draw As |
|
|
17
|
-
| --- | --- |
|
|
18
|
-
| data node | box split into fields |
|
|
19
|
-
| singly linked node | `data | next`, arrow leaves `next` |
|
|
20
|
-
| doubly linked node | `prev | data | next`, forward and backward lanes separated |
|
|
21
|
-
| header/dummy node | normal node with `head` or `dummy` role |
|
|
22
|
-
| external pointer | label with arrow to a node |
|
|
23
|
-
| field link | arrow from field to target node |
|
|
24
|
-
| traversal | pointer labels moving between states |
|
|
25
|
-
| `NULL` | terminal label or terminator mark |
|
|
26
|
-
|
|
27
|
-
## Linked List Patterns
|
|
28
|
-
|
|
29
|
-
Basic list:
|
|
30
|
-
|
|
31
|
-
- Draw each node as `data | next`.
|
|
32
|
-
- Last `next` points to `NULL`.
|
|
33
|
-
- Use `first`, `data`, `next`, and `NULL` as figure labels.
|
|
34
|
-
|
|
35
|
-
Insert after:
|
|
36
|
-
|
|
37
|
-
- Use two aligned states: `p -> q` and `p -> x -> q`.
|
|
38
|
-
- If showing update order, number only changed links:
|
|
39
|
-
1. `x->next = q`
|
|
40
|
-
2. `p->next = x`
|
|
41
|
-
|
|
42
|
-
Delete after:
|
|
43
|
-
|
|
44
|
-
- Use two aligned states: `p -> q -> r` and `p -> r`.
|
|
45
|
-
- If the removed node remains visible, ghost it or mark it removed.
|
|
46
|
-
|
|
47
|
-
Reverse:
|
|
48
|
-
|
|
49
|
-
- Show `prev`, `curr`, and `next` as pointer labels, not data nodes.
|
|
50
|
-
- Use a short sequence or table for repeated iterations.
|
|
51
|
-
|
|
52
|
-
## Circular And Doubly Linked Lists
|
|
53
|
-
|
|
54
|
-
Circular return links should look intentional:
|
|
55
|
-
|
|
56
|
-
- route return links outside the node group;
|
|
57
|
-
- avoid diagonal clutter over labels;
|
|
58
|
-
- for one-node circular lists, draw a small self-loop.
|
|
59
|
-
|
|
60
|
-
When using `last` as the entry pointer, show both `last` and `last->next`.
|
|
61
|
-
|
|
62
|
-
Doubly linked lists:
|
|
63
|
-
|
|
64
|
-
- separate forward and backward lanes;
|
|
65
|
-
- insertion between `x` and `y` shows four relationships:
|
|
66
|
-
- `p->prev = x`
|
|
67
|
-
- `p->next = y`
|
|
68
|
-
- `x->next = p`
|
|
69
|
-
- `y->prev = p`
|
|
70
|
-
|
|
71
|
-
## Stack, Queue, Polynomial, Sparse, Tree
|
|
72
|
-
|
|
73
|
-
Linked stack:
|
|
74
|
-
|
|
75
|
-
- `top` points to the first node.
|
|
76
|
-
- push is insert-at-front; pop is remove-at-front.
|
|
77
|
-
|
|
78
|
-
Linked queue:
|
|
79
|
-
|
|
80
|
-
- `front` points to the next node to delete.
|
|
81
|
-
- `rear` points to the last node.
|
|
82
|
-
- show both when the invariant depends on both.
|
|
83
|
-
|
|
84
|
-
Polynomial and sparse structures:
|
|
85
|
-
|
|
86
|
-
- use tables for dense coefficient arrays or matrix positions;
|
|
87
|
-
- use diagrams only for stored nonzero nodes.
|
|
88
|
-
|
|
89
|
-
Trees:
|
|
90
|
-
|
|
91
|
-
- label parent/child relationships clearly;
|
|
92
|
-
- use traversal diagrams only when node order or pointer movement is the point;
|
|
93
|
-
- avoid turning a tree diagram into a paragraph.
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: openpress-document-hierarchy
|
|
3
|
-
description: Use when planning, restructuring, or extending a open-press long-form document, handout, textbook, study guide, reference manual, or course note that needs a stable H1/H2/H3/H4 semantic hierarchy, table of contents depth, reader outline depth, chapter grouping, appendix placement, or multi-unit document structure.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# open-press Document Hierarchy
|
|
7
|
-
|
|
8
|
-
This skill owns the **document skeleton**: visible heading levels, formal TOC depth, reader outline depth, chapter grouping, and appendix placement. It does not own prose, visual style, figure design, or component implementation.
|
|
9
|
-
|
|
10
|
-
## When To Enter This Skill
|
|
11
|
-
|
|
12
|
-
`openpress-writing` is the default entry point for content work. Route here when the work involves any of:
|
|
13
|
-
|
|
14
|
-
- Adding or removing an H2 chapter, or splitting one chapter into two.
|
|
15
|
-
- Promoting / demoting headings across H2 / H3 / H4.
|
|
16
|
-
- Changing TOC depth or reader outline depth.
|
|
17
|
-
- Reorganizing appendices, or deciding what becomes an appendix vs an inline section.
|
|
18
|
-
- Auditing H4 granularity (too many vs too few sub-sections).
|
|
19
|
-
|
|
20
|
-
Hand back to `openpress-writing` once the structure is settled — prose, captions, exercises, and explanation order are not this skill's job.
|
|
21
|
-
|
|
22
|
-
Use `openpress` for CLI inspection, source search, and validation. This skill decides the heading model; it does not decide the command surface.
|
|
23
|
-
|
|
24
|
-
## Hierarchy Contract
|
|
25
|
-
|
|
26
|
-
Map document content to headings by semantic role:
|
|
27
|
-
|
|
28
|
-
| Level | Meaning | open-press behavior |
|
|
29
|
-
| --- | --- | --- |
|
|
30
|
-
| `#` | Whole document title only | Use on cover or document identity; do not use inside normal content files |
|
|
31
|
-
| `##` | Formal chapter / document unit | Enters the formal TOC; starts a major reader section |
|
|
32
|
-
| `###` | Major topic group inside a chapter | Enters the formal TOC; use for concepts readers should scan before reading |
|
|
33
|
-
| `####` | Concrete algorithm, operation, theorem, variant, or worked procedure | Enters reader outline/bookmarks; normally stays out of the formal TOC |
|
|
34
|
-
| Body blocks | Concept, table, figure, pseudocode, code, trace, practice | Do the explanation work; do not encode hierarchy by font size alone |
|
|
35
|
-
|
|
36
|
-
When a document becomes a full book or multi-unit reference, avoid promoting every algorithm to `##`. A stable long-form document usually has few H2 chapters, several H3 topic groups, and many H4 implementation items.
|
|
37
|
-
|
|
38
|
-
## H4 Granularity
|
|
39
|
-
|
|
40
|
-
Use H4 for a complete teachable unit, not for every local teaching block.
|
|
41
|
-
|
|
42
|
-
- Keep one H4 when the blocks share the same operation, invariant, or algorithm.
|
|
43
|
-
- Merge adjacent H4s when one only adds the table, figure, trace, pseudocode, or C-like code for the same topic.
|
|
44
|
-
- Do not make repeated local `小測驗` headings into H4; use a bold paragraph or exercise block unless the whole section is an assessment chapter.
|
|
45
|
-
- Prefer 3-7 H4 items under one H3. If an H3 needs many more, first check whether the H3 should split or whether the H4s are too granular.
|
|
46
|
-
- Keep terminology natural for programming topics. Use names such as `Linked List`, `Linked Queue`, `Header Node`, or `BST` when those are clearer than forced translation.
|
|
47
|
-
|
|
48
|
-
## Authoring Workflow
|
|
49
|
-
|
|
50
|
-
1. Identify the whole document scope from the user request and existing metadata.
|
|
51
|
-
2. Choose H2 chapters first. For source material already organized by chapters or units, one source chapter usually becomes one H2, such as `CH4 Linked List`, `CH5 Tree`, `CH6 Graph`, `CH7 Sorting`.
|
|
52
|
-
3. Group each H2 into H3 topic groups that belong in the public TOC.
|
|
53
|
-
4. Move named algorithms, operations, theorem items, and implementation variants to H4.
|
|
54
|
-
5. Merge H4s that only separate conceptual explanation from the worked trace or implementation of the same operation.
|
|
55
|
-
6. Keep explanations, edge cases, teaching notes, and reasons in body prose, tables, figures, or code blocks.
|
|
56
|
-
7. Put internal planning, style-pack rules, and agent guidance in `skills/`, `memory/`, or `document/design.md`, not in public chapter MDX.
|
|
57
|
-
8. When hierarchy changes also affect explanation order, exercise design, captions, or student-facing wording, hand that part back to `openpress-writing` and the appropriate portable writing skill.
|
|
58
|
-
|
|
59
|
-
## File Strategy
|
|
60
|
-
|
|
61
|
-
open-press scans `document/chapters/<NN-slug>/content/*.mdx` in chapter/file order. Chapter directories are durable editing units; file boundaries inside a chapter are editing boundaries, not necessarily book hierarchy boundaries.
|
|
62
|
-
|
|
63
|
-
- A long H2 chapter may span multiple files.
|
|
64
|
-
- Only the first file of that chapter needs the `##` heading.
|
|
65
|
-
- Later files in the same chapter may start with `###` or `####`.
|
|
66
|
-
- Use filename prefixes for ordering, not for visible hierarchy.
|
|
67
|
-
- Frontmatter `title:` is an editor/source label; visible book structure is defined by Markdown headings.
|
|
68
|
-
|
|
69
|
-
## Data Structures Notes
|
|
70
|
-
|
|
71
|
-
When the document is a data structures note, read `references/data-structures-outline.md` for the preferred H2/H3/H4 model. Treat it as structure memory, not public content.
|
|
72
|
-
|
|
73
|
-
## Completion Check
|
|
74
|
-
|
|
75
|
-
Before finishing a structure pass:
|
|
76
|
-
|
|
77
|
-
- use `openpress` for source scanning, validation, export, or render commands;
|
|
78
|
-
- inspect headings and confirm the semantic structure matches the intended H2/H3/H4 model;
|
|
79
|
-
- confirm public TOC is not overloaded with H4-level algorithm names;
|
|
80
|
-
- confirm reader outline H4s are not dominated by tiny code fragments, figure labels, or repeated quiz labels;
|
|
81
|
-
- confirm H2 chapters can scale when new units are added.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "open-press Document Hierarchy"
|
|
3
|
-
short_description: "Plan and revise long-form open-press heading hierarchy"
|
|
4
|
-
default_prompt: "Use this skill to structure a open-press long-form document into H2 chapters, H3 topic groups, and H4 algorithms, procedures, or worked items."
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
# Data Structures Document Outline
|
|
2
|
-
|
|
3
|
-
Use this outline when expanding a open-press document from one data-structure topic into a full data structures note. Keep it as authoring memory; do not copy it into public pages as an internal plan.
|
|
4
|
-
|
|
5
|
-
## Heading Model
|
|
6
|
-
|
|
7
|
-
- `## CH4 Linked List`
|
|
8
|
-
- `### List、Node 與 Pointer`
|
|
9
|
-
- `### Singly Linked List`
|
|
10
|
-
- `#### Insert`
|
|
11
|
-
- `#### Delete`
|
|
12
|
-
- `#### Search`
|
|
13
|
-
- `#### Reverse`
|
|
14
|
-
- `#### Concatenate`
|
|
15
|
-
- `### Linked Stack 與 Linked Queue`
|
|
16
|
-
- `#### Linked Stack push / pop`
|
|
17
|
-
- `#### Linked Queue add / delete`
|
|
18
|
-
- `### Circular Linked List 與 Header Node`
|
|
19
|
-
- `#### first / last entry design`
|
|
20
|
-
- `#### Circular delete`
|
|
21
|
-
- `#### Header Node operations`
|
|
22
|
-
- `#### Josephus problem`
|
|
23
|
-
- `### Polynomial 與 Sparse Matrix`
|
|
24
|
-
- `#### Polynomial add`
|
|
25
|
-
- `#### Polynomial multiply`
|
|
26
|
-
- `#### Sparse matrix representation`
|
|
27
|
-
- `### Doubly Linked List`
|
|
28
|
-
- `#### Insert`
|
|
29
|
-
- `#### Delete`
|
|
30
|
-
- `#### Circular Doubly Linked List`
|
|
31
|
-
- `### Practice`
|
|
32
|
-
|
|
33
|
-
Keep chapter-local exercises and mock quizzes inside `### Practice` unless the assessment is large enough to become its own chapter. When the document grows into a multi-chapter book, prefer one of these patterns:
|
|
34
|
-
|
|
35
|
-
- chapter-local practice inside each H2 chapter;
|
|
36
|
-
- a global `## Practice` chapter for cumulative exercises;
|
|
37
|
-
- a global `## Answer Appendix` chapter with H3 groups per source chapter.
|
|
38
|
-
|
|
39
|
-
- `## CH5 Tree`
|
|
40
|
-
- `### Tree Theorems`
|
|
41
|
-
- `#### Theorem 1`
|
|
42
|
-
- `#### Theorem 2`
|
|
43
|
-
- `#### Theorem 3`
|
|
44
|
-
- `### Traversal`
|
|
45
|
-
- `#### Recursive traversal`
|
|
46
|
-
- `#### Non-recursive traversal`
|
|
47
|
-
- `#### Level-order traversal`
|
|
48
|
-
- `### Heap`
|
|
49
|
-
- `#### insert heap`
|
|
50
|
-
- `#### delete heap`
|
|
51
|
-
- `### Binary Search Tree`
|
|
52
|
-
- `#### BST search`
|
|
53
|
-
- `#### BST insert`
|
|
54
|
-
- `#### BST delete`
|
|
55
|
-
- `#### Copy tree`
|
|
56
|
-
- `#### Verify equal trees`
|
|
57
|
-
- `#### Count nodes`
|
|
58
|
-
- `#### Count leaves`
|
|
59
|
-
- `### AVL Tree`
|
|
60
|
-
- `#### Left rotate`
|
|
61
|
-
- `#### Right rotate`
|
|
62
|
-
- `#### AVL insert`
|
|
63
|
-
- `#### AVL delete`
|
|
64
|
-
- `### Expression Conversion`
|
|
65
|
-
- `#### Infix to prefix`
|
|
66
|
-
- `#### Infix to postfix`
|
|
67
|
-
|
|
68
|
-
- `## CH6 Graph`
|
|
69
|
-
- `### DFS 與 BFS`
|
|
70
|
-
- `#### DFS`
|
|
71
|
-
- `#### DFS non-recursive`
|
|
72
|
-
- `#### BFS`
|
|
73
|
-
- `### Minimum Spanning Tree`
|
|
74
|
-
- `#### Kruskal`
|
|
75
|
-
- `#### Cycle detection by mask`
|
|
76
|
-
- `#### Union and Find`
|
|
77
|
-
- `#### Prim`
|
|
78
|
-
- `### Shortest Path`
|
|
79
|
-
- `#### Single-source shortest path Dijkstra`
|
|
80
|
-
- `#### All pairs shortest paths`
|
|
81
|
-
- `### Transitive Closure`
|
|
82
|
-
|
|
83
|
-
- `## CH7 Sorting`
|
|
84
|
-
- `### Elementary Sorts`
|
|
85
|
-
- `#### Selection sort`
|
|
86
|
-
- `#### Bubble sort`
|
|
87
|
-
- `#### Insertion sort`
|
|
88
|
-
- `### Quick Sort`
|
|
89
|
-
- `#### Recursive quick sort`
|
|
90
|
-
- `#### Non-recursive quick sort`
|
|
91
|
-
- `### Merge Sort`
|
|
92
|
-
- `#### Recursive merge sort`
|
|
93
|
-
- `#### Non-recursive merge sort`
|
|
94
|
-
- `### Heap Sort`
|
|
95
|
-
|
|
96
|
-
- `## Appendix A: C/C++ Programming Notes`
|
|
97
|
-
- `### Pointer Basics`
|
|
98
|
-
- `### Arrays and Strings`
|
|
99
|
-
- `### Function Parameters`
|
|
100
|
-
|
|
101
|
-
Keep C/C++ syntax and programming-language refreshers in an appendix when they are reused across multiple data-structure chapters. Do not attach them to `CH4 Linked List` unless the note is intentionally a single-chapter handout.
|
|
102
|
-
|
|
103
|
-
## Teaching Block Pattern
|
|
104
|
-
|
|
105
|
-
For an H4 algorithm/procedure, prefer this order:
|
|
106
|
-
|
|
107
|
-
1. Problem statement with input and output.
|
|
108
|
-
2. Data representation or invariant.
|
|
109
|
-
3. Pseudocode.
|
|
110
|
-
4. Worked trace or diagram.
|
|
111
|
-
5. C-like implementation.
|
|
112
|
-
6. Complexity and common mistake.
|
|
113
|
-
7. One practice prompt when useful.
|
|
114
|
-
|
|
115
|
-
Keep these blocks inside the same H4 when they teach the same operation. For example, a trace table and the final C-like code for `Polynomial add` should not become separate H4 headings unless they are genuinely different topics.
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: openpress-init
|
|
3
|
-
description: Use when the user wants to start a new open-press project, set up a fresh document workspace, pick a style pack for a new document, bootstrap a new proposal/whitepaper/teaching-note/spec/book, or run the first-time initialization conversation before any content is written.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# open-press Init
|
|
7
|
-
|
|
8
|
-
This skill owns the **conversation that happens before `openpress init` runs**. Its job is to gather the minimum context needed to pick the right style pack and fill the right metadata, then hand off to downstream skills.
|
|
9
|
-
|
|
10
|
-
It does not own writing, design, hierarchy, or deploy decisions — those belong to their specialist skills and only come into play after init completes.
|
|
11
|
-
|
|
12
|
-
## When To Enter
|
|
13
|
-
|
|
14
|
-
Activate when the user says any of:
|
|
15
|
-
|
|
16
|
-
- "新開一個 open-press 專案 / 文件"
|
|
17
|
-
- "start a new open-press doc / project"
|
|
18
|
-
- "我想寫一份 [提案 / 白皮書 / 論文 / 講義 / spec / 報告 / 書]"
|
|
19
|
-
- "幫我起手"
|
|
20
|
-
- Any request that implies an empty target directory and no chosen pack yet.
|
|
21
|
-
|
|
22
|
-
Do **not** activate when the workspace already has `document/` populated. In that case route to the appropriate domain skill instead.
|
|
23
|
-
|
|
24
|
-
## Required Intake Questions
|
|
25
|
-
|
|
26
|
-
Ask these before running `init`. Batch them; do not ask one at a time.
|
|
27
|
-
|
|
28
|
-
| Question | Used to decide |
|
|
29
|
-
| --- | --- |
|
|
30
|
-
| 文件類型(提案 / 白皮書 / 論文 / 教學講義 / 工作筆記 / brief / spec / 書 / 其他) | Style pack recommendation, hierarchy expectation |
|
|
31
|
-
| 目標讀者(內部團隊 / 客戶 / 學生 / 學術 / 公眾) | Tone register, portable skill triggers |
|
|
32
|
-
| 主要語言(繁體中文 / English / 雙語) | Whether `chinese-ai-writing-polish` will load downstream |
|
|
33
|
-
| 規模(單頁 brief / 多章長文 / 完整書 / 系列課程) | Style pack fit, chapter scaffold |
|
|
34
|
-
| Metadata: `title` / `subtitle` / `organization` / `author` | Written directly into `openpress.config.mjs` and `document/index.tsx` |
|
|
35
|
-
|
|
36
|
-
If the user already supplied any of these in the request, do not re-ask — only ask the gaps.
|
|
37
|
-
|
|
38
|
-
## Optional Questions (Ask Only When Relevant)
|
|
39
|
-
|
|
40
|
-
- 是否需要 PDF 輸出(默認需要,僅在使用者明確只要 web 時跳過 PDF preflight)
|
|
41
|
-
- 是否預定公開部署(會引入 `openpress-deploy` 後續流程)
|
|
42
|
-
- 目標完成日期(影響後續工作節奏建議,不影響 init 本身)
|
|
43
|
-
|
|
44
|
-
## Style Pack Recommendation
|
|
45
|
-
|
|
46
|
-
Map answers to pack choice:
|
|
47
|
-
|
|
48
|
-
| 文件類型 + 規模 | 建議 pack |
|
|
49
|
-
| --- | --- |
|
|
50
|
-
| 提案書 / 白皮書 / 論文 / spec / 規格 / 多章長文 | `editorial-monograph` |
|
|
51
|
-
| 工作筆記 / brief / 研究摘要 / 教學講義 / 內部備忘 / 單頁到中等長度 | `claude-document` |
|
|
52
|
-
| 兩者邊界模糊時 | 給使用者兩個選項,附簡短差異描述(hairline vs warm paper),讓使用者選 |
|
|
53
|
-
|
|
54
|
-
當未來有更多 pack 時,更新這張表並同步 `openpress-style-pack-contributor`。
|
|
55
|
-
|
|
56
|
-
## Workflow
|
|
57
|
-
|
|
58
|
-
1. Read the user's opening message; extract any answers already given.
|
|
59
|
-
2. Ask only the **missing** intake questions in one batch.
|
|
60
|
-
3. Confirm style pack choice with one sentence of rationale (e.g. 「多章長白皮書 → 建議 `editorial-monograph`,hairline 風格適合長段閱讀」).
|
|
61
|
-
4. Run init via `openpress`:
|
|
62
|
-
```bash
|
|
63
|
-
node engine/cli.mjs init <target> --skill <pack>
|
|
64
|
-
```
|
|
65
|
-
`<target>` defaults to current workspace when empty; ask if unsure.
|
|
66
|
-
5. Fill metadata: edit `openpress.config.mjs` (title/subtitle/organization/author) and the same fields in `document/index.tsx` cover props.
|
|
67
|
-
6. Run `node engine/cli.mjs validate <target>` to confirm the workspace is healthy.
|
|
68
|
-
7. Hand off:
|
|
69
|
-
- Tell the user what to edit next (`document/chapters/`, `document/index.tsx`, `document/theme/tokens.css`).
|
|
70
|
-
- Name which downstream skill will pick up next requests: writing → `openpress-writing`, design → `openpress-design`, structure → `openpress-document-hierarchy`, deploy → `openpress-deploy`.
|
|
71
|
-
- If 語言 is 繁體中文, mention that `chinese-ai-writing-polish` will load automatically during writing.
|
|
72
|
-
- If 文件類型 is 教學講義, mention that `teaching-notes-writing` will load.
|
|
73
|
-
|
|
74
|
-
## Boundaries
|
|
75
|
-
|
|
76
|
-
- `openpress` owns the `init` CLI itself and the source/generated boundary. This skill asks the questions; `openpress` runs the command.
|
|
77
|
-
- `openpress-style-pack-contributor` owns designing new packs. This skill only consumes existing packs.
|
|
78
|
-
- `openpress-writing` / `openpress-design` / `openpress-document-hierarchy` take over after init completes.
|
|
79
|
-
|
|
80
|
-
## Do Not
|
|
81
|
-
|
|
82
|
-
- Do not run `init` before metadata is gathered. An empty workspace with `[TODO]` placeholders in cover is a worse starting state than a 30-second intake conversation.
|
|
83
|
-
- Do not pick a style pack for the user when the answer is ambiguous; offer the two candidates.
|
|
84
|
-
- Do not start writing content during init. Hand off cleanly.
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: openpress-style-pack-contributor
|
|
3
|
-
description: Use when contributing, designing, creating, reviewing, or improving a open-press style pack, especially the visual philosophy, starter workspace, design doc, theme tokens, page surfaces, components, and validation for skills/<pack>/starter.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# open-press Style Pack Contributor
|
|
7
|
-
|
|
8
|
-
This skill owns **bundled style packs at the source** — everything under `skills/<pack>/`. A style pack is an opinionated document design system plus a runnable starter workspace. Use `openpress` for the exact init, validate, export, render, and scratch-workspace commands.
|
|
9
|
-
|
|
10
|
-
The split with `openpress-design` is by path, not by topic:
|
|
11
|
-
|
|
12
|
-
- `skills/<pack>/starter/document/…` → this skill (upstream, ships to every new workspace).
|
|
13
|
-
- `document/…` in an end-user workspace → `openpress-design` (downstream, one project's local edits).
|
|
14
|
-
|
|
15
|
-
## Responsibilities
|
|
16
|
-
|
|
17
|
-
- Define one clear visual philosophy for the pack.
|
|
18
|
-
- Edit only `skills/<pack>/` unless the framework lacks a generic capability.
|
|
19
|
-
- Provide a runnable `starter/` that the system-level `openpress` skill can initialize into a fresh target.
|
|
20
|
-
- Keep starter `design.md` public-readable.
|
|
21
|
-
- Preserve portable typography contracts: `theme/tokens.css` names `--openpress-font-*` tokens, `theme/fonts.css` loads faces, and `local(...)` alone is not enough for stable public output.
|
|
22
|
-
- Validate the pack through a scratch workspace (do not overwrite the user's current `document/`).
|
|
23
|
-
|
|
24
|
-
## Boundaries
|
|
25
|
-
|
|
26
|
-
- `openpress` owns CLI command choice and the source/generated boundary table.
|
|
27
|
-
- `openpress-design` owns the same visual concerns but in workspace `document/`, not pack `starter/`.
|
|
28
|
-
- `openpress-writing` owns starter content prose and factual boundaries.
|
|
29
|
-
|
|
30
|
-
## Pack Layout
|
|
31
|
-
|
|
32
|
-
```txt
|
|
33
|
-
skills/<pack>/
|
|
34
|
-
SKILL.md # visual signature, suitable-for, do/don't
|
|
35
|
-
starter/
|
|
36
|
-
openpress.config.mjs
|
|
37
|
-
document/
|
|
38
|
-
index.tsx
|
|
39
|
-
chapters/
|
|
40
|
-
design.md
|
|
41
|
-
theme/
|
|
42
|
-
components/
|
|
43
|
-
media/
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Do not put generated output, private content, customer data, secrets, or deployment artifacts in a style pack.
|
|
47
|
-
|
|
48
|
-
## Workflow
|
|
49
|
-
|
|
50
|
-
1. Define intended document types, readers, and visual philosophy.
|
|
51
|
-
2. Keep the pack narrow; one pack should not serve every tone or industry.
|
|
52
|
-
3. Build or update `starter/`.
|
|
53
|
-
4. Ask `openpress` to choose and run the scratch-workspace validation workflow.
|
|
54
|
-
5. Ask `openpress` for broader framework checks only when shared code changes.
|
|
55
|
-
|
|
56
|
-
## Cross-Pack Discovery
|
|
57
|
-
|
|
58
|
-
When adding a new pack, also update sibling pack SKILLs that overlap in audience so users can choose between them. Each pack SKILL should at minimum list its **suitable / not suitable** scope.
|
|
59
|
-
|
|
60
|
-
## When To Read References
|
|
61
|
-
|
|
62
|
-
- Read `references/starter-contract.md` for starter file responsibilities, typography portability, validation expectations, and review checklist.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Style Pack Starter Contract
|
|
2
|
-
|
|
3
|
-
## Starter Responsibilities
|
|
4
|
-
|
|
5
|
-
| Path | Responsibility |
|
|
6
|
-
| --- | --- |
|
|
7
|
-
| `starter/openpress.config.mjs` | root marker that points at `document/openpress.config.mjs` |
|
|
8
|
-
| `starter/document/index.tsx` | React document entry: config plus cover, TOC, and back-cover shell JSX |
|
|
9
|
-
| `starter/document/chapters/` | minimal coherent MDX chapters; optional chapter opener files |
|
|
10
|
-
| `starter/document/design.md` | single public-readable design brief (style positioning, tokens, components, CSS responsibilities) |
|
|
11
|
-
| `starter/document/theme/` | CSS tokens, fonts, base typography, page surfaces, patterns, shell rules, print safeguards |
|
|
12
|
-
| `starter/document/theme/fonts.css` | font-face imports or self-hosted font rules |
|
|
13
|
-
| `starter/document/theme/fonts/` | optional self-hosted `.woff2` files |
|
|
14
|
-
| `starter/document/components/` | reusable structured visual units |
|
|
15
|
-
| `starter/document/media/` | assets safe to ship with the pack |
|
|
16
|
-
|
|
17
|
-
The engine discovers a style pack by the presence of `starter/`.
|
|
18
|
-
|
|
19
|
-
Page surfaces are optional by document type. A report-focused pack can ship only cover, TOC, chapter, and back cover styling. A book/manual/teaching pack may also include `starter/document/theme/page-surfaces/chapter-opener.css` plus optional `chapter.tsx` opener exports. Chapter openers must be optional starter content, not a required page in every new workspace.
|
|
20
|
-
|
|
21
|
-
## Typography Portability
|
|
22
|
-
|
|
23
|
-
Style packs own typography:
|
|
24
|
-
|
|
25
|
-
- `theme/tokens.css` names font tokens and fallback stacks.
|
|
26
|
-
- `theme/fonts.css` loads actual font faces.
|
|
27
|
-
- `theme/fonts/` stores self-hosted files when the pack must work without a CDN.
|
|
28
|
-
|
|
29
|
-
Do not rely on `local(...)` alone for public, mobile, iPad, or PDF-stable output. If a pack uses system fonts, document that output is not pixel-identical across devices.
|
|
30
|
-
|
|
31
|
-
## Validation Expectations
|
|
32
|
-
|
|
33
|
-
Validate through a scratch workspace, but do not define the command sequence in this style-pack reference. Use `openpress` for init, validate, export, render, PDF, and broader framework check commands.
|
|
34
|
-
|
|
35
|
-
Run PDF only when `openpress` determines the scratch workspace has the required app/runtime files. Run broader framework checks only when shared code changes.
|
|
36
|
-
|
|
37
|
-
## Review Checklist
|
|
38
|
-
|
|
39
|
-
Before calling the pack ready, confirm:
|
|
40
|
-
|
|
41
|
-
- one narrow, describable visual philosophy;
|
|
42
|
-
- portable typography policy;
|
|
43
|
-
- starter renders without missing assets or fonts;
|
|
44
|
-
- `openpress` can initialize and validate the pack through the current system-level workflow;
|
|
45
|
-
- dense paragraphs, tables, figures, captions, and long headings remain readable;
|
|
46
|
-
- starter Markdown tables demonstrate `<TableCaption>...</TableCaption>` instead of legacy prose markers or hand-written table numbers;
|
|
47
|
-
- PDF output does not overflow fixed pages when PDF validation is available;
|
|
48
|
-
- `design.md` teaches users and agents how to review the pack;
|
|
49
|
-
- no private content, customer data, tokens, or deploy secrets are included.
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: openpress-update
|
|
3
|
-
description: Use when updating or upgrading an existing open-press workspace to a newer framework release, pulling new engine/runtime changes, applying release migration notes, or handling breaking changes between versions.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# open-press Update
|
|
7
|
-
|
|
8
|
-
This skill owns the **release update flow** for an existing workspace: pulling new framework code, applying migration notes, handling breaking changes, and verifying nothing broke.
|
|
9
|
-
|
|
10
|
-
It does not own first-time setup (that is `openpress-init`) and does not own content/design changes (those are domain skills).
|
|
11
|
-
|
|
12
|
-
## When To Enter
|
|
13
|
-
|
|
14
|
-
Activate when the user says any of:
|
|
15
|
-
|
|
16
|
-
- "升級 open-press / 更新到最新版"
|
|
17
|
-
- "update open-press / upgrade to latest"
|
|
18
|
-
- "拉新版的 engine"
|
|
19
|
-
- "看一下這版有什麼破壞性改動"
|
|
20
|
-
- After the user pulls a new git tag and asks to verify the workspace still works.
|
|
21
|
-
|
|
22
|
-
## Pre-Flight Check
|
|
23
|
-
|
|
24
|
-
Before touching anything, confirm:
|
|
25
|
-
|
|
26
|
-
1. **Workspace state is clean**: `git status` shows no uncommitted document changes that an upgrade might overwrite.
|
|
27
|
-
2. **Current version is known**: read `package.json` `version` field; compare to target version.
|
|
28
|
-
3. **CHANGELOG has been read**: locate the project's CHANGELOG (currently in `docs/superpowers/specs/` migration notes; future: top-level `CHANGELOG.md`). Identify every breaking change between current and target version.
|
|
29
|
-
|
|
30
|
-
If any of these are missing, surface to the user before proceeding.
|
|
31
|
-
|
|
32
|
-
## Current Update Surface (pre-`core/`)
|
|
33
|
-
|
|
34
|
-
Until the `core/` folder restructure ships (tracked in `docs/superpowers/specs/2026-05-21-open-press-template-and-skill-init.md`), framework code lives intermixed with workspace code in this repo. Update means:
|
|
35
|
-
|
|
36
|
-
1. `git pull` (or merge / rebase the new framework tag).
|
|
37
|
-
2. `npm install` to refresh dependencies.
|
|
38
|
-
3. `npm run typecheck` — first signal of API-shape breakage.
|
|
39
|
-
4. `npm test` — second signal of behavior breakage.
|
|
40
|
-
5. `npm run openpress:validate && npm run openpress:render` against current `document/`.
|
|
41
|
-
6. For each failure, check the CHANGELOG entry for the breaking change and apply the documented migration.
|
|
42
|
-
|
|
43
|
-
## Future Update Surface (post-`core/`)
|
|
44
|
-
|
|
45
|
-
When `core/` exists (planned, see spec):
|
|
46
|
-
|
|
47
|
-
1. Backup user-edited escape-hatch files under `src/` (workspace overrides via vite alias).
|
|
48
|
-
2. Overwrite `core/` wholesale from the new release.
|
|
49
|
-
3. Re-apply codemods listed in the release migration notes.
|
|
50
|
-
4. Verify with `typecheck` + `test` + `validate` + `render`.
|
|
51
|
-
|
|
52
|
-
This skill will own the codemod runner once it exists.
|
|
53
|
-
|
|
54
|
-
## Breaking Change Handling
|
|
55
|
-
|
|
56
|
-
For each breaking change in the CHANGELOG:
|
|
57
|
-
|
|
58
|
-
| Change type | Action |
|
|
59
|
-
| --- | --- |
|
|
60
|
-
| Renamed identifier (e.g. `BaseReportPage` → `BaseContentPage`) | grep workspace for old name; rewrite at every callsite |
|
|
61
|
-
| Removed export | grep workspace; ask user if replacement is acceptable |
|
|
62
|
-
| Changed function signature | typecheck will surface; fix per release notes |
|
|
63
|
-
| CSS class rename | grep `document/theme/` and `document/components/`; rewrite |
|
|
64
|
-
| Config schema change | edit `openpress.config.mjs` per release notes |
|
|
65
|
-
| Markdown / MDX directive change | grep `document/chapters/`; rewrite per release notes |
|
|
66
|
-
|
|
67
|
-
If a breaking change has no documented migration in the CHANGELOG, **stop and ask the user** — do not improvise.
|
|
68
|
-
|
|
69
|
-
## Workflow
|
|
70
|
-
|
|
71
|
-
1. Pre-flight (clean tree, version delta, CHANGELOG read).
|
|
72
|
-
2. Pull the new code.
|
|
73
|
-
3. Run `typecheck` / `test` / `validate` / `render` in that order; stop at the first failure.
|
|
74
|
-
4. For each failure: find the CHANGELOG entry, apply the migration, re-run the failing command.
|
|
75
|
-
5. After all gates pass, run `npm run openpress:pdf` to sanity-check PDF output.
|
|
76
|
-
6. Report to the user: starting version, ending version, list of migrations applied, anything that needed manual intervention.
|
|
77
|
-
|
|
78
|
-
## Boundaries
|
|
79
|
-
|
|
80
|
-
- `openpress` owns the CLI and the source/generated boundary. This skill uses those commands.
|
|
81
|
-
- `openpress-deploy` is **not** part of update; do not auto-deploy after a successful update.
|
|
82
|
-
- Domain skills (`openpress-writing` / `openpress-design`) handle non-mechanical content rewrites that the user wants to do alongside the upgrade.
|
|
83
|
-
|
|
84
|
-
## Do Not
|
|
85
|
-
|
|
86
|
-
- Do not skip CHANGELOG reading. An undocumented breaking change is a sign to stop, not a sign to guess.
|
|
87
|
-
- Do not bundle new feature work with an update. Land the update first, commit, then start new work.
|
|
88
|
-
- Do not run `--force` overwrites on workspace files. If a file conflicts, surface it.
|