gooseworks 0.4.2 → 0.4.5-dev.15.facf60fb

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 (156) hide show
  1. package/README.md +84 -22
  2. package/dist/agents/staging.d.ts +38 -0
  3. package/dist/agents/staging.d.ts.map +1 -0
  4. package/dist/agents/staging.js +309 -0
  5. package/dist/agents/staging.js.map +1 -0
  6. package/dist/auth/credentials.d.ts +1 -0
  7. package/dist/auth/credentials.d.ts.map +1 -1
  8. package/dist/auth/credentials.js +26 -8
  9. package/dist/auth/credentials.js.map +1 -1
  10. package/dist/auth/device-flow.d.ts +79 -0
  11. package/dist/auth/device-flow.d.ts.map +1 -0
  12. package/dist/auth/device-flow.js +411 -0
  13. package/dist/auth/device-flow.js.map +1 -0
  14. package/dist/auth/login-mode.d.ts +25 -0
  15. package/dist/auth/login-mode.d.ts.map +1 -0
  16. package/dist/auth/login-mode.js +87 -0
  17. package/dist/auth/login-mode.js.map +1 -0
  18. package/dist/auth/oauth-server.d.ts +2 -2
  19. package/dist/auth/oauth-server.d.ts.map +1 -1
  20. package/dist/auth/oauth-server.js +28 -5
  21. package/dist/auth/oauth-server.js.map +1 -1
  22. package/dist/auth/paste-login.d.ts +27 -0
  23. package/dist/auth/paste-login.d.ts.map +1 -0
  24. package/dist/auth/paste-login.js +203 -0
  25. package/dist/auth/paste-login.js.map +1 -0
  26. package/dist/commands/doctor.d.ts +29 -5
  27. package/dist/commands/doctor.d.ts.map +1 -1
  28. package/dist/commands/doctor.js +116 -63
  29. package/dist/commands/doctor.js.map +1 -1
  30. package/dist/commands/fetch.d.ts +1 -0
  31. package/dist/commands/fetch.d.ts.map +1 -1
  32. package/dist/commands/fetch.js +64 -29
  33. package/dist/commands/fetch.js.map +1 -1
  34. package/dist/commands/formats.js +2 -2
  35. package/dist/commands/formats.js.map +1 -1
  36. package/dist/commands/graphics/publish-flow.js +1 -1
  37. package/dist/commands/graphics/publish-flow.js.map +1 -1
  38. package/dist/commands/install.d.ts.map +1 -1
  39. package/dist/commands/install.js +126 -26
  40. package/dist/commands/install.js.map +1 -1
  41. package/dist/commands/launch.d.ts +3 -0
  42. package/dist/commands/launch.d.ts.map +1 -0
  43. package/dist/commands/launch.js +35 -0
  44. package/dist/commands/launch.js.map +1 -0
  45. package/dist/commands/login.d.ts +21 -1
  46. package/dist/commands/login.d.ts.map +1 -1
  47. package/dist/commands/login.js +112 -30
  48. package/dist/commands/login.js.map +1 -1
  49. package/dist/commands/logout.d.ts.map +1 -1
  50. package/dist/commands/logout.js +7 -1
  51. package/dist/commands/logout.js.map +1 -1
  52. package/dist/commands/skills.d.ts +50 -0
  53. package/dist/commands/skills.d.ts.map +1 -0
  54. package/dist/commands/skills.js +160 -0
  55. package/dist/commands/skills.js.map +1 -0
  56. package/dist/commands/styles.js +2 -2
  57. package/dist/commands/styles.js.map +1 -1
  58. package/dist/commands/tool.d.ts +17 -0
  59. package/dist/commands/tool.d.ts.map +1 -0
  60. package/dist/commands/tool.js +239 -0
  61. package/dist/commands/tool.js.map +1 -0
  62. package/dist/commands/update.d.ts.map +1 -1
  63. package/dist/commands/update.js +37 -6
  64. package/dist/commands/update.js.map +1 -1
  65. package/dist/commands/video-local.d.ts +9 -0
  66. package/dist/commands/video-local.d.ts.map +1 -0
  67. package/dist/commands/video-local.js +83 -0
  68. package/dist/commands/video-local.js.map +1 -0
  69. package/dist/commands/video-save.d.ts +3 -0
  70. package/dist/commands/video-save.d.ts.map +1 -0
  71. package/dist/commands/video-save.js +83 -0
  72. package/dist/commands/video-save.js.map +1 -0
  73. package/dist/config.d.ts.map +1 -1
  74. package/dist/config.js +14 -3
  75. package/dist/config.js.map +1 -1
  76. package/dist/environment.d.ts +9 -0
  77. package/dist/environment.d.ts.map +1 -0
  78. package/dist/environment.js +105 -0
  79. package/dist/environment.js.map +1 -0
  80. package/dist/index.js +12 -38
  81. package/dist/index.js.map +1 -1
  82. package/dist/lib/graphics-cache.d.ts.map +1 -1
  83. package/dist/lib/graphics-cache.js +2 -2
  84. package/dist/lib/graphics-cache.js.map +1 -1
  85. package/dist/lib/mcp-client.d.ts +53 -0
  86. package/dist/lib/mcp-client.d.ts.map +1 -0
  87. package/dist/lib/mcp-client.js +196 -0
  88. package/dist/lib/mcp-client.js.map +1 -0
  89. package/dist/lib/video-local-captions.d.ts +83 -0
  90. package/dist/lib/video-local-captions.d.ts.map +1 -0
  91. package/dist/lib/video-local-captions.js +261 -0
  92. package/dist/lib/video-local-captions.js.map +1 -0
  93. package/dist/lib/video-local-runtime.d.ts +8 -0
  94. package/dist/lib/video-local-runtime.d.ts.map +1 -0
  95. package/dist/lib/video-local-runtime.js +201 -0
  96. package/dist/lib/video-local-runtime.js.map +1 -0
  97. package/dist/lib/video-save-mcp.d.ts +9 -0
  98. package/dist/lib/video-save-mcp.d.ts.map +1 -0
  99. package/dist/lib/video-save-mcp.js +162 -0
  100. package/dist/lib/video-save-mcp.js.map +1 -0
  101. package/dist/lib/video-save.d.ts +77 -0
  102. package/dist/lib/video-save.d.ts.map +1 -0
  103. package/dist/lib/video-save.js +440 -0
  104. package/dist/lib/video-save.js.map +1 -0
  105. package/dist/program.d.ts +2 -0
  106. package/dist/program.d.ts.map +1 -0
  107. package/dist/program.js +56 -0
  108. package/dist/program.js.map +1 -0
  109. package/dist/skills/custom-video-skill.d.ts +3 -0
  110. package/dist/skills/custom-video-skill.d.ts.map +1 -0
  111. package/dist/skills/custom-video-skill.js +6 -0
  112. package/dist/skills/custom-video-skill.js.map +1 -0
  113. package/dist/skills/installer.d.ts +12 -6
  114. package/dist/skills/installer.d.ts.map +1 -1
  115. package/dist/skills/installer.js +82 -38
  116. package/dist/skills/installer.js.map +1 -1
  117. package/dist/skills/master-skill.d.ts +34 -28
  118. package/dist/skills/master-skill.d.ts.map +1 -1
  119. package/dist/skills/master-skill.js +2264 -858
  120. package/dist/skills/master-skill.js.map +1 -1
  121. package/dist/skills/package-freshness.d.ts +16 -0
  122. package/dist/skills/package-freshness.d.ts.map +1 -0
  123. package/dist/skills/package-freshness.js +36 -0
  124. package/dist/skills/package-freshness.js.map +1 -0
  125. package/dist/skills/releases.d.ts +12 -0
  126. package/dist/skills/releases.d.ts.map +1 -0
  127. package/dist/skills/releases.js +155 -0
  128. package/dist/skills/releases.js.map +1 -0
  129. package/dist/skills/routes.d.ts.map +1 -1
  130. package/dist/skills/routes.js +12 -6
  131. package/dist/skills/routes.js.map +1 -1
  132. package/dist/skills/staging-content.d.ts +3 -0
  133. package/dist/skills/staging-content.d.ts.map +1 -0
  134. package/dist/skills/staging-content.js +12 -0
  135. package/dist/skills/staging-content.js.map +1 -0
  136. package/dist/utils/browser-preflight.d.ts +29 -0
  137. package/dist/utils/browser-preflight.d.ts.map +1 -0
  138. package/dist/utils/browser-preflight.js +338 -0
  139. package/dist/utils/browser-preflight.js.map +1 -0
  140. package/dist/utils/http.d.ts +7 -1
  141. package/dist/utils/http.d.ts.map +1 -1
  142. package/dist/utils/http.js +5 -1
  143. package/dist/utils/http.js.map +1 -1
  144. package/package.json +11 -3
  145. package/skills/goose-ads/SKILL.md +509 -239
  146. package/skills/goose-product-photos/SKILL.md +161 -60
  147. package/skills/goose-video/SKILL.md +592 -259
  148. package/skills/goose-video-local/SKILL.md +1409 -236
  149. package/skills/gooseworks/SKILL.md +327 -34
  150. package/skills/make-custom-video/SKILL.md +735 -0
  151. package/skills/manifest.json +12 -0
  152. package/skills/routes.json +13 -6
  153. package/dist/skills/fetcher.d.ts +0 -18
  154. package/dist/skills/fetcher.d.ts.map +0 -1
  155. package/dist/skills/fetcher.js +0 -118
  156. package/dist/skills/fetcher.js.map +0 -1
@@ -12,7 +12,7 @@ description: >
12
12
  app uses) — credits are reserved and billed server-side. Analytics recipes are fetched from
13
13
  goose-skills on demand.
14
14
  category: ads
15
- version: 2.4.0
15
+ version: 2.6.1
16
16
  author: GooseWorks
17
17
  tags: [gooseworks, ads, remix, static-ad, brand, creative, image, analytics, meta-ads, performance]
18
18
  ---
@@ -30,39 +30,202 @@ The GooseWorks ads skill. Two jobs:
30
30
  2. **Analyze ad performance** — fetch ad-analytics recipes from goose-skills on demand
31
31
  (these are unrelated to generation; see "Analyze / intelligence" below).
32
32
 
33
- ## Prerequisite — the GooseWorks MCP server is REQUIRED
34
-
35
- Everything goes through the `mcp__gooseworks__*` tools. If they are not available, **stop and
36
- tell the user to run `gooseworks install --claude --mcp`** (and restart Claude Code). There is
37
- no HTTP/file fallback — the REST ad endpoints are session-cookie-only and reject your token.
33
+ It works the same in a chat app (ChatGPT, claude.ai, Cowork) and in a terminal coding agent:
34
+ everything except the few steps labelled terminal-only goes through the connector's tools.
35
+
36
+ ## How to talk to the customer (applies to every message you send them)
37
+
38
+ The customer is a marketer or founder, not an engineer. Everything in this skill about tools,
39
+ fields, files, polling, models and pipeline steps is for YOU. Never pass it on to them.
40
+
41
+ - **Say what they get and what they need to decide, never how it's made.**
42
+ Bad: "Checking the media-proxy helpers for voiceover timestamps and lipsync." / "Generated with
43
+ gpt-image-2 at high quality, mouth closed, passes QC."
44
+ Good: "Recording the voices now." / "Here are your two hosts."
45
+ - **Never mention** tool, file or field names, ids, JSON, commands, scripts, installed software,
46
+ uploads, model or vendor names, timings in seconds or frames, retries, polling, internal statuses
47
+ or your own quality checks. Fix what you can quietly. If they ask how something works, explain it
48
+ simply.
49
+ - **Update them only at milestones they care about**: choices confirmed, script and voices done,
50
+ visuals done, ready to review, finished. One short line each, then stay quiet until the next
51
+ milestone. No update for setup, downloads, uploads or saving.
52
+ - **Money is in credits, with a number**: "the full video uses about N credits". Never "the cheap
53
+ pieces" or "the expensive render".
54
+ - **Problems:** say what it means for them and what they can do, in one or two sentences. No error
55
+ codes or stack traces. Only raise a problem that changes something for them.
56
+ - **Use their words**: script, voice, hook, scene, host, ending, logo, the product shot.
57
+ - **No filler**: no "Great question!", "Certainly!", "I hope this helps!", no restating what they
58
+ just said at length.
59
+
60
+ Example. Instead of a dozen lines about render tools, scripts, uploads and portraits, send:
61
+ "Got it: warm tone, home podcast studio, Brielle as the skeptic and Mark as the believer." then
62
+ "Script and voices are done (about 34 seconds)." then "Ready for you to review: the script, voices,
63
+ both hosts and the ending. You can also review your recipe ingredients in the app: <link>. Say go
64
+ here and I'll make the full video (about N credits)."
65
+
66
+ ## Use current instructions for new work
67
+
68
+ Before a new task in a terminal host, run `gooseworks skills status` once. It compares the
69
+ installed entry files, running CLI and published npm release. An older CLI needs a package
70
+ upgrade before `gooseworks update`; update alone only uses that CLI's bundled instructions.
71
+ Preserve local edits or unknown install provenance. Review/back up before explicitly replacing
72
+ modified files; never quietly reinstall over them. If the release check is unavailable, report
73
+ that freshness is unknown rather than claiming the local copy is latest.
74
+
75
+ For a new recipe run, fetch its package from the connected catalog. Retain the returned
76
+ `version` / `contentHash` and every dependency's hash with the saved package. When reusing a
77
+ saved fetch JSON, `gooseworks fetch <slug> --saved-package <file>` returns the current package
78
+ and a hash comparison without changing that file. With MCP, if the advertised `catalog_fetch`
79
+ schema accepts them, send `saved_content_hash` and `saved_dependency_hashes`; otherwise fetch
80
+ normally and compare the returned hashes yourself. Missing hashes mean unknown, not current.
81
+ The server cannot inspect a client's saved files; hash metadata does not certify later edits.
82
+ Fetch current packages into a new run directory and report stale saved instructions. Preserve
83
+ an existing approved run's recorded package; changing that harness requires a reviewed change
84
+ and approval before spending. Hosted installed snapshots use the existing Skills Update action.
85
+ Skill content and a host's cached MCP tool schemas are separate: refreshing one does not refresh
86
+ the other. Check the actual advertised tools before using new fields.
87
+
88
+ ## No GooseWorks tools in this session? Call them through the CLI
89
+
90
+ The GooseWorks tools named here (for example `account_whoami`, `brand_onboarding`,
91
+ `brand_read`) normally come from the GooseWorks connector. If they are not registered in this
92
+ session but you have a shell with the `gooseworks` CLI signed in (a cloud sandbox such as
93
+ ChatGPT agent, Meta AI or Grok), call the same tool from the shell:
94
+
95
+ ```bash
96
+ npx gooseworks tool <name> '<arguments as a JSON object>'
97
+ ```
98
+
99
+ - Run `npx gooseworks tool --list` once first. It prints the server's rules for using the tools
100
+ and every tool name; `npx gooseworks tool <name> --schema` shows one tool's arguments.
101
+ - The result prints as JSON. When a tool answers with a one-line summary, the fields you act on
102
+ (such as `next_step` and ids) follow under "Data:". It exits 1 when the tool reports an error.
103
+ - Nothing renders as a widget here, so tell the user the result in plain words.
104
+ - The same rules apply as over the connector: state the credit total and get the user's yes
105
+ before paid work.
106
+ - If it says you are not logged in, run `npx gooseworks login --device --no-wait`, show the
107
+ user the link and code it prints, and run `npx gooseworks login --device` once they approve.
108
+
109
+ When the tools are registered in this session, call them directly instead.
110
+
111
+ ## Prerequisite — the GooseWorks connector tools
112
+
113
+ Everything below runs through the GooseWorks connector's tools, by the names this skill uses.
114
+ Match on the tool name: a coding agent may show a server prefix (for example
115
+ `mcp__gooseworks__ads_generate`), a chat app may not. There is no HTTP or file fallback: the REST ad
116
+ endpoints are session-cookie-only and reject your token.
117
+
118
+ If a tool named here is missing, the GooseWorks connection or its tool list is stale: ask the
119
+ user to reconnect or refresh GooseWorks in their app's connector settings. Installing or
120
+ updating the `gooseworks` CLI never fixes a missing connector tool, so never send a chat-app
121
+ user to a terminal for it. Only a terminal coding agent (Claude Code, Codex, Cursor) that has no
122
+ GooseWorks tools at all connects them, in that terminal, with `gooseworks install --mcp` plus
123
+ `--claude`, `--codex` or `--cursor`, then a restart.
124
+
125
+ Older notes or skill copies may name tools the connector no longer lists. Use the tool this skill
126
+ names instead; `catalog_fetch { type: "skill", slug: "gooseworks-guide" }` maps every old name.
38
127
 
39
128
  ## Start from the brand context — don't re-ask what it already answers
40
129
 
41
- If the `gooseworks` router handed you brand context, USE IT. If you were invoked directly, call
42
- `brand_get_context` first (falling back to `get_brand_kit` for the selected brand). It already
43
- answers most of what the flows below would otherwise ask the user:
130
+ If the `gooseworks` router handed you brand context and an evidence brief, USE THEM. If you were
131
+ invoked directly, call `brand_read { brand_id, sections: ["summary","kit","products","learnings"] }`
132
+ first, then search the Brand Brain (next section). Together they answer most of what the flows
133
+ below would otherwise ask the user:
44
134
 
45
- - **Which product to feature** → `products[]`. Offer the real catalog entries; never guess a
135
+ - **Which product to feature** → `products.items`. Recommend one real catalog entry; never guess a
46
136
  product name and never ask the user to list their products.
47
137
  - **The vibe / tone of the copy** → the brand's **voice**. Use it; don't ask "what tone?".
48
138
  - **Who the ad is for** → the brand's **audience**. Don't ask "who's the target?".
49
- - **The angle, offer framing, and what to claim** → **positioning**, value props, proof points.
139
+ - **The angle and offer framing** → **positioning** and value props, sharpened by the Brain:
140
+ lead with an angle past approved creatives proved, and drop anything a saved rule forbids.
141
+ - **What to claim** → only claim-grade proof: a search result with `approved_ad_claim: true`, the
142
+ kit's approved claims, or its proof points as written. Other Kit text, documents and
143
+ performance numbers are context.
50
144
  - **Logo, colors, fonts** → owned by the backend research pass. **Never re-derive them.**
51
145
  - **Whether the facts are trustworthy yet** → **research status**. If it isn't complete, say so in
52
146
  one line and continue; the batch queues and runs when research finishes.
53
147
 
54
- Ask only for what the context genuinely doesn't answer: the specific campaign intent (season,
55
- promo, which of several angles), the source ad, and anything the user must consent to.
56
-
57
- ## Identity & credits
58
-
59
- - One agent-scoped token authenticates the `gooseworks` MCP tools. Never print it. The tools
60
- resolve your org automatically — you do NOT resolve an "Ads agent" or pass `target` for the
61
- generation tools.
62
- - **Credits are handled entirely by the backend.** `submit_remix_batch` reserves the estimated
63
- cost up front (it errors with `insufficient_credits` if the wallet is short — relay the
64
- message and stop) and bills only the images that actually complete. Call
65
- `estimate_remix_batch` first to tell the user the cost; `gooseworks credits` shows balance.
148
+ Don't ask for the angle, product or tone: recommend them with a one-line reason. Ask only for a
149
+ decision the brand read and the Brain search cannot settle (for example an offer or season the
150
+ user hasn't mentioned) and for anything the user must consent to (rights, spend).
151
+
152
+ ## Search the Brand Brain, then propose — before any creative choice or question
153
+
154
+ The Brand Kit is a summary. The brand's saved knowledge (its Brain) holds what the Kit does not:
155
+ rules from past feedback, approved and rejected creatives, customer evidence, approved claims,
156
+ reports and documents. **After `brand_read`, and before you choose an angle, claim, hook,
157
+ product emphasis, format or source ad — and before you ask the user for any brand fact — call
158
+ `knowledge_search { brand_id, query }`** when it is registered. It is free and read-only: no
159
+ approval, no announcement to the customer and no questionnaire.
160
+
161
+ 1. **Search for this task, not the whole Brain.** Run one short query (under 500 characters) in
162
+ the user's own words plus the product (for example "ads for <product>: what worked, what to
163
+ avoid") and one with
164
+ `source_types: ["evidence", "claim", "learning", "creative", "document"]` for proof and past
165
+ creative results. Add a query only for a specific open question. Reuse results from this run.
166
+ 2. **Keep these states distinct** and record which one each query returned:
167
+
168
+ | Result | Means | Do |
169
+ | --- | --- | --- |
170
+ | `status: "ok"` with matches | Saved knowledge exists | Use it; keep each fact's citation in your working brief |
171
+ | `status: "empty"` | Nothing saved matches this query | Say "no saved evidence for <topic>", never "the brand has no proof" |
172
+ | `refresh_required` | The results shown are current; some changed sources were left out | Use them; search again shortly for anything missing |
173
+ | `building` | The index is not ready | Retry once shortly, then continue with the gap stated |
174
+ | An error, or the tool is not registered | Retrieval failed or is unavailable | Retry an error once, then continue from `brand_read` and treat evidence as unchecked |
175
+ | An empty Kit field | Only that field is blank | Not a search result: still search before asking |
176
+
177
+ 3. **Let the findings change the plan.** A `dont`/`must` learning or a rejected creative rules
178
+ options out; an approved or well-rated past creative is a proven angle to lead with; a report
179
+ shows what worked. Claim-grade proof is a result with `approved_ad_claim: true` or the kit's
180
+ `approvedClaims` within their stated applicability; the kit's `proofPoints` are what the
181
+ backend allows an ad to state, used as written. Other Kit text, documents and performance
182
+ numbers are context, never public claims. Never invent an offer, price or result. Judge
183
+ relevance and skip results about another product or business.
184
+ 4. **Propose; don't interview.** Lead with one recommended direction (angle, product, source or
185
+ format) and a one-line reason naming what you found, with up to two alternatives. When several
186
+ directions fit (two audiences, products or campaigns), pick the one the evidence favours, such
187
+ as an active campaign or approved past creatives, and name the other as an alternative instead
188
+ of asking. Ask only for a decision the brand read and the search cannot settle, or for spend
189
+ approval. Never ask the user for a fact the Brain already answered.
190
+ Keep directions already chosen (the user's words, a project's creative brief, handed-off
191
+ defaults, approved plans): search only to fill empty fields and to apply saved rules. When a
192
+ returned card or picker presents the choice, your recommendation is its one acknowledgement
193
+ line and the saved plan's defaults, not a separate list.
194
+ 5. **Carry an evidence brief** into the routed skill, writer or plan: findings with citations,
195
+ the state of each query, what it ruled out and the open gaps. Tell the customer the findings
196
+ in plain words; the citations stay in the brief.
197
+
198
+ On an approved resume, keep the saved brief and evidence; search again only for a new decision.
199
+
200
+ ## Credits — state the total, then get a yes
201
+
202
+ - One token authenticates the GooseWorks tools and resolves your org; never print it. The
203
+ generation tools need no `target`.
204
+ - **Nothing paid runs without the user's explicit yes in this chat, given after you state the
205
+ credit total.** The paid calls are `ads_generate` (without `dry_run`), every
206
+ `ads_creative_edit` action, `ads_approval_decide` with `decision: "approve"`, and every
207
+ `data_call_provider` / `data_post_provider` call (the data calls an analysis recipe or brand
208
+ research makes; `gooseworks call` in a terminal). Reads, dry runs, `ads_creative_update` and
209
+ `request_campaign_generation` (it only composes plans) are free.
210
+ - The balance is `credits.available_credits` from `account_whoami`; a dry-run `estimate` also
211
+ carries `available_credits`.
212
+ - The backend reserves the quoted credits when a paid call starts and bills only the images
213
+ that complete. A rejection with `insufficient_credits` means the wallet is short: tell the
214
+ user the total and their balance in plain words, offer fewer images or a top-up, and stop.
215
+ Never retry blindly.
216
+
217
+ How to get the total for each paid call:
218
+
219
+ | Paid call | Credit total to state |
220
+ | --- | --- |
221
+ | `ads_generate` with `source.template_ids` | The same call with `dry_run: true` returns `estimate`: `total_credits` for `images` images (plus `credits_per_image`, `rates` and `unknown_template_ids`). |
222
+ | `ads_generate` with `source.community_ad_ids` or `source.creative_ids` | No dry run (it returns `not_available`; these are priced when submitted). Pass `quality` explicitly (the user's choice, else `high`, the app default) and quote the images (each source's `variants` × its `ratios`) × `estimate.rates.<quality>` as the most it will cost (an engine without quality tiers costs the lower `rates.low`). `rates` comes with any template dry run; with no template at hand, dry-run one Surprise-me pick. |
223
+ | `ads_creative_edit` `animate` | The same call with `dry_run: true` returns its `estimate`. |
224
+ | `ads_creative_edit` `regenerate` / `precision_edit` | No dry run. Pass `quality` in the action's payload (without it `precision_edit` copies the source render's tier) and quote the images × `estimate.rates.<quality>` as the most it will cost: `regenerate` with `mode: "variation"` makes one per ratio (omitted `ratios` make three); `edit`, `exact` and `precision_edit` make one. |
225
+ | `ads_creative_edit` `resize` | No dry run and no quality setting: it renders at the server's default tier (`high` today). Quote one image per placement × the larger of `estimate.rates.high` and `credits_per_image` from a template dry run without `quality` (that dry run uses the server's default tier) as the most it will cost. `platforms` expands to every placement: meta 4, google 4, tiktok 2, linkedin 3, reddit 3, x 2; pass `targets` for fewer. |
226
+ | `ads_creative_edit` `layerize` | No dry run. It holds about 80 credits while it runs and charges the actual cost of the split (usually less). Say so and get the yes before sending `layerize: { confirmed: true }`. |
227
+ | `ads_approval_decide` approve | The `credits` that `request_campaign_generation` and `ads_creative_read { brand_id, view: "approvals", batch_id }` return for those plans. |
228
+ | `data_call_provider` / `data_post_provider` | The calls a recipe will make × their price: a ScrapeCreators call costs 1 credit today, and each result reports what it charged. A fal or ElevenLabs POST quotes free with the same call plus `query: { quote_only: true }`. State the rough total for the whole recipe once, before its first paid call. |
66
229
 
67
230
  ## Live MCP contract — inspect it before asking
68
231
 
@@ -75,79 +238,84 @@ Before each tool call:
75
238
  2. Fill required inputs already known from the Brand Kit, selected source, or conversation.
76
239
  3. Ask the user only for required inputs that cannot be inferred and for choices that materially
77
240
  change the result. Do not turn every optional field into a questionnaire.
78
- 4. Omit unspecified optional settings so the backend applies its current app defaults.
241
+ 4. Omit unspecified optional settings so the backend applies its current app defaults. Two
242
+ exceptions: always pass `ratios` on every source (omitted ratios make three images per
243
+ variant), and keep the same `quality` setting in the quote and the paid call (both omitted
244
+ for a template dry run, or the explicit `quality` the credits table asks for).
79
245
  5. If the live schema conflicts with this workflow, follow the live schema and report the drift
80
- with `log_cli_event`.
81
-
82
- ## The generation tools (the new, single-workflow surface)
83
-
84
- - `submit_remix_batch` — **the one call that makes ads.** Inspect its live schema and supply
85
- the required brand/source inputs plus any choices the user explicitly made.
86
- Returns the batch with a `links` block (`brand_url` + per-creative `app_url`). If the brand's
87
- research isn't finished yet the batch comes back `status: "queued"` — it auto-runs the moment
88
- research completes; tell the user it'll appear shortly, don't error.
89
- - `estimate_remix_batch` — cost preview. Reserves nothing. Use it to quote the cost first and
90
- check whether every selected source resolved before submitting.
91
- - `get_remix_batch` — poll status. Returns each creative with its renders and
92
- `completed`/`failed`/`pending` counts, plus `links`. A creative is done when its `pending` is 0
93
- — NOT when `current_render_url` is set (during a regenerate that field still points at the prior
94
- image). Each render carries `age_seconds` (since queued) and `elapsed_seconds` (time generating):
95
- use them to tell a slow-but-healthy render from a stuck one. A render only failed when its
96
- `status` is `"failed"` — never assume a stall and re-submit, that double-bills.
97
- - `list_brand_creatives` — the brand's gallery feed (newest
98
- first) + `brand_url`. Alternative poll target; also use to show everything made for a brand.
99
- - `surprise_me_templates` — the **"Surprise me" recommender**. Picks
100
- remixable Community creations (SAME logic as the web /create "Surprise me" button), shuffled
101
- so picks stay fresh. It does not use the retired curated third-party catalog.
102
- Returns the picked templates (id, slug, title, image, ratio) AND a ready-to-open `create_url`
103
- (the /create page with `cli=true` and the picks pre-selected). This is how you recommend
104
- templates — do NOT hand-pick from the raw catalog yourself (see "Picking templates" below).
105
- - `regenerate_creative` — edit or re-roll one existing creative through the same pipeline.
106
- Inspect the live schema to select the supported mode and required source inputs. Returns a
107
- single-item batch; poll it with `get_remix_batch`.
108
- - `set_creative_feedback` — record the user's reaction to a generated image. Use it whenever
109
- the user reacts; inspect the schema for the current rating and reason choices.
110
-
111
- ### Plan mode — review the plan BEFORE generating (optional)
112
-
113
- For users who want to approve each ad's plan before spending credits (the app's "Plan it" flow):
114
-
115
- - Use the approval option exposed by `submit_remix_batch` — it composes each creative's plan and PAUSES.
116
- **No credits are reserved and no image renders** until you approve.
117
- - `list_ad_approvals` — poll this. While a creative is
118
- `composing`, wait; once `awaiting_approval`, show its `plan` (composed prompt + refs + quality)
119
- to the user.
120
- - `revise_ad_plan` — recompose from a chat steer, still
121
- free. Poll `list_ad_approvals` until it's `awaiting_approval` again.
122
- - `approve_ad_plan` — approve one creative or the whole batch using the live schema.
123
- **This is the step that reserves credits and renders.** Then poll
124
- `get_remix_batch` and hand back links as usual.
125
-
126
- Only offer plan mode when the user asks to review/approve first — the default path generates
127
- immediately.
128
-
129
- ## Reading the brand & picking inputs (still MCP, read-only)
130
-
131
- - `get_brand_kit` — read the canonical brand context and available products/assets.
132
- - `list_ad_brands` / `get_ad_brand` — find and fetch the active brand.
133
- - `list_user_ad_templates` — list the org's own uploads and
134
- imported ads. Prefer `relationship: "self"` when the user wants to reuse their own ads;
135
- `relationship: "competitor"` is research/inspiration, never proof that the user owns the ad.
136
- - `search_ad_templates` — search remixable Community generations. The
137
- retired curated third-party catalog is not returned.
138
- - `get_static_ad_template` — resolve a source already owned by
139
- the org, including an own upload or a snapshotted Community creative. It does not resolve the
140
- retired curated third-party catalog.
141
- - `remix_community_ad` — turn a selected Community creative into a private remix source before
142
- submitting it. A Community ad id is an `ad_project` id, not a
143
- template id. Call this FIRST to snapshot it into a private template, then use the returned
144
- template `id` in `items`.
145
- - `create_user_ad_template` — upload a source image as a private template. Answer any
146
- ownership/rights input only from the user's explicit confirmation. Never claim rights for a
147
- competitor ad or an image found online.
148
- - `get_ad_project` / `append_project_message` — inspect a creative / leave a note on its thread.
149
-
150
- ## Keep the brand kit in sync — reconcile, then update (ASK first)
246
+ (see "Report problems" in the rules).
247
+
248
+ ## The ad tools
249
+
250
+ - `ads_generate` — **the one call that makes ads.** Needs `brand_id` and exactly one `source`:
251
+ `template_ids: [{ template_id, variants?, ratios }]` (the brand's own templates, Surprise-me
252
+ picks, Community rows whose `item_type` is `template`), `community_ad_ids: [{ community_id,
253
+ variants?, ratios }]` (Community rows whose `item_type` is `creative`; the backend snapshots
254
+ them), or `creative_ids: [{ project_id, render_id?, variants?, ratios }]` (remix the user's own
255
+ finished ads). Optional: `product_name` (a real product), `prompt` (a short steering note),
256
+ `reference_image_urls`, `quality`. `dry_run: true` quotes template sources and reserves
257
+ nothing. A real call GENERATES at once and returns `{ job_id }` (`kind: "ads_batch"`) and the
258
+ `batch`, which already carries its `links` (below). If the
259
+ brand's research is still running the batch is `queued` and starts on its own when research
260
+ finishes: tell the user it'll appear shortly, don't error.
261
+ - `job_get { job_id, kind: "ads_batch" }` — poll a batch. `status` is `queued`, `running`,
262
+ `complete`, `partial_failure` or `failed`; `progress` counts `completed` / `failed` /
263
+ `pending` images. `result.creatives[]` carry each creative's `renders[]` (`id`, `status`,
264
+ `ratio`, `output_url`, `age_seconds` since queued, `elapsed_seconds` generating). A creative
265
+ is done when its `pending` is 0, NOT when `current_render_url` is set (during a regenerate it
266
+ still points at the prior image). A render only failed when its `status` is `"failed"`: a slow
267
+ render is healthy, and re-submitting it double-bills. `result.links` holds the app links you end
268
+ the run with: `brand_url` (the brand's page, with all its ads) and `creative_links: [{
269
+ project_id, app_url }]` (each creative's page). `brand_url` is `null` and the list empty only
270
+ if the link lookup failed; the ads are still made. A server older than this skill returns no
271
+ `links` (and no `app_url` / `brand_url` on creative reads): then hand back the images
272
+ only and don't mention links.
273
+ - `ads_creative_read { brand_id }` — the brand's generated creatives, newest first (filter with
274
+ `batch_id`, `tags`, `approved_only`); each row has its `app_url` and the list has the
275
+ `brand_url`. `creative_id` reads one with its `renders`, plus `creative.app_url` and
276
+ `creative.brand_url`.
277
+ - `ads_template_read` — find or inspect a source (see "Picking source ads"). `template_id` reads one.
278
+ - `ads_creative_edit { brand_id, creative_id, action }` — every paid edit of one creative, one
279
+ `action` per call: `regenerate` (`regenerate: { mode: "variation" }` for another take;
280
+ `mode: "edit"` or `"exact"` with `source_render_id` and `prompt`), `precision_edit` (`source_render_id`
281
+ plus a `note` or region `annotations`), `resize` (`source_render_id` plus `platforms` or
282
+ `targets`), `layerize` (`confirmed: true`), `animate` (`source_image_url`; only when
283
+ `account_whoami` shows the Animate Images feature; for the full flow fetch the `animate-image`
284
+ skill). Returns `{ job_id }`: poll `job_get` with `kind: "ads_batch"` (regenerate, resize,
285
+ precision_edit) or `kind: "animate"`; for layerize read
286
+ `ads_creative_read { brand_id, creative_id, include: ["layers"] }`. While the brand's research is
287
+ still running, `regenerate`, `resize` and `precision_edit` refuse with
288
+ `brand_research_in_progress`: tell the user and try again when it finishes.
289
+ - `ads_creative_update { brand_id, creative_id, patch }` — free. `patch.feedback: { render_id, rating:
290
+ "happy" | "neutral" | "sad", comment?, reasons? }` records the user's reaction (it feeds the
291
+ quality loop); `patch.tags` replaces the creative's tags.
292
+ - `ads_template_create { brand_id, source, rights_attested? }` — register the user's own image as a
293
+ private source template (see "Upload" below).
294
+
295
+ ### Campaigns — the only plan-and-approve path
296
+
297
+ `ads_generate` has no plan step: the dry-run quote and the user's yes are the checkpoint, and a
298
+ submit generates at once. Never promise a review step before the images render. Plans exist only
299
+ for a campaign's concepts (planned with `campaign_read`, `campaign_upsert` and
300
+ `add_campaign_concept`; follow the connector guide for those):
301
+
302
+ 1. `request_campaign_generation { campaign_id }` composes the plans for the concepts with no
303
+ creatives yet (`concept_ids` re-runs chosen ones; `count` only for a number the user named). It
304
+ spends nothing and returns `batch_ids` and `credits`. Never say generation has started.
305
+ 2. Tell the user what will be made and the credit total, and wait for their explicit yes in this
306
+ chat. Never send them to a button in the app; a campaign link is only a place to look.
307
+ 3. Read `ads_creative_read { brand_id, view: "approvals", batch_id }` until that batch's plans are
308
+ `awaiting_approval` and none is `composing`. If its credit total differs from what they
309
+ agreed to, state the new total and ask again.
310
+ 4. `ads_approval_decide { brand_id, decision: "approve", batch_id, user_quote: "<their exact words>" }`
311
+ for each batch, then poll the batch ids it returns with `job_get` (`kind: "ads_batch"`) and
312
+ end with each batch's `result.links`, as in step 7 of the workflow below.
313
+
314
+ Before approving, a steer is free: `ads_approval_decide { brand_id, creative_id, decision: "revise",
315
+ revise: { message } }` recomposes that plan (read the approvals view again), and
316
+ `decision: "edit_plan"` patches it directly. Editing the campaign in between discards these plans.
317
+
318
+ ## Keep the brand kit in sync — reconcile, then save or propose
151
319
 
152
320
  The brand kit is the source of truth every generation reads. During ANY task, when the user
153
321
  **tells you something about the brand or asks to change something brand-level** — a different
@@ -155,194 +323,296 @@ tagline, audience, voice, a product's name/price/description, "our logo is X", "
155
323
  anymore", a new product photo — treat it as a possible kit update, don't just use it for this one
156
324
  ad and forget it:
157
325
 
158
- 1. **Check it against the kit.** Call `get_brand_kit` for the active brand and see whether what the user said
326
+ 1. **Check it against the kit.** Call `brand_read` with `kit` and `learnings` for the active brand and see whether what the user said
159
327
  matches, is missing from, or contradicts the kit.
160
328
  2. **If it's already in the kit and matches** — nothing to do; proceed.
161
- 3. **If it's new or different — ASK before writing.** Confirm in one line: *"Want me to update
162
- the brand kit so this sticks for future ads?"* Only persist on a yes (or when the user clearly
163
- asked you to change the brand). Don't silently mutate the kit, and don't nag on trivia.
164
- 4. **Persist with the write tools** (partial — only the fields you pass are touched; each edit is
165
- recorded as a user override that later re-research won't clobber):
166
- - `update_brand_kit` — structured brand fields.
167
- - `upsert_brand_product` / `delete_brand_product` — products.
168
- - `add_brand_product_image` / `remove_brand_reference_image` — product and reference photos.
329
+ 3. **If it's new or different**, persist an explicit request to correct or remember the brand
330
+ through the policy below; that request is already authorization. For an ambiguous one-ad
331
+ direction, ask once whether it should stick. Agent-derived suggestions become proposals.
332
+ 4. **Persist with the canonical write tools** (send only changed fields):
333
+ - `brand_update` with explicit user-correction intent — structured brand fields or products;
334
+ an inferred structured field uses agent-proposal intent instead. Follow the live schema.
335
+ - `media_upload` / `media_update` — the user's own product and reference photos.
169
336
  Inspect each live schema and send only the fields needed for the confirmed change.
170
- 5. **Confirm what changed** and continue the task. (Logo, colors, and fonts are owned by the
171
- backend research pass — prefer `update_ad_brand` / the research flow for those, not free text.)
337
+ 5. **Read back what changed** before saying saved, then continue the task. (Use the research
338
+ workflow for researched logo/colors/fonts; explicit user edits use only fields supported by
339
+ the canonical tool schema and the correction policy below.)
172
340
 
173
341
  This is the parity gap the app closes in-product: a brand fact the user gives mid-task should be
174
342
  able to flow back into the kit — with their ok — instead of being lost.
175
343
 
344
+ ## Save durable brand answers, then verify them
345
+
346
+ Read the selected brand with `brand_read { brand_id, sections: ["summary", "kit", "products", "learnings", "onboarding"] }`
347
+ (older clients: `brand_get_context` with the same sections, only when that tool is advertised).
348
+ Keep founder answers, user corrections, research and your own hypotheses distinct. Reuse
349
+ matching saved answers; ask only about gaps.
350
+
351
+ When the user asks to remember a rule, answers a brand interview, or explicitly corrects a
352
+ standing fact, save that answer in the same turn. The capture request authorizes those answers;
353
+ do not ask for approval again. A direction for this one video stays in its brief. If the scope
354
+ is genuinely ambiguous, ask whether it applies to future videos before saving a standing rule.
355
+
356
+ Use the **live registered schema**. Where supported, call `brand_update` with
357
+ `knowledge_intent: "user_correction"` and `user_statement` containing the user's exact,
358
+ verbatim answer, not your paraphrase or researched text.
359
+ For an inference or suggested improvement, use `knowledge_intent: "agent_proposal"`. Show the
360
+ before/after change from your prior read and proposed value; retain the returned proposal IDs
361
+ and say the user must accept it in the app. Link only a review surface actually returned by a
362
+ tool; the compact `knowledge_updates` response does not itself contain a diff or URL.
363
+ A pending proposal is not a saved fact. Never call an unavailable
364
+ tool or silently relabel research or your inference as something the user said.
365
+
366
+ The safe structured shape is `patch: { knowledge: { positioning?, audience?, voice?,
367
+ instructions?, brandType?, tagline?, valueProps? } }`, using only fields present in the live
368
+ schema. Inferred rules/taste go in an `instructions` proposal with a rationale, never in
369
+ `patch.facts`. Prefix every video-only preference in that proposed text with "Video preference:"
370
+ so it remains production direction after acceptance. Preserve unrelated instructions when
371
+ proposing a merged replacement.
372
+
373
+ | User answer | Canonical write |
374
+ | --- | --- |
375
+ | Primary audience, positioning or voice correction | `patch.knowledge: { audience/positioning/voice: <answer> }` (one actual key). During onboarding, `brand_onboarding { action: "review_research", review: { action: "correct", field, value } }` writes these existing corrections with provenance. |
376
+ | Founder story, customer pains, objections, buying trigger or useful audience detail without a structured field | `patch.facts: [{ kind: "insight", text }]`; retain attribution such as "Founder reports: …" rather than turn a belief into a verified result. |
377
+ | Required wording or pronunciation | `patch.facts: [{ kind: "must", text }]`; pronunciation is exactly `Pronounce "<term>" as "<say_as>"`. |
378
+ | Forbidden claim, word or visual | `patch.facts: [{ kind: "dont", text }]`. |
379
+ | Durable visual, voice or pacing preference | `patch.facts: [{ kind: "do", text }]` for a preference; `dont` for an avoidance; `template_hint` for a preferred format. Prefix video-only preferences with "Video preference:". |
380
+
381
+ Facts are existing `ad_brand_learning` rows with user provenance; they are not a second profile.
382
+ Update a matching rule by its returned `id` instead of adding duplicates. Preserve unrelated
383
+ rules and the user's exact meaning. Only use the legacy facts shape for explicitly user-authored
384
+ answers when the live schema lacks intent fields; agent suggestions still need a proposal path.
385
+
386
+ **Claims and plans have separate gates.** A founder assertion or proof point is not an approved,
387
+ evidence-backed claim or consent to quote a customer. Use the existing evidence/claims and
388
+ operating-plan tools only if registered, following their proposal, evidence and confirmation
389
+ requirements. Never encode a spend cap, approver or emergency stop as a learning. If that write
390
+ path is missing, report the specific unsaved item and keep it pending for the supported review
391
+ surface; do not claim it was saved or create a parallel local profile.
392
+
393
+ After every write, **read back before saying saved**: use `brand_read` with `kit`, `learnings`
394
+ or `onboarding` as appropriate, or `brand_onboarding { action: "status", brand_id }` after an
395
+ onboarding answer. Verify the intended field/rule, its source and the absence of a conflicting
396
+ duplicate. A generic success response, pending proposal, ignored key or truncated result is not
397
+ proof. Report partial saves honestly. Carry the verified rules into the current task and the
398
+ routed skill; claims still pass their own safety gate.
399
+
176
400
  ## Picking source ads — use approved sources, not the retired catalog
177
401
 
178
402
  When the user wants to make ads but has NOT named a specific template (id/slug/Community
179
- ad/upload), do NOT silently browse the raw catalog and hand-pick for them. Instead run this
180
- short ask flow — it mirrors the web app and keeps the human in the loop:
181
-
182
- 1. **Ask what kind of ads they want** — the angle/offer/theme/season. **The brand context already
183
- gives you the vibe (voice), the audience, and the product catalog — do NOT ask for those.**
184
- Offer the real `products[]` to pick from rather than asking "which product?", and derive the
185
- tone from the brand's voice. This shapes both the source choice and your steering `prompt`.
186
- Keep it to one quick question about campaign intent.
187
- 2. **Ask how to pick a source: their own ads, Community, upload, or "Surprise me".**
188
- - **Their own ads** → use `list_user_ad_templates` to load the active brand's own sources and
189
- let them choose from the results.
190
- - **Community** → `search_ad_templates`, let them choose, then call `remix_community_ad`
191
- before submitting.
192
- - **Upload** → upload through the workspace and call `create_user_ad_template`. If its live
193
- schema requires an ownership or permission answer, only supply it after explicit confirmation.
194
- - **Surprise me** (they want you/the app to pick) → call `surprise_me_templates` for the active
195
- brand and hand the user the returned `create_url`.
196
- It opens /create in **CLI mode** with the picks pre-selected, a preview modal, and the
197
- **copyable remix prompt at the bottom** (in place of the Generate input). They can swap
198
- picks and copy that prompt. If they'd rather you "just make them" without reviewing in the
199
- app, you MAY submit the `surprise_me_templates` picks directly (skip to submit).
200
- - **Browse in the app** → hand the user this URL, with the
201
- active brand's slug filled in:
202
- `https://make.gooseworks.ai/create?brand=<brand-slug>&cli=true`
203
- In CLI mode the app shows the copyable remix prompt at the bottom (dismissable / switchable
204
- back to the UI composer). They browse the available own/Community sources and copy the prompt.
403
+ ad/upload), do NOT silently browse the raw catalog and hand-pick for them. Instead send **one
404
+ proposal** — it mirrors the web app and keeps the human in the loop without an interview:
405
+
406
+ 1. **Propose the direction yourself.** From the brand read and the evidence brief, recommend the
407
+ product, angle/offer and tone, with a one-line reason naming what the Brain showed (a past
408
+ approved angle, a rule it respects). **Do NOT ask what kind of ads they want, which product,
409
+ or the vibe.** Keep any direction the user already gave. This shapes both the source choice
410
+ and your steering `prompt`.
411
+ 2. **Recommend a source in the same message: their own ads, Community, upload, or "Surprise me".**
412
+ Default to their own approved ads when suitable ones exist, otherwise Surprise-me picks for
413
+ the brand; list the other paths as one-line alternatives. You may resolve the picks and run the
414
+ free dry run first so the proposal already carries the credit total. Show a list of sources as
415
+ one table with every row and its image link, and mark your one suggestion.
416
+ - **Their own ads** → `ads_template_read { brand_id, mode: "mine", filters: { relationship: "self" } }`
417
+ and let them choose. `mode: "competitor"` rows are research and inspiration, never proof that
418
+ the user owns the ad.
419
+ - **Community** → `ads_template_read { brand_id, mode: "query", query: "<the angle and look>" }`
420
+ ranks Community ads by meaning; each row's `sourceId` (with `title` and `thumbnailUrl`) goes
421
+ in `source.community_ad_ids[].community_id`. To browse the feed instead, use `mode:
422
+ "community"`: its rows carry `item_type`, and a `template` id goes in `source.template_ids`,
423
+ a `creative` id in `source.community_ad_ids`. The backend snapshots a Community creative
424
+ itself; there is no separate step. Let the user choose.
425
+ - **Upload** → the user's own image becomes a private template: `media_upload` it (`scope:
426
+ "brand"`, `scope_id: <brand_id>`, `kind: "image"`; in a chat app `source.type: "bytes"`), then
427
+ `ads_template_create { brand_id, source: { type: "media", media_id } }` (or `source: { type:
428
+ "url", url }` for a public image). Set `rights_attested: true` only after the user explicitly
429
+ confirms they own it; this is the ownership/rights input. Never claim rights for a competitor
430
+ ad or an image found online.
431
+ - **Surprise me** (they want you/the app to pick) → `ads_template_read { brand_id, mode:
432
+ "surprise", count: 4 }` picks remixable Community ads for the brand, shuffled so picks stay
433
+ fresh. Every pick is a template: show them, and generate
434
+ from the ones the user keeps (or from all of them if they said "just make them").
435
+ - **Browse in the app** → the one link you build yourself: `<app>/create?brand=<brand-slug>&cli=true`,
436
+ with the active brand's slug, where `<app>` is the origin of a `brand_url` a tool returned
437
+ (the part before `/?brand=`: `https://ads-staging.gooseworks.ai/?brand=acme` gives
438
+ `https://ads-staging.gooseworks.ai`), so it opens on the user's own environment. Reuse a
439
+ `brand_url` you already have from this run, or read one cheaply with
440
+ `ads_creative_read { brand_id, limit: 1 }`; if none comes back, use `https://make.gooseworks.ai`.
441
+ In this mode the app shows a copyable remix prompt at the bottom (dismissable / switchable
442
+ back to the UI composer). They browse their own and Community sources and copy the prompt.
205
443
  3. **Close the loop.** When the user **pastes back the copyable remix prompt** from the app
206
444
  (it names the brand + the templates they chose), THAT is your cue to generate: resolve the
207
- named source(s), inspect `submit_remix_batch`, and collect only its unresolved required inputs.
445
+ named source(s) with `ads_template_read`, quote, and collect only the unresolved required inputs.
208
446
 
209
447
  If the user already named an owned source (id/slug), a Community ad, or an upload, skip the source
210
448
  choice. Competitor ads may inform the angle or structure, but describe them as inspiration, never
211
- claim ownership, and never attest rights for the user.
449
+ claim ownership, and never attest rights for the user. Never use the retired curated third-party
450
+ catalog.
212
451
 
213
452
  ## Workflow — make ads from a template
214
453
 
215
- 1. **Resolve the brand.** Use `list_ad_brands` by name/site, then call `get_brand_kit` for the
216
- selected brand. If the
217
- kit's `researchStatus` isn't `complete`, you can still submit (the batch queues and runs when
218
- research finishes) — just tell the user. Use the kit to pick `product_name` (a real entry from
219
- `products[]`, not a guess) and, if the user supplied product photos, `reference_image_urls`.
220
- 2. **Pick the source ad(s) via the ask flow above.** Once you have concrete ids:
221
- call `get_static_ad_template` for each.
222
- For a Community ad, `remix_community_ad` first; for an uploaded image, `create_user_ad_template`
223
- first.
454
+ 1. **Resolve the brand and its evidence.** List brands with `brand_read` (no `brand_id`), then
455
+ read the selected brand's summary, kit, products and
456
+ learnings and search the Brand Brain as above. If research isn't `complete`, you can still
457
+ submit (the batch queues and runs when research finishes) — just tell the user. Use the read to
458
+ pick `product_name` (a real entry from `products.items`, not a guess) and, if the user supplied
459
+ product photos, `reference_image_urls` (public URLs; `media_upload` a local file first).
460
+ 2. **Pick the source ad(s) via the proposal above.** Read each chosen template with
461
+ `ads_template_read { brand_id, template_id }`. Community creatives (a query row's `sourceId`,
462
+ a feed row with `item_type: "creative"`) and the user's own finished ads go straight into
463
+ `source.community_ad_ids` / `source.creative_ids`.
224
464
  3. **(Optional) Craft the steering prompt.** The `prompt` is OPTIONAL — this is where the skill
225
465
  adds value: turn the user's intent (from step 1) into a concise steering note (e.g. tone,
226
466
  season, emphasis). Don't over-specify; the backend pipeline + brand kit handle palette, fonts,
227
467
  product swap.
228
- 4. **Quote the cost.** Inspect and call `estimate_remix_batch`, then tell the user.
229
- 5. **Submit ONE batch.** Inspect the current `submit_remix_batch` schema, fill known required
230
- inputs, ask only for unresolved user decisions, and omit unspecified optional settings. Keep
231
- the returned `batch_id` and `links`.
232
- 6. **Poll until done.** Call `get_remix_batch` for the returned batch (or use
233
- `list_brand_creatives`) every ~20-30s
234
- until every creative's `pending` is 0. Most images finish in a few minutes; text-heavy templates
235
- and `quality: high` take longer. Read each render's `elapsed_seconds` rather than guessing — a
236
- render that's still `running` is healthy; do NOT re-submit thinking it stalled (that double-bills).
237
- 7. **Hand back the links** from the batch's `links` block — `brand_url` (gallery) and each
238
- creative's `app_url` — copied verbatim. Never end on just "done" or a file path.
468
+ 4. **Quote the cost.** Call `ads_generate` with the exact arguments you will submit plus
469
+ `dry_run: true` (template sources), or work out the total as in the credits table. Drop or
470
+ replace anything in `unknown_template_ids`. State the image count and credit total in one line
471
+ and wait for the user's explicit yes.
472
+ 5. **Submit ONE batch** after that yes: the same `ads_generate` call without `dry_run`. Keep the
473
+ returned `job_id`.
474
+ 6. **Poll until done.** `job_get { job_id, kind: "ads_batch" }` every ~20-30s until every creative's
475
+ `pending` is 0. Most images finish in a few minutes; text-heavy templates and `quality: high`
476
+ take longer. Read each render's `elapsed_seconds` rather than guessing; do NOT re-submit
477
+ thinking it stalled (that double-bills). If `ads_generate` refused with
478
+ `brand_research_required`, the brand was never researched: run "Brand research" below, then
479
+ quote and submit again.
480
+ 7. **Hand back the ads with their links.** Show every finished image (`renders[].output_url` of
481
+ completed renders) and say in one line what failed, if anything. Then give the links from the
482
+ last `job_get`'s `result.links`, copied verbatim: the `brand_url` where all the brand's
483
+ ads are, and the `app_url` of each creative with a finished image (match
484
+ `creative_links[].project_id` to `result.creatives[].id`; skip a creative whose renders all
485
+ failed). For a big batch (more than about 8 creatives) give the `brand_url` and offer the
486
+ rest. Skip a missing or `null` link; never build an app URL yourself. Never end on just
487
+ "done" or a file path.
239
488
 
240
489
  ## Workflow — edit an existing ad
241
490
 
242
- User wants to tweak a creative they already made → use `regenerate_creative`. Infer whether they
243
- want another take, a targeted edit, or an exact instructed change from their request. Then inspect
244
- the live schema, ask only for any required source or instruction that is still missing, submit,
245
- poll with `get_remix_batch`, and hand back the links.
491
+ User wants to tweak a creative they already made → `ads_creative_edit`. Read the creative first
492
+ (`ads_creative_read { brand_id, creative_id }`) to get the render they mean. Infer the action
493
+ from their request: another take (`regenerate`, `mode: "variation"`), a targeted change
494
+ (`regenerate` with `mode: "edit"`, or `precision_edit` when they point at a region), an exact
495
+ instructed change (`mode: "exact"`), new placements (`resize`), editable layers (`layerize`) or a
496
+ short video (`animate`). Ask only for a required source or instruction that is still missing,
497
+ state the credit total from the credits table, get the yes, submit, poll as above, and hand back
498
+ the new images with their links: `result.links` from `job_get` for `regenerate`, `resize` and
499
+ `precision_edit`; `creative.app_url` and `creative.brand_url` from `ads_creative_read { brand_id,
500
+ creative_id }` for `animate` and `layerize`.
246
501
 
247
502
  ## Brand research
248
503
 
249
- Prefer the backend's result: call `get_brand_kit` for the selected brand. If `researchStatus` is
250
- `complete`, REUSE it — never re-research.
504
+ Prefer the backend's result. `brand_read { brand_id, sections: ["summary"] }`: if
505
+ `research_status` is `complete`, REUSE it — never re-research. Proof points and the full product
506
+ catalog keep arriving until `enrichment.settled` is true.
251
507
 
252
508
  **The split — backend owns visuals, you own the qualitative depth:**
253
509
 
254
- - **Backend LIGHT pass (automatic).** `create_ad_brand` with a `website_url` kicks off the same
255
- backend research the web app uses, in `mode: "light"`: it resolves the **authoritative logo,
256
- colors, and fonts** (Brandfetch + context.dev) plus a baseline kit, then flips
257
- `research_status` to `complete` — usually under a minute. You can't reproduce those visual
258
- signals locally, so **never re-derive logo/colors/fonts.** (Web onboarding via `/api/ads/onboard`
259
- runs the full thing; nothing to do but read it.)
260
- - **Your DEEP pass (local, agentic).** You add the qualitative depth the light pass leaves thin —
261
- positioning, audience segments, voice, brandType, value props, proof points, products — grounded
262
- on the actual site.
263
-
264
- **CLI brand-research flow:**
265
-
266
- 1. Inspect and call `create_ad_brand` with the known brand identity and website, then keep its id
267
- and slug. The brand comes back with
268
- `research_status: "pending"` (light pass in flight).
269
- 2. **Wait for the backend light pass:** poll `get_brand_kit` for that brand until `researchStatus`
270
- is `complete` (usually <60s). Now the kit has authoritative logo/colors/fonts + a baseline.
271
- At this point generation is already unblocked — but do the deep pass to make it good.
272
- 3. **Deep research locally:** `gooseworks fetch brand-research` and follow its phases. **Ground
273
- every fact on the fetched site** — if the site can't be read, say so and ask the user; never
510
+ - **Backend LIGHT pass (automatic).** A new brand comes from the connector's setup flow
511
+ (`brand_onboarding { action: "status" }`, then its `next_step`). For an additional brand, check
512
+ it is absent (`brand_read` with no `brand_id`), then `brand_create { name, website_url }` (free).
513
+ The website starts the same backend research the web app uses: it resolves the
514
+ **authoritative logo, colors, and fonts** plus a baseline kit and returns `research_job_id`; poll
515
+ `job_get { job_id: research_job_id, kind: "brand_research" }` (or `brand_read`) until
516
+ `research_status` is `complete` — usually under a minute. If it returns `reused_existing: true`,
517
+ tell the user and use that brand. You can't reproduce those visual signals, so **never
518
+ re-derive logo/colors/fonts.**
519
+ - **Your DEEP pass (optional).** You add the qualitative depth the light pass leaves thin —
520
+ positioning, audience, voice, brand type, value props, proof points, products — grounded on
521
+ the actual site.
522
+
523
+ **Deep research flow:**
524
+
525
+ 1. Fetch the `brand-research` skill (`catalog_fetch { type: "skill", slug: "brand-research" }` in a
526
+ chat app; `gooseworks fetch brand-research` in a terminal) and follow its phases. Its data
527
+ calls are paid: state the credit total (credits table) and get the yes first. **Ground every
528
+ fact on the brand's own site** — if the site can't be read, say so and ask the user; never
274
529
  guess a category from the brand name alone.
275
- 4. **Write the pack** with `write_file` under `agent-config/brands/<slug>/`:
276
- - the `brand-research/*.md` docs + `brand-assets/manifest.json` (human-readable pack), AND
277
- - `brand-research/kit-patch.json` — the STRUCTURED fields the web UI renders. Field-for-field
278
- contract; only what you put here reaches the kit. Shape:
279
- `{ positioning?: string, audience?: string, voice?: string, brandType?: string, tagline?: string, valueProps?: string[], proofPoints?: string[], products?: [{ name, description?, link?, pricing?, imageUrls?: string[] }] }`
280
- (`brandType` ∈ product | saas | service | agency | restaurant | fashion | beauty | fitness |
281
- finance | education | health). Only URLs already in our storage for product images.
282
- - **Do NOT set logo / colors / fonts here** — the backend light pass already owns those.
283
- 5. **Persist it:** call `finalize_brand_research` for the brand. It merges `kit-patch.json` into the kit
284
- NON-CLOBBERINGLY (it will NOT overwrite the backend's visuals or any user edit), then re-confirms
285
- `research_status: complete`.
286
- 6. **Verify:** call `get_brand_kit` again and confirm the qualitative fields you wrote are present
287
- before generating.
288
-
289
- **If the brand has NO website**, the backend light pass can't run (nothing to fetch) — do the whole
290
- thing locally (steps 3–6) and finalize; an un-finalized brand has no kit for generation and leaves
291
- no artifact to debug a wrong run (this is how a bad local classification, e.g. mislabelling a SaaS
292
- as a "drink company", used to vanish without a trace).
530
+ 2. **Save what you improved.**
531
+ - **As proposals (the default):** `brand_update { brand_id,
532
+ knowledge_intent: "agent_proposal", rationale, patch: { knowledge: { positioning?, audience?,
533
+ voice?, brandType?, tagline?, valueProps? } } }`. They stay pending until the user accepts
534
+ them in the app.
535
+ - **As the full research pack (only when you wrote all of it; in a chat app, only for a brand
536
+ with no website, see below):** with `file_write`, under
537
+ `agent-config/brands/<slug>/brand-research/`, write all four docs `brand-summary.md`,
538
+ `visual-identity.md`, `audience.md` and `competitors.md` (real content, at least a few
539
+ sentences each) plus `kit-patch.json`: `{ positioning?, audience?, voice?, brandType?,
540
+ tagline?, valueProps?: string[], proofPoints?: [{ text, source_url }], products?: [{ name,
541
+ description?, link?, pricing?, imageUrls?: string[] }] }` with only the fields you improved;
542
+ every proof point copied word for word from the brand's own page at `source_url`; product
543
+ images only from URLs already in GooseWorks storage; **no logo / colors / fonts**. Then
544
+ `brand_update { brand_id, patch: { finalize_research: true } }` merges it NON-CLOBBERINGLY
545
+ (never over the backend's visuals or a user edit). **If any of the four docs is missing or
546
+ nearly empty, finalize fails and marks the brand's research as failed**, so never finalize a
547
+ partial pack.
548
+ 3. **Verify:** `brand_read` again (`summary`, `kit`) and confirm what you saved before generating.
549
+
550
+ **If the brand has NO website**, the backend light pass can't run and generation goes ahead with
551
+ an empty kit, so ads come out off-brand. Do the deep pass from what the user tells you and save the
552
+ full research pack, so the brand has a kit and a record to debug a wrong run (this is how a bad
553
+ classification, e.g. mislabelling a SaaS as a "drink company", used to vanish).
293
554
 
294
555
  ## Analyze / intelligence (fetched recipes — NOT generation)
295
556
 
296
- These are analysis recipes you fetch from goose-skills with `gooseworks fetch <slug>` and
297
- follow; they do NOT touch the generation tools or credits-for-images. Pick the closest match;
298
- if unsure, `gooseworks search "<what the user wants>"` first:
557
+ These are analysis recipes you fetch and follow; they don't use the generation tools, but their
558
+ data calls are paid (credits table: state the total and get the yes before the first one). Fetch with `catalog_fetch { type: "skill", slug: "<slug>" }` in a chat app or
559
+ `gooseworks fetch <slug>` in a terminal. Pick the closest match; if unsure, search first with
560
+ `catalog_search { type: "skill", query: "<what the user wants>" }` (terminal:
561
+ `gooseworks search "<what the user wants>"`):
299
562
  - **Campaign performance diagnosis** ("why is my Meta/Google campaign underperforming",
300
- creative fatigue, learning phase, pacing, auction overlap) → `gooseworks fetch meta-ads-analyzer`
563
+ creative fatigue, learning phase, pacing, auction overlap) → `meta-ads-analyzer`
301
564
  (or `ad-campaign-analyzer` for cross-platform).
302
565
  - **Lead/CAC quality** ("are these ads driving qualified leads", true CAC vs vanity CPA,
303
- Scale/Keep/Investigate/Cut) → `gooseworks fetch ad-lead-quality-analyzer`.
566
+ Scale/Keep/Investigate/Cut) → `ad-lead-quality-analyzer`.
304
567
  - **Competitor ad intelligence** ("what ads are competitors running") →
305
- `gooseworks fetch competitor-ad-intelligence` (Meta Ad Library: `meta-ad-scraper`;
306
- Google: `google-ad-scraper`).
307
- - **Creative ideation** (ad angles, winning hooks) → `gooseworks fetch ad-angle-miner` /
308
- `gooseworks fetch trending-ad-hook-spotter`.
309
- - **Policy / landing-page checks** → `gooseworks fetch meta-ad-policy-checker` /
310
- `gooseworks fetch ad-to-landing-page-auditor`.
568
+ `competitor-ad-intelligence` (Meta Ad Library: `meta-ad-scraper`; Google: `google-ad-scraper`).
569
+ - **Creative ideation** (ad angles, winning hooks) → `ad-angle-miner` / `trending-ad-hook-spotter`.
570
+ - **Policy / landing-page checks** → `meta-ad-policy-checker` / `ad-to-landing-page-auditor`.
311
571
 
312
- Save their scripts to `/tmp/gooseworks-scripts/<slug>/` and follow their instructions. These
313
- run through the `gooseworks` CLI (`gooseworks fetch` / `gooseworks call`), like the GTM skills.
572
+ A recipe's provider calls go through the connector in a chat app (`data_call_provider` for GET,
573
+ `data_post_provider` for POST) and through `gooseworks call` in a terminal; both are billed. Saving and running
574
+ its scripts (under `/tmp/gooseworks-scripts/<slug>/`) is terminal-only: without a terminal, do
575
+ that step's analysis yourself from the data the tools return, and never ask the user to run a
576
+ command.
314
577
 
315
578
  ## Rules
316
579
 
317
- - **MCP required** — if `mcp__gooseworks__*` is unavailable, stop and tell the user to run
318
- `gooseworks install --claude --mcp`.
319
- - **One backend workflow** — generation is `submit_remix_batch` / `regenerate_creative` ONLY.
580
+ - **Connector tools only** — every step uses the tool names above. A missing tool means the
581
+ GooseWorks connection is stale: ask the user to reconnect or refresh GooseWorks. Never send a
582
+ chat-app user to a terminal or a CLI install.
583
+ - **One backend workflow** — generation is `ads_generate` / `ads_creative_edit` ONLY.
320
584
  Do NOT call FAL, the media proxy, `submit_render`, `update_render_status`, or upload render
321
- files yourself; do NOT `gooseworks fetch` a local remix recipe to generate. The backend owns it.
322
- - **Always end a successful run with the links** from the batch's `links` block (`brand_url` +
323
- each creative's `app_url`), copied verbatim. Never end on just "done" or a file path.
324
- - **Quote cost before generating** when it's non-trivial (use `estimate_remix_batch`), and
325
- relay `insufficient_credits` plainly if the submit is rejected — don't retry blindly.
326
- - **Use approved source paths.** If the user didn't name a source, run the ask flow (own ads,
327
- Community, upload, Surprise me, or browse in the app). "Surprise me" goes through
328
- `surprise_me_templates`; browsing uses `/create?brand=<slug>&cli=true`. Never use the retired
329
- curated third-party catalog.
330
- Generate when they paste the app's copyable remix prompt back (or submit the surprise picks
331
- directly if they'd rather not review).
585
+ files yourself; do NOT fetch a local remix recipe to generate. The backend owns it.
586
+ - **State the credit total and get an explicit yes before every paid call** (credits table above).
587
+ Relay `insufficient_credits` plainly if the submit is rejected — don't retry blindly.
588
+ - **No plan step for one-off ads.** Only a campaign's plans wait for approval
589
+ (`request_campaign_generation` → `ads_approval_decide` with the user's words as `user_quote`).
590
+ - **Always end a successful run with the finished images and their links**, copied verbatim:
591
+ each creative's `app_url` and the `brand_url` from `result.links`, or from the creative
592
+ read (`creative.app_url`, `creative.brand_url`) after `animate` or `layerize`. When the
593
+ server returns no links, end with the images only. Never end on just "done" or a file path, and
594
+ never build an app URL yourself (the one exception is the browse link below).
595
+ - **Search the Brain before proposing.** After the brand read and before choosing an angle,
596
+ claim or source — or asking for a brand fact — run the task's `knowledge_search` and carry
597
+ its evidence brief. A failed or empty search is stated as such, never as "no evidence exists".
598
+ - **Use approved source paths.** If the user didn't name a source, recommend one in the single
599
+ proposal (own ads, Community, upload, Surprise me, or browse in the app). Surprise me is
600
+ `ads_template_read` with `mode: "surprise"`; browsing uses `/create?brand=<slug>&cli=true`.
601
+ Never use the retired curated third-party catalog. Generate when they paste the app's copyable
602
+ remix prompt back, or when they accept the surprise picks.
332
603
  - **Treat competitor ads as inspiration** — never attest rights, imply ownership, or promise to
333
604
  copy a competitor's distinctive expression.
334
605
  - **Reconcile brand facts into the kit** — when the user states or changes something brand-level
335
- mid-task, check it against `get_brand_kit` and, with their ok, persist it via `update_brand_kit`
336
- / `upsert_brand_product` / `add_brand_product_image` so it sticks for future ads. Ask first;
337
- never silently mutate the kit.
338
- - **Record feedback** — when the user reacts to a generated image, inspect and call
339
- `set_creative_feedback` so the quality loop learns.
340
- - **Plan mode is opt-in** — only use the live approval option, then `list_ad_approvals` and
341
- `approve_ad_plan`, when the user wants to review before spending credits; otherwise generate
342
- immediately.
343
- - **Don't busy-loop** — poll `get_remix_batch` on a sensible interval (~20-30s); a `queued`
344
- batch is waiting on research and will start on its own.
345
- - **Report problems so we can fix them** — when a batch fails/is rejected and you can't resolve it,
346
- a required brand input/asset is missing, or a recipe/instruction is ambiguous or contradictory,
347
- call the **`log_cli_event`** MCP tool (`event_type`: `error`/`blocker`/`missing_input`/`confusion`,
348
- with the real error + step in `details`) so the team gets visibility. Still tell the user too.
606
+ mid-task, compare it with `brand_read`. Save explicitly authorized corrections through
607
+ `brand_update` with correction intent and the user's exact statement, or the user's own
608
+ images through `media_upload`; read back before saying saved. Proposed improvements stay
609
+ pending. Ask only when it is unclear whether a one-ad direction should apply to future ads.
610
+ - **Record feedback** — when the user reacts to a generated image, call `ads_creative_update`
611
+ with `patch.feedback` so the quality loop learns.
612
+ - **Don't busy-loop** — poll `job_get` on a sensible interval (~20-30s); a `queued` batch is
613
+ waiting on research and will start on its own.
614
+ - **Report problems so we can fix them** — when a batch fails or is rejected and you can't resolve
615
+ it, a required brand input/asset is missing, or an instruction is ambiguous or contradictory:
616
+ in a terminal run `gooseworks log "<what happened>" --event-type <error|blocker|missing_input|confusion> --details '<json with the real error and step>'`,
617
+ or call the `log_cli_event` tool if your connection lists it. A chat app without either skips
618
+ this step. Always tell the user too.