@appeeky/open-slideshow 0.0.0-stage → 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 (78) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +297 -2
  3. package/dist/bin.d.ts +2 -0
  4. package/dist/bin.js +9 -0
  5. package/dist/brand.d.ts +57 -0
  6. package/dist/brand.js +263 -0
  7. package/dist/brandkit.d.ts +50 -0
  8. package/dist/brandkit.js +212 -0
  9. package/dist/cli.d.ts +1 -0
  10. package/dist/cli.js +355 -0
  11. package/dist/decks.d.ts +44 -0
  12. package/dist/decks.js +100 -0
  13. package/dist/fonts.d.ts +45 -0
  14. package/dist/fonts.js +243 -0
  15. package/dist/gallery.d.ts +35 -0
  16. package/dist/gallery.js +109 -0
  17. package/dist/ideas.d.ts +50 -0
  18. package/dist/ideas.js +146 -0
  19. package/dist/images.d.ts +62 -0
  20. package/dist/images.js +241 -0
  21. package/dist/index.d.ts +21 -0
  22. package/dist/index.js +22 -0
  23. package/dist/lint.d.ts +36 -0
  24. package/dist/lint.js +197 -0
  25. package/dist/mcp.d.ts +3 -0
  26. package/dist/mcp.js +303 -0
  27. package/dist/preview.d.ts +18 -0
  28. package/dist/preview.js +96 -0
  29. package/dist/publish.d.ts +105 -0
  30. package/dist/publish.js +406 -0
  31. package/dist/readability.d.ts +19 -0
  32. package/dist/readability.js +42 -0
  33. package/dist/render.d.ts +92 -0
  34. package/dist/render.js +647 -0
  35. package/dist/results.d.ts +89 -0
  36. package/dist/results.js +252 -0
  37. package/dist/schedule.d.ts +19 -0
  38. package/dist/schedule.js +114 -0
  39. package/dist/schema.d.ts +1159 -0
  40. package/dist/schema.js +211 -0
  41. package/dist/screenshots.d.ts +18 -0
  42. package/dist/screenshots.js +69 -0
  43. package/dist/shape.d.ts +31 -0
  44. package/dist/shape.js +169 -0
  45. package/dist/skill.d.ts +7 -0
  46. package/dist/skill.js +17 -0
  47. package/dist/templates.d.ts +47 -0
  48. package/dist/templates.js +330 -0
  49. package/dist/text.d.ts +40 -0
  50. package/dist/text.js +231 -0
  51. package/dist/themes.d.ts +43 -0
  52. package/dist/themes.js +202 -0
  53. package/dist/variants.d.ts +48 -0
  54. package/dist/variants.js +175 -0
  55. package/dist/version.d.ts +1 -0
  56. package/dist/version.js +1 -0
  57. package/dist/video.d.ts +22 -0
  58. package/dist/video.js +59 -0
  59. package/dist/viral.d.ts +12 -0
  60. package/dist/viral.js +35 -0
  61. package/dist/workspace.d.ts +85 -0
  62. package/dist/workspace.js +322 -0
  63. package/package.json +65 -4
  64. package/skills/open-slideshow/SKILL.md +65 -0
  65. package/skills/open-slideshow/references/brand.md +64 -0
  66. package/skills/open-slideshow/references/channels.md +63 -0
  67. package/skills/open-slideshow/references/ideas.md +23 -0
  68. package/skills/open-slideshow/references/images.md +61 -0
  69. package/skills/open-slideshow/references/languages.md +51 -0
  70. package/skills/open-slideshow/references/publishing.md +70 -0
  71. package/skills/open-slideshow/references/results.md +47 -0
  72. package/skills/open-slideshow/references/review.md +81 -0
  73. package/skills/open-slideshow/references/screenshots.md +26 -0
  74. package/skills/open-slideshow/references/series.md +20 -0
  75. package/skills/open-slideshow/references/templates.md +96 -0
  76. package/skills/open-slideshow/references/troubleshooting.md +92 -0
  77. package/skills/open-slideshow/references/video.md +18 -0
  78. package/skills/open-slideshow/references/writing.md +76 -0
@@ -0,0 +1,322 @@
1
+ import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, statSync, writeFileSync, appendFileSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
4
+ import YAML from "yaml";
5
+ import { z } from "zod";
6
+ import { channelSchema, deckSchema, ID_PATTERN, settingsSchema } from "./schema.js";
7
+ export const SETTINGS_FILE = "open-slideshow.yaml";
8
+ export const SPEC_FILE = "appeeky.spec.yaml";
9
+ export class UserError extends Error {
10
+ }
11
+ function walkUp(start, name) {
12
+ const home = homedir();
13
+ let dir = resolve(start);
14
+ for (;;) {
15
+ if (existsSync(join(dir, name)))
16
+ return dir;
17
+ const parent = dirname(dir);
18
+ if (parent === dir || dir === home)
19
+ return null;
20
+ dir = parent;
21
+ }
22
+ }
23
+ function readYaml(file) {
24
+ const text = readFileSync(file, "utf8");
25
+ try {
26
+ return YAML.parse(text, { maxAliasCount: 50 }) ?? {};
27
+ }
28
+ catch (e) {
29
+ throw new UserError(`${file}: not valid YAML (${e.message.split("\n")[0]})`);
30
+ }
31
+ }
32
+ function zodMessage(file, err) {
33
+ return `${file}:\n${err.issues.map((i) => ` ${i.path.join(".") || "(root)"}: ${i.message}`).join("\n")}`;
34
+ }
35
+ export function parseWith(schema, data, file) {
36
+ const r = schema.safeParse(data);
37
+ if (!r.success)
38
+ throw new UserError(zodMessage(file, r.error));
39
+ return r.data;
40
+ }
41
+ /** Writes through a temp file so a crash never leaves half a file. */
42
+ export function writeAtomic(file, content) {
43
+ mkdirSync(dirname(file), { recursive: true });
44
+ const tmp = `${file}.${process.pid}.tmp`;
45
+ writeFileSync(tmp, content);
46
+ renameSync(tmp, file);
47
+ }
48
+ const specAppSchema = z
49
+ .object({
50
+ app: z.object({ name: z.string().min(1), primaryLocale: z.string().optional() }).passthrough(),
51
+ stores: z
52
+ .object({
53
+ appStore: z.object({ appId: z.string() }).passthrough().optional(),
54
+ googlePlay: z.object({ packageName: z.string().optional(), appId: z.string().optional() }).passthrough().optional(),
55
+ })
56
+ .passthrough()
57
+ .optional(),
58
+ })
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
+ }
72
+ function readSpec(root) {
73
+ const file = join(root, SPEC_FILE);
74
+ // Spec owns this file and checks it fully; we only read what we need, and stop if even that is broken.
75
+ const data = parseWith(specAppSchema, readYaml(file), file);
76
+ const playbook = join(root, "appeeky", "playbook.md");
77
+ const appId = data.stores?.appStore?.appId;
78
+ const gp = data.stores?.googlePlay;
79
+ return {
80
+ file,
81
+ app: {
82
+ name: data.app.name,
83
+ app_store_id: appId && /^\d+$/.test(appId) ? appId : undefined,
84
+ play_package: gp?.packageName ?? gp?.appId,
85
+ locale: data.app.primaryLocale ?? "en-US",
86
+ },
87
+ playbook: existsSync(playbook) ? playbook : undefined,
88
+ store_dir: join(root, "appeeky", "store"),
89
+ accounts_file: join(root, "appeeky", "social", "accounts.yaml"),
90
+ posts_file: join(root, "appeeky", "social", "posts.jsonl"),
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"),
96
+ };
97
+ }
98
+ export function openWorkspace(cwd = process.cwd()) {
99
+ const warnings = [];
100
+ const specRoot = walkUp(cwd, SPEC_FILE);
101
+ const settingsRoot = walkUp(cwd, SETTINGS_FILE);
102
+ if (specRoot && (!settingsRoot || specRoot.length >= settingsRoot.length || settingsRoot.startsWith(specRoot))) {
103
+ const spec = readSpec(specRoot);
104
+ const dir = join(specRoot, "appeeky", "social", "slides");
105
+ const settingsFile = join(dir, SETTINGS_FILE);
106
+ const settings = existsSync(settingsFile) ? parseWith(settingsSchema, readYaml(settingsFile), settingsFile) : settingsSchema.parse({});
107
+ // Spec is the source of truth; our settings only fill what Spec does not say.
108
+ if (settings.app.name && settings.app.name !== spec.app.name)
109
+ warnings.push(`${SETTINGS_FILE} names the app "${settings.app.name}" but ${SPEC_FILE} says "${spec.app.name}"; using Spec's`);
110
+ if (settings.app.app_store_id && spec.app.app_store_id && settings.app.app_store_id !== spec.app.app_store_id)
111
+ warnings.push(`${SETTINGS_FILE} has App Store id ${settings.app.app_store_id} but ${SPEC_FILE} has ${spec.app.app_store_id}; using Spec's`);
112
+ settings.app.name = spec.app.name;
113
+ settings.app.app_store_id = spec.app.app_store_id ?? settings.app.app_store_id;
114
+ settings.app.play_package = spec.app.play_package ?? settings.app.play_package;
115
+ if (!existsSync(spec.accounts_file))
116
+ warnings.push("Spec has no appeeky/social/accounts.yaml yet: run `appeeky-spec social pull` to see your connected accounts");
117
+ return { mode: "spec", root: specRoot, dir, state: join(specRoot, ".appeeky", "slides"), settings_file: settingsFile, settings, initialized: true, spec, warnings };
118
+ }
119
+ const root = settingsRoot ?? resolve(cwd);
120
+ const settingsFile = join(root, SETTINGS_FILE);
121
+ const settings = existsSync(settingsFile) ? parseWith(settingsSchema, readYaml(settingsFile), settingsFile) : settingsSchema.parse({});
122
+ return { mode: "standalone", root, dir: root, state: join(root, ".open-slideshow"), settings_file: settingsFile, settings, initialized: existsSync(settingsFile), warnings };
123
+ }
124
+ export function initWorkspace(cwd, settings = {}) {
125
+ const ws = openWorkspace(cwd);
126
+ mkdirSync(join(ws.dir, "decks"), { recursive: true });
127
+ mkdirSync(join(ws.dir, "channels"), { recursive: true });
128
+ mkdirSync(join(ws.dir, "images"), { recursive: true });
129
+ mkdirSync(ws.state, { recursive: true });
130
+ if (!existsSync(ws.settings_file)) {
131
+ const merged = settingsSchema.parse({ ...settings });
132
+ writeAtomic(ws.settings_file, settingsYaml(merged));
133
+ }
134
+ if (ws.mode === "standalone") {
135
+ const gi = join(ws.root, ".gitignore");
136
+ const line = ".open-slideshow/cache/";
137
+ if (!existsSync(gi) || !readFileSync(gi, "utf8").includes(line))
138
+ appendFileSync(gi, `${existsSync(gi) ? "\n" : ""}${line}\n`);
139
+ }
140
+ return openWorkspace(cwd);
141
+ }
142
+ export function settingsYaml(s) {
143
+ return `# open-slideshow settings: what your agent needs to know about the app and the brand.\n# Not a format to learn: run \`open-slideshow brand\` or ask your agent to fill it in.\n${YAML.stringify(s)}`;
144
+ }
145
+ export function saveSettings(ws, settings) {
146
+ const s = settingsSchema.parse(settings);
147
+ if (ws.mode === "spec") {
148
+ // Never copy Spec's own facts into our file.
149
+ s.app = { country: s.app.country };
150
+ }
151
+ writeAtomic(ws.settings_file, settingsYaml(s));
152
+ ws.settings = settings;
153
+ }
154
+ // ---------- ids and paths ----------
155
+ const RESERVED = /^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/;
156
+ export function checkId(id, what = "id") {
157
+ if (!ID_PATTERN.test(id) || RESERVED.test(id))
158
+ throw new UserError(`${what} "${id}": use lowercase letters, digits and dashes (max 64)`);
159
+ return id;
160
+ }
161
+ export function slugify(text) {
162
+ const s = text
163
+ .normalize("NFKD")
164
+ .replace(/[̀-ͯ]/g, "")
165
+ .toLowerCase()
166
+ .replace(/ı/g, "i")
167
+ .replace(/[^a-z0-9]+/g, "-")
168
+ .replace(/^-+|-+$/g, "")
169
+ .slice(0, 48)
170
+ .replace(/-+$/, "");
171
+ return s || "deck";
172
+ }
173
+ export const deckDir = (ws, id) => join(ws.dir, "decks", checkId(id, "deck id"));
174
+ export const deckFile = (ws, id) => join(deckDir(ws, id), "deck.yaml");
175
+ export const rendersDir = (ws, id) => join(deckDir(ws, id), "renders");
176
+ export const channelFile = (ws, id) => join(ws.dir, "channels", `${checkId(id, "channel id")}.yaml`);
177
+ export const imagesDir = (ws) => join(ws.dir, "images");
178
+ /** True when `child` is `parent` or inside it, after following links. */
179
+ /** The real path, following links, even for a file that does not exist yet (its nearest existing folder is resolved). */
180
+ function realish(path) {
181
+ let dir = resolve(path);
182
+ const rest = [];
183
+ while (!existsSync(dir)) {
184
+ const parent = dirname(dir);
185
+ if (parent === dir)
186
+ break;
187
+ rest.unshift(dir.slice(parent.length + (parent.endsWith(sep) ? 0 : 1)));
188
+ dir = parent;
189
+ }
190
+ return join(existsSync(dir) ? realpathSync(dir) : dir, ...rest);
191
+ }
192
+ export function isInside(parent, child) {
193
+ const p = realish(parent);
194
+ const c = realish(child);
195
+ const rel = relative(p, c);
196
+ return rel === "" || (!rel.startsWith("..") && !isAbsolute(rel) && !rel.startsWith(`..${sep}`));
197
+ }
198
+ /** A slide's image: a name in images/ or a path inside the workspace. Never outside it. */
199
+ export function resolveImage(ws, ref) {
200
+ if (!ref || ref.includes("\0"))
201
+ return null;
202
+ const candidates = isAbsolute(ref) ? [ref] : [join(imagesDir(ws), ref), join(ws.dir, ref), join(ws.root, ref)];
203
+ for (const c of candidates) {
204
+ if (!existsSync(c))
205
+ continue;
206
+ if (!isInside(ws.root, c))
207
+ return null;
208
+ if (!statSync(c).isFile())
209
+ continue;
210
+ return realpathSync(c);
211
+ }
212
+ return null;
213
+ }
214
+ // ---------- decks ----------
215
+ export function deckExists(ws, id) {
216
+ return existsSync(deckFile(ws, id));
217
+ }
218
+ export function loadDeck(ws, id) {
219
+ const file = deckFile(ws, id);
220
+ if (!existsSync(file))
221
+ throw new UserError(`no deck "${id}"; deck_list shows the decks`);
222
+ const deck = parseWith(deckSchema, readYaml(file), file);
223
+ if (deck.id !== id)
224
+ throw new UserError(`${file}: id is "${deck.id}" but the folder is "${id}"`);
225
+ return deck;
226
+ }
227
+ export function saveDeck(ws, deck) {
228
+ const parsed = parseWith(deckSchema, deck, `deck ${deck.id}`);
229
+ writeAtomic(deckFile(ws, parsed.id), YAML.stringify(parsed, { lineWidth: 0 }));
230
+ return parsed;
231
+ }
232
+ export function listDecks(ws) {
233
+ const dir = join(ws.dir, "decks");
234
+ if (!existsSync(dir))
235
+ return [];
236
+ return readdirSync(dir)
237
+ .filter((d) => ID_PATTERN.test(d) && existsSync(join(dir, d, "deck.yaml")))
238
+ .sort()
239
+ .map((id) => {
240
+ try {
241
+ return { id, deck: loadDeck(ws, id) };
242
+ }
243
+ catch (e) {
244
+ return { id, error: e.message };
245
+ }
246
+ });
247
+ }
248
+ export function uniqueDeckId(ws, base) {
249
+ const slug = RESERVED.test(slugify(base)) ? `${slugify(base)}-deck` : slugify(base);
250
+ if (!deckExists(ws, slug))
251
+ return slug;
252
+ for (let i = 2; i < 1000; i++)
253
+ if (!deckExists(ws, `${slug}-${i}`))
254
+ return `${slug}-${i}`;
255
+ throw new UserError("too many decks with the same name");
256
+ }
257
+ // ---------- channels ----------
258
+ export function loadChannel(ws, id) {
259
+ const file = channelFile(ws, id);
260
+ if (!existsSync(file))
261
+ throw new UserError(`no channel "${id}"`);
262
+ const ch = parseWith(channelSchema, readYaml(file), file);
263
+ if (ch.id !== id)
264
+ throw new UserError(`${file}: id is "${ch.id}" but the file is "${id}.yaml"`);
265
+ return ch;
266
+ }
267
+ export function saveChannel(ws, ch) {
268
+ const parsed = parseWith(channelSchema, ch, `channel ${ch.id}`);
269
+ writeAtomic(channelFile(ws, parsed.id), YAML.stringify(parsed, { lineWidth: 0 }));
270
+ return parsed;
271
+ }
272
+ export function listChannels(ws) {
273
+ const dir = join(ws.dir, "channels");
274
+ if (!existsSync(dir))
275
+ return [];
276
+ return readdirSync(dir)
277
+ .filter((f) => f.endsWith(".yaml") && ID_PATTERN.test(f.slice(0, -5)))
278
+ .sort()
279
+ .map((f) => {
280
+ const id = f.slice(0, -5);
281
+ try {
282
+ return { id, channel: loadChannel(ws, id) };
283
+ }
284
+ catch (e) {
285
+ return { id, error: e.message };
286
+ }
287
+ });
288
+ }
289
+ // ---------- state ----------
290
+ export function readJson(file, fallback) {
291
+ if (!existsSync(file))
292
+ return fallback;
293
+ try {
294
+ return JSON.parse(readFileSync(file, "utf8"));
295
+ }
296
+ catch {
297
+ return fallback;
298
+ }
299
+ }
300
+ export function readJsonl(file) {
301
+ if (!existsSync(file))
302
+ return [];
303
+ const out = [];
304
+ for (const line of readFileSync(file, "utf8").split("\n")) {
305
+ if (!line.trim())
306
+ continue;
307
+ try {
308
+ out.push(JSON.parse(line));
309
+ }
310
+ catch {
311
+ /* a torn last line after a crash: skip it */
312
+ }
313
+ }
314
+ return out;
315
+ }
316
+ export function historyFile(ws) {
317
+ return join(ws.state, "history.jsonl");
318
+ }
319
+ export function appendHistory(ws, e) {
320
+ mkdirSync(ws.state, { recursive: true });
321
+ appendFileSync(historyFile(ws), `${JSON.stringify(e)}\n`);
322
+ }
package/package.json CHANGED
@@ -1,6 +1,67 @@
1
1
  {
2
2
  "name": "@appeeky/open-slideshow",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Make TikTok and Instagram slideshows with the coding agent you already use. Local renderer, CLI and MCP server.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "open-slideshow": "dist/bin.js"
9
+ },
10
+ "main": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "exports": {
13
+ ".": "./dist/index.js",
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "skills",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "engines": {
23
+ "node": ">=20"
24
+ },
25
+ "scripts": {
26
+ "build": "tsc -p tsconfig.build.json",
27
+ "typecheck": "tsc -p tsconfig.json --noEmit",
28
+ "test": "vitest run",
29
+ "dev": "tsx src/bin.ts"
30
+ },
31
+ "keywords": [
32
+ "tiktok",
33
+ "instagram",
34
+ "slideshow",
35
+ "carousel",
36
+ "mcp",
37
+ "agent"
38
+ ],
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/appeeky/open-slideshow.git"
42
+ },
43
+ "dependencies": {
44
+ "@fontsource/anton": "^5.3.0",
45
+ "@fontsource/instrument-serif": "^5.3.0",
46
+ "@fontsource/inter": "^5.3.0",
47
+ "@fontsource/tiktok-sans": "^5.3.0",
48
+ "@modelcontextprotocol/sdk": "^1.32.2",
49
+ "@resvg/resvg-js": "^2.6.2",
50
+ "bidi-js": "^1.1.0",
51
+ "harfbuzzjs": "^1.6.4",
52
+ "luxon": "^3.7.2",
53
+ "opentype.js": "^2.0.0",
54
+ "satori": "^0.64.3",
55
+ "sharp": "^0.35.6",
56
+ "yaml": "^2.9.1",
57
+ "zod": "^3.25.76"
58
+ },
59
+ "devDependencies": {
60
+ "@types/luxon": "^3.7.6",
61
+ "@types/node": "^26.6.11",
62
+ "@types/opentype.js": "^1.3.10",
63
+ "tsx": "^4.23.15",
64
+ "typescript": "^5.9.3",
65
+ "vitest": "^5.1.2"
66
+ }
67
+ }
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: open-slideshow
3
+ description: Make TikTok photo slideshows and Instagram carousels for the user's app with open-slideshow. Write the slides in the brand's voice, pick a theme and a template, find photos, render, check, then export, post or schedule. Use when the user asks for a slideshow, carousel, photo post, TikTok or Instagram content, a posting plan, or to schedule posts.
4
+ ---
5
+
6
+ # open-slideshow
7
+
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
+
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
+
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.
17
+
18
+ | Topic | When |
19
+ |---|---|
20
+ | `brand` | Before the first deck in a workspace, when brand facts are missing, or the user corrects the voice |
21
+ | `writing` | Writing or rewriting any slide, hook or caption; what already works on TikTok (`viral_search`) |
22
+ | `templates` | Choosing a template, or a deck that does not fit one |
23
+ | `images` | Finding, importing or crediting photos; the user's own images |
24
+ | `languages` | Any deck not in English, or mixed scripts |
25
+ | `review` | After every render; what each lint code means and how to fix it |
26
+ | `publishing` | Export, Photos, posting through Appeeky, Spec drafts, scheduling one post |
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 |
33
+ | `troubleshooting` | Any error message from a tool |
34
+
35
+ ## The flow, every time
36
+
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.
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.
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`).
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.
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.
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`.
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.
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.
46
+
47
+ ## Never
48
+
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).
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.
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.
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.
54
+ - Put words in a real person's mouth, or imitate a real person or brand.
55
+ - Edit a published deck. Make a new one.
56
+ - Edit Appeeky Spec's own files (`appeeky.spec.yaml`, `appeeky/playbook.md`, listings). Suggest the change to the user instead.
57
+ - Write API keys into any file, or ask the user to paste one in the chat. Keys come only from the user's environment.
58
+
59
+ ## Small things that matter
60
+
61
+ - Words in `*stars*` get the accent colour. Use it on 1–3 words per slide, the words that carry the point.
62
+ - A tip slide numbers itself. Do not type "1." in the title. Use `number` only to count down (ranking).
63
+ - One idea per slide, under ~25 words. The hook is under 10 words.
64
+ - Show every picture a tool returns (theme sheet, template sheet, render sheet, image search thumbnails, viral covers) to the user. Do not describe it instead.
65
+ - When something fails, read the message. It says what to do. If it does not, see the `troubleshooting` guide.
@@ -0,0 +1,64 @@
1
+ # Brand: know the app before writing
2
+
3
+ `brand_context` returns everything open-slideshow knows about the app and its voice, as one markdown page. Call it before every deck, not once per conversation: the hooks already used change after every post.
4
+
5
+ ## What it contains
6
+
7
+ - **App**: name, one-liner, and the App Store listing (description, category, rating) when there is an App Store id.
8
+ - **Voice**: audience, tone, voice examples, words to use, words to avoid.
9
+ - **Claims**: `claims_allowed` (safe to say) and `claims_never` (never say or imply).
10
+ - **Call to action**: the line used on app slides, e.g. "Free on the App Store".
11
+ - **Spec playbook**: in an Appeeky Spec repo, `appeeky/playbook.md` is included. It is the main source there.
12
+ - **Hooks already used**: from earlier decks, publish history and (in Spec) past posts, with views and likes when known.
13
+ - **Do not write**: phrases that sound machine-written, plus the user's own additions.
14
+ - **Missing**: facts it needs and the questions to ask.
15
+
16
+ ## When facts are missing
17
+
18
+ Ask all of the questions under **Missing** in one message. Keep them as written; they are short on purpose. Then save the answers:
19
+
20
+ ```
21
+ brand_set { brand: { one_liner, audience, tone: [...], claims_never: [...], cta } }
22
+ ```
23
+
24
+ - Lists replace the old list. To add one item, send the full list with the new item in it.
25
+ - If the user does not know or does not care ("just write something"), write the deck anyway with neutral claims. Tell them in one line which facts would make it better. Do not invent a one-liner or an audience.
26
+ - In a Spec repo, suggest adding the answers to `appeeky/playbook.md`. Save them with `brand_set` too, so this workspace has them.
27
+
28
+ ## App Store id
29
+
30
+ - If the app is on the App Store and there is no id, ask for the App Store link or id. Save it with `brand_set app_store_id`. open-slideshow then reads the listing and imports the icon for app slides.
31
+ - In a Spec repo the id comes from `appeeky.spec.yaml`, and `brand_set app_store_id` refuses. That is expected.
32
+ - Android-only apps: leave the id out. Import the icon with `image_import path` and set `brand_set { brand: { icon: <ref> } }`.
33
+ - The lookup is cached for 7 days. If the user just changed the listing, tell them the slides may use the older text until then.
34
+
35
+ ## Using the brand while writing
36
+
37
+ - **Tone** decides the words: "blunt" means short, no softeners; "warm" means second person and kind; "nerdy" means exact numbers and terms (only real ones).
38
+ - **Voice examples** are the best signal. Match their sentence length and punctuation.
39
+ - **Audience** decides the examples: write about one person's real day, not "users".
40
+ - **claims_never** covers implications too. "Never claim medical results" also rules out "cured my insomnia" and "doctors recommend".
41
+ - **words_to_avoid** are errors in lint, not style notes.
42
+ - Respect the user's own words over brand_context when they conflict in the conversation. Offer to save the change with `brand_set`.
43
+
44
+ ## Hooks already used
45
+
46
+ - Do not reuse a hook or its angle. "Why I stopped snoozing" and "I quit the snooze button" are the same hook.
47
+ - If the list shows views or likes, lean toward angles that did well, with new words. Say which past post you are building on.
48
+ - Lint warns `repeat-hook` when the cover matches a past one after normalising case and punctuation.
49
+
50
+ ## Colours and icon
51
+
52
+ - Brand colours (`colors: {bg, fg, accent}`) replace a page theme's colours. On photo themes only the accent changes.
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
+ - `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,63 @@
1
+ # Channels: a posting plan
2
+
3
+ A channel is a plan for one set of accounts. It says where to post, when, about what, and in which look. It lives in `channels/<id>.yaml`. Channels start disabled.
4
+
5
+ ```
6
+ channel_save { channel: {
7
+ id: "sleep-tiktok", name: "Sleep tips on TikTok",
8
+ accounts: ["tiktok:@sleepyapp"],
9
+ schedule: { mode: "window", days: ["mon","wed","fri"], per_day: 1,
10
+ window: { start: "18:00", end: "21:00" }, timezone: "Europe/Istanbul",
11
+ prepare: "day_before", min_gap: 45 },
12
+ content: { audience: ["students"], language: "tr", slide_count: 6, brand: true, bridge: false,
13
+ topics: ["bedtime routine", "naps"], never: ["melatonin dosage"], templates: ["tips","mistakes","checklist"] },
14
+ design: { theme: "tiktok-classic", size: "4:5" },
15
+ hashtags: ["uyku"], tiktok: { privacy: "public", disclosure: "own_brand" },
16
+ enabled: true } }
17
+ ```
18
+
19
+ ## Schedule
20
+
21
+ - `mode: "window"` picks times inside the window, spread out and different each day, at least `min_gap` minutes apart. `mode: "fixed"` uses `times` exactly.
22
+ - `timezone` must be a real zone name, such as Europe/Istanbul or America/New_York. Clock changes are handled. A time that does not exist on that day moves forward, with a note.
23
+ - `prepare` sets when a deck is due before its post time. The options are `day_before`, `{ hours_before: N }` or `at_post_time`.
24
+ - If the window is too short for `per_day` posts with `min_gap`, slots are spread evenly and the plan says so.
25
+
26
+ ## Running the plan
27
+
28
+ 1. `plan { days: 7 }` works out the slots for enabled channels and saves them.
29
+ 2. `due` lists the slots that need a deck now, with the channel's rules.
30
+ 3. For each due slot:
31
+ 1. Call `brand_context`.
32
+ 2. Write a deck for the channel's `content`. Respect its audience, language and topics, never write about anything under `never`, and use a different template than last time.
33
+ 3. Render it and look at it.
34
+ 4. Call `slot_assign { channel, at, deck }`. This sets the deck's time, accounts and TikTok options from the channel.
35
+ 5. Publish it. See below.
36
+ 4. `plan_show` shows the whole plan and which slots have decks.
37
+
38
+ ## Posting automatically or not
39
+
40
+ - **Default: not automatic.** Prepare the decks, render them, then show the user all the sheets with their times in one message. Publish each one only after their yes. The user can approve a whole week at once.
41
+ - **Automatic**: only when the user has said in plain words that this channel may post without asking, e.g. "post these without asking me". Even then:
42
+ - Publish with `appeeky` (or `postiz`, when the user schedules with Postiz) and the slot's `when`, so the post goes out at the right time even if this machine is off.
43
+ - Never auto-post a deck with lint errors, a `repeat-hook` warning, or a photo of unknown license.
44
+ - Tell the user afterwards what was scheduled.
45
+ - In a Spec repo, use `spec-draft`. Spec's review decides what gets sent.
46
+
47
+ ## Running it regularly
48
+
49
+ open-slideshow does not run by itself. Writing needs you, the agent. Choose one:
50
+
51
+ - **Batch, recommended**: once a week, the user asks "prepare next week's posts". You fill every slot for the week, they review the sheets, and everything is scheduled in Appeeky. Their computer can be off afterwards.
52
+ - **A scheduled agent run**: the user schedules their agent, for example with a cron job running their agent headless, or their agent's own scheduler. The run does steps 1–3 above. Only with automatic posting allowed, or with drafts left for review.
53
+ - **GitHub Actions**: the repo's examples/github-actions has two workflows. One runs the agent every Monday to prepare the week and opens a pull request; nothing is posted. Merging it runs `open-slideshow publish --scheduled --to appeeky --yes` (or `--to postiz`), which schedules only rendered decks with a time still ahead. When you run inside that workflow, do not publish: assign each deck to its slot and stop. The merge is the user's yes.
54
+
55
+ `prepare: at_post_time` only works if an agent run happens at that time. With the batch approach, use `day_before` or `hours_before`.
56
+
57
+ ## Edge cases
58
+
59
+ - **Nothing enabled.** `plan` says "no enabled channels". Turn the channel on with `channel_save { channel: { id, enabled: true } }`.
60
+ - **Slot already has a deck.** `slot_assign` refuses. Pick another slot, or the user removes the old deck's time.
61
+ - **Deck already in another slot.** `slot_assign` refuses. Make a new deck.
62
+ - **Missed slot.** The machine was off and the slot time passed. It stays in the plan without a deck. Tell the user, and offer to post the deck later or skip that slot.
63
+ - **Changed channel.** Run `plan` again after changing a channel's schedule. Slots that already have decks are kept.
@@ -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.