konpeki 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/AGENTS.md +21 -28
  2. package/AUTHORING.md +68 -229
  3. package/CONTRIBUTING.md +10 -23
  4. package/README.md +96 -87
  5. package/SETUP.md +50 -114
  6. package/docs/development.md +43 -248
  7. package/docs/workflow.md +6 -108
  8. package/html/README.md +140 -0
  9. package/html/browser.ts +103 -0
  10. package/html/document.ts +38 -0
  11. package/html/floor.ts +34 -0
  12. package/html/index.html +5 -0
  13. package/html/inspect.ts +313 -0
  14. package/html/preview.css +62 -0
  15. package/html/preview.tsx +463 -0
  16. package/html/review-hints.ts +63 -0
  17. package/html/server.ts +99 -0
  18. package/html/source.ts +104 -0
  19. package/html/starter.ts +6 -0
  20. package/html/theme-authoring.md +176 -0
  21. package/html/theme.md +61 -0
  22. package/index.html +9 -9
  23. package/package.json +21 -35
  24. package/plugin.json +1 -1
  25. package/public/og.png +0 -0
  26. package/runtime/browser-B-29TH1a.mjs +595 -0
  27. package/runtime/floor-Cmk7G3pU.mjs +41 -0
  28. package/runtime/konpeki.mjs +90 -1410
  29. package/runtime/server-BAqC_5WD.mjs +2 -0
  30. package/runtime/server-DfRpfcY9.mjs +205 -0
  31. package/runtime/source-B_Ui9tMp.mjs +141 -0
  32. package/runtime/source-CZQq9GUO.mjs +2 -0
  33. package/skills/konpeki/SKILL.md +88 -172
  34. package/skills/konpeki/assets/blank.html +17 -0
  35. package/skills/konpeki/floor.md +76 -0
  36. package/skills/konpeki/references/cover.md +27 -0
  37. package/skills/konpeki/references/long-document.md +40 -0
  38. package/skills/konpeki/references/one-pager.md +27 -0
  39. package/skills/konpeki/references/patterns.md +118 -0
  40. package/skills/konpeki/references/resume.md +28 -0
  41. package/skills/konpeki/references/slides.md +28 -0
  42. package/skills/konpeki/scripts/ensure-runtime.mjs +10 -31
  43. package/skills/konpeki/scripts/prepare-document.mjs +25 -14
  44. package/src/components/PageBoard.tsx +156 -0
  45. package/src/lib/alignment.ts +21 -0
  46. package/src/lib/page-board.ts +25 -0
  47. package/src/lib/review-position.ts +19 -0
  48. package/src/styles/base.css +4 -6
  49. package/src/styles/feedback.css +97 -61
  50. package/src/styles/shell.css +95 -323
  51. package/theme-base.css +90 -0
  52. package/theme.css +56 -0
  53. package/vite.config.ts +2 -5
  54. package/composition/README.md +0 -156
  55. package/composition/compile.ts +0 -227
  56. package/composition/document.ts +0 -600
  57. package/composition/schema.json +0 -3001
  58. package/composition/schema.ts +0 -437
  59. package/composition/theme-tokens.ts +0 -16
  60. package/composition/types.ts +0 -269
  61. package/composition/validate.ts +0 -226
  62. package/composition/vector.ts +0 -143
  63. package/composition/visualizations.ts +0 -319
  64. package/design/README.md +0 -17
  65. package/design/palettes/README.md +0 -14
  66. package/design/palettes/base.ts +0 -14
  67. package/design/palettes/candidates.ts +0 -19
  68. package/design/palettes/index.ts +0 -78
  69. package/design/review/color-theme.md +0 -44
  70. package/design/review/layout.md +0 -16
  71. package/design/review/text.md +0 -18
  72. package/design/review/typography.md +0 -15
  73. package/design/review/visuals.md +0 -31
  74. package/design/semantic-patterns.md +0 -43
  75. package/design/themes/README.md +0 -40
  76. package/design/themes/index.ts +0 -24
  77. package/design/visual-languages/technical-product.md +0 -17
  78. package/design/visual-review.md +0 -88
  79. package/lib/assets.d.ts +0 -8
  80. package/lib/charts.ts +0 -18
  81. package/lib/contrast.ts +0 -16
  82. package/lib/layouts.ts +0 -50
  83. package/lib/slide.tsx +0 -42
  84. package/lib/taste.ts +0 -17
  85. package/lib/text.tsx +0 -89
  86. package/lib/typeface.ts +0 -44
  87. package/scripts/migrate-react-page.ts +0 -120
  88. package/skills/konpeki/assets/blank.json +0 -23
  89. package/slides/README.md +0 -153
  90. package/slides/architecture/PROMPT.md +0 -31
  91. package/slides/architecture/index.tsx +0 -102
  92. package/slides/article-brief/PROMPT.md +0 -35
  93. package/slides/article-brief/index.tsx +0 -71
  94. package/slides/bar-chart/PROMPT.md +0 -39
  95. package/slides/bar-chart/index.tsx +0 -97
  96. package/slides/comparison/PROMPT.md +0 -29
  97. package/slides/comparison/index.tsx +0 -95
  98. package/slides/decision-memo/PROMPT.md +0 -34
  99. package/slides/decision-memo/index.tsx +0 -85
  100. package/slides/delivery-plan/PROMPT.md +0 -45
  101. package/slides/delivery-plan/index.tsx +0 -105
  102. package/slides/experiment/PROMPT.md +0 -44
  103. package/slides/experiment/index.tsx +0 -127
  104. package/slides/incident-workflow/PROMPT.md +0 -57
  105. package/slides/incident-workflow/index.tsx +0 -78
  106. package/slides/introducing-konpeki/PROMPT.md +0 -40
  107. package/slides/introducing-konpeki/README.md +0 -76
  108. package/slides/introducing-konpeki/SOURCE.md +0 -26
  109. package/slides/introducing-konpeki/author.ts +0 -165
  110. package/slides/introducing-konpeki/composition.json +0 -3270
  111. package/slides/line-chart/PROMPT.md +0 -40
  112. package/slides/line-chart/index.tsx +0 -72
  113. package/slides/migration/PROMPT.md +0 -38
  114. package/slides/migration/index.tsx +0 -89
  115. package/slides/og-images/PROMPT.md +0 -21
  116. package/slides/og-images/index.tsx +0 -76
  117. package/slides/product-introduction/PROMPT.md +0 -24
  118. package/slides/product-introduction/index.tsx +0 -105
  119. package/slides/research-brief/PROMPT.md +0 -40
  120. package/slides/research-brief/index.tsx +0 -104
  121. package/slides/results-explanation/PROMPT.md +0 -32
  122. package/slides/results-explanation/index.tsx +0 -96
  123. package/slides/retrospective/PROMPT.md +0 -43
  124. package/slides/retrospective/index.tsx +0 -105
  125. package/slides/sankey/PROMPT.md +0 -11
  126. package/slides/sankey/index.tsx +0 -93
  127. package/slides/teaching/PROMPT.md +0 -45
  128. package/slides/teaching/index.tsx +0 -124
  129. package/slides/vertical-bar-charts/PROMPT.md +0 -13
  130. package/slides/vertical-bar-charts/index.tsx +0 -97
  131. package/src/app/App.tsx +0 -820
  132. package/src/components/BuildOrb.tsx +0 -40
  133. package/src/components/Canvas.tsx +0 -1185
  134. package/src/components/DiagramTypeIcon.tsx +0 -78
  135. package/src/components/InspectorPanel.tsx +0 -773
  136. package/src/components/LeftPanel.tsx +0 -120
  137. package/src/components/PageSizePicker.tsx +0 -30
  138. package/src/components/Presentation.tsx +0 -105
  139. package/src/components/RevisionNotes.tsx +0 -56
  140. package/src/components/RightPanel.tsx +0 -201
  141. package/src/components/VectorOverflowWarning.tsx +0 -46
  142. package/src/components/WorkspaceChrome.tsx +0 -288
  143. package/src/components/ui.tsx +0 -53
  144. package/src/lib/examples/react-page-migration.json +0 -1295
  145. package/src/lib/examples.ts +0 -42
  146. package/src/lib/export-png.ts +0 -104
  147. package/src/lib/file-session.ts +0 -87
  148. package/src/lib/history.ts +0 -53
  149. package/src/lib/model.ts +0 -188
  150. package/src/lib/page-size.ts +0 -24
  151. package/src/lib/presentation.ts +0 -17
  152. package/src/lib/review.ts +0 -26
  153. package/src/lib/storage.ts +0 -71
  154. package/src/lib/theme.ts +0 -25
  155. package/src/lib/use-file-session.ts +0 -227
  156. package/src/main.tsx +0 -29
  157. package/src/styles/canvas.css +0 -299
  158. package/src/styles/chrome.css +0 -384
  159. package/src/styles/component-previews.css +0 -386
  160. package/src/styles/left-panel.css +0 -166
  161. package/src/styles/presentation.css +0 -72
  162. package/src/styles/right-panel.css +0 -1215
package/SETUP.md CHANGED
@@ -1,147 +1,83 @@
1
- # Set up Konpeki for your coding agent
1
+ # Set up Konpeki
2
2
 
3
- Install the `konpeki` skill once, then give your agent a creation brief:
3
+ Use Node.js 24+ and the matching Konpeki 0.4.0 runtime and skill. A repository
4
+ version or locally packed tarball does not establish that the npm release exists.
4
5
 
5
- ```text
6
- Use Konpeki to turn these launch notes into a product announcement.
7
- ```
8
-
9
- Opening and inspecting the editable preview is part of the skill, not an extra
10
- instruction the person has to remember. Covers, social graphics, charts,
11
- diagrams and presentations use the same workflow. Keep the brief and revisions
12
- in agent chat; the browser edits, reviews, presents and exports the document.
13
- Konpeki supplies no hosted AI service or additional model subscription.
14
-
15
- ## 1. Install the skill or plugin
6
+ ## npm package
16
7
 
17
- Use the host's skill installer to install the complete
18
- [`skills/konpeki`](skills/konpeki/) directory from
19
- `vcfgdev/konpeki`. Keep its `scripts/` and `assets/` directories. In Codex, ask the skill installer:
8
+ Check the exact version before installing:
20
9
 
21
- ```text
22
- Install the konpeki skill from vcfgdev/konpeki, at skills/konpeki.
10
+ ```sh
11
+ npm view konpeki@0.4.0 version
23
12
  ```
24
13
 
25
- Other agents may use another installer or skill location. Follow their documented
26
- mechanism; there is no universal slash command. If a host does not discover skills,
27
- read the installed `SKILL.md` directly. Do not overwrite existing agent guidance.
28
-
29
- If you previously installed `authoring-visuals`, replace that installed skill
30
- with `konpeki` rather than keeping both copies. The runtime package is unchanged.
31
-
32
- ### Choose init or generate
33
-
34
- | Mode | Codex CLI / IDE | Claude Code standalone skill |
35
- | --- | --- | --- |
36
- | Open the editor without generating | `$konpeki init [composition.json]` | `/konpeki init [composition.json]` |
37
- | Create or revise from your materials | `$konpeki generate [brief]` | `/konpeki generate [brief]` |
38
-
39
- `generate` automatically prepares the runtime when needed. It uses materials
40
- already supplied in chat, referenced files and the current canvas; it does not
41
- require `init` first or a repeated brief. Natural-language “Use Konpeki to…”
42
- creation requests also select generate. Follow-up feedback continues the same
43
- document without another command. Other GUIs may use skill selection, and plugin
44
- installations may namespace the skill. These modes are not terminal subcommands.
45
-
46
- For `init`, choose the supplied path or the document already active in the
47
- conversation; otherwise use `slides/untitled/composition.json`. After resolving
48
- the runtime below, run:
14
+ If it returns `0.4.0`, install in the workspace that will author your documents:
49
15
 
50
16
  ```sh
51
- node "<installed-skill>/scripts/prepare-document.mjs" "<cli>" "<composition.json>"
52
- node "<cli>" preview "<composition.json>"
17
+ npm install --save-exact konpeki@0.4.0
18
+ npx --no-install konpeki browser install
53
19
  ```
54
20
 
55
- The helper validates existing files without rewriting them. For a missing file,
56
- it validates and writes the bundled blank document without overwriting a file
57
- created concurrently. Invalid data is preserved, not replaced with a sample.
58
- Reuse an already running preview for the same file. Open and verify its exact
59
- session URL as described below, then stop: init does not generate or start a
60
- review listener. The starter works with the pinned published runtime; it does
61
- not import TypeScript from `node_modules` or require an unreleased `init` CLI.
21
+ Run commands with `npx --no-install konpeki`. If the version is unavailable, use
22
+ one of the local paths below; do not substitute the incompatible 0.3.x runtime.
62
23
 
63
- ### Optional Codex plugin packaging
24
+ ## Source checkout
64
25
 
65
- The root `plugin.json` packages that same skill, without MCP servers, hooks or
66
- credentials. `.agents/plugins/marketplace.json` exposes it as a repo marketplace.
67
- On a compatible Codex client, add the repository marketplace with:
26
+ With [mise](https://mise.jdx.dev/) installed, use the pinned toolchain:
68
27
 
69
28
  ```sh
70
- codex plugin marketplace add vcfgdev/konpeki
29
+ git clone https://github.com/vcfgdev/konpeki.git
30
+ cd konpeki
31
+ mise trust
32
+ mise install
33
+ mise exec -- pnpm install --frozen-lockfile
34
+ mise exec -- node bin/konpeki.mjs browser install
71
35
  ```
72
36
 
73
- Then install Konpeki from that source in the desktop plugin directory and test it
74
- in a new conversation. Install either the standalone skill or the plugin, not
75
- both. This is repository distribution, not a listing in OpenAI's public directory.
76
- It becomes available from the remote repository after these files are published.
77
- Native Codex GUI installation needs a separate client smoke test; package checks
78
- alone do not establish host compatibility.
37
+ The browser is needed for inspection and export, not preview or artifact viewing.
38
+ On minimal Linux hosts, its system libraries may require administrator-approved
39
+ installation with `mise exec -- pnpm exec playwright install-deps chromium`.
79
40
 
80
- ## 2. Let the skill prepare the runtime
41
+ Run the checkout CLI as `mise exec -- node bin/konpeki.mjs`. The authoring loop
42
+ is in the [skill](skills/konpeki/SKILL.md); CLI rules are in
43
+ [html/README.md](html/README.md).
81
44
 
82
- Check Node.js 24+, npm, command/file access and the host's browser capabilities.
83
- Follow host approval and toolchain rules if prerequisites are missing.
45
+ ## Local tarball
84
46
 
85
- From the user's document workspace, run:
47
+ From a prepared trusted checkout, build and pack without publishing:
86
48
 
87
49
  ```sh
88
- node "<installed-skill>/scripts/ensure-runtime.mjs"
50
+ mise exec -- pnpm install --frozen-lockfile
51
+ mise exec -- pnpm pack
89
52
  ```
90
53
 
91
- The script reuses a compatible workspace installation, surrounding Konpeki
92
- checkout, or cached runtime. If none exists, obtain any required host approval
93
- and rerun with `--install`. It installs the pinned `konpeki@0.3.0` release in a
94
- user cache, without adding project dependencies or changing project guidance.
95
- Missing/incompatible runtimes are never reported ready. The script prints JSON
96
- with `root`, `cli` and `version`; installation diagnostics go to stderr.
54
+ Install the resulting `.tgz` by local path in the workspace that will author the
55
+ document, for example `npm install --no-save /path/to/konpeki-0.4.0.tgz`. This is
56
+ a local package install, not evidence of an npm release. Run its CLI with
57
+ `npx --no-install konpeki` and install its browser before inspection or export.
97
58
 
98
- Use the returned absolute `root` for resources and `cli` for commands. Do not rely
99
- on repo-relative paths from a copied skill. Keep documents outside the runtime.
100
- For manual project-local npm installation, see [Manual npm start](README.md#manual-npm-start).
101
- Repository contributors instead use the [mise setup](docs/development.md); users
102
- of the published package do not need mise.
59
+ ## Skill helpers
103
60
 
104
- ## 3. Generate, validate and open the visual
105
-
106
- Follow the installed skill and the runtime's `AUTHORING.md`, composition contract
107
- and design resources. Use the brief already supplied; ask only for information
108
- needed for faithful work. Do not ask the person to repeat their prompt in the
109
- canvas. Continue the current document when revising or following init. Save new
110
- work to an unused `slides/<name>/composition.json`, with brief/source notes,
111
- unless the person chooses another destination. Preserve existing documents.
112
-
113
- For an installation check, validate the bundled example:
61
+ Install the authoring skill separately:
114
62
 
115
63
  ```sh
116
- node "<cli>" validate "<root>/slides/introducing-konpeki/composition.json"
64
+ npx skills add vcfgdev/konpeki -g
117
65
  ```
118
66
 
119
- After authoring the user's document:
67
+ `ensure-runtime.mjs` takes no arguments. It discovers either the containing
68
+ checkout or a compatible locally installed `konpeki` package and prints its CLI
69
+ location; it does not download or modify a runtime.
70
+
71
+ `prepare-document.mjs` takes `<cli> <document.html>`. It creates the starter HTML,
72
+ `theme.css`, and `theme-base.css` beside the document. It validates the result
73
+ and never overwrites existing files. The default theme loads IBM Plex Sans and
74
+ Mono from Google Fonts, so preview and export need network access. For offline
75
+ rendering, adapt the document's theme to use licensed local or embedded fonts.
120
76
 
121
77
  ```sh
122
- node "<cli>" validate "slides/<name>/composition.json"
123
- node "<cli>" preview "slides/<name>/composition.json"
78
+ node node_modules/konpeki/skills/konpeki/scripts/prepare-document.mjs node_modules/konpeki/runtime/konpeki.mjs document.html
124
79
  ```
125
80
 
126
- Reuse an existing preview for that file when available. Keep the process running
127
- using the host's supported service mechanism. Open the exact printed session URL
128
- in the in-app browser when supported, otherwise the regular browser. Preserve its
129
- query string and never publish its capability token. In remote workspaces, use
130
- authenticated preview/port forwarding, not a remote loopback address.
131
-
132
- Verify that the browser loads the intended document, then render, inspect and
133
- repair the result as directed by the skill. The file-backed canvas saves browser
134
- edits to that document and loads valid external edits. Setup is complete when
135
- validation succeeds and the intended composition opens—not merely when a server
136
- process starts. If browser inspection is unavailable, report that limitation.
137
-
138
- Return the document path, usable preview link and verification outcome. Continue
139
- revisions in agent chat. For submitted canvas reviews, generate checks `request`,
140
- claims a `submitted` request with `wait`, applies the notes against the latest
141
- document, and acknowledges it with `finish` only after validation and inspection.
142
- Coordinate ownership before resuming an already `working` request.
143
-
144
- An ongoing listener runs only when explicitly requested and supported by the host.
145
- Otherwise, use **Copy prompt** after **Build it**, or resume generate in agent chat.
146
- The [canvas workflow](docs/workflow.md) describes this handoff; the button cannot
147
- wake an idle agent, and an open preview is not a live agent connection.
81
+ From a source checkout, use
82
+ `mise exec -- node skills/konpeki/scripts/prepare-document.mjs bin/konpeki.mjs document.html`.
83
+ See [Upgrading from 0.3.x](README.md#upgrading-from-03x) before migrating old work.
@@ -1,257 +1,52 @@
1
1
  # Development
2
2
 
3
- Clone `https://github.com/vcfgdev/konpeki.git` with the required repository access.
4
- Use [mise](https://mise.jdx.dev/getting-started.html) to install the Node.js and
5
- pnpm versions pinned in `mise.toml`. On macOS, install mise with `brew install mise`.
6
- From the repository root:
3
+ Use the versions pinned by `mise.toml`, run commands through `mise exec --`, and
4
+ preserve `pnpm-lock.yaml`.
7
5
 
8
- ```sh
9
- mise trust
10
- mise install
11
- mise exec -- pnpm install --frozen-lockfile
12
- ```
13
-
14
- Mise manages the toolchain; pnpm manages dependencies through `pnpm-lock.yaml`.
15
- Run the commands below from that repository root with an activated mise shell,
16
- or prefix them with `mise exec --` (for example, `mise exec -- pnpm test`).
17
- No global Node.js or pnpm installation is required. npm for packing and publishing
18
- comes with the pinned Node.js; use `mise exec -- npm pack` to select it explicitly.
19
-
20
- Development and regression checks require a repository checkout, not an npm
21
- tarball, which excludes tests and review scripts.
22
-
23
- ## Development server and demo hosting
24
-
25
- ```sh
26
- pnpm dev
27
- ```
28
-
29
- For a production preview, run `pnpm build` then `pnpm preview`. The build produces
30
- a static site in `dist` for a root or subdirectory. Use
31
- `?example=introducing-konpeki` or `?example=custom-visual` to open a bundled editable
32
- example. Each example has an isolated browser-local working copy that survives
33
- reload. The Browser menu supports JSON import/download, starting blank and
34
- resetting the example. These actions never replace another example or the normal
35
- local draft. Invalid stored data remains untouched until an explicit reset.
36
-
37
- Deploy only the static `dist` output for the public playground, not a file-session
38
- server. Imported documents stay in that browser; there is no account, cloud sync,
39
- AI generation or Build/notes handoff in standalone mode. Downloaded JSON can be
40
- opened in a file-backed session with a coding agent. Browser storage is not a
41
- backup. Hosting shares bundled examples, not private drafts or an AI service.
42
- No deployment is automatic. In a remote environment, expose a review server
43
- through its authenticated preview mechanism, not a loopback address.
44
-
45
- The source CLI's `preview` chooses the next available port if its default is
46
- occupied. An explicit `--port <number>` fails rather than silently changing the
47
- requested port; `--port 0` asks the OS for a free port. `--json` prints one readiness
48
- record with `type`, `compositionPath` and the exact session-bearing `url` after
49
- listening. Treat that URL as a capability, not public logging data. This is a
50
- startup signal, not proof that the browser loaded the right composition.
6
+ ## Architecture
51
7
 
52
- ### GitHub Pages
53
-
54
- The public playground is hosted at
55
- [vcfgdev.github.io/konpeki](https://vcfgdev.github.io/konpeki/?example=introducing-konpeki).
56
- The example query opens the introduction; the root URL opens the ordinary local
57
- draft. Each visitor's edits stay in their own browser, not in the deployed site.
58
-
59
- `.github/workflows/pages.yml` deploys only when explicitly dispatched on `main`:
60
-
61
- ```sh
62
- gh workflow run pages.yml --repo vcfgdev/konpeki --ref main
63
- ```
64
-
65
- The workflow uses the pinned mise/pnpm toolchain, runs typecheck and tests, builds
66
- with the Pages base path, and uploads only `dist`. The deployment job publishes
67
- that artifact to the `github-pages` environment. Repository **Settings → Pages →
68
- Source** must be **GitHub Actions**. Ordinary pushes run CI but do not redeploy;
69
- package releases remain separate. Inspect the public example after deployment,
70
- including reload, fonts, editing, JSON download and Present.
71
-
72
- Existing example working copies survive deployments. Download any edits before
73
- choosing **Browser → Reset example** to load a newly published example.
74
-
75
- ## Skill and plugin packaging
76
-
77
- `skills/konpeki/` is the canonical portable skill. The repo's
78
- `.agents/skills/konpeki` symlink enables local discovery without a second
79
- copy. The root Agent Plugins `plugin.json` and repo marketplace expose the same
80
- skill to compatible Codex clients; no MCP, hook or hosted AI is involved. Review
81
- native-client installation separately from the npm smoke test.
82
-
83
- The skill dispatches `init` (open only) and `generate` (create/revise, including
84
- implicit setup). These are agent modes, not CLI subcommands. Its portable
85
- `scripts/prepare-document.mjs` validates through the resolved CLI and exclusively
86
- creates a blank file, or validates an existing file without rewriting it. The
87
- bundled `assets/blank.json` matches `initialDraft(true)` in
88
- `composition/document.ts`; onboarding tests enforce that contract. Keep scripts
89
- and assets when copying the skill. No TypeScript import from `node_modules` is
90
- needed, so a copied skill also supports the existing published runtime.
91
-
92
- Its `scripts/ensure-runtime.mjs` pins the release runtime. It performs
93
- no installation without `--install`, and never updates project dependencies.
94
- When preparing a new release, deliberately update its pin and the plugin version
95
- together with the package version after testing the target runtime. The current
96
- pin is 0.3.0; local CLI/playground changes do not republish that npm version.
97
-
98
- ## Implementation reference
99
-
100
- - `src/` contains the shared canvas application for editing and presentation.
101
- The [versioned composition contract](../composition/README.md) preserves
102
- content, relationships and visual intent across human and agent revisions.
103
- - `bin/` contains the file-session CLI and its revision-checked persistence.
104
- - [AUTHORING.md](../AUTHORING.md) owns design defaults, factual fidelity and review.
105
- [Design resources](../design/README.md) provide palettes, themes and semantic
106
- patterns; these are choices, not mandatory layouts.
107
- - `lib/text.tsx` supplies measured `Text` and `Paragraphs` with string or rich-text
108
- runs. Overset content is flagged, not automatically shrunk or hidden. Await
109
- `fontsReady` from `lib/typeface.ts` before measuring.
110
- - `lib/slide.tsx` supplies specimen `Panel`, `Relationship` and 1920×1080 `Sheet`
111
- components. `Panel` shares one heading/body size; `Relationship` is a short
112
- directional glyph. Convert their SVG output to composition vectors for the canvas.
113
- - `lib/layouts.ts` supplies fixed-gutter regions, not a content-fitting solver.
114
- - Retained React chart references use Nivo `Bar`, `Line` and `Sankey` with
115
- `chartDefaults(palette)` from `lib/charts.ts` spread before chart-specific props.
116
- Keep data, dimensions, scales and semantic colors in the deck. Use explicit
117
- label colors and `linkBlendMode="normal"` for Sankey.
118
-
119
- ### React/SVG drawing references
120
-
121
- The retained `slides/*/index.tsx` files are presentation-runtime-independent
122
- drawing references. They are checked as source but are not discovered as routes
123
- or executed by a second presentation runtime. New decks use composition JSON;
124
- a trusted build may render React to SVG, then convert supported elements into
125
- the owning component's editable vector payload.
126
-
127
- To migrate the retained architecture reference into the shared canvas:
128
-
129
- ```sh
130
- pnpm example:migrate-page slides/architecture/index.tsx all /tmp/architecture-composition.json
131
- ```
8
+ Static HTML and CSS are the only document source. `html/source.ts` validates and
9
+ revises source, `html/server.ts` exposes the authenticated preview and local
10
+ assets, and `html/browser.ts` uses Playwright for inspection and PNG/PDF export.
11
+ The React preview UI lives in `html/preview.tsx`; its small shared board,
12
+ alignment, positioning, and style modules live under `src/`.
132
13
 
133
- Drag the resulting JSON onto the canvas, edit its vectors, and use **Present**.
134
- Replace `all` with a zero-based page index for one page. This command executes
135
- trusted local React source; never use it on untrusted JSX. It rejects unsupported
136
- SVG elements rather than silently flattening them. Review converted typography
137
- and geometry in the browser; conversion is not a fidelity guarantee.
138
- The bundled `?example=react-page-migration` preview uses the same format.
139
- Its working copy autosaves in that browser. Download JSON or use a file-backed
140
- session to retain edits outside browser storage.
141
-
142
- ## Package contents
143
-
144
- `package.json` explicitly allowlists the npm payload: the source-based Vite
145
- runtime and file-session CLI, authoring guidance and design resources, and named
146
- curated examples with editable source and prompts. New example directories are
147
- not included automatically. Gallery screenshots, tests, research fixtures,
148
- browser review scripts, original branding assets, lockfiles and UI build output
149
- stay in the repository.
150
-
151
- `npm pack` builds the JavaScript CLI in `runtime/` automatically because Node
152
- cannot load its TypeScript source from inside `node_modules`. That generated
153
- CLI is included in the package.
154
-
155
- Run `pnpm check:package` before preparing a release. It checks npm's file selection,
156
- required resources, excluded development files and relative imports. For an
157
- installation smoke test, use `npm pack --pack-destination <temporary-dir>`, install
158
- the tarball in an empty project, then run its `konpeki validate` and `konpeki preview`
159
- commands against a composition outside the installed package. Do not publish
160
- until that isolated preview works. Publish the tested tarball rather than
161
- rebuilding during publication. Packing locally does not publish anything.
162
-
163
- ## Tag releases
164
-
165
- `.github/workflows/publish.yml` stages releases on bare version tags such as `0.2.1`
166
- (no `v` prefix). The tag must equal `package.json`'s version.
167
- The workflow installs the mise toolchain and frozen dependencies, runs typecheck,
168
- tests, build and package checks, then installs a tarball in an isolated directory
169
- to validate a composition and build the packaged canvas. It stages that same
170
- tarball for maintainer approval; it does not publish directly. Browser review
171
- remains a pre-release responsibility.
172
-
173
- Before the first tag release, configure **Trusted publishing → GitHub Actions**
174
- in the `konpeki` package settings on npmjs.com:
175
-
176
- - Organization or user: `vcfgdev`
177
- - Repository: `konpeki`
178
- - Workflow filename: `publish.yml`
179
- - Environment name: leave empty
180
- - Leave **Allow npm publish** unchecked (staged publishing only)
181
-
182
- The workflow uses GitHub-hosted runners and OIDC (`id-token: write`); no npm
183
- token secret is needed. Staged publishing requires npm 11.15.0 or newer and
184
- Node 22.14.0 or newer; the pinned toolchain meets both requirements.
185
- npm generates provenance automatically for public repositories;
186
- private repositories do not receive provenance.
187
-
188
- After updating the package version, completing release checks and pushing the
189
- release commit, explicitly create and push its matching tag:
190
-
191
- ```sh
192
- VERSION=0.2.1
193
- git tag "$VERSION"
194
- git push origin "$VERSION"
195
- ```
196
-
197
- Replace `0.2.1` with the version in `package.json`. Published versions cannot be
198
- republished. Pushing a matching tag submits the tested package to npm's staging
199
- area. After the workflow succeeds, review the release in npmjs.com's **Staged
200
- Packages** tab and click **Approve**, completing 2FA to publish it. Alternatively,
201
- use an authenticated local CLI:
202
-
203
- ```sh
204
- mise exec -- npm stage list konpeki
205
- mise exec -- npm stage view <stage-id>
206
- mise exec -- npm stage approve <stage-id>
207
- ```
208
-
209
- Approval makes the version public. Reject an incorrect staged release instead
210
- of approving it (`npm stage reject <stage-id>`).
14
+ `bin/konpeki.mjs` is the HTML-only CLI entry. `scripts/build-cli.mjs` bundles it
15
+ to `runtime/konpeki.mjs` so npm consumers can run it without TypeScript support.
211
16
 
212
17
  ## Verification
213
18
 
214
19
  ```sh
215
- pnpm check
216
- pnpm test
217
- pnpm build
218
- pnpm check:package
219
- ```
220
-
221
- With the dev server running and `agent-browser` installed:
222
-
223
- ```sh
224
- node scripts/check-canvas.mjs http://localhost:4318 .amp/in/artifacts
225
- node scripts/check-pages.mjs http://localhost:4318 .amp/in/artifacts/pages
226
- ```
227
-
228
- For the Build it lifecycle, `node scripts/check-build.mjs` starts its own
229
- disposable file session. It checks pending requests, agent refresh, failure
230
- recovery and reduced motion, and captures the affected states. Add an output
231
- directory and `--record` to also record the animation.
232
-
233
- `node scripts/check-notes.mjs` checks page/vector note scopes, draft isolation,
234
- reload persistence, CLI claim/finish, clarification and cancellation in a disposable
235
- file-backed browser session. It accepts a screenshot directory as its first argument.
236
-
237
- These checks exercise all five component kinds, empty slides, JSON round trips,
238
- vector editing/history and fitted line dragging. They capture editor and
239
- presentation states at two sizes; inspect the images because assertions alone
240
- do not establish visual correctness.
241
-
242
- Documentation changes need link and instruction checks. Deck changes need
243
- typecheck, build, relevant fixture checks and actual visual inspection. Shared
244
- component, theme or dependency changes also need the full test suite and
245
- representative affected decks. A build can report a large-framework-chunk advisory.
246
-
247
- Render affected pages at presentation and review sizes after fonts load. Inspect
248
- text, clipping, relationships, contrast and cross-page consistency. Repair issues
249
- and inspect fresh captures. Keep browser checks scoped to factual and layout
250
- contracts, not universal taste. Record untested outputs and limitations with
251
- the example; screenshots do not prove PDF/PPTX or cross-application fidelity.
252
-
253
- When adding examples, preserve the exact creative requests, editable source,
254
- source facts and reviewed images as described in [AUTHORING.md](../AUTHORING.md).
255
- Examples demonstrate capabilities; there is no separate benchmark suite or
256
- aesthetic score. Check font language subsets and license notices when
257
- redistributing assets; dependencies retain their own licenses.
20
+ mise exec -- pnpm install --frozen-lockfile
21
+ mise exec -- pnpm exec playwright install chromium
22
+ mise exec -- pnpm check
23
+ mise exec -- pnpm test
24
+ mise exec -- pnpm build
25
+ mise exec -- pnpm check:package
26
+ mise exec -- pnpm audit --prod
27
+ ```
28
+
29
+ Before a release, install the generated tarball in a disposable directory and
30
+ exercise runtime discovery, starter preparation, HTML validation, inspection,
31
+ PNG/PDF export, and preview. Audit the installed package too: npm consumers can
32
+ resolve dependencies differently from the repository lockfile. Exercise the
33
+ preview's comment and copy-and-clear flow from that installation, not only a
34
+ source checkout.
35
+
36
+ ## Release
37
+
38
+ 1. Finish the verification above and commit the exact release candidate. Keep
39
+ `package.json`, `plugin.json` and the skill's runtime version aligned. Describe
40
+ breaking changes in the README's upgrade section and the release notes.
41
+ 2. Obtain explicit approval before pushing or tagging. The release tag must
42
+ exactly match the package version (`0.4.0`, not `v0.4.0`).
43
+ 3. Pushing the approved tag starts **Stage package release**. It checks the code,
44
+ installs and exercises the tarball, then stages that tarball on npm. A green
45
+ workflow means staged, not published.
46
+ 4. The maintainer reviews and approves the staged package through npm's approval
47
+ flow. Verify the published version with `npm view konpeki@0.4.0 version` and
48
+ smoke-test a registry installation before announcing availability.
49
+
50
+ GitHub release creation and the manual Pages deployment are separate actions;
51
+ neither is authorized by permission to push a tag. Never publish, push, deploy,
52
+ or tag without explicit permission for that action.
package/docs/workflow.md CHANGED
@@ -1,110 +1,8 @@
1
- # Canvas workflow
1
+ # Workflow
2
2
 
3
- Start with [Use with your agent](../README.md#use-with-your-agent) and give your
4
- coding agent a brief in its prompt field. Install the complete skill directory;
5
- its bootstrap script finds or installs the runtime separately. Skill discovery
6
- varies by agent: Codex CLI/IDE uses `$konpeki`, while the standalone Claude Code
7
- skill uses `/konpeki`. Other clients may use skill selection or natural language.
8
- `init` opens a blank or existing file-backed editor without generating; `generate`
9
- creates or revises a visual, opens its preview and inspects it, with setup implicit.
10
- A creation brief without a mode selects generate. Follow-up reviews continue the
11
- same document without repeating a command. These are skill modes, not terminal
12
- subcommands. **Build it** is an optional revision handoff, not a required first-run
13
- step; opening the editor does not start a review listener.
3
+ The canonical authoring and revision loop lives in the
4
+ [Konpeki skill](../skills/konpeki/SKILL.md).
14
5
 
15
- ## Documents and exports
16
-
17
- New documents live in `slides/<name>/composition.json`, with `PROMPT.md`, source
18
- notes and reviewed images alongside. Keep the editable composition under version
19
- control. The canvas is the source of truth for editing and presentation; download
20
- its JSON for handoff and drag returned JSON onto the canvas to continue.
21
-
22
- One page is a complete creation. Presets cover Presentation (1920×1080), Square
23
- post (1080×1080), Portrait post (1080×1350), Link preview / OG (1200×630), and
24
- Article header (1600×600). The document contract supports 256–4096 pixels per side.
25
- Pages in one document may use different sizes. Changing size never stretches
26
- content and is refused when existing components would fall outside the page.
27
- Recompose for a new aspect ratio instead of stretching or cropping.
28
-
29
- **Export PNG** saves the active page at its declared dimensions without editor
30
- controls. JSON remains the editable source; PNG is an image. Fresh documents and
31
- added pages are empty. **Present** uses the same renderer for any page sequence.
32
-
33
- Standard Chart, Diagram and Table illustrations are structural drafts. Finished
34
- artwork can remain owned by its semantic component as editable vector elements.
35
- Retained React/SVG examples are drawing references, not another deck runtime.
36
-
37
- ## File-backed editing with an agent
38
-
39
- The CLI interface is `konpeki <command>`. After local installation, use
40
- `npm exec --no -- konpeki <command>` from your workspace. In a repository checkout,
41
- use the development shim `pnpm konpeki <command>` instead:
42
-
43
- ```sh
44
- npm exec --no -- konpeki validate slides/my-visual/composition.json
45
- npm exec --no -- konpeki preview slides/my-visual/composition.json
46
- ```
47
-
48
- `preview` prints a capability-bearing local URL. Open that exact URL. Valid
49
- browser edits are saved atomically to the composition file; a revision hash
50
- prevents overwriting concurrent external changes. When an agent updates the same
51
- file, the canvas loads the valid revision and keeps the previous document in Undo.
52
-
53
- An agent waiting for a person's revision request runs:
54
-
55
- ```sh
56
- npm exec --no -- konpeki wait slides/my-visual/composition.json
57
- ```
58
-
59
- In the file-backed canvas, select a component or an inner vector element and
60
- write a **Revision note** in the left panel's **Notes** tab. With nothing selected, the note targets
61
- the page. **Add note** saves feedback without starting a build; add notes to several
62
- targets, then choose **Build it** to submit them together. Numbered canvas pins
63
- return to their note and selection. Pins and notes never appear in presentations
64
- or PNG exports. Direct text, geometry and attribute edits still save normally.
65
-
66
- **Build it** saves the composition and submits its exact revision, selected page,
67
- component and optional vector-element ID, plus all unresolved notes. Without notes,
68
- it requests a build from the saved composition and selected scope as before.
69
- `wait` atomically claims one submitted request, marks it working, prints the
70
- machine-readable v2 request and exits. It does not launch or wake an agent.
71
- Until claimed, the canvas asks you to contact your coding agent and offers
72
- **Copy prompt** for the handoff. “Agent working” means claimed, not a live
73
- agent heartbeat. Only one request per document can be active. Connection errors
74
- keep an active request locked until completion or cancellation.
75
-
76
- The agent must reread the named composition and preserve newer human edits.
77
- Follow each note's target IDs, not just the active page; never silently retarget
78
- a deleted element. After validating, rendering and inspecting all requested
79
- changes, explicitly finish using the ID returned by `wait`:
80
-
81
- ```sh
82
- npm exec --no -- konpeki finish slides/my-visual/composition.json <request-id> --message "Updated and checked"
83
- ```
84
-
85
- Only this acknowledgement resolves the submitted notes and unlocks editing.
86
- File changes alone do not complete the request; explicit no-op completion is
87
- valid when the requested result is already present. If blocked, finish with
88
- `--status needs-clarification --message "What needs clarification?"` or
89
- `--status failed --message "What failed"`. Notes stay unresolved for a retry.
90
- Do not mark a partly applied batch done. **Cancel request** unlocks the editor
91
- and keeps notes, but cannot stop an agent process; stop that agent before retrying.
92
-
93
- Feedback is stored next to the document as `composition.json.review.json`, separate
94
- from artwork and exports. Retain that file with the composition when moving work.
95
- Browser reloads and preview restarts preserve notes and request status. To inspect
96
- or recover an already claimed request after an interruption, run:
97
-
98
- ```sh
99
- npm exec --no -- konpeki request slides/my-visual/composition.json
100
- ```
101
-
102
- Coordinate with the previous worker before resuming; `wait` does not claim an
103
- already working request a second time. Do not edit the sidecar manually while a
104
- preview or agent is updating it. Existing v1 temporary requests are not migrated;
105
- finish them before upgrading, then resubmit if needed. Browser-local drafts and
106
- hosted examples do not expose revision notes or **Build it** because no local
107
- agent owns their files.
108
-
109
- Browser screenshots do not establish PDF/PPTX editability, font embedding or
110
- cross-application fidelity. Inspect every requested export separately.
6
+ Use the [HTML, files, theme, and CLI reference](../html/README.md) for document
7
+ rules and tool behavior, the [authoring floor](../skills/konpeki/floor.md) for
8
+ bans and the review checklist, and [AUTHORING.md](../AUTHORING.md) for judgment.