@appeeky/open-slideshow 0.1.0 → 0.2.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 (55) hide show
  1. package/README.md +93 -23
  2. package/dist/bin.js +0 -0
  3. package/dist/brand.d.ts +2 -0
  4. package/dist/brand.js +36 -19
  5. package/dist/brandkit.d.ts +50 -0
  6. package/dist/brandkit.js +212 -0
  7. package/dist/cli.js +94 -0
  8. package/dist/decks.js +11 -1
  9. package/dist/ideas.d.ts +50 -0
  10. package/dist/ideas.js +146 -0
  11. package/dist/images.d.ts +15 -2
  12. package/dist/images.js +23 -5
  13. package/dist/index.d.ts +9 -0
  14. package/dist/index.js +9 -0
  15. package/dist/lint.d.ts +5 -2
  16. package/dist/lint.js +18 -2
  17. package/dist/mcp.js +72 -2
  18. package/dist/preview.d.ts +18 -0
  19. package/dist/preview.js +96 -0
  20. package/dist/publish.d.ts +5 -0
  21. package/dist/publish.js +6 -1
  22. package/dist/readability.d.ts +19 -0
  23. package/dist/readability.js +42 -0
  24. package/dist/render.d.ts +21 -2
  25. package/dist/render.js +143 -11
  26. package/dist/results.d.ts +89 -0
  27. package/dist/results.js +252 -0
  28. package/dist/schema.d.ts +166 -11
  29. package/dist/schema.js +38 -1
  30. package/dist/screenshots.d.ts +18 -0
  31. package/dist/screenshots.js +69 -0
  32. package/dist/templates.d.ts +4 -1
  33. package/dist/templates.js +145 -0
  34. package/dist/text.js +2 -1
  35. package/dist/variants.d.ts +48 -0
  36. package/dist/variants.js +175 -0
  37. package/dist/version.d.ts +1 -1
  38. package/dist/version.js +1 -1
  39. package/dist/video.d.ts +22 -0
  40. package/dist/video.js +59 -0
  41. package/dist/workspace.d.ts +5 -0
  42. package/dist/workspace.js +16 -0
  43. package/package.json +1 -1
  44. package/skills/open-slideshow/SKILL.md +16 -3
  45. package/skills/open-slideshow/references/brand.md +10 -0
  46. package/skills/open-slideshow/references/ideas.md +23 -0
  47. package/skills/open-slideshow/references/images.md +9 -1
  48. package/skills/open-slideshow/references/languages.md +10 -0
  49. package/skills/open-slideshow/references/results.md +47 -0
  50. package/skills/open-slideshow/references/review.md +8 -1
  51. package/skills/open-slideshow/references/screenshots.md +26 -0
  52. package/skills/open-slideshow/references/series.md +20 -0
  53. package/skills/open-slideshow/references/templates.md +37 -0
  54. package/skills/open-slideshow/references/troubleshooting.md +11 -1
  55. package/skills/open-slideshow/references/video.md +18 -0
package/dist/schema.d.ts CHANGED
@@ -41,10 +41,11 @@ export declare const colorsSchema: z.ZodObject<{
41
41
  card?: string | undefined;
42
42
  }>;
43
43
  export type Colors = z.infer<typeof colorsSchema>;
44
- export declare const slideKindSchema: z.ZodEnum<["cover", "tip", "list", "quote", "bridge", "app", "text"]>;
44
+ /** `screenshot` shows a screenshot of the app (its image) inside a phone, with an optional title above. */
45
+ export declare const slideKindSchema: z.ZodEnum<["cover", "tip", "list", "quote", "bridge", "app", "text", "screenshot"]>;
45
46
  export type SlideKind = z.infer<typeof slideKindSchema>;
46
47
  export declare const slideSchema: z.ZodObject<{
47
- kind: z.ZodEnum<["cover", "tip", "list", "quote", "bridge", "app", "text"]>;
48
+ kind: z.ZodEnum<["cover", "tip", "list", "quote", "bridge", "app", "text", "screenshot"]>;
48
49
  title: z.ZodOptional<z.ZodString>;
49
50
  body: z.ZodOptional<z.ZodString>;
50
51
  items: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -65,7 +66,7 @@ export declare const slideSchema: z.ZodObject<{
65
66
  text_style: z.ZodOptional<z.ZodEnum<["outline", "shadow", "plain", "box"]>>;
66
67
  text_position: z.ZodOptional<z.ZodNumber>;
67
68
  }, "strict", z.ZodTypeAny, {
68
- kind: "cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text";
69
+ kind: "cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text" | "screenshot";
69
70
  number?: number | undefined;
70
71
  title?: string | undefined;
71
72
  body?: string | undefined;
@@ -80,7 +81,7 @@ export declare const slideSchema: z.ZodObject<{
80
81
  text_style?: "outline" | "shadow" | "plain" | "box" | undefined;
81
82
  text_position?: number | undefined;
82
83
  }, {
83
- kind: "cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text";
84
+ kind: "cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text" | "screenshot";
84
85
  number?: number | undefined;
85
86
  title?: string | undefined;
86
87
  body?: string | undefined;
@@ -146,6 +147,57 @@ export declare const publishRecordSchema: z.ZodObject<{
146
147
  scheduled_for?: string | undefined;
147
148
  media?: Record<string, string> | undefined;
148
149
  }>;
150
+ /** How a published post did, from Appeeky, a Spec repo or typed in by hand. */
151
+ export declare const resultSchema: z.ZodObject<{
152
+ at: z.ZodString;
153
+ source: z.ZodEnum<["appeeky", "spec", "manual"]>;
154
+ platform: z.ZodOptional<z.ZodString>;
155
+ views: z.ZodOptional<z.ZodNumber>;
156
+ likes: z.ZodOptional<z.ZodNumber>;
157
+ comments: z.ZodOptional<z.ZodNumber>;
158
+ shares: z.ZodOptional<z.ZodNumber>;
159
+ saves: z.ZodOptional<z.ZodNumber>;
160
+ reach: z.ZodOptional<z.ZodNumber>;
161
+ }, "strict", z.ZodTypeAny, {
162
+ at: string;
163
+ source: "appeeky" | "spec" | "manual";
164
+ comments?: number | undefined;
165
+ platform?: string | undefined;
166
+ views?: number | undefined;
167
+ likes?: number | undefined;
168
+ shares?: number | undefined;
169
+ saves?: number | undefined;
170
+ reach?: number | undefined;
171
+ }, {
172
+ at: string;
173
+ source: "appeeky" | "spec" | "manual";
174
+ comments?: number | undefined;
175
+ platform?: string | undefined;
176
+ views?: number | undefined;
177
+ likes?: number | undefined;
178
+ shares?: number | undefined;
179
+ saves?: number | undefined;
180
+ reach?: number | undefined;
181
+ }>;
182
+ export type Result = z.infer<typeof resultSchema>;
183
+ export declare const seriesSchema: z.ZodObject<{
184
+ id: z.ZodEffects<z.ZodString, string, string>;
185
+ part: z.ZodNumber;
186
+ of: z.ZodOptional<z.ZodNumber>;
187
+ /** The label on the cover, e.g. "Bölüm {part}"; {part} and {of} are filled in. Default "Part {part}". */
188
+ label: z.ZodOptional<z.ZodString>;
189
+ }, "strict", z.ZodTypeAny, {
190
+ id: string;
191
+ part: number;
192
+ of?: number | undefined;
193
+ label?: string | undefined;
194
+ }, {
195
+ id: string;
196
+ part: number;
197
+ of?: number | undefined;
198
+ label?: string | undefined;
199
+ }>;
200
+ export type Series = z.infer<typeof seriesSchema>;
149
201
  export declare const deckSchema: z.ZodObject<{
150
202
  version: z.ZodDefault<z.ZodLiteral<1>>;
151
203
  id: z.ZodEffects<z.ZodString, string, string>;
@@ -177,7 +229,7 @@ export declare const deckSchema: z.ZodObject<{
177
229
  text_style: z.ZodOptional<z.ZodEnum<["outline", "shadow", "plain", "box"]>>;
178
230
  show_handle: z.ZodDefault<z.ZodBoolean>;
179
231
  slides: z.ZodArray<z.ZodObject<{
180
- kind: z.ZodEnum<["cover", "tip", "list", "quote", "bridge", "app", "text"]>;
232
+ kind: z.ZodEnum<["cover", "tip", "list", "quote", "bridge", "app", "text", "screenshot"]>;
181
233
  title: z.ZodOptional<z.ZodString>;
182
234
  body: z.ZodOptional<z.ZodString>;
183
235
  items: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -198,7 +250,7 @@ export declare const deckSchema: z.ZodObject<{
198
250
  text_style: z.ZodOptional<z.ZodEnum<["outline", "shadow", "plain", "box"]>>;
199
251
  text_position: z.ZodOptional<z.ZodNumber>;
200
252
  }, "strict", z.ZodTypeAny, {
201
- kind: "cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text";
253
+ kind: "cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text" | "screenshot";
202
254
  number?: number | undefined;
203
255
  title?: string | undefined;
204
256
  body?: string | undefined;
@@ -213,7 +265,7 @@ export declare const deckSchema: z.ZodObject<{
213
265
  text_style?: "outline" | "shadow" | "plain" | "box" | undefined;
214
266
  text_position?: number | undefined;
215
267
  }, {
216
- kind: "cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text";
268
+ kind: "cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text" | "screenshot";
217
269
  number?: number | undefined;
218
270
  title?: string | undefined;
219
271
  body?: string | undefined;
@@ -284,17 +336,76 @@ export declare const deckSchema: z.ZodObject<{
284
336
  scheduled_for?: string | undefined;
285
337
  media?: Record<string, string> | undefined;
286
338
  }>, "many">>;
339
+ /** How the post did, newest last (results_sync or results_record). */
340
+ results: z.ZodDefault<z.ZodArray<z.ZodObject<{
341
+ at: z.ZodString;
342
+ source: z.ZodEnum<["appeeky", "spec", "manual"]>;
343
+ platform: z.ZodOptional<z.ZodString>;
344
+ views: z.ZodOptional<z.ZodNumber>;
345
+ likes: z.ZodOptional<z.ZodNumber>;
346
+ comments: z.ZodOptional<z.ZodNumber>;
347
+ shares: z.ZodOptional<z.ZodNumber>;
348
+ saves: z.ZodOptional<z.ZodNumber>;
349
+ reach: z.ZodOptional<z.ZodNumber>;
350
+ }, "strict", z.ZodTypeAny, {
351
+ at: string;
352
+ source: "appeeky" | "spec" | "manual";
353
+ comments?: number | undefined;
354
+ platform?: string | undefined;
355
+ views?: number | undefined;
356
+ likes?: number | undefined;
357
+ shares?: number | undefined;
358
+ saves?: number | undefined;
359
+ reach?: number | undefined;
360
+ }, {
361
+ at: string;
362
+ source: "appeeky" | "spec" | "manual";
363
+ comments?: number | undefined;
364
+ platform?: string | undefined;
365
+ views?: number | undefined;
366
+ likes?: number | undefined;
367
+ shares?: number | undefined;
368
+ saves?: number | undefined;
369
+ reach?: number | undefined;
370
+ }>, "many">>;
371
+ /** A hook test: decks with the same experiment differ only in the cover; variant is a, b, c… */
372
+ experiment: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
373
+ variant: z.ZodOptional<z.ZodString>;
374
+ /** One part of a series of linked decks. */
375
+ series: z.ZodOptional<z.ZodObject<{
376
+ id: z.ZodEffects<z.ZodString, string, string>;
377
+ part: z.ZodNumber;
378
+ of: z.ZodOptional<z.ZodNumber>;
379
+ /** The label on the cover, e.g. "Bölüm {part}"; {part} and {of} are filled in. Default "Part {part}". */
380
+ label: z.ZodOptional<z.ZodString>;
381
+ }, "strict", z.ZodTypeAny, {
382
+ id: string;
383
+ part: number;
384
+ of?: number | undefined;
385
+ label?: string | undefined;
386
+ }, {
387
+ id: string;
388
+ part: number;
389
+ of?: number | undefined;
390
+ label?: string | undefined;
391
+ }>>;
392
+ /** The deck this one translates (deck_translate). */
393
+ translation_of: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
394
+ /** The deck this one posts again with a new hook (deck_repost). */
395
+ repost_of: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
396
+ /** The idea from the idea queue this deck was made from. */
397
+ idea: z.ZodOptional<z.ZodString>;
287
398
  }, "strict", z.ZodTypeAny, {
288
399
  status: "draft" | "rendered" | "published";
289
- version: 1;
290
400
  id: string;
401
+ version: 1;
291
402
  language: string;
292
403
  size: "4:5" | "1:1" | "9:16";
293
404
  theme: string;
294
405
  full_cover: boolean;
295
406
  show_handle: boolean;
296
407
  slides: {
297
- kind: "cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text";
408
+ kind: "cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text" | "screenshot";
298
409
  number?: number | undefined;
299
410
  title?: string | undefined;
300
411
  body?: string | undefined;
@@ -321,6 +432,17 @@ export declare const deckSchema: z.ZodObject<{
321
432
  scheduled_for?: string | undefined;
322
433
  media?: Record<string, string> | undefined;
323
434
  }[];
435
+ results: {
436
+ at: string;
437
+ source: "appeeky" | "spec" | "manual";
438
+ comments?: number | undefined;
439
+ platform?: string | undefined;
440
+ views?: number | undefined;
441
+ likes?: number | undefined;
442
+ shares?: number | undefined;
443
+ saves?: number | undefined;
444
+ reach?: number | undefined;
445
+ }[];
324
446
  text_style?: "outline" | "shadow" | "plain" | "box" | undefined;
325
447
  channel?: string | undefined;
326
448
  colors?: {
@@ -341,10 +463,21 @@ export declare const deckSchema: z.ZodObject<{
341
463
  } | undefined;
342
464
  topic?: string | undefined;
343
465
  template?: string | undefined;
466
+ experiment?: string | undefined;
467
+ variant?: string | undefined;
468
+ series?: {
469
+ id: string;
470
+ part: number;
471
+ of?: number | undefined;
472
+ label?: string | undefined;
473
+ } | undefined;
474
+ translation_of?: string | undefined;
475
+ repost_of?: string | undefined;
476
+ idea?: string | undefined;
344
477
  }, {
345
478
  id: string;
346
479
  slides: {
347
- kind: "cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text";
480
+ kind: "cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text" | "screenshot";
348
481
  number?: number | undefined;
349
482
  title?: string | undefined;
350
483
  body?: string | undefined;
@@ -398,6 +531,28 @@ export declare const deckSchema: z.ZodObject<{
398
531
  scheduled_for?: string | undefined;
399
532
  media?: Record<string, string> | undefined;
400
533
  }[] | undefined;
534
+ results?: {
535
+ at: string;
536
+ source: "appeeky" | "spec" | "manual";
537
+ comments?: number | undefined;
538
+ platform?: string | undefined;
539
+ views?: number | undefined;
540
+ likes?: number | undefined;
541
+ shares?: number | undefined;
542
+ saves?: number | undefined;
543
+ reach?: number | undefined;
544
+ }[] | undefined;
545
+ experiment?: string | undefined;
546
+ variant?: string | undefined;
547
+ series?: {
548
+ id: string;
549
+ part: number;
550
+ of?: number | undefined;
551
+ label?: string | undefined;
552
+ } | undefined;
553
+ translation_of?: string | undefined;
554
+ repost_of?: string | undefined;
555
+ idea?: string | undefined;
401
556
  }>;
402
557
  export type Deck = z.infer<typeof deckSchema>;
403
558
  export type DeckInput = z.input<typeof deckSchema>;
@@ -617,8 +772,8 @@ export declare const channelSchema: z.ZodObject<{
617
772
  cover_index?: number | undefined;
618
773
  }>>;
619
774
  }, "strict", z.ZodTypeAny, {
620
- version: 1;
621
775
  id: string;
776
+ version: 1;
622
777
  hashtags: string[];
623
778
  accounts: string[];
624
779
  name: string;
package/dist/schema.js CHANGED
@@ -16,7 +16,8 @@ export const hexColor = z.string().regex(/^#[0-9a-fA-F]{6}$/, "use a 6-digit hex
16
16
  export const colorsSchema = z
17
17
  .object({ bg: hexColor, fg: hexColor, accent: hexColor, muted: hexColor.optional(), card: hexColor.optional() })
18
18
  .strict();
19
- export const slideKindSchema = z.enum(["cover", "tip", "list", "quote", "bridge", "app", "text"]);
19
+ /** `screenshot` shows a screenshot of the app (its image) inside a phone, with an optional title above. */
20
+ export const slideKindSchema = z.enum(["cover", "tip", "list", "quote", "bridge", "app", "text", "screenshot"]);
20
21
  export const slideSchema = z
21
22
  .object({
22
23
  kind: slideKindSchema,
@@ -58,6 +59,29 @@ export const publishRecordSchema = z
58
59
  media: z.record(z.string()).optional(),
59
60
  })
60
61
  .strict();
62
+ /** How a published post did, from Appeeky, a Spec repo or typed in by hand. */
63
+ export const resultSchema = z
64
+ .object({
65
+ at: z.string(),
66
+ source: z.enum(["appeeky", "spec", "manual"]),
67
+ platform: z.string().max(40).optional(),
68
+ views: z.number().int().min(0).optional(),
69
+ likes: z.number().int().min(0).optional(),
70
+ comments: z.number().int().min(0).optional(),
71
+ shares: z.number().int().min(0).optional(),
72
+ saves: z.number().int().min(0).optional(),
73
+ reach: z.number().int().min(0).optional(),
74
+ })
75
+ .strict();
76
+ export const seriesSchema = z
77
+ .object({
78
+ id: idSchema,
79
+ part: z.number().int().min(1).max(99),
80
+ of: z.number().int().min(1).max(99).optional(),
81
+ /** The label on the cover, e.g. "Bölüm {part}"; {part} and {of} are filled in. Default "Part {part}". */
82
+ label: z.string().min(1).max(40).optional(),
83
+ })
84
+ .strict();
61
85
  export const deckSchema = z
62
86
  .object({
63
87
  version: z.literal(1).default(1),
@@ -82,6 +106,19 @@ export const deckSchema = z
82
106
  template: idSchema.optional(),
83
107
  status: z.enum(["draft", "rendered", "published"]).default("draft"),
84
108
  published: z.array(publishRecordSchema).default([]),
109
+ /** How the post did, newest last (results_sync or results_record). */
110
+ results: z.array(resultSchema).default([]),
111
+ /** A hook test: decks with the same experiment differ only in the cover; variant is a, b, c… */
112
+ experiment: idSchema.optional(),
113
+ variant: z.string().regex(/^[a-e]$/, "a variant is one letter, a to e").optional(),
114
+ /** One part of a series of linked decks. */
115
+ series: seriesSchema.optional(),
116
+ /** The deck this one translates (deck_translate). */
117
+ translation_of: idSchema.optional(),
118
+ /** The deck this one posts again with a new hook (deck_repost). */
119
+ repost_of: idSchema.optional(),
120
+ /** The idea from the idea queue this deck was made from. */
121
+ idea: z.string().max(64).optional(),
85
122
  })
86
123
  .strict();
87
124
  const timeOfDay = z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "use 24-hour HH:MM");
@@ -0,0 +1,18 @@
1
+ import { type ImageMeta } from "./images.js";
2
+ import { type Workspace } from "./workspace.js";
3
+ /** The app's screenshots in a Spec repo: appeeky/screenshots/<store>/<locale>/<device>/*.png|jpg. */
4
+ export declare function specScreenshotFiles(ws: Workspace, locale?: string): string[];
5
+ export declare const fullSize: (u: string) => string;
6
+ /** iPhone screenshots from the App Store listing (Apple's public lookup). */
7
+ export declare function appStoreScreenshotUrls(id: string, country?: string): Promise<string[]>;
8
+ /**
9
+ * The app's own screenshots, imported as images to put in a `screenshot` slide. In a Spec repo
10
+ * they come from the repo; otherwise from the App Store listing.
11
+ */
12
+ export declare function appScreenshots(ws: Workspace, opts?: {
13
+ limit?: number;
14
+ locale?: string;
15
+ }): Promise<{
16
+ source: string;
17
+ images: ImageMeta[];
18
+ }>;
@@ -0,0 +1,69 @@
1
+ import { existsSync, readdirSync, statSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { importImageFromFile, importImageFromUrl } from "./images.js";
4
+ import { UserError } from "./workspace.js";
5
+ /** Phone screenshot folders Spec writes, best first (the largest iPhone, then any phone). */
6
+ const SPEC_TYPES = ["APP_IPHONE_69", "APP_IPHONE_67", "APP_IPHONE_65", "APP_IPHONE_61", "APP_IPHONE_58", "APP_IPHONE_55", "phone"];
7
+ /** The app's screenshots in a Spec repo: appeeky/screenshots/<store>/<locale>/<device>/*.png|jpg. */
8
+ export function specScreenshotFiles(ws, locale) {
9
+ const root = ws.spec?.screenshots_dir;
10
+ if (!root || !existsSync(root))
11
+ return [];
12
+ const locales = [locale, ...(ws.spec?.locales ?? [])].filter((l) => !!l);
13
+ for (const store of ["app-store", "google-play"]) {
14
+ const sd = join(root, store);
15
+ if (!existsSync(sd))
16
+ continue;
17
+ const available = readdirSync(sd).filter((d) => statSync(join(sd, d)).isDirectory());
18
+ for (const loc of [...locales, ...available]) {
19
+ const ld = join(sd, loc);
20
+ if (!existsSync(ld))
21
+ continue;
22
+ const types = readdirSync(ld).filter((d) => statSync(join(ld, d)).isDirectory());
23
+ const type = SPEC_TYPES.find((t) => types.includes(t)) ?? types.find((t) => /iphone|phone/i.test(t));
24
+ if (!type)
25
+ continue;
26
+ const files = readdirSync(join(ld, type))
27
+ .filter((f) => /\.(png|jpe?g)$/i.test(f))
28
+ .sort()
29
+ .map((f) => join(ld, type, f));
30
+ if (files.length)
31
+ return files;
32
+ }
33
+ }
34
+ return [];
35
+ }
36
+ export const fullSize = (u) => u.replace(/\/\d+x\d+bb\.(jpg|png|webp)$/, "/1290x2796bb.$1");
37
+ /** iPhone screenshots from the App Store listing (Apple's public lookup). */
38
+ export async function appStoreScreenshotUrls(id, country = "us") {
39
+ const res = await fetch(`https://itunes.apple.com/lookup?id=${encodeURIComponent(id)}&country=${encodeURIComponent(country)}&entity=software`, { signal: AbortSignal.timeout(10_000) });
40
+ if (!res.ok)
41
+ throw new UserError(`App Store lookup: HTTP ${res.status}`);
42
+ const data = (await res.json());
43
+ // The lookup gives small thumbnails; the same path with a larger size returns the original (capped at its real size).
44
+ return (data.results?.[0]?.screenshotUrls ?? []).map(fullSize);
45
+ }
46
+ /**
47
+ * The app's own screenshots, imported as images to put in a `screenshot` slide. In a Spec repo
48
+ * they come from the repo; otherwise from the App Store listing.
49
+ */
50
+ export async function appScreenshots(ws, opts = {}) {
51
+ const limit = Math.min(Math.max(opts.limit ?? 6, 1), 10);
52
+ const local = specScreenshotFiles(ws, opts.locale).slice(0, limit);
53
+ if (local.length) {
54
+ const images = [];
55
+ for (const f of local)
56
+ images.push(await importImageFromFile(ws, f, { source: "spec", license: "own", note: `app screenshot ${f.split("/").slice(-3).join("/")}` }));
57
+ return { source: "appeeky/screenshots", images };
58
+ }
59
+ const id = ws.settings.app.app_store_id;
60
+ if (!id)
61
+ throw new UserError("no screenshots in this repo and no App Store id; import a screenshot with image_import (path), or set the App Store id with brand_set");
62
+ const urls = (await appStoreScreenshotUrls(id, ws.settings.app.country)).slice(0, limit);
63
+ if (!urls.length)
64
+ throw new UserError("the App Store listing has no iPhone screenshots; import one with image_import");
65
+ const images = [];
66
+ for (const u of urls)
67
+ images.push(await importImageFromUrl(ws, u, { source: "app-store", license: "own", note: "app screenshot" }));
68
+ return { source: "App Store", images };
69
+ }
@@ -15,6 +15,8 @@ export interface Template {
15
15
  description: string;
16
16
  /** When this shape works best. */
17
17
  when: string;
18
+ /** Hook patterns that fit this shape; fill them with the app's own topic, never copy them as they are. */
19
+ hooks: string[];
18
20
  slots: TemplateSlot[];
19
21
  /** A filled-in example, for the preview and for the agent to see the shape. */
20
22
  example: (app: string) => Slide[];
@@ -33,9 +35,10 @@ export declare function templateGuide(t: Template): {
33
35
  name: string;
34
36
  description: string;
35
37
  when: string;
38
+ hooks: string[];
36
39
  shape: string;
37
40
  slots: {
38
- kinds: ("cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text")[];
41
+ kinds: ("cover" | "tip" | "list" | "quote" | "bridge" | "app" | "text" | "screenshot")[];
39
42
  label: string;
40
43
  count: string | number;
41
44
  hint: string;
package/dist/templates.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const cover = (hint) => ({ kinds: ["cover"], label: "hook", hint, min: 1, max: 1 });
2
2
  const appEnd = [
3
3
  { kinds: ["bridge"], label: "bridge", hint: "One line that turns to the app, only if it follows from the slides before.", min: 0, max: 1 },
4
+ { kinds: ["screenshot"], label: "screen", hint: "The app screen that does this, in a phone (app_screenshots finds them), with one line above it.", min: 0, max: 2 },
4
5
  { kinds: ["app"], label: "app", hint: "The app's name and what it does for this; a short call to action in the body.", min: 0, max: 1 },
5
6
  ];
6
7
  export const TEMPLATES = [
@@ -9,6 +10,7 @@ export const TEMPLATES = [
9
10
  name: "Tips",
10
11
  description: "A hook that promises a number of tips, one tip per slide, then the app.",
11
12
  when: "Teaching something useful. The easiest shape to save and share.",
13
+ hooks: ["{n} small {things} that fixed my {problem}", "Save this if you {struggle with X}", "{n} {topic} tips nobody tells beginners"],
12
14
  slots: [cover("Promise a number and a result: '5 small habits that fixed my *sleep*'."), { kinds: ["tip"], label: "tips", hint: "One tip each: the tip as the title, why or how in the body.", min: 3, max: 7 }, ...appEnd],
13
15
  example: (app) => [
14
16
  { kind: "cover", title: "3 tiny habits that fixed my *sleep*" },
@@ -24,6 +26,7 @@ export const TEMPLATES = [
24
26
  name: "Mistakes",
25
27
  description: "Things people get wrong, each with the fix, then the app.",
26
28
  when: "Your audience already tries to do the thing and it does not work for them. Strong hooks, lots of comments.",
29
+ hooks: ["{n} {topic} mistakes you make every {day}", "Stop doing this if you want {result}", "I did this wrong for {time}"],
27
30
  slots: [
28
31
  cover("Call out the mistakes: '4 sleep mistakes you make *every night*'."),
29
32
  { kinds: ["tip"], label: "mistakes", hint: "The mistake as the title, the fix in the body.", min: 3, max: 5 },
@@ -43,6 +46,7 @@ export const TEMPLATES = [
43
46
  name: "Story",
44
47
  description: "A personal story: the problem, what did not work, what did, then the app.",
45
48
  when: "Founder or user stories. Feels like a person, not an ad. Works best with real photos.",
49
+ hooks: ["I {did X} for {time}. Here's what happened", "How I went from {before} to {after}", "Nobody warned me about {thing}"],
46
50
  slots: [
47
51
  cover("A personal, specific opening: 'I slept 5 hours a night for *two years*'."),
48
52
  { kinds: ["text", "quote"], label: "problem", hint: "What it was like. Concrete details, first person.", min: 1, max: 2 },
@@ -63,6 +67,7 @@ export const TEMPLATES = [
63
67
  name: "Before / after",
64
68
  description: "How it was, how it is now, and what changed in between.",
65
69
  when: "A clear change you can show: a routine, a result, a screen. Good with two contrasting photos.",
70
+ hooks: ["My {thing}, before and after {time}", "{time} of {habit}: the honest result", "What changed when I stopped {X}"],
66
71
  slots: [
67
72
  cover("The change in one line: 'My nights, *before and after* 30 days'."),
68
73
  { kinds: ["text", "tip"], label: "before", hint: "Start with *Before:* and the honest picture.", min: 1, max: 1 },
@@ -83,6 +88,7 @@ export const TEMPLATES = [
83
88
  name: "Ranking",
84
89
  description: "Options ranked, counting down to the best one.",
85
90
  when: "Comparisons and opinions. People comment to argue with the order, which helps reach.",
91
+ hooks: ["{topic}, ranked from worst to best", "Every {thing} I tried, ranked", "Ranking {n} {things} so you don't have to"],
86
92
  slots: [
87
93
  cover("What is ranked and in which direction: 'Bedtime habits, ranked from *worst to best*'."),
88
94
  { kinds: ["tip"], label: "ranked items", hint: "One item each, counting down with `number` (5, 4, 3…); one line why.", min: 3, max: 10 },
@@ -102,6 +108,7 @@ export const TEMPLATES = [
102
108
  name: "Quotes",
103
109
  description: "Lines worth saving, one per slide, then the app.",
104
110
  when: "Motivation and mindset content. Only real quotes: the user's own words, or a person who really said it.",
111
+ hooks: ["Things {person} said that stuck", "{n} lines I reread when {situation}", "Advice I wish I heard at {age}"],
105
112
  slots: [
106
113
  cover("Why these lines matter: 'Things my sleep coach said that *stuck*'."),
107
114
  { kinds: ["quote"], label: "quotes", hint: "The quote as the title, who said it as author. Never invent a quote or put words in a real person's mouth.", min: 3, max: 6 },
@@ -120,6 +127,7 @@ export const TEMPLATES = [
120
127
  name: "Checklist",
121
128
  description: "A short checklist people save and come back to.",
122
129
  when: "Routines and step-by-step things. High saves.",
130
+ hooks: ["Save this {topic} checklist", "Your {time} {routine} in {n} steps", "Do these before {moment}"],
123
131
  slots: [
124
132
  cover("Tell people to save it: 'Save this *bedtime checklist*'."),
125
133
  { kinds: ["list"], label: "checklists", hint: "One group per slide (e.g. '1 hour before', 'In bed'), 3–5 short items.", min: 1, max: 4 },
@@ -132,6 +140,142 @@ export const TEMPLATES = [
132
140
  { kind: "app", title: `*${app}* ticks it off with me`, body: "Free on the App Store." },
133
141
  ],
134
142
  },
143
+ {
144
+ id: "myth-fact",
145
+ name: "Myth vs fact",
146
+ description: "Common beliefs, each followed by what is true, then the app.",
147
+ when: "A topic full of half-truths (sleep, money, fitness, studying). People share to correct friends.",
148
+ hooks: ["{n} {topic} myths you still believe", "Things everyone gets wrong about {topic}", "Myth: {belief}. Fact: (swipe)"],
149
+ slots: [
150
+ cover("Promise to correct something: '4 sleep *myths* you still believe'."),
151
+ { kinds: ["tip", "text"], label: "myth and fact", hint: "*Myth:* the belief as the title, *Fact:* what is true in the body. Only facts you can stand behind.", min: 3, max: 6 },
152
+ ...appEnd,
153
+ ],
154
+ example: (app) => [
155
+ { kind: "cover", title: "3 sleep *myths* you still believe" },
156
+ { kind: "tip", title: "*Myth:* you can catch up on weekends", body: "*Fact:* sleeping in shifts your body clock and Monday feels like jet lag." },
157
+ { kind: "tip", title: "*Myth:* a nightcap helps you sleep", body: "*Fact:* you fall asleep faster but wake up more in the second half of the night." },
158
+ { kind: "tip", title: "*Myth:* 5 hours is enough for some people", body: "*Fact:* almost everyone needs 7 or more." },
159
+ { kind: "app", title: `*${app}* keeps the facts simple`, body: "Free on the App Store." },
160
+ ],
161
+ },
162
+ {
163
+ id: "instead",
164
+ name: "This instead of that",
165
+ description: "Swaps: what people do, and the better thing to do instead.",
166
+ when: "Practical, quick wins. Each slide is a small decision people can copy today.",
167
+ hooks: ["Do this instead of {habit}", "{n} swaps that fixed my {problem}", "Stop {X}, try {Y}"],
168
+ slots: [
169
+ cover("Promise the swaps: '5 swaps that fixed my *evenings*'."),
170
+ { kinds: ["tip"], label: "swaps", hint: "*Instead of* the habit as the title, *try* the better one in the body.", min: 3, max: 6 },
171
+ ...appEnd,
172
+ ],
173
+ example: (app) => [
174
+ { kind: "cover", title: "3 swaps that fixed my *evenings*" },
175
+ { kind: "tip", title: "Instead of *scrolling in bed*", body: "Try 10 pages of a paper book." },
176
+ { kind: "tip", title: "Instead of *coffee at 4pm*", body: "Try a 10-minute walk outside." },
177
+ { kind: "tip", title: "Instead of *one more episode*", body: "Try the same bedtime as yesterday." },
178
+ { kind: "app", title: `*${app}* reminds me which swap is next`, body: "Free on the App Store." },
179
+ ],
180
+ },
181
+ {
182
+ id: "wish-i-knew",
183
+ name: "Things I wish I knew",
184
+ description: "Lessons learned the hard way, one per slide, in the first person.",
185
+ when: "Beginners in a topic follow people a few steps ahead. Feels personal and honest.",
186
+ hooks: ["Things I wish I knew before {starting X}", "{n} lessons from {time} of {thing}", "What {time} of {thing} taught me"],
187
+ slots: [
188
+ cover("Personal and specific: 'What 2 years of *bad sleep* taught me'."),
189
+ { kinds: ["tip", "text"], label: "lessons", hint: "One lesson each, in the first person, with the detail that makes it real.", min: 3, max: 7 },
190
+ ...appEnd,
191
+ ],
192
+ example: (app) => [
193
+ { kind: "cover", title: "What 2 years of *bad sleep* taught me" },
194
+ { kind: "tip", title: "Tired is a *schedule* problem first", body: "My bedtime moved by 2 hours every weekend." },
195
+ { kind: "tip", title: "The phone *has* to leave the room", body: "Willpower at midnight is not a plan." },
196
+ { kind: "tip", title: "Boring routines *work*", body: "Same time, same playlist, same lamp." },
197
+ { kind: "app", title: `I keep the routine in *${app}*`, body: "Free on the App Store." },
198
+ ],
199
+ },
200
+ {
201
+ id: "how-to",
202
+ name: "How to, step by step",
203
+ description: "A goal and the numbered steps to reach it, then the app.",
204
+ when: "Something people want to do and do not know how. Highly saved; steps must be concrete.",
205
+ hooks: ["How to {result} in {n} steps", "The {n}-step {routine} I use every {day}", "{result} without {pain}: step by step"],
206
+ slots: [
207
+ cover("The result and the number of steps: 'Fall asleep in 10 minutes: *4 steps*'."),
208
+ { kinds: ["tip"], label: "steps", hint: "One step each, in order, as an action: the step as the title, how in the body.", min: 3, max: 7 },
209
+ ...appEnd,
210
+ ],
211
+ example: (app) => [
212
+ { kind: "cover", title: "Fall asleep in 10 minutes: *4 steps*" },
213
+ { kind: "tip", title: "Dim *every* light at 10pm", body: "Your brain reads light as daytime." },
214
+ { kind: "tip", title: "Write down tomorrow's *3 tasks*", body: "So you stop rehearsing them in bed." },
215
+ { kind: "tip", title: "Breathe *4 in, 6 out*", body: "Five rounds. Slower than feels normal." },
216
+ { kind: "tip", title: "Same sound, *every night*", body: "Your body learns it means sleep." },
217
+ { kind: "app", title: `*${app}* plays the same sound for you`, body: "Free on the App Store." },
218
+ ],
219
+ },
220
+ {
221
+ id: "comparison",
222
+ name: "Comparison",
223
+ description: "Two or more options side by side on the things that matter, and which one wins for whom.",
224
+ when: "People choosing between things. Fair comparisons get saves; never compare against a named competitor's app.",
225
+ hooks: ["{A} vs {B}: which one actually {result}", "I tried {A} and {B} for {time}", "{A} or {B}? Depends on this"],
226
+ slots: [
227
+ cover("The two options and the question: '*Rain* or *brown noise* for sleep?'."),
228
+ { kinds: ["list", "tip"], label: "points", hint: "One thing compared per slide, or a list per option. Fair and specific.", min: 2, max: 5 },
229
+ { kinds: ["text", "tip"], label: "verdict", hint: "Who should pick which, in one or two lines.", min: 1, max: 1 },
230
+ ...appEnd,
231
+ ],
232
+ example: (app) => [
233
+ { kind: "cover", title: "*Rain* or *brown noise* for sleep?" },
234
+ { kind: "list", title: "Rain", items: ["Changes all the time", "Good for busy minds", "Can wake light sleepers"] },
235
+ { kind: "list", title: "Brown noise", items: ["Steady and deep", "Covers street noise", "Some find it dull"] },
236
+ { kind: "text", body: "Light sleeper in a city? *Brown noise*. Racing thoughts? *Rain*." },
237
+ { kind: "app", title: `*${app}* has both, mixed how you like`, body: "Free on the App Store." },
238
+ ],
239
+ },
240
+ {
241
+ id: "pov",
242
+ name: "POV",
243
+ description: "A relatable moment in the second person, slide by slide, ending on the fix.",
244
+ when: "Emotional, relatable situations your audience lives through. Comments tag friends.",
245
+ hooks: ["POV: it's {time} and you {situation}", "POV: you finally {result}", "When you {relatable moment}"],
246
+ slots: [
247
+ cover("A moment people recognise: 'POV: it's *3am* and you're still awake'."),
248
+ { kinds: ["text"], label: "moments", hint: "What happens next, one short beat per slide, in 'you'. Real details.", min: 2, max: 5 },
249
+ { kinds: ["text", "tip"], label: "the fix", hint: "The turn: what finally helps.", min: 1, max: 1 },
250
+ ...appEnd,
251
+ ],
252
+ example: (app) => [
253
+ { kind: "cover", title: "POV: it's *3am* and you're still awake" },
254
+ { kind: "text", body: "You check the time. *3:07*. You do the math on how much sleep is left." },
255
+ { kind: "text", body: "You replay a conversation from *2019*." },
256
+ { kind: "text", body: "What finally helped: the *same* sound every night, so your body knows what's next." },
257
+ { kind: "app", title: `That's why I made *${app}*`, body: "Free on the App Store." },
258
+ ],
259
+ },
260
+ {
261
+ id: "hot-takes",
262
+ name: "Hot takes",
263
+ description: "Opinions people will argue with, each with one line of why.",
264
+ when: "An audience that likes to debate. Drives comments; keep it honest, never mean.",
265
+ hooks: ["{topic} opinions that get me in trouble", "Unpopular opinion: {take}", "{n} {topic} takes I'll defend"],
266
+ slots: [
267
+ cover("Promise opinions: 'Sleep opinions that get me *in trouble*'."),
268
+ { kinds: ["tip", "text", "quote"], label: "takes", hint: "One opinion each as the title, one line of why. Things you really think.", min: 3, max: 6 },
269
+ ...appEnd,
270
+ ],
271
+ example: (app) => [
272
+ { kind: "cover", title: "Sleep opinions that get me *in trouble*" },
273
+ { kind: "tip", title: "Naps are *overrated*", body: "Most of us need a bedtime, not a nap." },
274
+ { kind: "tip", title: "Your bed is *not* an office", body: "Laptop in bed means brain on at night." },
275
+ { kind: "tip", title: "Weekends *don't* count", body: "Sleeping in is a jet lag you choose." },
276
+ { kind: "app", title: `*${app}* agrees with all three`, body: "Free on the App Store." },
277
+ ],
278
+ },
135
279
  ];
136
280
  export function getTemplate(id) {
137
281
  return TEMPLATES.find((t) => t.id === id);
@@ -179,6 +323,7 @@ export function templateGuide(t) {
179
323
  name: t.name,
180
324
  description: t.description,
181
325
  when: t.when,
326
+ hooks: t.hooks,
182
327
  shape: shapeText(t),
183
328
  slots: t.slots.map((s) => ({ kinds: s.kinds, label: s.label, count: s.min === s.max ? s.min : `${s.min}–${s.max}`, hint: s.hint })),
184
329
  };