@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/text.js CHANGED
@@ -94,7 +94,8 @@ function pieces(runs, upper, locale) {
94
94
  pendingNewline = true;
95
95
  }
96
96
  else if (/\s/u.test(ch)) {
97
- const nl = pendingNewline;
97
+ // A new line carries over a space typed right after it, not past the next word.
98
+ const nl = pendingNewline && !cur.length;
98
99
  flush();
99
100
  pendingNewline = nl;
100
101
  pendingSpace = !nl;
@@ -0,0 +1,48 @@
1
+ import { type Deck, type Slide } from "./schema.js";
2
+ import { type Workspace } from "./workspace.js";
3
+ /**
4
+ * A hook test: copies of a deck that differ only in the cover's hook. The first deck is variant a;
5
+ * each new hook becomes b, c… With spread_days, each copy is scheduled that many days after the one
6
+ * before, so the variants do not compete with each other on the same day.
7
+ */
8
+ export declare function hookTest(ws: Workspace, id: string, hooks: string[], opts?: {
9
+ spread_days?: number;
10
+ }): Deck[];
11
+ /** The next part of a series. The first deck becomes part 1 when it is not in a series yet. */
12
+ export declare function seriesNext(ws: Workspace, id: string, slides: Slide[], opts?: {
13
+ topic?: string;
14
+ of?: number;
15
+ label?: string;
16
+ when?: string;
17
+ }): Deck;
18
+ export declare function listSeries(ws: Workspace): {
19
+ id: string;
20
+ parts: {
21
+ deck: string;
22
+ part: number;
23
+ of: number | undefined;
24
+ status: "draft" | "rendered" | "published";
25
+ when: string | undefined;
26
+ hook: string | undefined;
27
+ }[];
28
+ }[];
29
+ /**
30
+ * The same deck in another language. The agent writes the translated slides; this keeps every
31
+ * image, crop and number from the original, and checks the slides line up one to one.
32
+ */
33
+ export declare function translateDeck(ws: Workspace, id: string, language: string, t: {
34
+ slides: Partial<Slide>[];
35
+ caption?: string;
36
+ hashtags?: string[];
37
+ accounts?: string[];
38
+ when?: string;
39
+ }): Deck;
40
+ /**
41
+ * A deck that did well, posted again with a new hook. Platforms push down copies of the same post,
42
+ * so the cover must change; the middle slides can be reordered too.
43
+ */
44
+ export declare function repostDeck(ws: Workspace, id: string, hook: string, opts?: {
45
+ order?: number[];
46
+ min_days?: number;
47
+ now?: Date;
48
+ }): Deck;
@@ -0,0 +1,175 @@
1
+ import { DateTime } from "luxon";
2
+ import { normalizeHook, usedHooks } from "./brand.js";
3
+ import { newDeck } from "./decks.js";
4
+ import { slideSchema } from "./schema.js";
5
+ import { listDecks, loadDeck, parseWith, saveDeck, uniqueDeckId, UserError } from "./workspace.js";
6
+ /** Everything about a deck's look and where it goes, without its history. */
7
+ function design(d) {
8
+ return {
9
+ channel: d.channel,
10
+ language: d.language,
11
+ size: d.size,
12
+ theme: d.theme,
13
+ colors: d.colors,
14
+ full_cover: d.full_cover,
15
+ text_style: d.text_style,
16
+ show_handle: d.show_handle,
17
+ caption: d.caption,
18
+ hashtags: d.hashtags,
19
+ accounts: d.accounts,
20
+ tiktok: d.tiktok,
21
+ topic: d.topic,
22
+ template: d.template,
23
+ };
24
+ }
25
+ const coverIndex = (slides) => {
26
+ const i = slides.findIndex((s) => s.kind === "cover");
27
+ return i === -1 ? 0 : i;
28
+ };
29
+ function withHook(slides, hook) {
30
+ const i = coverIndex(slides);
31
+ return slides.map((s, j) => (j === i ? parseWith(slideSchema, { ...s, title: hook }, `slide ${i}`) : s));
32
+ }
33
+ const shiftDays = (when, days) => (when && days ? DateTime.fromISO(when, { setZone: true }).plus({ days }).toISO({ suppressMilliseconds: true }) ?? undefined : when);
34
+ // ---------- hook tests ----------
35
+ const LETTERS = ["a", "b", "c", "d", "e"];
36
+ /**
37
+ * A hook test: copies of a deck that differ only in the cover's hook. The first deck is variant a;
38
+ * each new hook becomes b, c… With spread_days, each copy is scheduled that many days after the one
39
+ * before, so the variants do not compete with each other on the same day.
40
+ */
41
+ export function hookTest(ws, id, hooks, opts = {}) {
42
+ const base = loadDeck(ws, id);
43
+ if (base.status === "published")
44
+ throw new UserError(`deck ${id} is already published; test hooks on a new deck (or deck_repost for a second go)`);
45
+ if (base.variant && base.variant !== "a")
46
+ throw new UserError(`deck ${id} is variant ${base.variant} of ${base.experiment}; start from variant a`);
47
+ if (!hooks.length || hooks.length > 4)
48
+ throw new UserError("give 1 to 4 new hooks (variant a is the deck as it is)");
49
+ const seen = new Set([normalizeHook(base.slides[coverIndex(base.slides)]?.title ?? "")]);
50
+ for (const h of hooks) {
51
+ const k = normalizeHook(h);
52
+ if (!k || seen.has(k))
53
+ throw new UserError(`each hook must be different: "${h}"`);
54
+ seen.add(k);
55
+ }
56
+ const experiment = base.experiment ?? base.id;
57
+ const existing = listDecks(ws).filter((d) => d.deck?.experiment === experiment).length;
58
+ if (existing + hooks.length > LETTERS.length && existing)
59
+ throw new UserError(`an experiment has at most ${LETTERS.length} variants`);
60
+ const a = saveDeck(ws, { ...base, experiment, variant: "a" });
61
+ const out = [a];
62
+ hooks.forEach((hook, i) => {
63
+ const letter = LETTERS[Math.max(existing, 1) + i];
64
+ out.push(newDeck(ws, {
65
+ ...design(base),
66
+ id: uniqueDeckId(ws, `${base.id}-${letter}`),
67
+ slides: withHook(base.slides, hook),
68
+ when: shiftDays(base.when, (opts.spread_days ?? 0) * (i + 1)),
69
+ experiment,
70
+ variant: letter,
71
+ }));
72
+ });
73
+ return out;
74
+ }
75
+ // ---------- series ----------
76
+ /** The next part of a series. The first deck becomes part 1 when it is not in a series yet. */
77
+ export function seriesNext(ws, id, slides, opts = {}) {
78
+ const prev = loadDeck(ws, id);
79
+ let series = prev.series;
80
+ if (!series) {
81
+ series = { id: prev.id, part: 1, ...(opts.of ? { of: opts.of } : {}), ...(opts.label ? { label: opts.label } : {}) };
82
+ // A posted deck keeps its look; the series starts from it anyway.
83
+ if (prev.status !== "published")
84
+ saveDeck(ws, { ...prev, series, status: "draft" });
85
+ }
86
+ const part = Math.max(series.part, ...listDecks(ws).filter((d) => d.deck?.series?.id === series.id).map((d) => d.deck.series.part)) + 1;
87
+ const of = opts.of ?? series.of;
88
+ if (of && part > of)
89
+ throw new UserError(`the series has ${of} parts and part ${of} exists; raise "of" to add more`);
90
+ return newDeck(ws, {
91
+ ...design(prev),
92
+ id: uniqueDeckId(ws, `${series.id}-part-${part}`),
93
+ topic: opts.topic ?? prev.topic,
94
+ slides,
95
+ when: opts.when,
96
+ series: { id: series.id, part, ...(of ? { of } : {}), ...(opts.label ?? series.label ? { label: opts.label ?? series.label } : {}) },
97
+ });
98
+ }
99
+ export function listSeries(ws) {
100
+ const by = new Map();
101
+ for (const d of listDecks(ws))
102
+ if (d.deck?.series)
103
+ by.set(d.deck.series.id, [...(by.get(d.deck.series.id) ?? []), d.deck]);
104
+ return [...by.entries()].map(([id, ds]) => ({
105
+ id,
106
+ parts: ds
107
+ .sort((a, b) => a.series.part - b.series.part)
108
+ .map((d) => ({ deck: d.id, part: d.series.part, of: d.series.of, status: d.status, when: d.when, hook: d.slides[coverIndex(d.slides)]?.title })),
109
+ }));
110
+ }
111
+ // ---------- translations ----------
112
+ /**
113
+ * The same deck in another language. The agent writes the translated slides; this keeps every
114
+ * image, crop and number from the original, and checks the slides line up one to one.
115
+ */
116
+ export function translateDeck(ws, id, language, t) {
117
+ const src = loadDeck(ws, id);
118
+ if (src.translation_of)
119
+ throw new UserError(`deck ${id} is itself a translation of ${src.translation_of}; translate the original`);
120
+ if (language.toLowerCase() === src.language.toLowerCase())
121
+ throw new UserError(`deck ${id} is already in ${src.language}`);
122
+ if (t.slides.length !== src.slides.length)
123
+ throw new UserError(`the translation has ${t.slides.length} slides; the original has ${src.slides.length}. Translate every slide, in order`);
124
+ const slides = src.slides.map((s, i) => {
125
+ const tr = t.slides[i];
126
+ if (tr.kind && tr.kind !== s.kind)
127
+ throw new UserError(`slide ${i + 1} is a ${s.kind} in the original but ${tr.kind} in the translation`);
128
+ if (s.items?.length && tr.items && tr.items.length !== s.items.length)
129
+ throw new UserError(`slide ${i + 1}: the original list has ${s.items.length} items`);
130
+ // Words come from the translation; the picture and its crop stay.
131
+ return parseWith(slideSchema, { ...s, ...tr, kind: s.kind, image: s.image, focus: s.focus, number: s.number }, `slide ${i + 1}`);
132
+ });
133
+ return newDeck(ws, {
134
+ ...design(src),
135
+ id: uniqueDeckId(ws, `${src.id}-${language.toLowerCase()}`),
136
+ language,
137
+ slides,
138
+ caption: t.caption ?? "",
139
+ hashtags: t.hashtags ?? [],
140
+ accounts: t.accounts ?? src.accounts,
141
+ when: t.when,
142
+ translation_of: src.id,
143
+ });
144
+ }
145
+ // ---------- reposts ----------
146
+ /**
147
+ * A deck that did well, posted again with a new hook. Platforms push down copies of the same post,
148
+ * so the cover must change; the middle slides can be reordered too.
149
+ */
150
+ export function repostDeck(ws, id, hook, opts = {}) {
151
+ const src = loadDeck(ws, id);
152
+ const last = src.published.at(-1);
153
+ if (!last)
154
+ throw new UserError(`deck ${id} was never published; publish it instead`);
155
+ const days = opts.min_days ?? 30;
156
+ const posted = Date.parse(last.scheduled_for ?? last.at);
157
+ const age = ((opts.now ?? new Date()).getTime() - posted) / 86_400_000;
158
+ if (age < days)
159
+ throw new UserError(`deck ${id} went out ${Math.floor(age)} days ago; wait ${days} days before posting it again`);
160
+ const key = normalizeHook(hook);
161
+ const used = usedHooks(ws, 1000).find((h) => normalizeHook(h.hook) === key);
162
+ if (!key || used)
163
+ throw new UserError(`"${hook}" was used before${used?.deck ? ` (${used.deck})` : ""}; a repost needs a hook people have not seen`);
164
+ let slides = withHook(src.slides, hook);
165
+ if (opts.order) {
166
+ const n = slides.length;
167
+ const sorted = [...opts.order].sort((a, b) => a - b);
168
+ if (sorted.length !== n || sorted.some((v, i) => v !== i))
169
+ throw new UserError(`order must list every slide index 0–${n - 1} once`);
170
+ if (opts.order[0] !== coverIndex(slides))
171
+ throw new UserError("the cover stays first");
172
+ slides = opts.order.map((i) => slides[i]);
173
+ }
174
+ return newDeck(ws, { ...design(src), id: uniqueDeckId(ws, `${src.id}-again`), slides, repost_of: src.id });
175
+ }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.1.0";
1
+ export declare const VERSION = "0.2.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.1.0";
1
+ export const VERSION = "0.2.0";
@@ -0,0 +1,22 @@
1
+ import { type SizeId } from "./schema.js";
2
+ import { type Workspace } from "./workspace.js";
3
+ export interface VideoOptions {
4
+ /** Seconds each slide stays on screen. */
5
+ seconds?: number;
6
+ /** Seconds of crossfade between slides; 0 cuts. */
7
+ fade?: number;
8
+ /** The video frame; slides of another shape sit in the middle on the theme's background. */
9
+ size?: SizeId;
10
+ }
11
+ /** ffmpeg's arguments to turn the slides into one MP4, without sound (music is added in the app). */
12
+ export declare function videoArgs(files: string[], out: string, o: Required<VideoOptions> & {
13
+ background: string;
14
+ }): string[];
15
+ /**
16
+ * The rendered slides as a short MP4 for Reels, Shorts or a TikTok video post: each slide for a
17
+ * few seconds, with a soft fade. Needs ffmpeg on this machine (or FFMPEG_PATH).
18
+ */
19
+ export declare function renderVideo(ws: Workspace, id: string, opts?: VideoOptions): Promise<{
20
+ file: string;
21
+ seconds: number;
22
+ }>;
package/dist/video.js ADDED
@@ -0,0 +1,59 @@
1
+ import { execFile } from "node:child_process";
2
+ import { existsSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ import { promisify } from "node:util";
5
+ import { freshRenders } from "./decks.js";
6
+ import { SIZES } from "./schema.js";
7
+ import { themeFor } from "./render.js";
8
+ import { loadDeck, rendersDir, UserError } from "./workspace.js";
9
+ const run = promisify(execFile);
10
+ /** ffmpeg's arguments to turn the slides into one MP4, without sound (music is added in the app). */
11
+ export function videoArgs(files, out, o) {
12
+ const { width: W, height: H } = SIZES[o.size];
13
+ const args = ["-y"];
14
+ const hold = o.seconds + o.fade;
15
+ for (const f of files)
16
+ args.push("-loop", "1", "-t", hold.toFixed(2), "-i", f);
17
+ const bg = o.background.replace("#", "0x");
18
+ const parts = files.map((_, i) => `[${i}:v]scale=${W}:${H}:force_original_aspect_ratio=decrease:out_range=tv,pad=${W}:${H}:(ow-iw)/2:(oh-ih)/2:color=${bg},setsar=1,fps=30,format=yuv420p[s${i}]`);
19
+ let last = "s0";
20
+ if (files.length === 1)
21
+ parts.push("[s0]null[v]");
22
+ else if (o.fade > 0)
23
+ for (let i = 1; i < files.length; i++) {
24
+ const offset = (o.seconds * i).toFixed(2);
25
+ const label = i === files.length - 1 ? "v" : `x${i}`;
26
+ parts.push(`[${last}][s${i}]xfade=transition=fade:duration=${o.fade.toFixed(2)}:offset=${offset}[${label}]`);
27
+ last = label;
28
+ }
29
+ else
30
+ parts.push(`${files.map((_, i) => `[s${i}]`).join("")}concat=n=${files.length}:v=1:a=0[v]`);
31
+ args.push("-filter_complex", parts.join(";"), "-map", "[v]", "-c:v", "libx264", "-preset", "medium", "-crf", "20", "-pix_fmt", "yuv420p", "-movflags", "+faststart", "-an", out);
32
+ return args;
33
+ }
34
+ /**
35
+ * The rendered slides as a short MP4 for Reels, Shorts or a TikTok video post: each slide for a
36
+ * few seconds, with a soft fade. Needs ffmpeg on this machine (or FFMPEG_PATH).
37
+ */
38
+ export async function renderVideo(ws, id, opts = {}) {
39
+ const deck = loadDeck(ws, id);
40
+ const manifest = freshRenders(ws, deck);
41
+ const o = { seconds: Math.min(Math.max(opts.seconds ?? 2.5, 1), 10), fade: Math.min(Math.max(opts.fade ?? 0.35, 0), 1), size: opts.size ?? "9:16" };
42
+ if (o.fade >= o.seconds)
43
+ throw new UserError("fade must be shorter than seconds");
44
+ const files = manifest.files.map((f) => join(rendersDir(ws, id), f));
45
+ const out = join(rendersDir(ws, id), "video.mp4");
46
+ const ffmpeg = process.env.FFMPEG_PATH ?? "ffmpeg";
47
+ if (process.env.FFMPEG_PATH && !existsSync(process.env.FFMPEG_PATH))
48
+ throw new UserError(`FFMPEG_PATH points to ${process.env.FFMPEG_PATH}, which does not exist`);
49
+ try {
50
+ await run(ffmpeg, videoArgs(files, out, { ...o, background: themeFor(deck).colors.bg }), { timeout: 300_000, maxBuffer: 8 * 1024 * 1024 });
51
+ }
52
+ catch (e) {
53
+ const err = e;
54
+ if (err.code === "ENOENT")
55
+ throw new UserError("making a video needs ffmpeg: install it (macOS: brew install ffmpeg; Windows: winget install ffmpeg; Linux: your package manager) or set FFMPEG_PATH");
56
+ throw new UserError(`ffmpeg failed: ${String(err.stderr ?? err.message).trim().split("\n").slice(-3).join(" ")}`);
57
+ }
58
+ return { file: out, seconds: Math.round((o.seconds * files.length) * 10) / 10 };
59
+ }
@@ -15,6 +15,11 @@ export interface SpecInfo {
15
15
  accounts_file: string;
16
16
  posts_file: string;
17
17
  drafts_dir: string;
18
+ comments_file: string;
19
+ reviews_dir: string;
20
+ screenshots_dir: string;
21
+ /** Locales of the store listing (appeeky/store/<store>/<locale>.yaml), primary first. */
22
+ locales: string[];
18
23
  }
19
24
  export interface Workspace {
20
25
  mode: "standalone" | "spec";
package/dist/workspace.js CHANGED
@@ -57,6 +57,18 @@ const specAppSchema = z
57
57
  .optional(),
58
58
  })
59
59
  .passthrough();
60
+ function specLocales(storeDir, primary) {
61
+ const found = new Set([primary]);
62
+ for (const store of ["app-store", "google-play"]) {
63
+ const dir = join(storeDir, store);
64
+ if (!existsSync(dir))
65
+ continue;
66
+ for (const f of readdirSync(dir).sort())
67
+ if (/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?\.ya?ml$/.test(f))
68
+ found.add(f.replace(/\.ya?ml$/, ""));
69
+ }
70
+ return [...found];
71
+ }
60
72
  function readSpec(root) {
61
73
  const file = join(root, SPEC_FILE);
62
74
  // Spec owns this file and checks it fully; we only read what we need, and stop if even that is broken.
@@ -77,6 +89,10 @@ function readSpec(root) {
77
89
  accounts_file: join(root, "appeeky", "social", "accounts.yaml"),
78
90
  posts_file: join(root, "appeeky", "social", "posts.jsonl"),
79
91
  drafts_dir: join(root, "appeeky", "social", "drafts"),
92
+ comments_file: join(root, "appeeky", "social", "comments.jsonl"),
93
+ reviews_dir: join(root, "appeeky", "reviews"),
94
+ screenshots_dir: join(root, "appeeky", "screenshots"),
95
+ locales: specLocales(join(root, "appeeky", "store"), data.app.primaryLocale ?? "en-US"),
80
96
  };
81
97
  }
82
98
  export function openWorkspace(cwd = process.cwd()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appeeky/open-slideshow",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Make TikTok and Instagram slideshows with the coding agent you already use. Local renderer, CLI and MCP server.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -7,6 +7,12 @@ description: Make TikTok photo slideshows and Instagram carousels for the user's
7
7
 
8
8
  You write the words. open-slideshow renders the slides on this machine, checks them, and publishes them. It never calls a model: you are the model. Use the MCP tools (`open-slideshow` server). The `open-slideshow` CLI does the same things from a terminal.
9
9
 
10
+ If the open-slideshow tools are not available (the skill was installed on its own), the MCP server is missing. Give the user the one command for their agent, then ask them to restart it:
11
+
12
+ - Claude Code: `claude mcp add open-slideshow -- npx -y @appeeky/open-slideshow mcp`
13
+ - Codex: add `[mcp_servers.open-slideshow]` with `command = "npx"` and `args = ["-y", "@appeeky/open-slideshow", "mcp"]` to `~/.codex/config.toml`
14
+ - Cursor and other agents: a stdio server running `npx -y @appeeky/open-slideshow mcp`
15
+
10
16
  Detailed guides live next to this file in `references/`. Read the one you need, or call the `guide` tool with its topic. Do not load them all up front.
11
17
 
12
18
  | Topic | When |
@@ -19,25 +25,32 @@ Detailed guides live next to this file in `references/`. Read the one you need,
19
25
  | `review` | After every render; what each lint code means and how to fix it |
20
26
  | `publishing` | Export, Photos, posting through Appeeky, Spec drafts, scheduling one post |
21
27
  | `channels` | Recurring posting plans, due slots, automatic posting |
28
+ | `results` | After posting: numbers, what worked (`insights`), hook tests, posting a winner again |
29
+ | `series` | A topic that needs several posts, "part 2" |
30
+ | `screenshots` | Showing the app's own screen in a phone |
31
+ | `video` | A phone preview to check, a GIF, or an MP4 for Reels and Shorts |
32
+ | `ideas` | The user asks what to post, or has no topic |
22
33
  | `troubleshooting` | Any error message from a tool |
23
34
 
24
35
  ## The flow, every time
25
36
 
26
37
  1. **Brand.** Call `brand_context`. Follow it. If it lists **Missing** facts, ask those questions in one message, then save the answers with `brand_set`. Do not write slides on guesses.
27
38
  2. **Theme.** If the user has not picked one yet, call `themes_preview` and show the picture. Save the choice with `brand_set default_theme`. Do not ask again for every deck.
28
- 3. **What works.** For a new topic, or when the user asks, call `viral_search` (Appeeky key, $0.01 a search) and read the top covers before writing. See the `writing` guide.
39
+ 3. **What works.** `brand_context` includes what worked for this app once posts are measured (`insights`). For a new topic, or when the user asks, call `viral_search` (Appeeky key, $0.01 a search) and read the top covers before writing. No topic? Offer ideas from `ideas_list` (fill it with `ideas_collect`).
29
40
  4. **Template.** Suggest one or two from `templates_list` that fit the topic and say why in one line. Show `templates_preview` if the user wants to see them.
30
41
  5. **Write.** Call `deck_create` with `template`, `language`, `topic`, the slides, the caption and the hashtags. Set `accounts` when you know where it goes.
31
42
  6. **Images.** Photo themes need a photo on every slide except the app slide. Use `image_search`, then `image_import`, then put the returned `ref` in each slide's `image`.
32
- 7. **Render and look.** Call `deck_render` and look at the sheet yourself, slide by slide. Fix errors and real problems with `deck_update`, then render again. Show the user the sheet.
43
+ 7. **Render and look.** Call `deck_render` and look at the sheet yourself, slide by slide. Fix errors and real problems with `deck_update`, then render again. Show the user the sheet, and offer `deck_preview` to see it on a phone.
33
44
  8. **Publish with a yes.** Call `deck_publish` without `confirm`, show the user what would happen, and call it again with `confirm: true` only after they say yes.
45
+ 9. **Learn.** A day or more later, `results_sync` (or ask the user for the numbers and `results_record`). Then a hook test, the next part of a series, a translation or a repost may be the next deck: see the `results` guide.
34
46
 
35
47
  ## Never
36
48
 
37
49
  - Publish, post or schedule without the user's yes for this deck. A channel the user explicitly set to post automatically is the only exception (see the `channels` guide).
38
50
  - Invent facts. That covers numbers, results, prices, features, reviews, testimonials, quotes and "studies show". Use only `brand_context` and what the user told you.
39
51
  - Use a claim from `claims_never`, a word from `words_to_avoid`, or a hook (or its angle) that `brand_context` lists as used.
40
- - Use an image whose license is unknown, unless the user says they own it or have the right to post it.
52
+ - Use an image whose license is unknown, unless the user says they own it or have the right to post it. Record what they say with `image_license`; never set a license yourself to get past the check.
53
+ - Make up results. Numbers come from `results_sync` or from the user.
41
54
  - Put words in a real person's mouth, or imitate a real person or brand.
42
55
  - Edit a published deck. Make a new one.
43
56
  - Edit Appeeky Spec's own files (`appeeky.spec.yaml`, `appeeky/playbook.md`, listings). Suggest the change to the user instead.
@@ -52,3 +52,13 @@ brand_set { brand: { one_liner, audience, tone: [...], claims_never: [...], cta
52
52
  - Brand colours (`colors: {bg, fg, accent}`) replace a page theme's colours. On photo themes only the accent changes.
53
53
  - Lint checks contrast. A `contrast` error means the text will not read on a phone. Pick darker text or a lighter page; do not ignore it.
54
54
  - `brand_set { brand: { icon } }` needs a ref from `image_import`, not a path or URL.
55
+
56
+ ## Brand kit from the website
57
+
58
+ `brand_kit { url }` reads the app's website (or, without `url`, the seller site on its App Store listing, and in a Spec repo any colours in `appeeky/playbook.md`) and proposes:
59
+
60
+ - colours: background, text and accent, with text contrast checked;
61
+ - the fonts the site uses, and the theme closest to them;
62
+ - the logo (Apple touch icon, a large icon, or the share image).
63
+
64
+ Show the proposal to the user first. `brand_kit { apply: true }` saves the colours and, if there is no icon yet, imports the logo as the icon (license `own`). Only public https pages are read.
@@ -0,0 +1,23 @@
1
+ # Ideas
2
+
3
+ The idea queue (`ideas.yaml` in the workspace) collects what to make next, from what is already known. Nothing is sent anywhere to fill it.
4
+
5
+ `ideas_collect` adds ideas from:
6
+
7
+ | Source | What it looks for |
8
+ |---|---|
9
+ | Comments (`appeeky/social/comments.jsonl` in a Spec repo) | Questions people asked under posts |
10
+ | Reviews (Spec's `appeeky/reviews/`, or the App Store's recent reviews) | Wishes ("I wish", "please add") and detailed five-star praise |
11
+ | The store listing (Spec repo) | Each feature line, as a screenshot slide idea |
12
+ | `appeeky/playbook.md` | Listing changes that won, as a post |
13
+ | Channels | Topics no deck has used yet |
14
+
15
+ Each idea keeps the words behind it (`evidence`). Ideas from people come first. The same idea is never added twice.
16
+
17
+ `ideas_list` shows the queue; `idea_add` adds one the user gives you (or a pattern you saw in `viral_search`); `idea_update` marks one `used` or `skipped`.
18
+
19
+ ## From idea to deck
20
+
21
+ 1. Show the user three or four new ideas and suggest one, with the reason ("three people asked this in comments").
22
+ 2. Write the deck with `deck_create` and `idea: <id>`; the idea is marked used.
23
+ 3. Stay true to the evidence: a review's wish is not a promise that the feature exists. Check `brand_context` before saying the app does something. Never quote a review or comment word for word on a slide without the user's yes, and never with the person's name.
@@ -31,7 +31,7 @@ Avoid photos that:
31
31
  - `url`: an https image the user gave. Its license is "unknown" unless you pass `license` and `author`. Use it only if the user owns it or has the right to post it, and ask if unsure.
32
32
  - `path`: a file on this machine, such as the user's photo, a screenshot, or an image another tool generated. Its license is "own".
33
33
  - Imports are re-encoded to JPEG. EXIF data, including GPS location, is removed. The same image imported twice gets the same ref.
34
- - Refused: SVG, files over 25 MB, images under 600 px on the short side, non-images, http (not https), local or private network addresses.
34
+ - Refused: SVG, files over 25 MB, images under 200 px on a side, non-images, http (not https), local or private network addresses.
35
35
 
36
36
  ## Placing
37
37
 
@@ -39,6 +39,14 @@ Avoid photos that:
39
39
  - `text_position` (0–100) moves a photo theme's text up or down. Use it when the text covers the subject.
40
40
  - `text_style` per slide (`outline`, `shadow`, `box`, `plain`) helps when one photo is too busy for the theme's style.
41
41
 
42
+ ## Licenses
43
+
44
+ Every image records who may post it: `own` (the user's), `licensed` (bought, or permission given), `cc0`, `pdm` (public domain), `by-4.0` / `by-3.0` / `by-2.0` (credit needed), `unsplash`, `pexels`, or `unknown`.
45
+
46
+ - Search hits come with their license. Files (`path`) and the app's own screenshots are `own`. A `url` import is `unknown` unless you pass `license`.
47
+ - A deck with an `unknown` image renders, with a `license-unknown` warning, but cannot be published (the warning becomes an error).
48
+ - `image_license { ref, license, author }` records the license. Set it only from what the user tells you ("it's my photo", "I bought it on…"). Never mark an image `own` or `licensed` to get past the check.
49
+
42
50
  ## Credit
43
51
 
44
52
  - CC BY photos need the author credited. Export writes `credits.txt`. For posts, add a short credit to the caption ("Photos: A. Name, B. Name (CC BY)"). Lint warns `attribution` until a credit is in the caption.
@@ -39,3 +39,13 @@ Not supported yet: Bengali, Tamil, Telugu, Gujarati, Punjabi, Ethiopic, Khmer, G
39
39
  - Hashtags in the post's language. Add one English tag only if the audience uses it.
40
40
  - `banned-phrase` only knows English phrases. In other languages, avoid their equivalents yourself ("unlock", "game-changer", "journey" in translation).
41
41
  - If the user writes to you in one language but posts in another, write the slides in the posting language. Ask if unclear.
42
+
43
+ ## The same deck in another language
44
+
45
+ When a deck did well, or the app's store has several languages, `deck_translate { id, language, slides, caption, hashtags }` makes the same deck in another language (id `<deck>-<language>`):
46
+
47
+ - Give every slide's translated words in order: the same number of slides, the same kinds, the same number of list items. Images, crops and numbers stay.
48
+ - Translate the idea, not word for word. Rewrite the hook so it works in that language, and keep it short.
49
+ - Caption and hashtags in that language. Accounts and time can differ (`accounts`, `when`): a German deck goes to the German account.
50
+ - In a Spec repo, `brand_context` lists the store's languages. Suggest those first.
51
+ - Render and look: German runs long, and scripts like Japanese or Arabic may need a theme with TikTok Sans or Inter.
@@ -0,0 +1,47 @@
1
+ # Results: learn what works, test hooks, post again
2
+
3
+ open-slideshow keeps each published deck's numbers on the deck (`results`) and turns them into advice. Read it before writing new decks; once two or more decks are measured, `brand_context` includes it too.
4
+
5
+ ## Bringing numbers in
6
+
7
+ `results_sync` fills in views, likes, comments, shares and saves:
8
+
9
+ | Published with | Where the numbers come from |
10
+ |---|---|
11
+ | `spec-draft` | `appeeky/social/posts.jsonl`, once Spec has sent the draft and pulled its numbers (`appeeky-spec social pull`) |
12
+ | `appeeky` | Appeeky, with the user's `APPEEKY_API_KEY` |
13
+ | `photos`, `export`, `postiz` | Nobody can read them for you. Ask the user, then `results_record` |
14
+
15
+ `results_record { id, platform, views, likes, comments, shares, saves }` saves what the user read off the app. One call per platform; a new call replaces the last one. Never guess numbers.
16
+
17
+ Run `results_sync` a day or more after posting; TikTok numbers keep growing for about a week.
18
+
19
+ ## Reading insights
20
+
21
+ `insights` compares measured decks with the median deck (a "lift" of 1.5× means 50% more views than usual) by:
22
+
23
+ - template, theme, number of slides, size and channel;
24
+ - hook kind: a number, a question, "you", POV, "stop/never/don't", a short hook;
25
+ - day of the week and hour posted.
26
+
27
+ It lists what to do more of and less of, the best hooks, hook test winners and decks worth posting again. Groups with one deck are not shown, so the advice says nothing until a few decks are measured. Tell the user how many decks it is based on; five decks are a hint, not a rule.
28
+
29
+ Use it when you suggest a template or write hooks: "Mistakes decks got 2.1× your usual views, so I wrote this one as mistakes."
30
+
31
+ ## Hook tests
32
+
33
+ The cover decides most of a slideshow's views. `hook_test { id, hooks: [...], spread_days }` copies a deck once per new hook (variants b, c… ; the deck itself is a). Only the cover changes. `spread_days` schedules each copy that many days after the one before.
34
+
35
+ - Write hooks that differ in kind, not in one word: a number vs a question vs a POV.
36
+ - Post the variants on different days, or on different accounts the same day. Never two variants on one account the same day.
37
+ - `insights` calls a winner once every variant has at least 300 views and one has at least 1.2× the next. Until then it says it is waiting, or that there is no clear winner.
38
+ - Use the winning hook's kind for the next decks.
39
+
40
+ ## Posting a winner again
41
+
42
+ A deck that did well can be posted again after 30 days. `deck_repost { id, hook, order }` makes a new deck with:
43
+
44
+ - a hook nobody has seen (a hook used before is refused);
45
+ - optionally the middle slides in a new order (`order` lists every slide index once, cover first).
46
+
47
+ `insights` lists repost candidates: decks with at least 1.5× the usual views, posted 30 or more days ago, not reposted yet. Post a repost to the same account only once; after that, make something new on the same idea.
@@ -1,6 +1,6 @@
1
1
  # Render and review
2
2
 
3
- `deck_render` writes `01.jpg … NN.jpg` and `sheet.jpg` (all slides side by side), lints the deck, and returns the sheet. Pass `slide: N` to also get slide N full size.
3
+ `deck_render` writes `01.jpg … NN.jpg` and `sheet.jpg` (all slides side by side), lints the deck, and returns the sheet. Pass `slide: N` to also get slide N full size. Pass `safe_zones: true` to get `sheet-safe.jpg` instead: the same sheet with TikTok's buttons, caption and top tabs drawn over the slides in red.
4
4
 
5
5
  ## Look at the sheet yourself
6
6
 
@@ -44,12 +44,19 @@ Errors block publishing (except export). Warnings do not, but read them.
44
44
  | `brand-word` / `brand-claim` | Breaks `words_to_avoid` / `claims_never` | Remove it |
45
45
  | `repeat-hook` | Hook used before | New angle |
46
46
  | `missing-glyphs`, `font-download`, `font-fallback`, `emoji-shaped` | Languages | See `languages.md` |
47
+ | `small-text` | Body or list text had to shrink below ~38 px to fit | Cut words, or split the slide; small text is skipped on a phone |
48
+ | `tiktok-ui` | Lines sit under TikTok's buttons (right side), caption (bottom) or top tabs | Move the words (`text_position`), shorten the lines, or check with `safe_zones` |
47
49
  | `layout` | The slide could not be laid out at all | Read the message; usually an unreadable image file. Re-import the image, or tell the user if it keeps failing |
48
50
 
49
51
  ### Images and colours
50
52
  | Code | Means | Do |
51
53
  |---|---|---|
52
54
  | `image-missing` | `image` ref is not in the workspace | `image_import` it, use the returned ref |
55
+ | `photo-contrast` | The photo is bright where the words are | `text_style: "outline"` or `"box"` on that slide, move the words (`text_position`) or the photo (`focus`), or pick a darker photo |
56
+ | `busy-photo` | The photo is busy (much detail) where the words are | Same fixes as `photo-contrast`; a calmer part of the photo works best |
57
+ | `screenshot-empty` | A `screenshot` slide without its screenshot | `app_screenshots`, then put the ref in `image` (see `screenshots.md`) |
58
+ | `small-screenshot` | The phone came out small | Shorten the title above it, or drop the title |
59
+ | `license-unknown` | Nobody said the image may be posted | Warning while drafting, error when publishing. If the user owns it or has the rights, `image_license`; otherwise pick another image |
53
60
  | `no-image` | A photo theme slide without a photo | Add one, or pick a page theme |
54
61
  | `no-icon` | App slide but no brand icon | Set the App Store id, or `brand_set icon` |
55
62
  | `contrast` / `accent-contrast` | Colours hard to read | Change `colors` |
@@ -0,0 +1,26 @@
1
+ # App screenshots in a phone
2
+
3
+ A `screenshot` slide shows the app's own screen inside a phone, with a line of text above it. Use it to show the feature the slide talks about: a slideshow that shows the real app is more believable than one that only describes it.
4
+
5
+ ```json
6
+ { "kind": "screenshot", "title": "Mix *rain* and *fan* in one tap", "image": "<ref>" }
7
+ ```
8
+
9
+ The title is optional; leave it out to show only the phone, larger.
10
+
11
+ ## Finding the screenshots
12
+
13
+ `app_screenshots` imports the app's screenshots and returns a sheet to pick from:
14
+
15
+ - In an Appeeky Spec repo, from `appeeky/screenshots/` (the largest iPhone size, the store's main language first; pass `locale` for another).
16
+ - Otherwise from the App Store listing, using the App Store id in the brand.
17
+
18
+ They are saved with license `own`. A screenshot the user sends can be imported with `image_import` (path); ask whether it is their app.
19
+
20
+ ## Good screenshot slides
21
+
22
+ - One or two per deck: after the problem, when the app is the answer, or in a how-to step. Not on the cover.
23
+ - Pick the screen that shows the point of the slide, not the home screen.
24
+ - Store screenshots often have marketing text and frames on them already. Prefer a plain screen; if only marketed ones exist, use one whose words do not fight the slide's.
25
+ - Keep the title short. Long text makes the phone small and lint warns `small-screenshot`.
26
+ - Every template with an app slide takes up to two screenshot slides before it.
@@ -0,0 +1,20 @@
1
+ # Series
2
+
3
+ A series is one idea told over several posts: "Part 1: mornings", "Part 2: evenings". People who liked part 1 come back for part 2, and the label on the cover tells new viewers there is more.
4
+
5
+ `series_next { id, slides, topic, of, label, when }` makes the next part:
6
+
7
+ - `id` is the last part. The first time, it is the deck that starts the series; that deck becomes part 1.
8
+ - The new deck keeps the theme, size, language, template and accounts. You write its slides.
9
+ - The cover gets a small label at the top: "Part 2", or "Part 2/3" with `of`. For another language set `label`, e.g. `Bölüm {part}` or `Teil {part}/{of}`.
10
+ - A series that has all its parts (`of`) refuses another one.
11
+
12
+ `series_list` shows each series with its parts, their status and times.
13
+
14
+ ## Writing a series
15
+
16
+ - Decide the parts up front and say how many on part 1's caption ("3 parts, follow for part 2").
17
+ - Each part stands on its own: someone who sees only part 3 still gets something.
18
+ - Refer back in one line, not a recap: "Yesterday: mornings. Today: the evening."
19
+ - Post parts one to three days apart. Schedule them with `when`, or put them in a channel's slots.
20
+ - Run `insights` after part 1. If it did badly, ask the user before making part 2.