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/AGENTS.md CHANGED
@@ -1,33 +1,26 @@
1
- # Konpeki
1
+ # Konpeki repository guidance
2
2
 
3
- Konpeki is a shared editable canvas for people and coding agents. The agent owns
4
- the conversation; composition JSON owns the document; the browser edits and
5
- presents that same document.
3
+ ## Read by responsibility
6
4
 
7
- ## Choose the relevant guide
5
+ - Authoring workflow: [skills/konpeki/SKILL.md](skills/konpeki/SKILL.md)
6
+ - HTML, local files, theme, diagnostics, preview, and CLI:
7
+ [html/README.md](html/README.md)
8
+ - Bans, defaults and review checklist: [skills/konpeki/floor.md](skills/konpeki/floor.md)
9
+ - Editorial and visual judgment: [AUTHORING.md](AUTHORING.md)
10
+ - Environment setup: [SETUP.md](SETUP.md)
11
+ - Implementation work: [docs/development.md](docs/development.md)
8
12
 
9
- - First-time setup: [SETUP.md](SETUP.md).
10
- - Opening the editor, creating or revising visuals: [Konpeki skill](skills/konpeki/SKILL.md)
11
- and [AUTHORING.md](AUTHORING.md), which owns design and factual-fidelity rules.
12
- - Changing the application: [development guidance](docs/development.md) and
13
- the [composition contract](composition/README.md).
14
- - Browser/file handoff: [canvas workflow](docs/workflow.md).
13
+ Use the toolchain pinned in `mise.toml`; run repository commands through
14
+ `mise exec --` unless it is already active. Use pnpm, preserve the lockfile, and
15
+ do not install tools globally.
15
16
 
16
- ## Shared rules
17
+ Preserve unrelated work, supplied facts and provenance, stable IDs, and deliberate
18
+ human edits. Reread source before revising it. Automated checks do not replace
19
+ visual or factual review.
17
20
 
18
- - For repository development, use the toolchain pinned in `mise.toml`. Run
19
- commands through `mise exec --` unless the mise environment is already active.
20
- Use pnpm and preserve the dependency lockfile; do not install tools globally.
21
- - Keep drafting, editing and presentation on the shared composition canvas.
22
- Retained React/SVG examples are drawing references, not a parallel deck runtime.
23
- Example geometry is not a design requirement.
24
- - Preserve unrelated work, human edits and stable component/vector IDs. Reread
25
- the current composition before revising it; do not overwrite a newer revision.
26
- - Complete requested implementation, rendering, inspection and repair unless
27
- the person requests a checkpoint. Ask when missing facts prevent faithful work.
28
- - Scale checks using [verification guidance](docs/development.md#verification).
29
- Inspect affected renders for visual changes; tests alone are not visual review.
30
- - Keep creative briefs and factual provenance with examples. Exclude private
31
- chat, coordination transcripts, workspace paths, credentials and agent/model
32
- or timezone metadata. Label excerpts, adaptations and redactions honestly.
33
- - Do not push, publish or deploy without permission.
21
+ Keep taste rules in `floor.md`, one ID each. A rule agents keep breaking gets an
22
+ `inspect` check under the same ID, with passing and failing fixtures from real
23
+ output; a rule without a check stays on the review checklist. Name the output
24
+ that prompted a floor change.
25
+
26
+ Never publish, push, deploy, or tag without explicit permission.
package/AUTHORING.md CHANGED
@@ -1,233 +1,72 @@
1
- # Authoring visuals
1
+ # Authoring judgment
2
2
 
3
- Make visually compelling pages that explain the material clearly.
4
- This file owns design guidance. The brief overrides taste defaults; preserve
5
- accuracy and readability. Components, specimens and historical studies are
6
- resources to adapt freely.
3
+ This guide owns editorial and visual judgment that no rule can settle. For
4
+ workflow steps, use the [Konpeki skill](skills/konpeki/SKILL.md); for the bans,
5
+ defaults and review checklist, use its [authoring floor](skills/konpeki/floor.md);
6
+ for source and tool rules, use the [HTML reference](html/README.md).
7
7
 
8
- ## Destination and surface
8
+ ## Accuracy and editorial judgment
9
9
 
10
- A single page is a complete creation. The brief may request a social graphic,
11
- Open Graph preview, article header, standalone explanation or presentation.
12
- Choose page dimensions for that destination, within 256–4096 pixels per side;
13
- do not assume 16:9 or invent extra pages. Record the destination in
14
- `intendedViewingSize` (`social`, `article`, `presentation` or `custom`).
15
- For another aspect ratio, recompose deliberately rather than stretching artwork,
16
- silently cropping evidence or shrinking essential text. Each page can have its own size.
17
-
18
- Return finished, inspected output by default. Do not require people to sketch,
19
- choose component types or approve an outline unless they ask for that checkpoint.
20
- Treat supplied sketches as partial direction and preserve deliberate human edits.
21
- The slide-oriented guidance below also applies to single visual pages where relevant.
22
-
23
- ## Requirements
24
-
25
- - Preserve facts, sources, units, denominators, bounds and meaningful caveats.
10
+ - Preserve facts, sources, units, denominators, bounds, and meaningful caveats.
26
11
  Distinguish evidence from interpretation; never invent data or filler.
27
- - Keep all essential content readable at the intended viewing size. Check
28
- captions and sources as carefully as body text. Do not hide overflow, truncate
29
- required copy or automatically shrink text to fit.
30
- - Represent relationships honestly: correct arrow directions, clear label/value
31
- associations, appropriate chart scales and zero baselines for amount bars.
32
- Do not rely on color alone to distinguish meanings.
33
- - Use licensed assets and real font weights; verify fonts load before measuring
34
- text.
35
- - Keep slide order, outer component geometry, reading/paint order and semantic
36
- relationships in the Konpeki composition document. Use the same canvas for
37
- editing and presentation preview.
38
- - When standard components cannot express the artwork, attach editable vector
39
- elements to the owning component. The composition owns both the component's
40
- outer geometry and stable IDs for its internal lines, shapes, paths and text.
41
- React may generate SVG in a trusted build step, but convert supported SVG
42
- primitives into the vector tree rather than making React a second deck source.
43
-
44
- ## Writing tone
45
-
46
- Write like a builder explaining their work to a capable peer: plainspoken,
47
- concrete and concise. Give each slide a main point and state it in the headline.
48
- Cut hype, repetition and rhetorical “not X, but Y” framing. Keep names consistent,
49
- explain unfamiliar terms and retain enough context to make sense without narration.
50
-
51
- Start the slide's reading order with its main headline. By default, omit brand
52
- eyebrows above it and section labels that repeat it. Do not add a numbered
53
- micro-heading merely because the slide belongs to a sequence; retain numbers
54
- when they explain actual steps or provide useful page navigation.
55
- Keep an extra label only when removing it would lose necessary context,
56
- navigation or required attribution, or when the user explicitly requests it.
57
- Apply this test when composing shared slide frames as well as individual pages.
58
-
59
- Omit recurring metadata footers by default. Put deck-wide product names,
60
- generic source descriptions and provenance in the example's README/source record
61
- or introduce them once where useful. Keep page-specific citations, units and
62
- meaningful caveats next to the evidence they qualify; preserve legally required
63
- attribution and make fictional data clear where it is presented. Useful page
64
- numbers may stand alone without a footer strip or separator. A table's closing
65
- rule ends the table, not the page; do not add a page-bottom rule for metadata.
66
-
67
- Make each page answer one identifiable audience question. In a worked example,
68
- carry named actors, current state and consequences through the explanation.
69
- Explain what a choice changes: abstract labels such as “keep, revise or replace”
70
- are not enough without their concrete outcomes. Place implementation requirements
71
- with the mechanism they constrain and limitations with the claims they qualify;
72
- do not turn an action-oriented page into an equal-weight collection of steps,
73
- requirements and unrelated caveats. Preserve essential limitations visibly,
74
- redistributing them across the deck rather than hiding them in notes. Use names
75
- instead of pronouns when multiple actors make the reference ambiguous.
76
-
77
- ## Taste and creative freedom
78
-
79
- ### Authoring mode
80
-
81
- Offer exactly two modes: `default` and `dynamic`. Use `default` when omitted.
82
- Default preserves the pre-revision visual rules; dynamic removes the specific
83
- restrictions listed below. It grants freedom, not a requirement to add decoration,
84
- more colors or more diagrams. This is an authoring instruction, not a runtime
85
- switch or a model-specific setting.
86
-
87
- | Rule | `default` — original rules | `dynamic` — relaxed rules |
88
- | --- | --- | --- |
89
- | Unspecified theme | Minimalist white canvas, dark text, sans-serif and one restrained main accent. Beige and light violet only when requested. Additional semantic chart/status colors are allowed. | Same background, font and main-accent defaults. Expressiveness comes from composition and visual explanation, not an automatic theme change. |
90
- | Emphasis and containers | Prefer typography, placement and whitespace. Keep containers restrained; use fills for state, meaningful boundaries or highlighted evidence, not decorative emphasis. | Color fields, tinted panels and shapes may also provide hierarchy, grouping, rhythm and emphasis. Remove competing layers, not containers as a category. |
91
- | Subheadings | Give subheadings enough typographic emphasis to distinguish them from supporting text. | Hierarchy may also come from placement, color or grouping without extra type contrast. |
92
- | Drawing style | Keep text/data crisp; Rough.js is opt-in by user or template choice. | Choose crisp or hand-drawn treatment to suit the direction; text/data remain legible. |
93
- | Arrows | Use arrows for relationships that placement and wording do not already make clear. Default to open, stroked heads unless the user or notation calls for another form. | Arrows may reinforce prose when useful; open or filled heads are valid. |
94
- | Framing | No decorative top/bottom ribbons or side rails. Match surrounding padding to differently proportioned artwork rather than adding contrasting bands. | Bands and rails may support composition or emphasis; compose surrounding space deliberately. |
95
-
96
- Dynamic does not imply a dark or colored canvas. Make the composition more
97
- expressive before changing the theme. Keep the white canvas and sans-serif
98
- fallback unless the user supplies another direction; use accent fills locally
99
- for emphasis, grouping or visual explanation rather than recoloring the page.
100
-
101
- In both modes, explicit brand, palette, typeface and visual references override
102
- taste defaults, never accuracy or readability. Choose explanation structure and
103
- depth from the source, audience and brief, not extra parameters. Tinted text cards
104
- alone do not constitute a visual explanation. Never invent relationships or
105
- supporting facts to satisfy a mode.
106
-
107
- Palette/background, font pairing, illustration style, audience, tone, delivery
108
- format, viewing size and page count are brief choices or constraints. They are
109
- not additional numeric knobs.
110
- Do not expose separate container-count, arrow-count, hue, corner-radius or
111
- "creativity" sliders: choose these implementation details to serve the brief.
112
-
113
- Resolve conflicts in this order: accuracy/readability requirements, explicit
114
- content and delivery constraints, specific visual directions, then authoring mode
115
- and its default. With a fixed page count, recompose or remove optional repetition
116
- rather than shrinking text to fit; ask for a scope/page-count decision if required
117
- content cannot fit legibly. Never silently drop it or add pages.
118
-
119
- Apply the mode deck-wide, with page-level variation where content warrants it.
120
- Record the requested setting (or `unspecified`) and resolved setting in the adaptation
121
- record in `PROMPT.md`, separately from verbatim user wording. Do not retroactively
122
- label historical outputs as if they were generated with this parameter.
123
-
124
- The parameter is usable through the existing authoring workflow, but its
125
- reliability has not been established by earlier examples. Compare actual renders
126
- on the same brief, not counts of shapes or an aesthetic score.
127
-
128
- ### Palette, type and visual explanation
129
-
130
- For font-family choices, consider IBM Plex Sans for technical explanations,
131
- Noto Sans for neutral typography or Hanken Grotesk for a product-oriented feel.
132
- Reuse the project's established typeface when one exists. Inter is acceptable;
133
- choose for readability, language coverage and fit with the brief rather than
134
- novelty. These are suggestions, not a closed list. Keep font roles consistent
135
- and verify the required weights load.
136
-
137
- Choose a coherent deck-wide palette and treatment within the selected mode or
138
- explicit user direction. Keep font roles consistent and the reading order clear.
139
- Keep chart and status meanings stable, and provide labels or other cues when a
140
- distinction carries information. Apply the mode table to emphasis and containers.
141
-
142
- Consider a diagram, annotated artifact or visual comparison when relationships
143
- are central to the point. Use it when it makes those relationships easier to
144
- grasp, even if prose could describe them. Supporting words and visuals can
145
- reinforce each other. Do not require a diagram on every page or invent causal,
146
- temporal or quantitative meaning to justify one.
147
-
148
- Use whitespace and alignment for independent paragraphs and heading–description
149
- pairs; columns alone do not require borders. Use horizontal rules when they help
150
- readers track corresponding items across columns. When rules establish table
151
- rows or paired rows, give the group a clear ending before notes or conclusions,
152
- usually a closing bottom rule. Do not add separators to every paragraph.
153
- Align a short row heading with the first line of its description, rather than
154
- centering it against a multiline paragraph. Apply the mode's subheading guidance
155
- and verify that headings are distinguishable from their supporting text.
156
-
157
- Use the mode's arrow policy. Keep arrow meaning and treatment consistent, and
158
- align anchors and labels with the objects they refer to. Do not imply a transition
159
- or dependency that the evidence does not support.
160
-
161
- Use the mode's framing policy; do not add recurring metadata strips merely to
162
- fill space. Use the intended ratio where supported. Inspect both the preview
163
- and requested export.
164
-
165
- Find optional themes, palettes and semantic patterns in the
166
- [design index](design/README.md). Choose visuals for the audience's question
167
- and the relationships to explain.
168
-
169
- ## Workflow and review
170
-
171
- Ground the story in the brief and sources: audience, takeaway and delivery needs.
172
- Use lightweight page drafts when they help resolve story, density or pacing;
173
- they are not a required deliverable for every edit. State material assumptions
174
- and proceed with reasonable composition choices within the design defaults.
175
- Ask when missing evidence or conflicting requirements prevent a faithful result.
176
- Honor an explicit draft-review checkpoint; otherwise continue to the requested output.
177
-
178
- Reuse the kit where useful. Use deck-local SVG/React as trusted drawing source
179
- when existing components weaken the explanation, then convert its supported
180
- primitives to composition vectors. Do not replace the editable composition with
181
- framework source. No new runtime or template framework is needed.
182
-
183
- A completed slide implementation includes runnable source, source notes and
184
- inspected captures at presentation and review sizes. Check factual fidelity,
185
- readability, clipping and visual relationships, plus coherence across pages and
186
- any requested variants. Before delivery, inspect each page's reading order and
187
- apply the [text review](design/review/text.md), including redundant hierarchy.
188
- Readable, in-bounds text can still repeat the headline unnecessarily. Record
189
- the page-level evidence and repair findings without waiting for user feedback.
190
- Repair consequential issues and inspect fresh renders
191
- before delivery. Use [development checks](docs/development.md#verification) for relevant code checks
192
- and [focused visual review](design/visual-review.md) for applicable review guidance.
193
- Specimen geometry assertions and aesthetic scores are not design requirements.
194
- Do not add an aesthetic linter.
195
-
196
- For each new example, save `slides/<name>/PROMPT.md` before authoring: the exact
197
- initial prompt, supplied source material or links, and explicit visual preferences
198
- (including none). Preserve creative follow-ups accurately and record material
199
- assumptions and manual edits separately. Exclude private coordination transcripts,
200
- agent/model identifiers, generation timestamps and environment metadata. Keep input
201
- facts and datasets in `SOURCE.md` when substantial. These records explain why
202
- the example looks and reads as it does, as well as supporting reproduction.
203
- Mark adaptation prompts and reconstructed history honestly; do not invent an
204
- original prompt for an inherited specimen. Never commit secrets or private
205
- material without permission; record any redaction.
206
-
207
- Report verification limitations and only behavior actually tested. Browser
208
- images do not establish PDF/PPTX or cross-application fidelity. Inspect requested
209
- exports separately; if a delivery target is unsupported, explain the limitation.
210
-
211
- ### Explore an uncertain direction
212
-
213
- When the user is unsure about the mode, offer two candidates of one representative
214
- page: `default` and `dynamic`. Generate them when requested or accepted, not
215
- automatically for every deck. Keep wording, evidence, caveats and viewing size
216
- fixed. Honor the same explicit visual constraints; otherwise let each mode's
217
- theme policy apply. Render and inspect both, label the modes and explain the
218
- differences. Let the user choose before applying the mode across the deck.
219
-
220
- When a design choice matters and the brief does not settle it, choose one page
221
- and one primary axis: composition, density, hierarchy or wording. Render two or
222
- three named alternatives with the same facts, evidence and chosen theme.
223
- Vary the answer, not just the tint. For architecture, an ownership map, request
224
- journey and failure-boundary view can test which structure explains the point.
225
- Keep required relationships visible in every candidate.
226
-
227
- Show candidates at the same viewing size and explain what each makes easier
228
- and what it sacrifices. For an exploration-only request, recommend a direction
229
- and let the user choose. When implementation is requested, choose and carry it
230
- through unless the user requested a selection checkpoint.
231
- Promote the selected direction and remove temporary comparison scaffolding;
232
- retain alternatives only when requested. This is optional exploration, not a
233
- required extra round for every deck.
12
+ - Give each page one identifiable audience question, answered by its headline.
13
+ - Keep names consistent and explain unfamiliar terms. Put citations, units, and
14
+ caveats next to the evidence they qualify; preserve required attribution.
15
+ - If fixed page count and required content conflict, ask for a scope decision
16
+ rather than dropping content or making it illegible.
17
+
18
+ ## Adapt content to the format
19
+
20
+ Read the matching [output guide](skills/konpeki/SKILL.md#choose-the-output-guide)
21
+ for slides, résumés, long documents, one-pagers/cards, or covers/social graphics.
22
+ Use [content patterns](skills/konpeki/references/patterns.md) for text with visuals,
23
+ charts, tables, comparisons, processes, systems, or annotations in the work.
24
+ They guide decisions, not fixed templates or a placement grid.
25
+
26
+ Specify required facts per format, not on every page of a multi-format set.
27
+ Keep a qualification wherever its claim appears, and retain required disclosure.
28
+ Preserve the same headline wording across announcement formats; change its
29
+ line breaks, not the promise. Avoid breaks that strand articles or prepositions.
30
+
31
+ Review link cards at about 500px wide, slides at presentation distance and print
32
+ pages at actual size. The minimum-size diagnostic is a floor, not a target for
33
+ body text. Use print running heads, page numbers and recurring source references
34
+ when they help navigate a multi-page document; remove repetitive metadata from
35
+ standalone graphics.
36
+
37
+ ## Visual judgment
38
+
39
+ The brief, brand, and references choose the visual language, but never override
40
+ accuracy or readability. The selected theme owns repeatable treatments; this
41
+ guide and other design skills own their use. Konpeki bundles one theme, Cobalt:
42
+ cobalt ink on warm paper. A brief-specific theme adapted from it is an equally
43
+ valid starting point.
44
+
45
+ For Cobalt, use square corners, precise alignment and an asymmetric layout led
46
+ by a strong headline. That is this theme's taste, not a restriction on a
47
+ brief-specific theme or meaningful chart geometry. A custom theme may carry
48
+ short companion `NOTES.md` with its own look-specific guidance.
49
+
50
+ Use complete type roles rather than accumulating near-identical treatments, and
51
+ the same rule treatment for the same purpose. Color distinguishes roles: accent
52
+ for the main claim or path, muted ink for supporting copy, categorical colors
53
+ for identity, sequential colors for amount. Token compliance does not establish
54
+ good composition or honest visual encoding.
55
+
56
+ Budget space for the headline, chart or table, sources and caveats together.
57
+ Prefer flow or grid rows over absolute positions for text that can wrap after a
58
+ theme swap. Avoid guessed fixed-height paragraph boxes and manual line breaks
59
+ that imitate wrapping. Judge visible text as well as its CSS box: line height,
60
+ padding, and font metrics affect perceived gaps and alignment. On contrasting
61
+ fields, explicitly set the ink of nested type roles and code too: their defaults
62
+ may replace the parent's color.
63
+
64
+ Use diagrams, annotated artifacts, charts, or comparisons only when they make
65
+ real relationships easier to grasp. Use arrows sparingly and keep semantic
66
+ colors consistent.
67
+
68
+ Resolve conflicts in this order: accuracy and readability; the floor's bans;
69
+ explicit content and delivery constraints; specific visual direction; then the
70
+ floor's defaults and these taste notes. Finished work is the default: do not
71
+ impose a questionnaire, diagram choice, or outline checkpoint unless the user
72
+ asks for one.
package/CONTRIBUTING.md CHANGED
@@ -1,25 +1,12 @@
1
1
  # Contributing to Konpeki
2
2
 
3
- Thanks for helping improve Konpeki. Bug reports, focused fixes and additions that
4
- strengthen the shared human-agent canvas are welcome.
3
+ Bug reports and focused improvements are welcome. Search existing issues first,
4
+ and discuss large contract changes before implementing them. Never include
5
+ private documents, credentials, or proprietary source material in issues,
6
+ fixtures, or screenshots. Report vulnerabilities via [SECURITY.md](SECURITY.md).
5
7
 
6
- ## Before opening a change
7
-
8
- - Search existing issues before filing a new one.
9
- - Use an issue to discuss large features or changes to the composition contract
10
- before investing in an implementation.
11
- - Do not include private compositions, credentials or proprietary source material
12
- in issues, fixtures or screenshots.
13
- - Report security concerns through the process in [SECURITY.md](SECURITY.md), not
14
- through a public issue.
15
-
16
- ## Development
17
-
18
- Follow [docs/development.md](docs/development.md) to install the pinned Node.js and
19
- pnpm toolchain. Keep changes scoped and preserve existing composition compatibility
20
- unless a contract change has been agreed in advance.
21
-
22
- Before opening a pull request, run:
8
+ Follow [docs/development.md](docs/development.md) for the pinned toolchain and
9
+ verification guidance. Before opening a pull request, run:
23
10
 
24
11
  ```sh
25
12
  mise exec -- pnpm check
@@ -28,9 +15,9 @@ mise exec -- pnpm build
28
15
  mise exec -- pnpm check:package
29
16
  ```
30
17
 
31
- UI changes also require visual inspection using the relevant browser checks in
32
- [docs/development.md](docs/development.md#verification). Include the affected
33
- states and verification performed in the pull request description.
18
+ Include affected states and verification in the pull request description. UI
19
+ changes require visual inspection. Releases and deployments require maintainer
20
+ approval.
34
21
 
35
- By submitting a contribution, you agree that it is licensed under the repository's
22
+ By submitting a contribution, you agree that it is licensed under the
36
23
  [Apache-2.0 license](LICENSE).
package/README.md CHANGED
@@ -1,107 +1,116 @@
1
- ![Konpeki — Create clear visuals with your coding agent](slides/github-cover/cover.png)
1
+ # Konpeki
2
+
3
+ Konpeki helps a coding agent turn a brief and source material into finished
4
+ visuals: covers, social graphics, diagrams, charts, explainers, documents, and
5
+ presentations. Ordinary HTML and CSS are the editable source. Konpeki validates
6
+ that source, inspects the rendered pages, opens a review preview, and exports PNG
7
+ or PDF.
8
+
9
+ PNG and PDF are the delivery artifacts; recipients do not need Konpeki,
10
+ Playwright, or Chromium to view them. Konpeki requires no account or hosted AI
11
+ service. Your coding agent's pricing and data handling still apply.
12
+
13
+ ## How it works
14
+
15
+ The [Konpeki skill](skills/konpeki/SKILL.md) owns the authoring workflow. The
16
+ agent reads shared guidance, the matching [output guide](skills/konpeki/SKILL.md#choose-the-output-guide),
17
+ and relevant content patterns. Guides cover landscape slides, résumés, multi-page
18
+ documents, one-pagers/cards, and covers/social graphics without imposing fixed
19
+ layouts. The agent writes static HTML with fixed-size pages, then repeats a
20
+ short loop until the pages are sound:
21
+
22
+ 1. `validate` checks the source contract: explicit pages, stable IDs, local
23
+ resources, and no scripts.
24
+ 2. `inspect` renders the pages in the pinned Chromium and reports overflow,
25
+ clipping, text overlap, low contrast, small text, font fallback, theme
26
+ compliance, and [authoring floor](skills/konpeki/floor.md) rules as JSON.
27
+ 3. `render` exports a page or document and prints the review checklist for the
28
+ judgment calls no check covers. It refuses to write output while errors
29
+ remain and never overwrites an existing file.
30
+
31
+ `preview` opens a local board where a person can comment on elements and make
32
+ small source-backed moves, then copy that feedback back to the agent.
33
+
34
+ Automated checks do not establish factual correctness or visual quality. Supply
35
+ the facts and approved assets; examples and placeholders are not evidence about
36
+ real products.
37
+
38
+ ## Quick start
39
+
40
+ Use Node.js 24+ and install the exact version in your document workspace.
41
+ Check availability with `npm view konpeki@0.4.0 version`; if the registry does not
42
+ have it, use a [source checkout or local tarball](SETUP.md) instead. The 0.3.x
43
+ runtime is incompatible with this workflow.
2
44
 
3
- **Create clear visuals with your coding agent.** Konpeki is an opinionated design
4
- framework for covers, social graphics, visual explanations and presentations.
5
-
6
- Give your coding agent notes, source material and a brief. Konpeki provides the
7
- canvas, design guidance, typography and semantic components for the intended
8
- format and dimensions.
9
-
10
- People and agents edit the same composition. Export a page as PNG, download its
11
- editable JSON, or use **Present** for a chrome-free presentation.
12
-
13
- ## Use with your agent
14
-
15
- Requires **Node.js 24+**, npm, a coding agent that can edit files and run commands,
16
- and a browser.
17
-
18
- Install the [Konpeki skill](skills/konpeki/) with your agent's
19
- skill installer. Install the whole directory, including `scripts/` and `assets/`, not just
20
- `SKILL.md`. For example, ask a Codex skill installer:
21
-
22
- ```text
23
- Install the konpeki skill from vcfgdev/konpeki, at skills/konpeki.
45
+ ```sh
46
+ npm install --save-exact konpeki@0.4.0
47
+ npx --no-install konpeki browser install
24
48
  ```
25
49
 
26
- Then choose a mode, or just give it a brief:
27
-
28
- | Workflow | Codex CLI / IDE | Claude Code standalone skill |
29
- | --- | --- | --- |
30
- | Open a blank or existing editor; no generation | `$konpeki init` | `/konpeki init` |
31
- | Create, inspect and revise a visual | `$konpeki generate …` | `/konpeki generate …` |
32
-
33
- `init` accepts a composition JSON path and preserves existing work. `generate`
34
- uses the materials already in your conversation and prepares the runtime if
35
- needed; there is no required init step. Plugin installations may namespace the
36
- skill. Other hosts can select the skill or use natural language:
50
+ Create a starter with its theme beside it, then run the loop:
37
51
 
38
- > Use Konpeki to turn these launch notes into a product announcement.
39
-
40
- Or ask for an article cover, a social graphic, a chart, a diagram or a presentation.
41
- Natural-language creation requests select `generate` automatically.
42
- The skill reuses a compatible runtime or, with permission, installs the pinned
43
- npm release in a user cache. It creates editable JSON in your workspace, opens
44
- the preview and visually checks the result. You do not need to clone Konpeki,
45
- edit a package manifest, or repeat your prompt in a blank canvas.
46
-
47
- First-run installation, browser permissions and remote preview forwarding depend
48
- on your agent host. If skills are unavailable, give the agent the public
49
- [SETUP.md](https://raw.githubusercontent.com/vcfgdev/konpeki/main/SETUP.md) URL and
50
- your brief together. The setup guide also covers the optional Codex plugin package.
52
+ ```sh
53
+ node node_modules/konpeki/skills/konpeki/scripts/prepare-document.mjs node_modules/konpeki/runtime/konpeki.mjs work/document.html
54
+ npx --no-install konpeki validate work/document.html
55
+ npx --no-install konpeki inspect work/document.html
56
+ npx --no-install konpeki render work/document.html --page 1 --format png --scale 2 --output work/page-1.png
57
+ npx --no-install konpeki render work/document.html --format pdf --output work/document.pdf
58
+ npx --no-install konpeki preview work/document.html
59
+ ```
51
60
 
52
- Ask for revisions in the same conversation. Add “Stop after the outline for
53
- approval” when you want a checkpoint. Supply a visual direction or leave it open;
54
- [authoring modes](AUTHORING.md#authoring-mode) provide defaults without requiring
55
- you to choose fonts, colors or layouts first.
61
+ The browser is needed for `inspect`, `check` and `render`, not for `preview`. On
62
+ minimal Linux hosts, Chromium may need system libraries; see [SETUP.md](SETUP.md).
56
63
 
57
- Canvas review notes use **Build it** and an active agent listener, or the
58
- button's copyable handoff to resume the agent. Opening the editor alone does not
59
- connect or wake an agent. The skill modes are not terminal CLI subcommands.
64
+ To let your coding agent do the authoring, install the skill separately:
60
65
 
61
- ## Try the editor in your browser
66
+ ```sh
67
+ npx skills add vcfgdev/konpeki -g
68
+ ```
62
69
 
63
- [Open the editable Konpeki example](https://vcfgdev.github.io/konpeki/?example=introducing-konpeki).
70
+ Installing the skill does not install the runtime. The skill's
71
+ `ensure-runtime.mjs` finds a Konpeki 0.4.0 checkout or a `konpeki` package
72
+ installed in the current workspace, and never downloads one.
64
73
 
65
- The browser-only playground lets you edit an example or start blank, keep a local
66
- working copy, import/download editable JSON, export PNG and present. It requires
67
- no account or AI service. Browser-local data is not cloud backup; download JSON
68
- to keep or move your work. Continue with your coding agent using that file.
74
+ ## Upgrading from 0.3.x
69
75
 
70
- The [GitHub Pages playground](docs/development.md#github-pages) does not connect
71
- to an agent or expose **Build it**. The agent-led workflow above is the route
72
- from a prompt to a finished visual.
76
+ 0.4.0 replaces JSON compositions and the previous editing engine with static
77
+ HTML/CSS. Old JSON files do not open in this version, and there is no automatic
78
+ conversion. Keep an isolated 0.3.x installation for old work, or recreate it in
79
+ HTML while preserving its facts, assets and intended layout.
73
80
 
74
- ## Manual npm start
81
+ - Delivery formats are PNG and PDF; SVG can be authored inline, but is not an
82
+ export format. Inspection and export require the pinned Chromium.
83
+ - Review uses browser-local comments and **Copy & clear**, not the old
84
+ `wait` / `request` / `finish` CLI protocol. Update the skill and runtime together.
85
+ - Cobalt is the single bundled theme. Its Google Fonts dependency requires
86
+ network access unless you adapt the theme to local or embedded fonts.
87
+ - Review includes opt-in [Vim keyboard navigation and element hints](html/README.md#keyboard-review).
75
88
 
76
- For a manual start, install [Konpeki from npm](https://www.npmjs.com/package/konpeki)
77
- in your workspace (run `npm init -y` first in a new, empty directory):
89
+ The [public comment preview](https://vcfgdev.github.io/konpeki/) opens the
90
+ packaged starter. Use the CLI's `preview` to review your own document; local
91
+ changes stay local until a separately authorized release or deployment.
78
92
 
79
- ```sh
80
- npm install --save-dev konpeki@latest
81
- curl -fL https://raw.githubusercontent.com/vcfgdev/konpeki/main/slides/introducing-konpeki/composition.json -o introduction.json
82
- npm exec --no -- konpeki preview introduction.json
83
- ```
93
+ ## Theme
84
94
 
85
- Open the exact URL printed by `preview`. Browser edits save to your downloaded file;
86
- valid agent edits appear on the same canvas. In a remote environment, use its
87
- authenticated preview mechanism rather than sharing a local address.
95
+ Konpeki bundles one theme, Cobalt: cobalt blue on a light canvas with IBM Plex
96
+ Sans and Mono from Google Fonts. Its CSS contract lets a brief supply its own
97
+ visual treatment by adapting a copy; composition stays in HTML and page-owned CSS.
88
98
 
89
- ## Examples and guides
99
+ The default theme needs access to Google Fonts during preview, inspection, and
100
+ export. Exports fail if fonts cannot load or glyphs fall back to installed fonts.
101
+ For offline or reproducible rendering, use licensed local or embedded fonts in
102
+ the document's theme. Finished PNGs and PDFs need no network access.
90
103
 
91
- - [Example gallery](slides/README.md): 18 fictional examples and an editable
92
- Konpeki introduction. Retained React/SVG examples are drawing references;
93
- new editable documents use composition JSON.
94
- - [Agent-led setup](SETUP.md) and [authoring guidance](AUTHORING.md).
95
- - [Canvas workflow](docs/workflow.md): page sizes, export and agent handoff.
96
- - [Development](docs/development.md): architecture, demo hosting, packaging and checks.
97
- - [Composition contract](composition/README.md) and [design resources](design/README.md).
98
- - [Contributing](CONTRIBUTING.md) and [security policy](SECURITY.md).
104
+ ## Documentation
99
105
 
100
- Konpeki requires no account or hosted AI service. Your coding agent's pricing
101
- and data handling still apply. Supply facts and approved assets; examples and
102
- component placeholders are not evidence about real products.
106
+ - [Konpeki skill](skills/konpeki/SKILL.md): the authoring and revision workflow
107
+ - [HTML, files, theme, and CLI](html/README.md)
108
+ - [Theme contract](html/theme.md) and [theme authoring](html/theme-authoring.md)
109
+ - [Authoring floor: bans, defaults and review checklist](skills/konpeki/floor.md)
110
+ - [Editorial and visual judgment](AUTHORING.md)
111
+ - [Setup](SETUP.md), [development](docs/development.md) and
112
+ [contributing](CONTRIBUTING.md)
103
113
 
104
114
  ## License
105
115
 
106
- [Apache-2.0](LICENSE). Dependencies and bundled fonts retain their own licenses;
107
- external design references are credited where used.
116
+ [Apache-2.0](LICENSE). Fonts and other dependencies retain their own licenses.