@mevdragon/vidfarm-devcli 0.2.7 → 0.2.8

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 (56) hide show
  1. package/GETTING_STARTED.developers.md +14 -18
  2. package/README.md +19 -5
  3. package/SKILL.developer.md +140 -11
  4. package/dist/src/account-pages.js +1 -1
  5. package/dist/src/app.js +305 -9
  6. package/dist/src/cli.js +142 -6
  7. package/dist/src/config.js +2 -5
  8. package/dist/src/context.js +16 -0
  9. package/dist/src/db.js +33 -2
  10. package/dist/src/homepage.js +33 -1
  11. package/dist/src/lib/template-paths.js +10 -4
  12. package/dist/src/registry.js +9 -2
  13. package/dist/src/services/auth.js +2 -6
  14. package/dist/src/services/job-logs.js +4 -4
  15. package/dist/src/services/providers.js +470 -0
  16. package/dist/src/services/storage.js +13 -0
  17. package/dist/src/services/template-certification.js +16 -2
  18. package/dist/src/services/template-loader.js +17 -1
  19. package/dist/src/services/template-sources.js +249 -5
  20. package/{templates/template_0000 → dist/templates/vidfarm_template_0000}/src/remotion/Root.js +1 -0
  21. package/dist/templates/{template_0000 → vidfarm_template_0000}/src/template.js +9 -3
  22. package/package.json +4 -3
  23. package/templates/{template_0000 → vidfarm_template_0000}/README.md +23 -0
  24. package/templates/{template_0000 → vidfarm_template_0000}/package.json +0 -1
  25. package/templates/{template_0000 → vidfarm_template_0000}/src/sdk.ts +18 -0
  26. package/templates/{template_0000 → vidfarm_template_0000}/src/template.js +9 -3
  27. package/templates/{template_0000 → vidfarm_template_0000}/src/template.ts +10 -3
  28. package/templates/vidfarm_template_0000/tmp/solobacterium-moorei-slideshow.request.json +31 -0
  29. /package/dist/templates/{template_0000 → vidfarm_template_0000}/src/lib/images.js +0 -0
  30. /package/dist/templates/{template_0000 → vidfarm_template_0000}/src/remotion/index.js +0 -0
  31. /package/dist/templates/{template_0000 → vidfarm_template_0000}/src/sdk.js +0 -0
  32. /package/dist/templates/{template_0000 → vidfarm_template_0000}/src/style-options.js +0 -0
  33. /package/dist/templates/{template_0000 → vidfarm_template_0000}/src/template-dna.js +0 -0
  34. /package/templates/{template_0000 → vidfarm_template_0000}/SKILL.md +0 -0
  35. /package/templates/{template_0000 → vidfarm_template_0000}/assets/Abel-Regular.ttf +0 -0
  36. /package/templates/{template_0000 → vidfarm_template_0000}/assets/DMSerifDisplay-Regular.ttf +0 -0
  37. /package/templates/{template_0000 → vidfarm_template_0000}/assets/Montserrat[wght].ttf +0 -0
  38. /package/templates/{template_0000 → vidfarm_template_0000}/assets/SourceCodePro[wght].ttf +0 -0
  39. /package/templates/{template_0000 → vidfarm_template_0000}/assets/TikTokSans-SemiBold.ttf +0 -0
  40. /package/templates/{template_0000 → vidfarm_template_0000}/assets/Yesteryear-Regular.ttf +0 -0
  41. /package/templates/{template_0000 → vidfarm_template_0000}/composition.json +0 -0
  42. /package/templates/{template_0000 → vidfarm_template_0000}/research/preview/.gitkeep +0 -0
  43. /package/templates/{template_0000 → vidfarm_template_0000}/research/source_notes.md +0 -0
  44. /package/templates/{template_0000 → vidfarm_template_0000}/src/lib/images.js +0 -0
  45. /package/templates/{template_0000 → vidfarm_template_0000}/src/lib/images.ts +0 -0
  46. /package/{dist/templates/template_0000 → templates/vidfarm_template_0000}/src/remotion/Root.js +0 -0
  47. /package/templates/{template_0000 → vidfarm_template_0000}/src/remotion/Root.tsx +0 -0
  48. /package/templates/{template_0000 → vidfarm_template_0000}/src/remotion/index.js +0 -0
  49. /package/templates/{template_0000 → vidfarm_template_0000}/src/remotion/index.tsx +0 -0
  50. /package/templates/{template_0000 → vidfarm_template_0000}/src/sdk.js +0 -0
  51. /package/templates/{template_0000 → vidfarm_template_0000}/src/style-options.js +0 -0
  52. /package/templates/{template_0000 → vidfarm_template_0000}/src/style-options.ts +0 -0
  53. /package/templates/{template_0000 → vidfarm_template_0000}/src/template-dna.js +0 -0
  54. /package/templates/{template_0000 → vidfarm_template_0000}/src/template-dna.ts +0 -0
  55. /package/templates/{template_0000 → vidfarm_template_0000}/template.config.json +0 -0
  56. /package/templates/{template_0000 → vidfarm_template_0000}/tsconfig.json +0 -0
@@ -86,31 +86,27 @@ That will populate with a reference folder of what a template code looks like. W
86
86
 
87
87
  9. Now find an easy winning format from https://winning-formats-gallery-tiktok.cloud.zoomgtm.com/ and save the image to your drafts/ folder. then tell Codex to look at that image (right click, copy relative path, paste to codex), then tell codex please make a new template based on the image.
88
88
 
89
- ## Publish Responsibility
89
+ ## Shipping Updates
90
90
 
91
- When your template is ready for hosted Vidfarm, your responsibility is only:
91
+ For a brand-new template, register the source once.
92
92
 
93
- 1. push your template code to GitHub
94
- 2. register or update the template source metadata so Vidfarm knows the repo URL, branch, and template folder path
93
+ For an update to an already-registered template:
95
94
 
96
- Your responsibility does not include:
95
+ 1. Push the exact commit to GitHub.
96
+ 2. Submit that exact commit SHA to Vidfarm for review.
97
+ 3. Wait for platform admin approval and activation.
97
98
 
98
- 1. importing the source into the live platform
99
- 2. activating the release
100
- 3. making the template public/live
101
-
102
- Those are platform-admin steps. If an API route says `403 Admin access required` for import or activate, that means you reached the correct handoff boundary.
103
-
104
- When you need to register your template with hosted Vidfarm, use the dev CLI command below from your repo root:
99
+ Developer CLI example:
105
100
 
106
101
  ```bash
107
- npx @mevdragon/vidfarm-devcli register-source-hosted \
102
+ node dist/src/cli.js publish-update-hosted \
108
103
  --env-file .env \
109
- --template-id <uuid-v4> \
110
- --slug-id <template_slug> \
111
- --repo-url https://github.com/<you>/<repo> \
104
+ --template-id YOUR_TEMPLATE_ID \
105
+ --slug-id vidfarm_template_your_slug \
106
+ --repo-url https://github.com/your-org/your-repo.git \
112
107
  --branch main \
113
- --template-module-path templates/vidfarm_template_<slug>/src/template.ts
108
+ --template-module-path src/vidfarm_template_your_slug/src/template.ts \
109
+ --commit-sha YOUR_GITHUB_COMMIT_SHA
114
110
  ```
115
111
 
116
- That command uses your `VIDFARM_API_KEY` and sends the registration to the hosted REST API, so the template appears in Vidfarm's review queue with `pending_review` status.
112
+ This does not make the template live. The CLI packages that exact commit locally, uploads the artifact to Vidfarm-managed S3, and creates or refreshes the reviewable release so a platform admin can approve and activate it.
package/README.md CHANGED
@@ -88,6 +88,7 @@ The developer handoff ends at:
88
88
 
89
89
  - `git push` of the template code
90
90
  - template source registration or registration update
91
+ - for an already-registered template, publishing the exact GitHub commit SHA that should enter review
91
92
 
92
93
  The developer handoff does not include:
93
94
 
@@ -95,7 +96,7 @@ The developer handoff does not include:
95
96
  - activating a release
96
97
  - making the template public/live
97
98
 
98
- If a developer receives `403 Admin access required` while trying to import or activate a registered source, that is expected. Those routes are for platform admins.
99
+ If a developer receives `403 Admin access required` while trying to import or activate a registered source, that is expected. Those routes are for platform admins. Developers should use the publish-update flow to submit an exact commit SHA for review instead.
99
100
 
100
101
  ## Template Deploy Cycle
101
102
 
@@ -132,10 +133,10 @@ node dist/src/cli.js deploy-template-cycle \
132
133
 
133
134
  The important distinction is:
134
135
 
135
- - third-party developers only ship template repo changes plus registration metadata
136
+ - third-party developers ship template repo changes plus registration metadata, and can publish an exact commit SHA for an existing registered template
136
137
  - platform admins import and activate those template repo changes
137
138
  - new source registrations land in the hosted review queue before approval
138
- - newly imported releases can be approved while an older active release stays live
139
+ - developer-published commit SHAs become reviewable releases while an older active release stays live
139
140
  - platform code changes ship through the root prod deploy script
140
141
  - multiple templates can live in one git repo as long as each template has its own folder and its `template_module_path` points at that folder's `src/template.ts`
141
142
 
@@ -153,7 +154,20 @@ For hosted template source registration, treat `template_module_path` as repo-re
153
154
 
154
155
  For hosted registration, use `register-source-hosted`. It talks to the Vidfarm REST API directly, so the source record lands in the production database that backs the hosted review queue. `register-source-prod` remains as a compatibility alias for internal/operator workflows.
155
156
 
156
- For private GitHub repos, set `VIDFARM_GITHUB_TOKEN` or `GITHUB_TOKEN` in the hosted runtime environment before using the REST import and approval flow. The production API now performs the clone/import itself, so the token must be available to the server process rather than injected from the operator shell.
157
+ For updates to an already-registered template, use `publish-update-hosted` with the exact reviewed commit SHA. The CLI packages that commit locally into a signed artifact, uploads it to platform-controlled S3 through the Vidfarm API, and then creates or refreshes the pending release for admin review without granting developers approval or activation rights.
158
+
159
+ ```bash
160
+ node dist/src/cli.js publish-update-hosted \
161
+ --env-file .env \
162
+ --template-id c7af2cd8-f032-45fa-9d4d-7af0e85cf4ef \
163
+ --slug-id vidfarm_template_reddit_brainrot \
164
+ --repo-url https://github.com/mevdragon/vidfarm_templates.git \
165
+ --branch main \
166
+ --template-module-path src/vidfarm_template_reddit_brainrot/src/template.ts \
167
+ --commit-sha 5e05a90a05a40105cc6e3b6a06774fdfb60c1893
168
+ ```
169
+
170
+ The hosted publish path no longer depends on server-side GitHub access for template updates. Prod imports the uploaded artifact from S3 during review/import.
157
171
 
158
172
  For local CLI usage, the `session` command gives you a local seeded session so you can test without manually wiring auth state.
159
173
 
@@ -180,4 +194,4 @@ If your template uses `ctx.remotion`, develop and validate it locally through th
180
194
 
181
195
  ## Next Read
182
196
 
183
- For the external template-author workflow, continue with [GETTING_STARTED.developers.md](./GETTING_STARTED.developers.md) and the example template in [`templates/template_0000`](./templates/template_0000).
197
+ For the external template-author workflow, continue with [GETTING_STARTED.developers.md](./GETTING_STARTED.developers.md) and the example template in [`templates/vidfarm_template_0000`](./templates/vidfarm_template_0000).
@@ -30,11 +30,18 @@ Do not use this skill for:
30
30
 
31
31
  Third-party template developers publish template code by pushing git commits to GitHub. That is the only code-distribution step they own.
32
32
 
33
+ Important nuance:
34
+
35
+ - GitHub is relevant for the hosted handoff, not for normal local template authoring
36
+ - do not make GitHub setup or GitHub debugging a blocker for local template creation, testing, iteration, or validation
37
+ - if the user is only building or revising a template locally, they should not need to worry about GitHub at all
38
+
33
39
  The third-party developer responsibility is:
34
40
 
35
41
  - build and validate the template locally
36
42
  - commit and push the template folder to GitHub
37
43
  - register or update the hosted template source metadata with `register-source-hosted` so Vidfarm knows which repo, branch, and template folder to import from
44
+ - for an already-registered template update, publish the exact GitHub commit SHA with `publish-update-hosted`
38
45
  - stop there and hand off to the platform team
39
46
 
40
47
  The third-party developer should not:
@@ -46,6 +53,12 @@ The third-party developer should not:
46
53
 
47
54
  `import-source-prod` and `deploy-template-cycle` are platform-operator commands. They are for internal admin flow, not for external template authors.
48
55
 
56
+ Private repo rule:
57
+
58
+ - if the registered source repo is private, assume the intended hosted setup is that Vidfarm has already been granted access to it
59
+ - when repo sharing is needed, the repo should be shared with GitHub username `mevdragon`
60
+ - do not treat a private repo itself as a problem if that access assumption is already stated
61
+
49
62
  For third-party developers, Remotion is local and storage should be accessed through Vidfarm helpers. Do not require cloud Remotion setup or hand-written S3 integration for normal template work.
50
63
 
51
64
  ## Agent Operating Rule
@@ -115,40 +128,76 @@ Notes:
115
128
  - at least one runtime AI provider key is usually enough
116
129
  - `GEMINI_API_KEY` is the key used by the built-in DNA analysis commands
117
130
  - `VIDFARM_API_KEY` is needed when calling a hosted Vidfarm API directly, including when minting presigned preview-media uploads through `vidfarm-devcli presign-preview-media`
118
- - `VIDFARM_API_KEY` is also what `vidfarm-devcli register-source-hosted` uses for hosted source registration
131
+ - `VIDFARM_API_KEY` is also what `vidfarm-devcli register-source-hosted` and `vidfarm-devcli publish-update-hosted` use for hosted handoff
119
132
  - local `vidfarm-devcli session` already gives you a seeded local API key for the local runtime
120
133
  - when calling the hosted API directly, include both `vidfarm-user-id` and `vidfarm-api-key` headers
121
134
  - for local `vidfarm-devcli` sessions, you usually do not need to supply `VIDFARM_USER_ID` manually
122
135
  - template authoring is TypeScript-first; create and edit template source as `src/template.ts`, not `src/template.js`
123
136
  - keep exploratory scripts, one-off test runners, scratch validation files, and temporary job-driving code out of `src/`; place them in a repo-local tmp folder that is a sibling to `src` instead, for example `templates/vidfarm_template_0007/tmp/`
124
137
  - when registering a hosted template source, set `template_module_path` to the repo-relative TypeScript entrypoint inside the template folder, for example `templates/vidfarm_template_example/src/template.ts`; the platform build/import flow resolves the compiled `src/template.js` sibling after `npm run build`
125
- - hosted template registration is git metadata only: repo URL, branch, template entrypoint path, and optionally an explicit commit SHA for a specific import
138
+ - hosted template registration is git metadata only: repo URL, branch, and template entrypoint path
126
139
  - if a template moves folders or switches branches, update the registration metadata; if the template code changed but the location stayed the same, just push a new Git commit
127
- - the platform determines whether an update exists by comparing the registered branch head against the latest imported release commit
140
+ - for an already-registered template, submit the exact commit you want reviewed with `publish-update-hosted --commit-sha <sha>`; that command packages the commit locally and uploads a review artifact to platform-controlled S3
141
+ - a local shell GitHub auth failure does not prove the hosted Vidfarm platform lacks repo access
142
+ - if `git ls-remote` fails locally, interpret that as local credential state unless the hosted import flow itself reports a GitHub access error
128
143
  - do not ask for platform secrets like `ENCRYPTION_SECRET`, `API_KEY_SALT`, `WEBHOOK_SECRET`, admin emails, S3 config, or generic AWS credentials
129
144
  - do not ask for `REMOTION_AWS_ACCESS_KEY_ID` or `REMOTION_AWS_SECRET_ACCESS_KEY`
130
145
 
146
+ Current first-class speech model allowlists in the platform runtime:
147
+
148
+ - text-to-speech
149
+ - `openrouter`: `google/gemini-3.1-flash-tts-preview`
150
+ - `gemini`: `gemini-3.1-flash-tts-preview`
151
+ - `openai`: `gpt-4o-mini-tts-2025-12-15`
152
+
153
+ - speech-to-text
154
+ - `openrouter`: `openai/gpt-4o-mini-transcribe`
155
+ - `gemini`: `gemini-3.1-flash-lite-preview`, `gemini-2.5-flash-lite`
156
+ - `openai`: `gpt-4o-mini-transcribe-2025-12-15`
157
+
131
158
  ## Hosted Registration Flow
132
159
 
133
160
  For a third-party developer, the hosted publish handoff is:
134
161
 
135
162
  1. push the repo changes that contain the target template folder
136
163
  2. register the source location if it is new, or update the existing registration if the repo, branch, or template path changed
137
- 3. stop there, then tell the platform operator which branch head or commit SHA should be imported if they ask
164
+ 3. if the template is already registered and the location did not change, publish the exact GitHub commit SHA with `publish-update-hosted`; that command uploads a signed artifact for that commit
165
+ 4. stop there, then tell the platform operator which commit was submitted if they ask
138
166
 
139
167
  Registration data should be treated like this:
140
168
 
141
169
  - `repo_url`: the GitHub repo that contains the template code
142
170
  - `branch`: the branch Vidfarm should watch for the latest version, usually `main`
143
171
  - `template_module_path`: the repo-relative path to the template TypeScript entrypoint, for example `src/vidfarm_template_funnychat/src/template.ts`
144
- - `commit_sha`: optional and only needed when you want to import a specific commit instead of the current branch head
172
+ - `install_command`: the exact command that installs dependencies for the registered template source
173
+ - `build_command`: the exact command that leaves the compiled JavaScript entrypoint beside the declared TypeScript entrypoint, or `:` when the compiled `.js` files are already committed and no build step is needed
174
+ - `commit_sha`: for developer publish flow, the exact GitHub commit to package locally and submit for review on an already-registered source
175
+
176
+ Registration command rule:
145
177
 
146
- Do not tell third-party developers to run AWS-backed operator commands just to publish template code. If the task is only "make my updated template available to Vidfarm", the correct answer is GitHub push plus source registration metadata.
178
+ - do not guess `install_command` and `build_command`
179
+ - for a standalone template repo rooted at the template itself, root-level commands like `npm install` and `npm run build` are usually correct
180
+ - for a multi-template repo, the commands must match the registered template folder, usually with `--prefix <template-folder>`
181
+ - if the declared `template_module_path` is `src/vidfarm_template_chadvirgin/src/template.ts`, then a typical install command is `npm install --prefix src/vidfarm_template_chadvirgin`
182
+ - if that template folder already commits `src/template.js`, a typical build command is `:`
183
+ - if that template folder requires compilation, a typical build command is `npm run build --prefix src/vidfarm_template_chadvirgin`
184
+ - a broken `build_command` will block hosted import even if the source registration itself succeeded
185
+ - before telling a user to register or update hosted source metadata, inspect the repo's actual `package.json` files and choose commands that match the template's real location
186
+
187
+ Do not tell third-party developers to run AWS-backed operator commands just to publish template code. If the task is only "make my updated template available to Vidfarm", the correct answer is GitHub push plus source registration metadata for new sources, or GitHub push plus `publish-update-hosted --commit-sha ...` for existing sources.
188
+
189
+ When reasoning about hosted visibility:
190
+
191
+ - the required developer-side outcome is that the intended commit is pushed to the registered branch
192
+ - do not infer hosted GitHub access failure from a local CLI auth error
193
+ - for hosted template updates, the review artifact is uploaded from the developer machine and prod later imports it from S3, so server-side GitHub access is not part of the normal publish path
147
194
 
148
195
  If a developer can register a source but receives `403 Admin access required` when trying to import or activate it, that is the expected boundary, not a blocker they are supposed to solve. It means the handoff point was reached correctly.
149
196
 
150
197
  Hosted registration should use `register-source-hosted`, not a local DB-backed command. That command calls the Vidfarm REST API so the source appears in the production review queue with `pending_review` status.
151
198
 
199
+ For updates to an already-registered template, use `publish-update-hosted` so the exact GitHub commit is packaged locally, uploaded as a signed artifact, and enters review as a pending release without granting approval or activation rights.
200
+
152
201
  ## Template Deploy Cycle
153
202
 
154
203
  If the user explicitly says "template deploy cycle", interpret that as the internal platform-operator sequence:
@@ -169,8 +218,8 @@ Read these files first when doing template work:
169
218
 
170
219
  1. [GETTING_STARTED.developers.md](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/GETTING_STARTED.developers.md)
171
220
  2. [README.md](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/README.md)
172
- 3. [templates/template_0000/SKILL.md](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/templates/template_0000/SKILL.md)
173
- 4. [templates/template_0000/src/template.ts](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/templates/template_0000/src/template.ts)
221
+ 3. [templates/vidfarm_template_0000/SKILL.md](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/templates/vidfarm_template_0000/SKILL.md)
222
+ 4. [templates/vidfarm_template_0000/src/template.ts](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/templates/vidfarm_template_0000/src/template.ts)
174
223
  5. [src/template-sdk.ts](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/src/template-sdk.ts)
175
224
  6. [src/cli.ts](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/src/cli.ts)
176
225
 
@@ -187,9 +236,19 @@ The contract is:
187
236
  - `jobs` implement the actual work
188
237
  - `configSchema` defines editable per-user template config
189
238
  - `about.viral_dna` and `about.visual_dna` explain why the format wins
239
+ - `about.proposal_generator` tells directors and agents how to turn product/about context into template-native post ideas
240
+ - `about.sample_prompts` shows future users and agents how to prompt the template well
190
241
  - `SKILL.md` teaches humans and agents how to call the template correctly
191
242
  - the canonical template entrypoint is `src/template.ts`
192
243
 
244
+ The platform-owned helper surface on `ctx.providers` currently includes:
245
+
246
+ - `generateText(...)`
247
+ - `generateImage(...)`
248
+ - `analyzeImageLayout(...)`
249
+ - `generateSpeech(...)`
250
+ - `transcribeSpeech(...)`
251
+
193
252
  Every public template action should remain async and job-based. Prefer one or more named operations behind `POST /api/v1/templates/:templateId/operations/:operationName` instead of inventing custom synchronous endpoints.
194
253
 
195
254
  Templates are expected to evolve through multiple revisions. One-shot generation is not the standard. The standard is:
@@ -213,7 +272,7 @@ That documentation should describe:
213
272
 
214
273
  - supported provider names
215
274
  - allowed model IDs per provider
216
- - which capability each model is intended for, such as `text`, `image`, `layout_analysis`, or `video`
275
+ - which capability each model is intended for, such as `text`, `image`, `layout_analysis`, `tts`, `stt`, or `video`
217
276
  - whether the list is strict, preferred, or just known-good defaults
218
277
  - any runtime caveats, especially when a provider is only partially supported by the current platform adapter
219
278
 
@@ -288,6 +347,13 @@ This boots the local API, worker, SQLite state, provider-key seeding, and local
288
347
 
289
348
  Use a folder name that starts with `vidfarm_template_`, such as `templates/vidfarm_template_<nnnn>/`.
290
349
 
350
+ Keep the identifiers separate:
351
+
352
+ - the folder / package name should keep the `vidfarm_template_` prefix
353
+ - the `slugId` should stay clean and human-meaningful, for example `ugc_hooks_v1`
354
+ - `about.title` is the user-facing display title and should not be prefixed with `Vidfarm Template` unless that phrase is genuinely part of the brand or concept
355
+ - avoid redundant titles like `Vidfarm Template UGC Hooks V1` when `UGC Hooks V1` is the actual display name
356
+
291
357
  Example:
292
358
 
293
359
  ```bash
@@ -352,11 +418,19 @@ These commands:
352
418
  - sync the generated DNA module back into the template
353
419
  - populate the strings consumed by `about.viral_dna`, `about.visual_dna`, and `about.link_to_original`
354
420
 
421
+ After DNA analysis, add `about.proposal_generator` and `about.sample_prompts` manually. The standard now requires both. `proposal_generator` should help a director combine product/about information with the template's format to invent many post proposals, and `sample_prompts` should show what strong final prompts look like. Do not leave either as optional polish.
422
+
423
+ Required-field rule:
424
+
425
+ - treat missing required fields as a blocking bug, not as follow-up polish
426
+ - before calling a template "ready", verify every required field in `defineTemplate(...)` is present and populated with real values
427
+ - if a scaffold or older repo shape omits any current required field, update the template to the current contract in the same pass
428
+
355
429
  Do not hand-write these summaries if the CLI can generate them from the source media.
356
430
 
357
431
  ### 6. Implement the actual repeatable workflow
358
432
 
359
- Use [templates/template_0000/src/template.ts](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/templates/template_0000/src/template.ts) as the baseline pattern.
433
+ Use [templates/vidfarm_template_0000/src/template.ts](/Users/localghost/Projects/OfficeX/OfficeX/ZoomGTM/vidfarm/templates/vidfarm_template_0000/src/template.ts) as the baseline pattern.
360
434
 
361
435
  For a new template, make sure it has:
362
436
 
@@ -364,6 +438,14 @@ For a new template, make sure it has:
364
438
  - `slugId`
365
439
  - `version`
366
440
  - `about`
441
+ - `about.title`
442
+ - `about.description`
443
+ - `about.viral_dna`
444
+ - `about.visual_dna`
445
+ - `about.preview_media`
446
+ - `about.link_to_original`
447
+ - `about.proposal_generator` with a reusable instruction for proposal generation
448
+ - `about.sample_prompts` with multiple concrete examples
367
449
  - `configSchema`
368
450
  - `operations`
369
451
  - `jobs`
@@ -471,6 +553,7 @@ A revision is not complete just because the code compiles. It is complete when:
471
553
  - the requested change is visible in the output
472
554
  - the change does not obviously regress the core format
473
555
  - the template can still be rerun by another user or agent
556
+ - `about.proposal_generator` and `about.sample_prompts` still reflect the best current way to ideate and prompt the template
474
557
  - the usage instructions still match the implementation
475
558
 
476
559
  ## Template Contract
@@ -488,7 +571,14 @@ export const myTemplate = defineTemplate({
488
571
  viral_dna: "Fast creator-style hooks with simple repeatable structure.",
489
572
  visual_dna: "Presentation-led mobile layouts with recognizable creator-native framing.",
490
573
  preview_media: ["templates/ugc_hooks_v1/about/preview-01.jpg"],
491
- link_to_original: "https://www.tiktok.com/@example/video/1234567890"
574
+ link_to_original: "https://www.tiktok.com/@example/video/1234567890",
575
+ proposal_generator:
576
+ "Given the director's product, audience, and positioning, propose multiple UGC hook post ideas that fit this template. Return ideas that can either be used directly as prompts or expanded into a larger series of related prompts.",
577
+ sample_prompts: [
578
+ "Create a 3-slide UGC hook sequence for a sleep supplement targeting new parents.",
579
+ "Make a creator-style launch teaser for a skincare serum with one hook, one proof point, and one CTA.",
580
+ "Generate a short product explainer slideshow for a budgeting app aimed at freelancers."
581
+ ]
492
582
  },
493
583
  configSchema: z.object({
494
584
  defaultProvider: z.enum(["openai", "openrouter", "gemini", "perplexity"]).default("openai")
@@ -522,10 +612,48 @@ Keep these roles clear:
522
612
 
523
613
  - `id` is the UUID-style template identifier
524
614
  - `slugId` is the stable human-readable identifier
615
+ - `version` is required and should be an explicit template version string such as `1.0.0`
616
+ - `about.title` is the customer-facing display name; it does not need the folder prefix and should usually read like a normal product/template title
617
+ - `about.description` is required and should explain the reusable output format, not just restate the folder name
618
+ - `about.viral_dna` is required and should describe the repeatable distribution mechanics that make the format work
619
+ - `about.visual_dna` is required and should describe the repeatable visual system, framing, pacing, and composition cues
620
+ - `about.preview_media` is required and should contain checked-in preview asset paths that represent the template well
621
+ - `about.link_to_original` is required and should point to the original inspiration post or source reference when one exists
622
+ - `about.proposal_generator` is required and should help directors turn product/about context into a list of strong post proposals for that template
623
+ - `about.sample_prompts` is required and should contain realistic, high-signal examples that teach users how to get good results
525
624
  - `operations` define the public API
526
625
  - `jobs` implement the actual work
527
626
  - `smokeTestPayload` is required for each operation
528
627
 
628
+ Required fields checklist:
629
+
630
+ - `id`
631
+ - `slugId`
632
+ - `version`
633
+ - `about.title`
634
+ - `about.description`
635
+ - `about.viral_dna`
636
+ - `about.visual_dna`
637
+ - `about.preview_media`
638
+ - `about.link_to_original`
639
+ - `about.proposal_generator`
640
+ - `about.sample_prompts`
641
+ - `configSchema`
642
+ - at least one operation
643
+ - a valid workflow function for every operation
644
+ - `smokeTestPayload` for every operation
645
+ - template-local `SKILL.md`
646
+
647
+ Best-practice rule:
648
+
649
+ - every template should ship with sample prompts
650
+ - every template should ship with a proposal generator prompt
651
+ - proposal generation should support a workflow of proposal -> prompts -> posts
652
+ - proposal outputs should be useful either as direct one-off prompts or as seeds for a whole series
653
+ - include more than one example so users can see the range of valid requests
654
+ - prefer prompts that are specific enough to be reusable exemplars, not vague one-liners
655
+ - refresh both `about.proposal_generator` and `about.sample_prompts` when the template's prompting strategy or supported use cases change
656
+
529
657
  ## Provider Rules
530
658
 
531
659
  Templates should use the provider abstractions already available on `ctx.providers`.
@@ -541,6 +669,7 @@ Rules:
541
669
  Important distinction:
542
670
 
543
671
  - runtime template generation can use OpenAI, OpenRouter, Gemini, or Perplexity according to template logic
672
+ - first-class speech helpers use a strict runtime allowlist per provider/model pair; if a template needs other speech models, document that it is using a custom provider path instead of the built-in helper
544
673
  - built-in DNA analysis commands currently depend on `GEMINI_API_KEY`
545
674
 
546
675
  ## Storage And Upload Rules
@@ -516,7 +516,7 @@ export function renderSettingsPage(input) {
516
516
  <div class="card-head">
517
517
  <div>
518
518
  <div class="pill">AI Providers</div>
519
- <h2>Attached inference keys</h2>
519
+ <h2>Attached AI API keys</h2>
520
520
  </div>
521
521
  </div>
522
522
  <p class="helper">These are stored in plain text in SQLite for now, per your current platform requirement.</p>