@opendirectory.dev/skills 0.1.56 → 0.1.58

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.
@@ -0,0 +1,123 @@
1
+ # graphic-ebook
2
+
3
+ Create professionally designed B2B SaaS e-books (3–10 pages) using HTML + CSS. Supports 9 visual styles and 11 page layout types. Outputs a browser-ready HTML file + print-ready PDF.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npx "@opendirectory.dev/skills" install graphic-ebook --target claude
9
+ ```
10
+
11
+ ### Video Tutorial
12
+ Watch this quick video to see how it's done:
13
+
14
+ https://github.com/user-attachments/assets/ee98a1b5-ebc4-452f-bbfb-c434f2935067
15
+
16
+ ### Step 1: Download the skill from GitHub
17
+ 1. Copy the URL of this specific skill folder from your browser's address bar.
18
+ 2. Go to [download-directory.github.io](https://download-directory.github.io/).
19
+ 3. Paste the URL and click **Enter** to download.
20
+
21
+ ### Step 2: Install the Skill in Claude
22
+ 1. Open your **Claude desktop app**.
23
+ 2. Go to the sidebar on the left side and click on the **Customize** section.
24
+ 3. Click on the **Skills** tab, then click on the **+** (plus) icon button to create a new skill.
25
+ 4. Choose the option to **Upload a skill**, and drag and drop the `.zip` file (or extract and drop the folder).
26
+
27
+ > **Note:** Make sure you upload the folder that contains the `SKILL.md` file directly.
28
+
29
+ ---
30
+
31
+ ## What it does
32
+
33
+ - Asks 4 required questions to establish topic, audience, CTA, and content source
34
+ - Asks 9 optional intake questions to determine style, page count, and brand
35
+ - Plans the chapter structure and page sequence (with user confirmation)
36
+ - Drafts or uses provided content — per-page copy with word count discipline
37
+ - Generates a single self-contained HTML file — opens in any browser, no build tools
38
+ - Splits into per-page HTML files for individual sharing or editing
39
+ - Exports a print-ready PDF via Playwright (A4 portrait, 1200×1697px)
40
+ - Enforces visual rhythm — no 2+ consecutive text pages back-to-back
41
+
42
+ ## Example
43
+
44
+ > "Create a 6-page ebook titled 'The B2B SaaS Guide to Reducing Churn'. Audience: Customer Success Managers at 50–500 person SaaS companies. CTA: book a demo. Style: clean-slate. Brand: DataPulse."
45
+
46
+ Output: cover + TOC + chapter opener + body page + stat page + closing CTA, exported as PDF.
47
+
48
+ ---
49
+
50
+ ## Supported Styles
51
+
52
+ | Style | Best for |
53
+ |---|---|
54
+ | clean-slate | Enterprise B2B, sales teams, any audience that expects professionalism |
55
+ | midnight-editorial | Tech/AI companies, premium B2B, thought leadership |
56
+ | matt-gray | Board materials, internal reviews, professional mixed audiences |
57
+ | product-minimal | Product companies, design-forward B2B, design-savvy buyers |
58
+ | mint-pixel-corporate | SaaS sales, tech startups, growth-stage B2B |
59
+ | warm-earth | Agencies, consultancies, service businesses, health/education tech |
60
+ | brutalist | Standout materials, design-forward agencies, bold brands |
61
+ | magazine-red | Marketing agencies, brand-forward companies, research reports |
62
+ | soft-cloud | Onboarding materials, customer education, approachable SaaS |
63
+
64
+ ---
65
+
66
+ ## Supported Page Layouts
67
+
68
+ | Layout | Purpose |
69
+ |---|---|
70
+ | cover | Opening page — title, subtitle, brand name, visual |
71
+ | toc | Table of contents — numbered chapter list |
72
+ | chapter-intro | Section opener — large chapter number, title, teaser |
73
+ | text-column | Reading body copy — 1-column or 2-column |
74
+ | text-sidebar | Body copy + typed callout sidebar (tip/warning/stat/quote/checklist) |
75
+ | quote-callout | Full-page pull quote with attribution |
76
+ | stat-grid | 3–6 key metrics with visual emphasis |
77
+ | key-takeaways | Summary list — what the reader retains |
78
+ | full-image | Full-page CSS-generated visual or abstract composition |
79
+ | closing-cta | Final page — CTA action + email + URL |
80
+
81
+ ---
82
+
83
+ ## Output
84
+
85
+ | File | What it is |
86
+ |---|---|
87
+ | `ebook/[slug]/index.html` | Full ebook, browser-ready |
88
+ | `ebook/[slug]/page-01.html` … | Per-page HTML files for individual sharing |
89
+ | `ebook/[slug].pdf` | Print-ready PDF (A4 portrait) |
90
+
91
+ Standard dimensions: 1200×1697px (A4 portrait).
92
+
93
+ ---
94
+
95
+ ## Parameters
96
+
97
+ | Param | Required | Notes |
98
+ |---|---|---|
99
+ | topic | Yes | The ebook subject (specific: "5 ways to reduce CAC") |
100
+ | audience | Yes | Target reader persona (role, company size, pain point) |
101
+ | desired_action | Yes | What reader should do after reading |
102
+ | content | Yes | Existing content to use, or "draft from scratch" |
103
+ | page_count | No | 3–10 (default: 6) |
104
+ | key_takeaways | No | 3–5 things the reader should learn |
105
+ | brand_name | No | Company/product name for cover and footer |
106
+ | brand_logo | No | Logo URL (CSS initials generated if omitted) |
107
+ | style | No | One of 9 named presets or "show me options" (default: clean-slate) |
108
+ | chapter_count | No | Number of main sections (derived from page_count if omitted) |
109
+ | cta_details | No | Primary CTA (default: "book a demo") |
110
+ | contact_info | No | Email + URL for closing page |
111
+ | slug | No | Filename slug (derived from topic if omitted) |
112
+
113
+ ---
114
+
115
+ ## Dependencies
116
+
117
+ **Node.js** — required for PDF export. Auto-detected; install from [nodejs.org](https://nodejs.org) if missing.
118
+
119
+ Everything else is bundled inside this skill:
120
+ - `assets/viewport-base.css` — responsive page foundation (included verbatim in generated HTML)
121
+ - `scripts/export-pdf.sh` — PDF export via Playwright (auto-installs Playwright + Chromium on first run)
122
+
123
+ No external skill dependencies. No API keys required.
@@ -0,0 +1,396 @@
1
+ ---
2
+ name: graphic-ebook
3
+ description: Creates professionally designed B2B SaaS e-books in HTML + CSS, exported as print-ready PDF. 3–10 pages, 9 style presets, 11 page layout types. Trigger when user says "create an ebook", "design a lead magnet", "make a PDF guide", "build a gated content piece", "write a B2B ebook", "design a white paper", "create a nurture asset", or "make a PDF report".
4
+ compatibility: [claude-code, gemini-cli, github-copilot]
5
+ author: OpenDirectory
6
+ version: 1.0.0
7
+ ---
8
+
9
+ # graphic-ebook
10
+
11
+ Creates professionally designed B2B SaaS e-books — lead magnets, gated guides, nurture assets, white papers. HTML + CSS → print-ready PDF. 3–10 pages.
12
+
13
+ ## Critical Rules
14
+
15
+ Before any step, these rules are absolute:
16
+
17
+ 1. Every page MUST fit within A4 canvas (1200×1697px). No content overflow.
18
+ 2. All scalable font sizes use `clamp()`. Fixed px only for borders/structural elements.
19
+ 3. Single self-contained HTML. All CSS inline. Font CDN `<link>` only external dependency.
20
+ 4. **Never dump HTML in chat.** Save to file, show summary only.
21
+ 5. Body copy is primary. Line-height ≥ 1.75 on all text-column and text-sidebar pages. Max-width ≤ 65ch for single-column body.
22
+ 6. No generic AI slop: no Inter as display font, no purple-to-blue gradient on white, no "Thank You" closing.
23
+ 7. Visual rhythm: never place 2+ text-column pages back-to-back. Break with chapter-intro, quote-callout, or stat-grid.
24
+ 10. **Before generating HTML, commit to a design direction:** one tone, one signature element, one background system. Generic = failure. Each ebook must be distinctly designed for its audience and subject — not a template.
25
+ 8. `* { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }` — mandatory global CSS. Chromium strips all background colors in PDF without this.
26
+ 9. Every page except cover must have a page footer: page number + brand name. Absolute position at bottom of each `.slide`.
27
+
28
+ ---
29
+
30
+ ## Step 1: Brief Intake
31
+
32
+ Four required fields. If all four are present in the user's prompt: **skip to Step 2.**
33
+
34
+ If any are missing, ask **exactly**:
35
+
36
+ > "To create your ebook, I need four things:
37
+ > 1. **Topic** — what is the ebook about? (be specific: "5 ways to reduce CAC" not "marketing tips")
38
+ > 2. **Audience** — who reads it? (role, company size, pain point: "Customer Success Managers at 50–500 person SaaS companies struggling with churn")
39
+ > 3. **Desired action** — what should the reader do after? (book a demo, download a template, share with team)
40
+ > 4. **Content** — do you have existing content, or should I draft from the topic?"
41
+
42
+ Stop and wait. Do not read reference files. Do not generate any HTML or outline.
43
+
44
+ ---
45
+
46
+ ## Step 2: Complete Intake
47
+
48
+ Ask all 9 questions in one message, grouped. Defaults apply if skipped.
49
+
50
+ **Content**
51
+ 1. **Page count** — 3–5 (quick guide / checklist) / 6–8 (standard guide) / 9–10 (deep dive) (default: 6)
52
+ 2. **Key takeaways** — 3–5 things the reader should know or do after reading (informs chapter structure)
53
+ 3. **Brand name** — company or product name for cover and footer (or "skip")
54
+ 4. **Brand logo** — URL or "none"
55
+
56
+ **Design**
57
+ 5. **Style** — clean-slate / midnight-editorial / matt-gray / product-minimal / mint-pixel-corporate / warm-earth / brutalist / magazine-red / soft-cloud / "show me options" (default: clean-slate)
58
+ 6. **Chapter count** — how many main sections? (default: derived from page count)
59
+
60
+ **Output**
61
+ 7. **CTA details** — demo booking / newsletter signup / template download / other (default: "book a demo")
62
+ 8. **Contact info** — email + URL for closing CTA page (or "I'll add later")
63
+ 9. **Slug** — filename slug (e.g., "reduce-churn-guide-2025"; derived from topic if skipped)
64
+
65
+ **Defaults:**
66
+
67
+ | Question | Default |
68
+ |---|---|
69
+ | Page count | 6 |
70
+ | Key takeaways | derive from topic |
71
+ | Brand name | none |
72
+ | Brand logo | none |
73
+ | Style | clean-slate |
74
+ | Chapter count | derived from page count |
75
+ | CTA details | book a demo |
76
+ | Contact info | placeholder (flagged in checklist) |
77
+ | Slug | kebab-case of topic |
78
+
79
+ **If style = "show me options":** Generate 3 single-page HTML previews (cover page only) saved to `.claude-design/previews/style-a.html`, `style-b.html`, `style-c.html`. Open each automatically. Ask user to pick before Step 3.
80
+
81
+ ---
82
+
83
+ ## Step 3: Internal Architecture
84
+
85
+ Derive internally. Never show this to the user.
86
+
87
+ **Chapter → page mapping:**
88
+
89
+ | Pages | Typical structure |
90
+ |---|---|
91
+ | 3 | cover + [1 content page] + closing-cta |
92
+ | 4 | cover + [1 chapter-intro + 1 text-column] + closing-cta |
93
+ | 5 | cover + toc + [1 chapter-intro + 1 text-column] + closing-cta |
94
+ | 6 | cover + toc + [2 chapter-intros + 1 text-column] + closing-cta |
95
+ | 8 | cover + toc + [3 chapter-intros + 2 content pages] + closing-cta |
96
+ | 10 | cover + toc + [4 chapter-intros + 3 content pages] + key-takeaways + closing-cta |
97
+
98
+ **TOC rule:** Include for ebooks ≥ 6 pages. For 3–5 page ebooks, use a "What's inside" bullet list on the cover page or skip entirely.
99
+
100
+ **Three-point CTA architecture** (for ebooks ≥ 6 pages):
101
+ 1. **Intro CTA** (after page 2) — subtle 1-line inline mention: "explore our [tool] at [url]"
102
+ 2. **Mid-ebook CTA** (after a stat-grid or chapter-intro) — small `.callout--stat` or `.callout--tip` box with 1-line CTA
103
+ 3. **Closing CTA** (final page) — full-page, primary conversion action
104
+
105
+ **Visual rhythm check:** If 2+ consecutive `text-column` pages appear in the plan → insert `quote-callout` or `stat-grid` between them before proceeding.
106
+
107
+ **Design direction** (derive from style preset + audience — never shown to user):
108
+
109
+ | Decision | Derive from |
110
+ |---|---|
111
+ | **Tone** | What emotional register does this audience expect? (authoritative, editorial, energetic, calm, warm…) |
112
+ | **Signature element** | ONE visual device used consistently: oversized decorative numerals, diagonal accent bar, dot-grid overlay, gradient mesh on cover, rule lines, geometric shape bleed. Pick one. Use it. |
113
+ | **Background system** | How do backgrounds vary across pages? Cover and chapter-intros = most distinctive. Content pages quieter but NOT all-white. Closing CTA = dark or full-accent inversion. No 3+ consecutive pages with identical background. |
114
+ | **Motion style** | What do `.reveal` animations do? Pick one and stay consistent: `translateY(16px) → 0`, `scale(0.97) → 1`, `translateX(-12px) → 0`. Stagger delays 0.1s apart. |
115
+ | **Unforgettable detail** | What is the ONE thing a reader will remember about the design? Name it before writing any CSS. |
116
+
117
+ If no strong direction is derivable from style preset alone, ask yourself: what would a top-tier design agency produce for this specific audience and topic? Then execute that.
118
+
119
+ **Body copy density limits:**
120
+ - text-column 1-col: 180–250 words max per page
121
+ - text-column 2-col: 280–380 words max (140–190 per column)
122
+ - text-sidebar: 140–180 words main + ≤70 words sidebar
123
+ - chapter-intro: 40–60 words (teaser only)
124
+ - quote-callout: 30–45 words
125
+ - stat-grid: 3–6 metrics, minimal labels
126
+
127
+ ---
128
+
129
+ ## Step 4: Page Structure
130
+
131
+ Read `references/page-library.md` before planning.
132
+
133
+ Output a numbered list with `[layout-type]` labels per page. Example for 6-pager:
134
+ ```
135
+ Page 1: [cover] — title, subtitle, brand
136
+ Page 2: [toc] — 3 chapter titles + page numbers
137
+ Page 3: [chapter-intro] — Chapter 1 opener
138
+ Page 4: [text-column] — Chapter 1 body (1-column)
139
+ Page 5: [stat-grid] — 4 key metrics
140
+ Page 6: [closing-cta] — demo booking CTA + contact
141
+ ```
142
+
143
+ **Confirm with user before Step 5.**
144
+
145
+ ---
146
+
147
+ ## Step 5: Content Draft
148
+
149
+ Write per-page copy in plain text (no HTML). Rules per layout type:
150
+
151
+ - **cover**: title (≤10 words, leads with value or tension — not a generic label) + subtitle (≤15 words) + optional category label + brand name
152
+ - **toc**: chapter titles (≤6 words each) + corresponding section numbers. Clean, numbered list.
153
+ - **chapter-intro**: chapter number (decorative) + chapter title (≤8 words) + teaser paragraph (2–3 sentences)
154
+ - **text-column (1-col)**: section heading + body paragraphs. Max 250 words. Prose > bullets. Every sentence earns its place.
155
+ - **text-column (2-col)**: same rules, 140–190 words per column. Use for comparisons, step pairs, dual perspectives.
156
+ - **text-sidebar**: main body (140–180 words) + sidebar callout type (tip / warning / stat / quote / checklist) with max 70 words
157
+ - **quote-callout**: pull quote ≤40 words + attribution (name, title, company or source)
158
+ - **stat-grid**: 3–6 metrics — number + label + 1-line context. Optional: 1-sentence narrative below.
159
+ - **key-takeaways**: 5–8 takeaways, ≤15 words each, imperative where possible
160
+ - **closing-cta**: headline ≤5 words (imperative) + 1-sentence body + CTA action + email + URL (both required)
161
+
162
+ **Forbidden words (no exceptions):** "powerful", "seamless", "game-changing", "leverage", "innovative", "revolutionary", "transform", "cutting-edge", "robust", "unlock", "scalable" (as filler).
163
+
164
+ ---
165
+
166
+ ## Step 6: HTML Generation
167
+
168
+ Read ALL of these before generating. Do not paraphrase or summarize them — read the actual files.
169
+
170
+ **This skill's references:**
171
+ - `references/design-system.md`
172
+ - `references/page-library.md`
173
+ - `references/style-presets.md`
174
+
175
+ **Bundled asset (exact path — include FULL verbatim contents in `<style>` block):**
176
+ - `assets/viewport-base.css` — bundled inside this skill's directory
177
+
178
+ > **Path resolution:** All paths prefixed `assets/` or `scripts/` are relative to the directory containing this SKILL.md file. In Claude Code after install: `~/.claude/skills/graphic-ebook/assets/` and `~/.claude/skills/graphic-ebook/scripts/`. Resolve the actual path from the SKILL.md file location before reading.
179
+
180
+ ### Generation Rules
181
+
182
+ 1. **Single self-contained HTML.** All CSS inline. Font CDN `<link>` only external dependency.
183
+
184
+ 2. **Include FULL verbatim contents** of `viewport-base.css` inside the `<style>` block.
185
+
186
+ 3. **Add A4 portrait overrides AFTER viewport-base.css** (in the same `<style>` block):
187
+ ```css
188
+ /* A4 portrait overrides */
189
+ html { scroll-snap-type: none; scroll-behavior: auto; }
190
+ .slide {
191
+ width: 100vw;
192
+ height: 100vh;
193
+ height: 100dvh;
194
+ overflow: hidden;
195
+ display: flex;
196
+ flex-direction: column;
197
+ position: relative;
198
+ scroll-snap-align: none;
199
+ }
200
+ /* CRITICAL: prevents Chromium from stripping backgrounds in PDF */
201
+ * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
202
+ ```
203
+
204
+ 4. **Each page = `<section class="slide">`** — required for export-pdf.sh page detection.
205
+
206
+ 5. **Comment each page:** `/* === PAGE N: LAYOUT-TYPE === */`
207
+
208
+ 6. **Body text:** `clamp(0.875rem, 1.25vw, 1.05rem)`, `line-height: 1.75`, `max-width: min(65ch, 100%)` on all `<p>` in text-column and text-sidebar layouts.
209
+
210
+ 7. **Stat numbers:** hero at `clamp(3rem, 8vw, 5.5rem)` in accent color. Supporting at `clamp(2.5rem, 7vw, 5rem)` in secondary color.
211
+
212
+ 8. **No images available** → CSS-generated visuals only (gradients, geometric shapes, dot patterns, abstract elements). Never show placeholder boxes.
213
+
214
+ 9. **No SlidePresentation JS.** Include only minimal IntersectionObserver for `.reveal` animations.
215
+
216
+ 10. **Chapter number decoration** (on chapter-intro pages):
217
+ ```css
218
+ .chapter-number-deco {
219
+ font-family: var(--font-display);
220
+ font-size: clamp(6rem, 18vw, 14rem);
221
+ font-weight: var(--display-weight);
222
+ opacity: 0.06;
223
+ position: absolute;
224
+ top: -0.1em;
225
+ right: var(--page-padding);
226
+ line-height: 1;
227
+ color: var(--accent);
228
+ pointer-events: none;
229
+ user-select: none;
230
+ }
231
+ ```
232
+
233
+ 11. **Typed callout boxes** (for text-sidebar pages):
234
+ ```css
235
+ .callout { border-left: 3px solid; border-radius: var(--card-radius, 4px); padding: clamp(0.75rem, 1.5%, 1.1rem); }
236
+ .callout-label { font-size: clamp(0.58rem, 0.8vw, 0.68rem); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.5em; }
237
+ .callout--tip { background: rgba(22, 163, 74, 0.07); border-color: #16A34A; }
238
+ .callout--tip .callout-label { color: #16A34A; }
239
+ .callout--warning { background: rgba(217, 119, 6, 0.07); border-color: #D97706; }
240
+ .callout--warning .callout-label { color: #D97706; }
241
+ .callout--stat { background: rgba(var(--accent-rgb, 100,100,100), 0.07); border-color: var(--accent); }
242
+ .callout--stat .callout-label { color: var(--accent); }
243
+ .callout--quote { background: var(--bg-elevated); border-color: var(--divider); font-style: italic; }
244
+ .callout--quote .callout-label { color: var(--text-muted); }
245
+ .callout--checklist { background: rgba(8, 145, 178, 0.07); border-color: #0891B2; }
246
+ .callout--checklist .callout-label { color: #0891B2; }
247
+ ```
248
+
249
+ 12. **Page footer** (on every page except cover):
250
+ ```css
251
+ .page-footer {
252
+ position: absolute;
253
+ bottom: 0; left: 0; right: 0;
254
+ padding: clamp(0.5rem, 1%, 0.625rem) var(--page-padding);
255
+ display: flex;
256
+ justify-content: space-between;
257
+ align-items: center;
258
+ border-top: 1px solid var(--divider);
259
+ font-family: var(--font-body);
260
+ font-size: clamp(0.55rem, 0.75vw, 0.65rem);
261
+ font-weight: 600;
262
+ letter-spacing: 0.1em;
263
+ text-transform: uppercase;
264
+ color: var(--text-muted);
265
+ }
266
+ ```
267
+ HTML: `<div class="page-footer"><span>[Brand Name]</span><span>[N]</span></div>`
268
+
269
+ 13. **2-column layout:** `display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 4%, 3.5rem);` with `border-right: 1px solid var(--divider)` on left column.
270
+
271
+ 14. **Text-sidebar layout:** `display: grid; grid-template-columns: 2fr 1fr; gap: clamp(1.5rem, 3%, 2.5rem);`
272
+
273
+ ### Design Quality Rules (from frontend-design principles)
274
+
275
+ These govern the aesthetic ambition of every generated ebook. Applied after structural rules, before output.
276
+
277
+ **Typography:**
278
+ - Display font must have character at large sizes. Plus Jakarta Sans 800, Instrument Serif, Syne, Lora, Fraunces — all acceptable. Inter at display weight = immediate slop signal.
279
+ - Never use the same font weight for two consecutive hierarchy levels. Cover title (800) → chapter heading (700) → section heading (700, smaller size) → body (400/500).
280
+ - Pair a display font with a refined body font when the preset supports it (e.g. Instrument Serif + Inter, Syne + IBM Plex Sans). Single-font stacks must use weight contrast instead.
281
+
282
+ **Backgrounds and atmosphere:**
283
+ - Cover MUST have a significant decorative `::before` or `::after` pseudo-element creating visual depth: ghost letter at `opacity: 0.04–0.06`, geometric shape bleed, radial gradient overlay, or dot/line grid pattern.
284
+ - Chapter-intro pages MUST visually contrast with adjacent content pages — use `var(--bg-alt)` or a style-appropriate alt treatment.
285
+ - Content pages (text-column, text-sidebar) can be white/neutral, but the stat-grid and quote-callout pages should carry a distinct background (alt section bg, elevated card, or accent inversion).
286
+ - Closing CTA: always dark or full-accent inversion — never light. It is the conversion moment.
287
+ - CSS texture patterns when appropriate: `radial-gradient(circle, var(--accent) 1px, transparent 1px)` dot grids; `repeating-linear-gradient` rule lines; `::before` with clipped geometric shapes.
288
+
289
+ **Spatial composition:**
290
+ - Generous whitespace on chapter-intro pages — the visual openness signals a chapter break.
291
+ - At least one element per ebook should break the standard grid: oversized chapter deco number that bleeds off-screen right, quote mark that overlaps content, stat number that dominates 60%+ of its column.
292
+ - Avoid centered layouts unless the preset explicitly calls for it (quote-callout is the only centered-by-default layout).
293
+
294
+ **Motion:**
295
+ - All `.reveal` animations use consistent direction derived from design direction step.
296
+ - Stagger delays: 0.05s increments, max 0.5s cumulative. Nothing slower than 0.65s duration.
297
+ - Stat items in stat-grid: stagger by index for cascade effect.
298
+ - No animation on structural elements (footers, borders, rules). Animation = content appearing, not layout materializing.
299
+
300
+ **The unforgettable detail rule:**
301
+ Before writing the first line of CSS, name the ONE element that makes this ebook unmistakably designed — not just competently assembled. That element gets the most CSS investment. If you cannot name it, you have not thought hard enough about the design.
302
+
303
+ ---
304
+
305
+ ## Step 7: Self-QA
306
+
307
+ Fix every failure before proceeding to output. Do not skip this step.
308
+
309
+ **Layout & rendering:**
310
+ - [ ] Every `.slide` has `height:100vh; height:100dvh; overflow:hidden`
311
+ - [ ] `* { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }` present globally
312
+ - [ ] All scalable font sizes use `clamp()`
313
+ - [ ] No content overflows at 1200×1697 — review each page's density
314
+ - [ ] No placeholder boxes visible
315
+ - [ ] No `-clamp()`, `-min()`, `-max()` directly (wrap negatives in `calc(-1 * ...)`)
316
+
317
+ **Structure:**
318
+ - [ ] Page count matches Step 4 plan
319
+ - [ ] Every page uses `class="slide"` on `<section>` only
320
+ - [ ] All layout types from Step 4 present in correct order
321
+ - [ ] TOC included for ebooks ≥ 6 pages
322
+
323
+ **Reading quality:**
324
+ - [ ] Body text `line-height ≥ 1.75` on text-column and text-sidebar pages
325
+ - [ ] Single-column body text `max-width ≤ 65ch`
326
+ - [ ] No 2+ consecutive text-column pages without visual break
327
+ - [ ] TOC has chapter titles + section/page numbers
328
+ - [ ] Chapter-intro pages have `.chapter-number-deco` (opacity 0.06–0.08)
329
+ - [ ] Every page except cover has `.page-footer` with page number + brand name
330
+ - [ ] Sidebar callout boxes use typed CSS class (`.callout--tip/warning/stat/quote/checklist`)
331
+
332
+ **Design quality:**
333
+ - [ ] Style preset tokens applied consistently (from `references/style-presets.md`)
334
+ - [ ] No slop patterns (see `references/design-system.md` DO NOT USE list)
335
+ - [ ] Typography hierarchy: cover title >> chapter heading >> section heading >> body (2:1 min ratio between levels)
336
+ - [ ] Stat numbers visually dominant — no body copy at same visual weight
337
+ - [ ] Cover has a significant decorative `::before`/`::after` element — not just text on a flat color
338
+ - [ ] Chapter-intro pages visually distinct from content pages (different bg or treatment)
339
+ - [ ] Closing CTA uses dark or full-accent inversion background — never light
340
+ - [ ] No 3+ consecutive pages with identical background color
341
+ - [ ] Signature element from design direction step is present and visible
342
+ - [ ] At least one layout element breaks the grid (oversized deco number, bleed shape, dominant stat)
343
+ - [ ] Reveal animations consistent direction and stagger — not random per-element
344
+
345
+ **Content:**
346
+ - [ ] No forbidden words anywhere
347
+ - [ ] Cover title ≤10 words, leads with value or tension
348
+ - [ ] Quote callout ≤40 words
349
+ - [ ] Closing CTA: imperative headline + email + URL (both mandatory — QA fails without both)
350
+ - [ ] TOC matches actual page structure
351
+ - [ ] Three-point CTA present for ebooks ≥ 6 pages
352
+
353
+ ---
354
+
355
+ ## Step 8: Output
356
+
357
+ ```bash
358
+ mkdir -p ebook/[slug]
359
+ ```
360
+
361
+ **Write main HTML:** `ebook/[slug]/index.html`
362
+ **Open:** `open ebook/[slug]/index.html`
363
+
364
+ **Per-page split (always generate):**
365
+ Extract each `<section class="slide">` into standalone HTML files with full `<style>` block, no JS:
366
+ `ebook/[slug]/page-01.html`, `page-02.html`, … (zero-padded 2 digits)
367
+
368
+ **PDF export (always run):**
369
+ ```bash
370
+ bash [skill-root]/scripts/export-pdf.sh \
371
+ ebook/[slug]/index.html \
372
+ ebook/[slug].pdf --portrait
373
+ ```
374
+ `[skill-root]` = the directory containing this SKILL.md. Resolve it before running (e.g. `~/.claude/skills/graphic-ebook` in Claude Code after install).
375
+
376
+ **Cleanup:** Delete `.claude-design/previews/` if style preview files were generated in Step 2.
377
+
378
+ **Summary (no HTML in chat):**
379
+ ```
380
+ ## Ebook: [title]
381
+ Date: [today] | Style: [style] | Pages: [N] | Format: A4 portrait
382
+ Brand: [brand name] | Topic: [topic]
383
+
384
+ Files
385
+ Main: ebook/[slug]/index.html
386
+ Per-page: ebook/[slug]/page-01.html → page-0N.html
387
+ PDF: ebook/[slug].pdf
388
+
389
+ Checklist
390
+ - [ ] Replace contact info placeholders (email + URL on closing page)
391
+ - [ ] Replace brand logo initials with real asset
392
+ - [ ] Verify TOC section numbers match actual page positions
393
+ - [ ] Proof all stat accuracy (page [N])
394
+ - [ ] Review body copy — no page should feel overflowed
395
+ - [ ] Test PDF opens correctly (page count = [N])
396
+ ```
@@ -0,0 +1,153 @@
1
+ /* ===========================================
2
+ VIEWPORT FITTING: MANDATORY BASE STYLES
3
+ Include this ENTIRE file in every presentation.
4
+ These styles ensure slides fit exactly in the viewport.
5
+ =========================================== */
6
+
7
+ /* 1. Lock html/body to viewport */
8
+ html, body {
9
+ height: 100%;
10
+ overflow-x: hidden;
11
+ }
12
+
13
+ html {
14
+ scroll-snap-type: y mandatory;
15
+ scroll-behavior: smooth;
16
+ }
17
+
18
+ /* 2. Each slide = exact viewport height */
19
+ .slide {
20
+ width: 100vw;
21
+ height: 100vh;
22
+ height: 100dvh; /* Dynamic viewport height for mobile browsers */
23
+ overflow: hidden; /* CRITICAL: Prevent ANY overflow */
24
+ scroll-snap-align: start;
25
+ display: flex;
26
+ flex-direction: column;
27
+ position: relative;
28
+ }
29
+
30
+ /* 3. Content container with flex for centering */
31
+ .slide-content {
32
+ flex: 1;
33
+ display: flex;
34
+ flex-direction: column;
35
+ justify-content: center;
36
+ max-height: 100%;
37
+ overflow: hidden; /* Double-protection against overflow */
38
+ padding: var(--slide-padding);
39
+ }
40
+
41
+ /* 4. ALL typography uses clamp() for responsive scaling */
42
+ :root {
43
+ /* Titles scale from mobile to desktop */
44
+ --title-size: clamp(1.5rem, 5vw, 4rem);
45
+ --h2-size: clamp(1.25rem, 3.5vw, 2.5rem);
46
+ --h3-size: clamp(1rem, 2.5vw, 1.75rem);
47
+
48
+ /* Body text */
49
+ --body-size: clamp(0.75rem, 1.5vw, 1.125rem);
50
+ --small-size: clamp(0.65rem, 1vw, 0.875rem);
51
+
52
+ /* Spacing scales with viewport */
53
+ --slide-padding: clamp(1rem, 4vw, 4rem);
54
+ --content-gap: clamp(0.5rem, 2vw, 2rem);
55
+ --element-gap: clamp(0.25rem, 1vw, 1rem);
56
+ }
57
+
58
+ /* 5. Cards/containers use viewport-relative max sizes */
59
+ .card, .container, .content-box {
60
+ max-width: min(90vw, 1000px);
61
+ max-height: min(80vh, 700px);
62
+ }
63
+
64
+ /* 6. Lists auto-scale with viewport */
65
+ .feature-list, .bullet-list {
66
+ gap: clamp(0.4rem, 1vh, 1rem);
67
+ }
68
+
69
+ .feature-list li, .bullet-list li {
70
+ font-size: var(--body-size);
71
+ line-height: 1.4;
72
+ }
73
+
74
+ /* 7. Grids adapt to available space */
75
+ .grid {
76
+ display: grid;
77
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
78
+ gap: clamp(0.5rem, 1.5vw, 1rem);
79
+ }
80
+
81
+ /* 8. Images constrained to viewport */
82
+ img, .image-container {
83
+ max-width: 100%;
84
+ max-height: min(50vh, 400px);
85
+ object-fit: contain;
86
+ }
87
+
88
+ /* ===========================================
89
+ RESPONSIVE BREAKPOINTS
90
+ Aggressive scaling for smaller viewports
91
+ =========================================== */
92
+
93
+ /* Short viewports (< 700px height) */
94
+ @media (max-height: 700px) {
95
+ :root {
96
+ --slide-padding: clamp(0.75rem, 3vw, 2rem);
97
+ --content-gap: clamp(0.4rem, 1.5vw, 1rem);
98
+ --title-size: clamp(1.25rem, 4.5vw, 2.5rem);
99
+ --h2-size: clamp(1rem, 3vw, 1.75rem);
100
+ }
101
+ }
102
+
103
+ /* Very short viewports (< 600px height) */
104
+ @media (max-height: 600px) {
105
+ :root {
106
+ --slide-padding: clamp(0.5rem, 2.5vw, 1.5rem);
107
+ --content-gap: clamp(0.3rem, 1vw, 0.75rem);
108
+ --title-size: clamp(1.1rem, 4vw, 2rem);
109
+ --body-size: clamp(0.7rem, 1.2vw, 0.95rem);
110
+ }
111
+
112
+ /* Hide non-essential elements */
113
+ .nav-dots, .keyboard-hint, .decorative {
114
+ display: none;
115
+ }
116
+ }
117
+
118
+ /* Extremely short (landscape phones, < 500px height) */
119
+ @media (max-height: 500px) {
120
+ :root {
121
+ --slide-padding: clamp(0.4rem, 2vw, 1rem);
122
+ --title-size: clamp(1rem, 3.5vw, 1.5rem);
123
+ --h2-size: clamp(0.9rem, 2.5vw, 1.25rem);
124
+ --body-size: clamp(0.65rem, 1vw, 0.85rem);
125
+ }
126
+ }
127
+
128
+ /* Narrow viewports (< 600px width) */
129
+ @media (max-width: 600px) {
130
+ :root {
131
+ --title-size: clamp(1.25rem, 7vw, 2.5rem);
132
+ }
133
+
134
+ /* Stack grids vertically */
135
+ .grid {
136
+ grid-template-columns: 1fr;
137
+ }
138
+ }
139
+
140
+ /* ===========================================
141
+ REDUCED MOTION
142
+ Respect user preferences
143
+ =========================================== */
144
+ @media (prefers-reduced-motion: reduce) {
145
+ *, *::before, *::after {
146
+ animation-duration: 0.01ms !important;
147
+ transition-duration: 0.2s !important;
148
+ }
149
+
150
+ html {
151
+ scroll-behavior: auto;
152
+ }
153
+ }