From a Design System to 42 Editing Commands: Building QuireKit's Native AI PPT With Tools, Design Thinking, and Workflow

2026-12-05来源 dev.toEnglish
From a Design System to 42 Editing Commands: Building QuireKit's Native AI PPT With Tools, Design Thinking, and Workflow

Slides were not on QuireKit's early roadmap. Once the DOCX editor matured, however, it became clear that a word processor alone leaves too many everyday workflows uncovered, so we added PPTX next. Online slide tools and AI PPT generators are already everywhere; true to how we build QuireKit, if we take it on, we want to build something genuinely different.

Working with AI every day, what I want is human-AI co-creation where AI does the heavy lifting: humans set direction and make judgment calls, while AI handles design execution. For AI to carry that weight, it cannot just stuff text into preset template boxes. It needs aesthetic taste, design thinking, and stylistic range.

Here are six native .pptx covers synthesized on the fly in QuireKit 0.3.0 (@quirekit/pptx-editor) with zero built-in templates (live demo: https://quirekit.com/demo/pptx-editor/ · docs: https://docs.quirekit.com/pptx ; evaluation outputs below come from real Chinese-language runs):

Zero built-in templates: 6 native OOXML decks synthesized on the fly across distinct styles

None of these are raster exports or HTML screenshots. Every text box, vector shape, table cell, and chart bar is native OOXML that stays editable in the browser and exports cleanly to PowerPoint or WPS.

1. After Deleting 26 Templates: Three Intentional Design Ideas Behind the "Design Brain"

Our first version used 26 curated style templates behind a composeSlide command. The flaw showed up immediately: no matter what the topic was, the output kept falling back to the same handful of shells whether they fit the subject or not, feeling rigid and repetitive after just a few decks.

After deleting all 26 templates, I realized I needed to answer a basic question first: what actually makes a good presentation? Thinking back to Chinese keynote designer Xu Cen's videos on presentation craft (and his work at Smartisan), alongside launches from Apple and Xiaomi, good decks rely heavily on deliberate design decisions, and the designer is the soul of the deck. Instead of relying on preset templates, I gave AI the role of a designer around three clear ideas:

Design Idea Core Problem Solved Concrete Mechanism
1. Build a "Design Brain" Stops AI from dumping bullet points without narrative pacing Core Design Doctrine (one claim per slide, content-driven layouts, strong visual beats every 3 to 5 slides), 5 on-demand scenario skills, and a 10-task window.pptxEval suite
2. Study 1,000 Commercial Covers Closes the gap between varied layouts and real visual assets Without access to full commercial .pptx files, we annotated ~1,000 commercial cover slides against a fixed taxonomy. Covers alone carry enough visual signals to analyze what works and decide which underlying elements, effects, and drawing tools to build (while refusing to copy monotonous template layouts)
3. Design Language First (L0-to-L8) Keeps free-form synthesis cohesive without rigid coordinates Followed the same path we used for QuireKit Design (defining the design language before building the UI component library), combining Atomic Design, W3C Design Tokens, Gestalt, and CRAP into an 8-layer assembly model; trimmed 22 style cards down to 16 sample-backed cards, reverted rigid ratios, and removed an ambiguous radial-rays motif

2. A Design System Instead of Templates (Four Real Runs)

Handing an LLM a blank canvas and expecting great design from thin air is just gambling on retries. To keep quality dependable even when a model is not top-tier, I borrowed how frontend engineers build component libraries and designers maintain design assets: instead of locking whole-slide templates, we ship reusable underlying grids, skinnable components, parametric vector elements, and visual effects that AI can both assemble directly and imitate or adapt.

In code, those reusable assets form five composable layers: 16 sample-backed style cards (luminance, whitespace, and type-scale ranges), OKLCH palette derivation (directly reusing QuireKit Design / @quirekit/ui's own OKLCH color and contrast algorithm, quireSrgbToOklch / quireContrastRatio, adjusting lightness while keeping hue to target 7:1 for running text and 4.5:1 for secondary text), a 12-column semantic page grid (area: { columns, rows, band, bleed }, aligning margins and even wrapped card rows), 16 skinnable components (bento, matrix, pyramid, layers, timeline, mock-email/phone/browser), and 19 parametric vector motifs (dot grids, glows, HUD rings, ink mountains, seals, and frames rendered as native editable shapes).

Same topic, three visual languages: running the exact same data-security training prompt through tech-glow, flat-illustration, and type-poster re-skins the entire visual system, including the phishing mock-email component:

Same data-security training topic synthesized across tech-glow, flat-illustration, and Swiss type-poster styles

Out-of-library synthesis: there is no newspaper card in the library. Prompted with one sentence ("urban-renewal oral history reading-club deck like a vintage newspaper front page"), the model distilled a new style card on the fly with newsprint tones, masthead metadata, hairline columns, red seals, and hand-drawn callout circles:

Four-slide urban renewal oral history deck synthesized from a single vintage newspaper prompt

Native data slides: instead of frozen chart screenshots, the bank Q3 earnings deck renders native OOXML ledger tables and focal-highlighted bar charts using the deck's theme. Double-click the chart in PowerPoint and the data stays editable:

Bank Q3 earnings eval deck: cover, hero KPI, borderless native OOXML ledger table, and highlighted native bar chart

Dual illustration paths: with image generation on, parallel Qwen-Image calls share one character anchor across a 12-slide story deck while switching cleanly to vocabulary cards where art is unnecessary; with image generation off, the model authors sanitized native SVG vectors directly (with an automatic Office bitmap fallback):

Comparison of Qwen-Image parallel illustrations versus model-authored native SVG vectors on the same lesson deck

3. Reserved Support for Fixed Templates as Well

Shipping zero built-in templates does not mean rejecting fixed layouts. For universities, enterprises, or any workflow that requires a fixed template, QuireKit supports applying an existing .pptx directly as a template and exposes a pluggable PptxTemplateSource interface for building dedicated or online template libraries later. Once bound, the engine automatically analyzes example slides and masters in the browser (classifying page roles, slot character limits, repeated items, and safe content areas), hides redesign commands (drawSlide, setDeckDesign), and switches AI to addTemplatePage so every new page respects the template.

4. Co-Creation: Keeping Creative Sign-Off With the Human

Because I want real human-AI co-creation, the workflow avoids one-shot roulette and stores every workflow decision inside the .pptx itself:

流程图:QuireKit AI PPT Co-Creation Flow: Returning Decisions to Humans

Two details matter most: direction samples render the user's real titles and pass a ~17ms static layout check before display so broken wraps are filtered out early; and QuireKit.Brief / Plan / Theme / Directions persist in standard .pptx custom properties so PowerPoint and WPS ignore them cleanly while reopening in QuireKit restores the storyboard and lets single-slide edits regenerate only affected pages.

5. Beyond Generation: 42 Native Operations Inside the Live PPTX Editor

Design ideas and style cards can be studied by anyone. Where most AI slide tools stop is fine-grained editing: they can regenerate a whole slide, not manipulate native objects inside a live deck. QuireKit exposes 42 native OOXML editor commands directly to AI on the same transaction and undo stack as the toolbar:

Capability Area Native Operations AI Can Execute Directly
Fine Layout & Object Editing Move or resize single objects or whole semantic card groups (moveShapes, setShapeBounds), align, reorder z-index, rotate/flip, ungroup, adjust text runs, indentation, spacing, fills, and outlines
In-Place Tables & Charts Edit individual table cells while preserving formatting (setTableCellText), update live native chart categories and series (setChartData), and insert native tables, charts, and diagrams
Native Motion & Transitions Apply deck-wide pacing for live talks or auto-play (applyMotion), add or clear entrance/emphasis/exit animations on individual shapes or groups, and configure slide transitions (setSlideTransition)
Slides, Notes & Template Filling Add, duplicate, hide slides, write speaker notes, switch slide layouts (setSlideLayout), and fill pages strictly within fixed templates (addTemplatePage)

This builds directly on the self-describing command mechanism we designed starting with Classic (our DOCX editor): via defineCommand in @quirekit/extension-authoring, every command carries its own AI description, JSON Schema parameters, and validation rules right on the command factory (overriding a command replaces both implementation and description). That mechanism has become QuireKit's shared product language across editors, and every batched AI call runs as a single atomic undo step right alongside manual toolbar edits.

6. Four Engineering Principles Holding It Together

流程图:Decoupled AI Core Architecture: Shared Command Surface for UI, Scripts & AI

  1. Centralized AI surface + self-describing decoupling: pnpm ai:boundary:check enforces that @quirekit/ai-runtime owns all model-facing tools, views, and instructions, while feature packages only expose self-describing commands. No matter how many visual components or commands we add, the core surface stays minimal (document_read / edit / help + slide_look + on-demand skill_read).
  2. One command registry + natural-phrasing tolerance: Toolbar actions, host scripts, and AI share the same command registry and undo stack. document_edit accepts intra-batch slide references and normalizes common model aliases, recovering 152 / 182 previously rejected operations replayed from 41 real chat logs.
  3. Gestalt checks + vision + 3-way merge undo: parseSlideStructure groups flat OOXML shapes into a readable region tree and flags hard overlaps, overflows, and line crossings; vision models inspect rendered slides and generated pictures via slide_look; rejecting AI edits on an existing .pptx runs an OOXML 3-way merge (@quirekit/office-kit-pptx-editor/merge) so concurrent manual edits survive.
  4. Cutting "clever" ideas backed by real-model evals: Multi-run regressions on the 10-task suite led us to turn off parallel sub-assistants (upstream request serialization made parallel 9 min slower than 8.3 min serial), keep deep thinking enabled (disabling it hit the 48-turn cap in 98s with 5 overlapping slides vs. 16 clean slides in 41 turns), and keep turn history append-only to preserve ~196k tokens of prompt prefix cache.

7. Open-Source and Commercial Boundaries

QuireKit's core stack (165+ npm packages) is MIT open source, including @quirekit/office-kit-pptx, @quirekit/office-kit-pptx-preview, and @quirekit/office-kit-pptx-editor (derived from Yuichiro Yamashita's MIT office-kit/pptx), plus the @quirekit/ai-* runtime packages.

The full turnkey workbench @quirekit/pptx-editor is a commercial component, installable via npm and free for development and evaluation (a light unlicensed indicator appears only in unlicensed production deployments). Our commercial focus is primarily enterprise licensing, and we do not charge users for AI usage: every QuireKit product line integrates the AI agent panel so you can plug in your own model API key directly. For everyday users, all online tools on our website are already licensed with no watermark and open for free, and we also plan to package approachable consumer-facing tools on top of this stack to help people save on everyday software subscriptions.

In future posts, I will unpack the lower-level engineering problems we solved while building the PPTX editor and its AI capabilities. Let me know which parts you would like to dive into.

原文:https://www.a8q9.cn/en/article/from-a-design-system-to-42-editing-commands-building-quirekit-s-native-ai-ppt-wi-669096.html

相关文章