@officexapp/vidfarm-devcli 0.21.39 → 0.21.43

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 (30) hide show
  1. package/.agents/skills/editor-capabilities/SKILL.md +16 -0
  2. package/.agents/skills/vidfarm/SKILL.md +31 -6
  3. package/.agents/skills/vidfarm/harnesses/README.md +1 -0
  4. package/.agents/skills/vidfarm/harnesses/explainer.HARNESS.md +11 -0
  5. package/.agents/skills/vidfarm/harnesses/product-demo.HARNESS.md +2 -0
  6. package/.agents/skills/vidfarm/harnesses/product-explainer.HARNESS.md +242 -0
  7. package/.agents/skills/vidfarm/recipes/bulk-scripting-with-a-harness.md +1 -1
  8. package/.agents/skills/vidfarm/recipes/cutout-graphics-for-explainers.md +2 -0
  9. package/.agents/skills/vidfarm/recipes/onboard-a-new-director.md +10 -8
  10. package/.agents/skills/vidfarm/references/automation-and-local-dev.md +21 -8
  11. package/.agents/skills/vidfarm/references/content-ideas.md +113 -0
  12. package/.agents/skills/vidfarm/references/editor-workflows.md +36 -3
  13. package/.agents/skills/vidfarm/references/onboarding.md +64 -1
  14. package/.agents/skills/vidfarm/references/primitives.md +67 -0
  15. package/.agents/skills/vidfarm-media/SKILL.md +50 -0
  16. package/SKILL.director.md +347 -27
  17. package/SKILL.md +6 -3
  18. package/crowdsourcing.md +49 -1
  19. package/dist/src/cli.js +579 -19
  20. package/dist/src/devcli/consult.js +389 -0
  21. package/dist/src/devcli/cost-mode.js +8 -0
  22. package/dist/src/devcli/experiments.js +10 -5
  23. package/dist/src/devcli/qa-check.js +74 -0
  24. package/dist/src/devcli/skill-docs.js +103 -0
  25. package/dist/src/services/brainstorm-prompts.js +132 -0
  26. package/experimental/unique-product-explainers.md +855 -0
  27. package/experiments.md +33 -2
  28. package/package.json +10 -1
  29. package/src/assets/SELLING_AWARENESS_STAGES.md +579 -0
  30. package/src/assets/SELLING_WITH_HOOKS.md +377 -0
package/dist/src/cli.js CHANGED
@@ -19,7 +19,7 @@ import { formatCompositionLintIssues, lintCompositionHtml } from "./services/com
19
19
  import { resolveFfmpeg } from "./services/clip-curation/ffmpeg.js";
20
20
  import { parseHyperframesJson, runHyperframesCommand } from "./devcli/hyperframes-cli.js";
21
21
  import { renderCompositionStills } from "./devcli/stills.js";
22
- import { extractCompositionFacts, formatQaReport, formatWatchTheVideoNotice, qaCompositionHtml, watchTheVideoDirective } from "./devcli/qa-check.js";
22
+ import { extractCompositionFacts, formatQaReport, formatWatchTheVideoNotice, qaCompositionHtml, recordQaPass, watchTheVideoDirective } from "./devcli/qa-check.js";
23
23
  import { HARNESS_FILENAME, discoverHarness, formatHarnessReport, isLegacyHarnessFilename, listBuiltinHarnesses, loadAndEvaluateHarness, mergeHarnessIntoReport, parseHarness, resolveHarnessPath } from "./devcli/harness.js";
24
24
  import { removeGreenscreenLocal, localGreenscreenAvailable, defaultGreenscreenOutPath, GREENSCREEN_PRESETS, trimTransparentBorders, cropImageRegion } from "./devcli/greenscreen-local.js";
25
25
  import { dedupeMediaLocal, localDedupeAvailable, defaultDedupeOutPath, describeLocalDedupe, DEDUPE_PRESETS, DEDUPE_DEFAULT_PRESET, isDedupePresetName } from "./devcli/dedupe-local.js";
@@ -29,7 +29,7 @@ import { runDoctorCommand } from "./devcli/doctor.js";
29
29
  import { findFreePort } from "./devcli/port-utils.js";
30
30
  import { scanLocalServers } from "./devcli/process-scan.js";
31
31
  import { runSkillsCommand } from "./devcli/skills.js";
32
- import { AmbiguousDocRef, DEFAULT_PACK, bundledPackDir, listPackDocs, readPackDoc, searchPackDocs } from "./devcli/skill-docs.js";
32
+ import { AmbiguousDocRef, DEFAULT_PACK, bundledPackDir, listPackDocs, listPackTopics, loadIdeaBank, readPackDoc, readPackTopic, resolvePackTopic, searchPackDocs } from "./devcli/skill-docs.js";
33
33
  import { initTelemetry, reportCliCrash } from "./devcli/telemetry.js";
34
34
  import { resolveLocalDataDir, localBackendAvailable, LocalModeUnavailableError, localApiRequest } from "./devcli/local-backend.js";
35
35
  import { startLocalFrontendServer, serveShellsPresent } from "./devcli/local-frontend-server.js";
@@ -37,6 +37,8 @@ import { readStoredAuth, writeStoredAuth, clearStoredAuth, hostsMatch } from "./
37
37
  import { CostModeBlockedError, assertBilledAllowed, clearStoredCostMode, costModeExplainer, costModeSummaryLine, normalizeCostMode, resolveCostMode, writeStoredCostMode, COST_MODE_BLURB, COST_MODE_DISPLAY_LIST, costModeDisplayName } from "./devcli/cost-mode.js";
38
38
  import { INTERACTION_MODES, INTERACTION_MODE_BLURB, clearStoredInteractionMode, interactionModeExplainer, interactionModeSummaryLine, interactiveOfferLine, normalizeInteractionMode, resolveInteractionMode, writeStoredInteractionMode } from "./devcli/interaction-mode.js";
39
39
  import { buildImageHandoff, buildRawsHandoff, formatHandoff } from "./devcli/handoff.js";
40
+ import { buildConsultBrief, CONSULT_ARTIFACTS, consultContextState, consultCountRange, defaultConsultCount, findOfferFile, formatConsultBrief, looksLikeOfferPath, planConsultation, resolveConsultStep, resolveOfferPath } from "./devcli/consult.js";
41
+ import { resolveRootFileCandidates } from "./lib/package-root.js";
40
42
  import { STORYBOARD_FILENAME, readStoryboard, renderStoryboardScaffold, storyboardStage } from "./devcli/storyboard.js";
41
43
  import { CORE_METRICS, DEFAULT_FORMAT, DEFAULT_METRIC, EASY_FORMATS, EXPERIMENTS_FILENAME, EXPERIMENT_MODES, analyzeRound, appendResult, appendRound, capacityOf, epochsNeeded, findRoundIndex, lintDiary, markPosted, readDiary, renderDiaryScaffold, writeDiary } from "./devcli/experiments.js";
42
44
  // vidfarm-devcli — command-line bridge for the Vidfarm video studio. The
@@ -120,6 +122,31 @@ Account (persisted login — points the CLI + \`serve\` at cloud prod):
120
122
  download (a downloader SEARCH, not a rotting link), and
121
123
  the vidfarm clipper / raws scan follow-up. Try browser control
122
124
  or "vidfarm raws scan" first.
125
+ consult [step] THE CONSULTATION / BRAINSTORM CHAIN, KEYLESS AND LOCAL.
126
+ The cloud runs these as brainstorm/* primitives that need
127
+ a provider key or wallet credits. This prints the IDENTICAL
128
+ prompt for YOU (the agent already in this terminal) to
129
+ answer — $0, no key, no network. Bare "consult" = the map
130
+ of the four steps + which artifacts already exist.
131
+ Every step reads and updates CONTEXT.md in --dir, the
132
+ durable answer file, so a later session starts warm.
133
+ Run the whole chain from ONE working folder.
134
+ (aliases: consultation, brainstorm)
135
+ coldstart [--short] The interview → OFFER.md. Ask the human the questions a
136
+ few at a time; never invent their answers. --short is a
137
+ fixed 6-question form for a director in a hurry, and it
138
+ still feeds every later step. (alias: interview)
139
+ awareness Which awareness stage to sell to → awareness-levels.md
140
+ angles Persuasive angles → persuasive-angles.md
141
+ [--problem-awareness problem_unaware|problem_aware]
142
+ [--solution-awareness solution_unaware|solution_aware]
143
+ hooks Openings to test → ad-hooks.md (grade them before showing)
144
+ placement --video <p> Native product-placement moments in an existing video
145
+ --offer <text|path> The offer. Auto-reads OFFER.md / OFFER_<NAME>.md from --dir.
146
+ --count <n> How many questions/angles/hooks (default 12)
147
+ --refs Inline the full SELLING_*.md references, exactly as the
148
+ cloud prompt does. Off by default: ~34KB of your context.
149
+ --json The brief as data (prompt, steps, artifact, next)
123
150
  storyboard [dir] The PLAN pass: read the project's STORYBOARD.md (ordered
124
151
  frames + duration/status/src/scene/voiceover, plus SCRIPT.md).
125
152
  The editor renders this file in its Storyboard view — a
@@ -694,6 +721,32 @@ Speech (TTS/STT) — LOCAL-FIRST on your own AI key; --cloud is the explicit bac
694
721
  --free List the $0 local Kokoro voices instead (--all lists both rosters)
695
722
  --own-key List voices on your own saved ElevenLabs key (default: platform account)
696
723
  --limit <n> | --json Show more / raw JSON
724
+ media <type> "<query>" Search the FREE stock catalog — no AI spend, no wallet cost.
725
+ type: image|vector|icon|video|bgm|sfx. Openverse (CC images,
726
+ music, SFX) and iconify (icons) are KEYLESS; a free Pixabay
727
+ key adds photos/vectors/stock video.
728
+ --provider <p> Force pixabay|openverse|iconify|iconscout
729
+ --limit <n> | --json
730
+ iconscout "<query>" DESIGNER icons, STICKERS, illustrations, 3D and Lottie —
731
+ THE CHEAP ALTERNATIVE TO AI IMAGE GENERATION. Reach for this
732
+ BEFORE 'generate' / 'image': an AI sticker costs cents per
733
+ attempt, needs a prompt loop, and rarely returns a clean
734
+ transparent vector; IconScout returns a finished SVG or
735
+ transparent PNG on the first try. Search is FREE.
736
+ Works with NO key — vidfarm's own IconScout subscription
737
+ serves premium downloads for a tiny wallet charge.
738
+ --asset <a> icon (default)|illustration|3d|lottie|ai_image
739
+ --style <s> sticker|flat|line|glyph|gradient|isometric|rounded|doodle|
740
+ dualtone|colored-outline|tile (--style sticker = STICKERS)
741
+ --free Free assets only ($0, credit required). --premium for the
742
+ paid catalog (no credit line needed)
743
+ --sort <s> relevant (default)|popular|latest|featured
744
+ --limit <n> --page <n> --json
745
+ iconscout get <uuid> Download ONE asset to a durable vidfarm URL you can place.
746
+ --format <f> icon svg|png · illustration svg|png|eps · 3d png|gltf|glb|
747
+ obj|fbx|blend · lottie json|lottie|gif|mp4 (default: first valid)
748
+ --size <px> Pixel size for raster formats (default 512; vectors ignore it)
749
+ --out <file> Also save the file locally
697
750
  stt <file|url> Video or audio → transcript (alias: transcribe). LOCAL: local ffmpeg demux +
698
751
  Returns BOTH formats: the simple subtitle your provider key (gemini labels
699
752
  version (plain text + timed SRT cues) and speakers; openai/openrouter give
@@ -787,20 +840,30 @@ Local media engines & toolchain (all local, free, no account — no cloud key ne
787
840
  lint <dir|composition.html> Validate a composition on disk (same (local)
788
841
  checks the /editor chat preflights); prints
789
842
  errors/warnings, exit 1 on errors [--json]
790
- qa <dir|composition.html> Social-native QA pass — HIGHLY RECOMMENDED (local, devcli-only)
791
- on every video you produce. Blocklists "HTML
792
- slop" (CTA buttons, benefit chip rows, frosted
793
- cards, gradient text, web-page classes/fonts)
794
- and checks the caption font regime + safe zone.
795
- Feedback only: exits 0 even when it finds slop,
796
- and it never runs automatically. Blocklist, not
797
- allowlist — unusual styles pass untouched
843
+ qa <dir|composition.html> Social-native QA pass — OPTIONAL. (local, devcli-only)
844
+ Blocklists "HTML slop" (CTA buttons, benefit
845
+ chip rows, frosted cards, gradient text,
846
+ web-page classes/fonts) and checks the caption
847
+ font regime + safe zone. Feedback only: exits 0
848
+ even when it finds slop, and it never runs
849
+ automatically. Blocklist, not allowlist —
850
+ unusual styles pass untouched. Skip it freely;
851
+ watching the render is the review that counts
798
852
  --harness <name|path> Grade against a HARNESS.md too (repeatable —
799
853
  they stack). A built-in name or ANY file path.
800
854
  <dir>/HARNESS.md is picked up automatically
801
855
  --no-harness Skip HARNESS.md auto-discovery
802
856
  --json Machine-readable findings (rule/severity/fix)
803
857
  --strict Also exit 1 when slop is found (for CI)
858
+ --max-revisions <n> REVISION GOVERNOR (default 1, 0 disables). qa counts
859
+ how many times the composition CHANGED between passes
860
+ — re-running on an untouched file is free — and at the
861
+ limit it WITHHOLDS the findings and tells you to ship
862
+ or ask the human. That's the base case that stops a
863
+ qa -> fix -> qa loop: one pass names the slop, one fix
864
+ clears it, and what's left is nearly always taste, not
865
+ a defect. Raise it when the human asks for another round
866
+ --reset-revisions Start the revision count over
804
867
  harness <sub> HARNESS.md — the reusable AI harness for ONE (local, devcli-only)
805
868
  format or template: what makes it special,
806
869
  written down so an agent can reproduce it.
@@ -809,7 +872,7 @@ Local media engines & toolchain (all local, free, no account — no cloud key ne
809
872
  template_id" all land here
810
873
  harness list [--json] Bundled starting points: short-form,
811
874
  hooks, ugc-testimonial, explainer,
812
- product-demo
875
+ product-demo, product-explainer
813
876
  harness show <name|path> Print one [--dna <strand>] to print just
814
877
  one strand (viral_dna, visual_dna, …)
815
878
  harness init <name> [--out <p>] Copy one next to your work, then EDIT it
@@ -889,10 +952,31 @@ Account:
889
952
  whoami Show the authenticated account → GET /api/v1/user/me
890
953
  provider-keys List saved AI provider keys → GET /api/v1/user/me/provider-keys
891
954
  add-provider-key <provider> <secret> Save an AI provider key → POST /api/v1/user/me/provider-keys
955
+ provider: openai|gemini|openrouter|perplexity|nvidia|elevenlabs|pixabay|iconscout
956
+ (iconscout takes BOTH values as one secret: <client_id>:<client_secret>)
892
957
 
893
958
  Agent skill (the director knowledge — a full copy SHIPS INSIDE this CLI):
959
+ ideas [topic] "What should I post?" — the 50-frame ANGLE BANK (local — offline, free, no AI)
960
+ (the rise of · what everyone gets wrong · then vs
961
+ now · one decision that changed everything · …).
962
+ One offer poured into 50 frames is 50 DIFFERENT
963
+ videos, not 50 rewrites of one. It hands over the
964
+ frames; you fill them with the director's offer,
965
+ then write hook/loop/payoff/bait per pick
966
+ --topic "<offer>" Print each frame already filled with your topic
967
+ --family <name> One family only (arc, contrast, pivot, …)
968
+ --families List the families and their sizes
969
+ --count <n> Sample N, spread across families (default 20 with --topic)
970
+ --json Machine-readable frames (+ starter lines)
971
+ skill topics The craft this pack knows, by SPOKEN name — (local — offline, no account)
972
+ meme-recaption, product-explainer, captions,
973
+ first-frame, blurred-plate, density, avatar, …
974
+ each mapped to its file and section
894
975
  skill ls List every file in the bundled pack, with sizes (local — offline, no account)
895
- skill show <path> Print one file. Shorthand works: \`skill show
976
+ skill show <path|topic> Print one file or just the SECTION a topic
977
+ names: \`skill show meme-recaption\` prints the
978
+ recaption method, not the 650-line reference it
979
+ lives in. Shorthand works too: \`skill show
896
980
  primitives\`, \`skill show harnesses/README.md\`
897
981
  skill search "<term>" Grep all of it — the fastest way to find the one
898
982
  paragraph you need without loading a whole file
@@ -1239,6 +1323,11 @@ async function main() {
1239
1323
  case "media":
1240
1324
  await runMediaCommand(rest);
1241
1325
  return;
1326
+ case "iconscout":
1327
+ case "icons":
1328
+ case "stickers":
1329
+ await runIconScoutCommand(rest);
1330
+ return;
1242
1331
  case "stt":
1243
1332
  case "transcribe":
1244
1333
  await runSttCommand(rest);
@@ -1334,6 +1423,13 @@ async function main() {
1334
1423
  case "hand-off":
1335
1424
  await runHandoffCommand(rest);
1336
1425
  return;
1426
+ // The brainstorm chain with no AI key: the prompt goes to the agent that is
1427
+ // already here, not to a provider. "consultation" is the director's word.
1428
+ case "consult":
1429
+ case "consultation":
1430
+ case "brainstorm":
1431
+ await runConsultCommand(rest);
1432
+ return;
1337
1433
  case "storyboard":
1338
1434
  case "plan":
1339
1435
  await runStoryboardCommand(rest);
@@ -1342,6 +1438,12 @@ async function main() {
1342
1438
  case "experiments":
1343
1439
  await runExperimentCommand(rest);
1344
1440
  return;
1441
+ // "what should I post?" — the 50-frame angle bank, read off the bundled pack.
1442
+ case "content-ideas":
1443
+ case "idea":
1444
+ case "ideas":
1445
+ await runIdeasCommand(rest);
1446
+ return;
1345
1447
  case "update-skill":
1346
1448
  case "skill":
1347
1449
  await runUpdateSkillCommand(rest);
@@ -2509,15 +2611,17 @@ Rules:
2509
2611
  - If narration must be customized, default to premium ElevenLabs first, then the user's own ElevenLabs path, then BYOK OpenAI/Gemini/OpenRouter. If captions or scenes were timed to the old VO, retime them to the new narration.
2510
2612
  - NO HTML SLOP. You are editing HTML, but the output is a social video, not a web page. THE TEST IS THE NATIVE-EDITOR TEST: could you have made this element with the tools inside TikTok's own editor? That toolset is a font, a color, a stroke/outline, a soft shadow, a tight text box, alignment, opacity, rotation, animation presets — plus stickers, emoji, drawn marks and clips. It has NO padded capsule, NO border, NO gradient fill, NO blur panel, NO card. If you reached past it, cut it. Never author landing-page furniture: CTA "buttons" (a filled/gradient rounded capsule with action copy like "Sign Up for a Free Trial →"), benefit chip/badge rows ("✓ No Credit Card Needed"), bordered/shadowed/frosted cards holding a headline + URL, gradient text fills, feature grids, bulleted lists, or web-default fonts (Inter/Roboto/Arial/system-ui). AND NOT A SINGLE PILL EITHER: one lonely rounded, padded, filled capsule around a static stat or label — "10 hrs / week", "STEP 2", "EP.01", "+40%" — is a web badge, and being the only one on screen does not make it native. The ONLY legitimate capsule in a video is the active-word spotlight/karaoke caption highlight, because it moves with the spoken word. Emphasize a stat the way the editor would: bigger, heavier, ALL-CAPS, an accent color, a hand-drawn circle or underline, or its own beat on screen. Rule of thumb on anything holding words: border-radius over ~8px PLUS a background fill PLUS padding = a badge; drop the fill or drop the radius until the band hugs the glyphs. None of this appears in a real TikTok, and nothing in a video is clickable — say it as timed text on the footage instead. Arrows, scribble/underline marks, italics, ALL-CAPS, single-word color pops, emoji, transparent cut-out stickers, and mock social UI (iMessage bubbles, comment cards) are all fine. Captions use an imported family (Montserrat default / TikTok Sans / Abel / Source Code Pro / Yesteryear) at weight 700-900, ~36-64px on a 1080-wide frame, inside the 8%-85% safe zone, with exactly one of four backgrounds: outline, plain, an active-word spotlight/karaoke pill, or a tight-hugging solid band (radius <=8px, no border/shadow/gradient/blur).
2511
2613
  - STRUCTURE BEFORE POLISH — THE FOUR CHARGES, WRITTEN BEFORE YOU TOUCH THE TIMELINE. Most agent-made videos fail on structure, not polish, because the timeline is the fun part so it gets built first and the words get retrofitted. Invert it: (1) HOOK — write the opening line as text first: a complete clause (subject + verb), no jargon, naming a SITUATION ("I've quit six businesses") not a label ("anonymity"); it goes on screen at start:0, because caption chunk 1 is read before any audio and muted autoplay is the default. Banned openings: throat-clearing ("so I was thinking", "here's the thing"), a logo, a title card, a fade from black, context before the claim. (2) LOOP — one open question by 0:10, said ON SCREEN, closing INSIDE this video (state the timestamp it closes at; if you can't, there is no loop), and the withheld answer must be one the viewer CANNOT supply themselves — a formally-correct loop with a guessable answer passes every mechanical check and dies in the field. (3) PAYOFF — shown, not summarized, ≥5 uninterrupted seconds, landing BEFORE the final beat; the payoff is not the CTA. (4) BAIT — one ask in the final beat and in the post caption; a keyword comment ask ("comment CLIPPER and I'll send the breakdown") is standard and allowed, but never "follow for part two", ragebait, or an earnings/health claim traded for the reply. Then build the timeline. Re-theming a decomposed template: viral_dna already names the source's hook/retention/payoff — rebuild each charge for the new subject, never flatten the loop into a product statement. Full craft harness: the vidfarm skill's references/hooks-and-virality.md. Checkable form: \`vidfarm harness show hooks\`.
2614
+ - ORIENT THE COLD VIEWER IN THE FIRST 3 SECONDS — THE VIEWER HAS NO CONTEXT AND DID NOT CHOOSE THIS VIDEO. Distinct from the hook: the hook makes them WANT to watch, orientation makes the watching POSSIBLE. A stranger mid-scroll must be able to answer three things by ~3s — what am I looking at (the CATEGORY noun), who is it for, and why is this on my screen (the situation). The failure is not a bad first frame, it is a good video that BEGINS AT BEAT TWO, and the author cannot see it because the author already knows what the thing is. Signatures, each a rebuild not a polish: a pronoun with no referent ("it just works", "this changes everything", "here's how they do it"); starting at step three (the process already running, the dashboard already full); a metaphor whose subject only lands at 6s; insider vocabulary, a product's own feature name, or an ACRONYM in the first line; a detail crop that reads as texture until you know the whole. Instead, the opening beat is BOTH channels at once: an EASY IMAGE (one large subject, already moving, legible at a glance and at thumbnail scale — a relevant die-cut sticker names the category before a word is read) AND an EASY LINE (first spoken sentence one clause, <=12 words, everyday words, concrete noun + verb, no subordinate clause, brand name said once plainly, and the CATEGORY named: "X is a language app that…"). Give the SITUATION, not the label — "the end of the month, and your receipts are in a shoebox" orients, "expense automation" does not. THIS IS NOT AN INTRO AND COSTS NO EXTRA SECONDS: it replaces the wind-up sentence, it never precedes it, and it never licenses a logo, a title card or a fade from black. Test it on the render, not the script: play the first 3 seconds ONLY to somebody with no context and stop — they should say what kind of thing it is and roughly who it is for. "Something about audio" is a fail. Fullest form: \`vidfarm harness show product-explainer\` (Rule 0).
2512
2615
  - THE FIRST FRAME IS THE THUMBNAIL. Frame 0 is one frame of ~30 in the first second, but every feed card, share link, and paused player freezes on it — more people see that frame than watch the video. It must never be black, empty, mid-fade, or mid-animation: a real visual at start:0 (\`vidfarm retime . --layer <key> --start 0\`), the hook words already on screen at t=0, and NO entrance transition on the FIRST clip (\`vidfarm transitions set . --layer <key> --in none\`; junction transitions between later clips are fine). Look at the actual pixels before you render: \`vidfarm stills . --at 0\`.
2513
2616
  - REVIEW THE WHOLE VIDEO AS ONE OBJECT — AND NEVER JUDGE IT BY ONE FRAME. Assume your own finished video has a defect you cannot see: across a 32-video batch, EVERY first-pass video had a real defect its own author had already reported as "verified, looks good". The cause is structural — you build scene by scene, each scene correct while it is the whole world, so every scene passes alone and the video fails as a SEQUENCE: margins shift between beats, headline sizes drift, the accent color wanders, one asset is flat vector and the next is photographic, every beat is the same length, a join lands like a slap. Nobody watches a scene; they watch the sequence. So before you call anything done, tile ~12 stills into ONE contact sheet and READ IT AS AN IMAGE — one command: \`vidfarm stills . --sheet\` (add \`--at 0,2,4,…\` to pick timestamps; writes stills/contact-sheet.png). Check: visual balance (no dead band under top-anchored content), consistent spacing/margins, ONE type scale, ONE accent color, ONE illustration style, deliberate pacing rather than N identical beats, nothing jarring at the joins, no frame where two elements compete for the eye — and the summary question, does it look like one person made it in one sitting? Fix drift by defining the SYSTEM (type scale, margin, palette, default beat) and applying it to every scene, not by patching the one scene that stood out. The defects that actually ship, in observed frequency order: large flat dead regions · a placeholder empty state that reads as a failed render · two contradictory numbers in one frame · a CTA still building at the last frame (settle it >=2s before the end) · two headlines superimposed at a scene handoff (exit at nextIn-0.18, duration 0.24, ease power2.out) · type colliding with a busy background exactly as it is spoken. If a frame looks empty, sample 0.2s apart to see whether it RESTS there — a transient wipe frame is fine, >0.5s is a hole. AND ALWAYS COMPARE TWO FRAMES FROM DIFFERENT SCENES: a frozen render (an overlay/watermark pass missing \`-loop 1\`, or assets outside the composition root so the timeline never runs) makes every frame identical while duration, frame count and audio hash all still pass, and frame 0 looks perfect. Verify audio by MEASUREMENT, never "it sounds fine" (you cannot hear it): ~12-15 dB speech-over-bed separation across the actual word spans, peak <0 dBFS. Never \`adelay\` the VO — whisper word timings and every caption built from them are relative to the raw vo.wav; use apad+atrim. Report what you MEASURED separately from what you JUDGED. Full method: the vidfarm skill's references/reviewing-renders.md.
2514
- - THE HARNESS IS A FIRST-CLASS ARTIFACT — KNOW THE THREE PHRASINGS. A HARNESS.md is the reusable AI harness for ONE format or template: what makes it special, written down so an agent reproduces it without the director in the room. "Create me a harness" → \`vidfarm harness init short-form --out ./HARNESS.md\` (bases: short-form, hooks, ugc-testimonial, explainer, product-demo), then EDIT it with them. "Update the harness for this format" → open the file and write the new rule in WITH ITS REASON on the same line. "Give me the harness for this template_id" → they mean the DECOMPOSITION: \`vidfarm harness derive <forkId>\` distils this fork's viral/visual/structural/audio/build DNA into an editable HARNESS.md, keyed the same way the decompose JSON is (\`## Viral DNA\` → \`viral_dna\`, …); \`vidfarm harness show <ref> --dna visual\` prints one strand. \`vidfarm qa .\` picks up ./HARNESS.md automatically; \`--harness <name|path>\` adds more (they stack, and any file of theirs anywhere is valid). Its \`checks:\` are machine-settled; its \`- [ ]\` items come back for YOU to answer honestly in your report — never claim a pass on the half the CLI can't judge. ONE-TIME OR BULK? Ask before you build: if the director wants volume (daily posting, N variants, hook tests), that's SCRIPTING MODE — pin this fork as the base, vary exactly ONE thing per variant, and install a harness, because nobody watches variant #37 as carefully as #1. When a batch teaches you something, write it back into the harness — the compositions are disposable, the harness compounds. (Formerly QA_REGIME.md; \`vidfarm regime …\` still works as an alias. NOTE: the \`.harness/\` directory beside this file is machine-generated context regenerated on every pull — never hand-edit it. HARNESS.md is the one you own.)
2617
+ - THE HARNESS IS A FIRST-CLASS ARTIFACT — KNOW THE THREE PHRASINGS. A HARNESS.md is the reusable AI harness for ONE format or template: what makes it special, written down so an agent reproduces it without the director in the room. "Create me a harness" → \`vidfarm harness init short-form --out ./HARNESS.md\` (bases: short-form, hooks, ugc-testimonial, explainer, product-demo, product-explainer), then EDIT it with them. "Update the harness for this format" → open the file and write the new rule in WITH ITS REASON on the same line. "Give me the harness for this template_id" → they mean the DECOMPOSITION: \`vidfarm harness derive <forkId>\` distils this fork's viral/visual/structural/audio/build DNA into an editable HARNESS.md, keyed the same way the decompose JSON is (\`## Viral DNA\` → \`viral_dna\`, …); \`vidfarm harness show <ref> --dna visual\` prints one strand. \`vidfarm qa .\` picks up ./HARNESS.md automatically; \`--harness <name|path>\` adds more (they stack, and any file of theirs anywhere is valid). Its \`checks:\` are machine-settled; its \`- [ ]\` items come back for YOU to answer honestly in your report — never claim a pass on the half the CLI can't judge. ONE-TIME OR BULK? Ask before you build: if the director wants volume (daily posting, N variants, hook tests), that's SCRIPTING MODE — pin this fork as the base, vary exactly ONE thing per variant, and install a harness, because nobody watches variant #37 as carefully as #1. When a batch teaches you something, write it back into the harness — the compositions are disposable, the harness compounds. (Formerly QA_REGIME.md; \`vidfarm regime …\` still works as an alias. NOTE: the \`.harness/\` directory beside this file is machine-generated context regenerated on every pull — never hand-edit it. HARNESS.md is the one you own.)
2515
2618
  - DEDUPLICATE BEFORE YOU PUBLISH — AND ASK FIRST. Social platforms fingerprint every upload, so the same render posted twice (a second account, another platform, a re-post next month) gets the later copy suppressed as duplicate/reused content. BEFORE you render for publication, and before any bulk run, ASK the director: "do you want deduplicated copies for posting, and how many?" Ask THEN, not after — dedupe is a post-render ffmpeg pass, so the correct order is RENDER ONCE → DEDUPE N, and deciding late means paying for a second render. Run it on the EXPORTED file: \`vidfarm dedupe ./final.mp4\` (one copy) or \`vidfarm dedupe ./final.mp4 --variants N --seed <slug> --out-dir ./posts\` (N copies, one per account/slot). Free, offline, no wallet — it never re-renders the composition. The default \`standard\` preset is skew 2%, zoom 3%, rotate 2°, speed +2%, saturation +4%, plus contrast/brightness/hue/grain, a container-metadata strip and a per-variant CRF walk; invisible to a viewer, and each variant differs from the original AND from its siblings. Post each variant to a DIFFERENT account — two accounts posting the same variant defeats the point. A rotate forces a bigger centre-crop to hide the black corners (~6.7% on a tall frame at 2°) and the CLI says so; pass \`--rotate 0\` when framing matters more. Cloud twin: \`POST /api/v1/primitives/media/dedupe\`.
2516
2619
  - QA EVERY VIDEO BEFORE YOU RENDER: run \`vidfarm qa .\` in this directory. It's free, instant, and local — a blocklist for the slop above plus the first frame, the font regime, and the safe zone, with a concrete fix per finding. It's feedback, not a gate (exits 0 even on findings, never runs automatically) and a blocklist, not an allowlist, so stylized or hand-made work passes untouched. Fix what's real, ignore what's a deliberate style call. \`--json\` for scripted batches.
2517
2620
 
2518
2621
  The three paintbrushes (Vidfarm is thrift-first — do NOT spend AI credits on every scene):
2519
2622
  - Paint each REPLACE beat with one of three brushes, cheapest first: (1) RAW CLIPS remixed from existing footage (\`vidfarm raws search\` the local/library first, then \`vidfarm raws scan <url|file>\` to hunt new ones — free local compute); (2) HTML/JS HYPERFRAMES — animate text/images/logos/stickers/charts with CSS or JS adapters (anime.js/GSAP/Lottie/Three) for titles, kinetic captions, data beats, brand cards; (3) PURE AI GENERATION (\`vidfarm generate image|video\`) — most expensive, AI video especially, last resort for beats no clip or hyperframe can cover.
2520
2623
  - A background video + a foreground video (greenscreen / picture-in-picture) covers most "video meme" formats with zero generation.
2624
+ - IF THE DIRECTOR GAVE YOU A WEBSITE (a product explainer / client brand video), THAT SITE IS THE FIRST ASSET LIBRARY — harvest before you buy or generate, unless they said not to use their site art. Take product screenshots and UI states, brand illustrations, mascots, spot art and icons, the palette and their own words, any animated WebP/GIF (free motion footage — extract frames to a sprite sheet), an SPA's manifest.json screenshots[], and best of all a screen recording in the JS bundle (that is A-roll). \`vidfarm capture <url>\` renders the page and pulls assets; \`vidfarm mask <image> --crop x,y,w,h\` cuts ONE element out of a screenshot into a snug transparent PNG with local matting for $0 (\`--flat <hex>\` on a solid background), repeatable to lift a whole cast out of one image; then place + keyframes it like any sticker. The order is HARVEST -> ICONSCOUT CATALOG -> GENERATE, and it is on-brand by construction, free, and truthful (a screen off their live site cannot claim what they do not claim). Two limits: harvest the ASSETS, never the landing-page furniture (no CTA capsules, feature grids, pricing cards, chip rows — a video is not a web page), and treat obvious stock photography as licensed to THEM, not to you. Say in your report which assets came from the client's own site. Full rule: \`vidfarm harness show product-explainer\` (Rule 5b).
2521
2625
  - Reusable asset library (logos, stickers, reactions, b-roll, a-roll, brand media kit): have an opinion on when/where to reuse — but anchor every asset choice to the viral DNA + harness above. Reskinning past a load-bearing beat kills what made the format work. AI-generate a reusable element ONCE, then reuse it; don't regenerate per-scene.
2522
2626
 
2523
2627
  Two replication harnesses — pick one and name it to the user (default A). When \`replication-harness.json\` is present it holds a CONCRETE, per-beat version of both plans (see "Replication plan" below) — prefer its beat assignments over freestyling; this prose is the fallback when it's absent:
@@ -4525,7 +4629,10 @@ async function runGenerateCommand(argv) {
4525
4629
  estimate: "cheap, ~$0.01–$0.05",
4526
4630
  freeAlternative: 'free stock image/vector — vidfarm media search "<meaning>" --type image|vector ($0). ' +
4527
4631
  "Openverse (CC images) is keyless and always on — check it first; a free Pixabay key adds " +
4528
- "photos/vectors and may already be saved (check vidfarm provider-keys)",
4632
+ "photos/vectors and may already be saved (check vidfarm provider-keys). " +
4633
+ "If the image is an ICON, STICKER, illustration, 3D prop or Lottie, do NOT generate it at all — " +
4634
+ 'vidfarm iconscout "<meaning>" --style sticker returns a designer\'s finished transparent asset ' +
4635
+ "for $0 (free tier, credit required) or a few cents, with no prompt loop",
4529
4636
  interactiveAlternative: 'hand the user an image brief — vidfarm handoff image --theme "<what>" --items "a,b,c" — they run it ' +
4530
4637
  "in a free web generator (meta.ai / ChatGPT / Gemini) and drop the PNG back; needing several graphics " +
4531
4638
  "makes it ONE sticker sheet that vidfarm sticker-pack splits for $0"
@@ -7696,7 +7803,10 @@ async function runMediaCommand(argv) {
7696
7803
  const items = Array.isArray(body.items) ? body.items : [];
7697
7804
  console.log(`${DIM}${items.length} ${type} result(s) for "${query}" via [${(body.providers_used ?? []).join(", ") || "none"}]${RESET}`);
7698
7805
  if (!items.length) {
7699
- console.log(`${DIM}No results. Try a broader query, another --type, or a specific --provider (pixabay|openverse|iconify).${RESET}`);
7806
+ console.log(`${DIM}No results. Try a broader query, another --type, or a specific --provider (pixabay|openverse|iconify|iconscout).${RESET}`);
7807
+ if (type === "icon" || type === "vector") {
7808
+ console.log(`${DIM}(for icons/STICKERS/illustrations/3D/Lottie try 'vidfarm iconscout "${query}" --style sticker' — a much deeper designer catalog, and far cheaper than generating one with AI.)${RESET}`);
7809
+ }
7700
7810
  if (type === "image" || type === "vector" || type === "video") {
7701
7811
  console.log(`${DIM}(photos/vectors/video need YOUR OWN free Pixabay key — get one at https://pixabay.com/api/docs/ then save it: 'vidfarm add-provider-key pixabay <key>'. openverse covers CC images keyless.)${RESET}`);
7702
7812
  }
@@ -7710,6 +7820,124 @@ async function runMediaCommand(argv) {
7710
7820
  }
7711
7821
  console.log(`${DIM}Attribution shown for CC-BY-style items — include it when you use them. Pixabay/CC0 need none.${RESET}`);
7712
7822
  }
7823
+ // IconScout — designer icons / STICKERS / illustrations / 3D / Lottie.
7824
+ //
7825
+ // This is the CHEAP path, and the CLI says so loudly: an AI image attempt costs
7826
+ // cents and a prompt loop for a sticker a designer already drew. Search is free,
7827
+ // so there is no cost-mode gate on it; only `iconscout get` can spend, and only
7828
+ // on a PREMIUM asset running on the platform subscription.
7829
+ async function runIconScoutCommand(argv) {
7830
+ const ASSETS = ["icon", "illustration", "3d", "lottie", "ai_image"];
7831
+ const parsed = parseArgs({
7832
+ args: argv,
7833
+ allowPositionals: true,
7834
+ options: {
7835
+ ...commonOptions(),
7836
+ asset: { type: "string", short: "a" },
7837
+ style: { type: "string" },
7838
+ format: { type: "string", short: "f" },
7839
+ sort: { type: "string" },
7840
+ free: { type: "boolean" },
7841
+ premium: { type: "boolean" },
7842
+ limit: { type: "string" },
7843
+ page: { type: "string" },
7844
+ size: { type: "string" },
7845
+ out: { type: "string" }
7846
+ }
7847
+ });
7848
+ const ctx = commonContext(parsed.values);
7849
+ const positionals = parsed.positionals.slice();
7850
+ const sub = (positionals[0] ?? "").toLowerCase();
7851
+ // ── iconscout get <uuid> — download one asset ────────────────────────────
7852
+ if (sub === "get" || sub === "download") {
7853
+ const uuid = positionals[1];
7854
+ if (!uuid)
7855
+ throw new Error('iconscout get requires an asset uuid (from `vidfarm iconscout "<query>"`).');
7856
+ const size = Number(parsed.values.size ?? "512") || 512;
7857
+ const body = { uuid };
7858
+ if (parsed.values.format)
7859
+ body.format = String(parsed.values.format).toLowerCase();
7860
+ if (parsed.values.size) {
7861
+ body.width = size;
7862
+ body.height = size;
7863
+ }
7864
+ const res = await apiRequest({
7865
+ method: "POST", host: ctx.host, path: "/api/v1/primitives/iconscout/download", auth: ctx.auth, body
7866
+ });
7867
+ assertApiOk(res, "iconscout get");
7868
+ const out = (res.json ?? {});
7869
+ if (ctx.json) {
7870
+ printJson(out);
7871
+ return;
7872
+ }
7873
+ console.log(`${GREEN}${out.url}${RESET}`);
7874
+ const cost = out.billed ? `$${out.charged_usd} wallet` : out.is_free ? "$0 (free asset)" : "$0 (your own IconScout key)";
7875
+ console.log(`${DIM} ${out.name} · ${out.asset}/${out.format} · ${out.size_bytes} bytes · ${cost}${RESET}`);
7876
+ if (out.attribution_required && out.attribution) {
7877
+ console.log(`${RED} ⚠ credit required: ${out.attribution}${RESET}`);
7878
+ }
7879
+ if (parsed.values.out) {
7880
+ const dest = path.resolve(process.cwd(), String(parsed.values.out));
7881
+ const fileRes = await fetch(out.url, { headers: buildAuthHeaders(ctx.auth) });
7882
+ if (!fileRes.ok || !fileRes.body)
7883
+ throw new Error(`Could not save the asset: ${fileRes.status}.`);
7884
+ await pipeline(Readable.fromWeb(fileRes.body), createWriteStream(dest));
7885
+ console.log(`${DIM} saved → ${dest}${RESET}`);
7886
+ }
7887
+ console.log(`${DIM}Place it with: vidfarm set-media <dir> --src "${out.url}" --replace <layer_key>${RESET}`);
7888
+ return;
7889
+ }
7890
+ // ── iconscout "<query>" — search ─────────────────────────────────────────
7891
+ const query = (sub === "search" || sub === "find" ? positionals.slice(1) : positionals).join(" ").trim();
7892
+ if (!query) {
7893
+ console.error(`${RED}iconscout: a search query is required${RESET}`);
7894
+ console.error(`${DIM}e.g. vidfarm iconscout "pineapple" --style sticker | vidfarm iconscout "rocket" --asset 3d${RESET}`);
7895
+ process.exit(2);
7896
+ }
7897
+ const asset = String(parsed.values.asset ?? "icon").toLowerCase();
7898
+ if (!ASSETS.includes(asset)) {
7899
+ console.error(`${RED}iconscout: --asset must be one of: ${ASSETS.join(", ")}${RESET}`);
7900
+ process.exit(2);
7901
+ }
7902
+ const qs = new URLSearchParams({ q: query, asset });
7903
+ if (parsed.values.free)
7904
+ qs.set("price", "free");
7905
+ else if (parsed.values.premium)
7906
+ qs.set("price", "premium");
7907
+ if (parsed.values.style)
7908
+ qs.set("style", String(parsed.values.style).toLowerCase());
7909
+ if (parsed.values.format)
7910
+ qs.set("format", String(parsed.values.format).toLowerCase());
7911
+ if (parsed.values.sort)
7912
+ qs.set("sort", String(parsed.values.sort).toLowerCase());
7913
+ qs.set("limit", String(Number(parsed.values.limit ?? "20") || 20));
7914
+ qs.set("page", String(Number(parsed.values.page ?? "1") || 1));
7915
+ const res = await apiRequest({
7916
+ method: "GET", host: ctx.host, path: `/api/v1/primitives/iconscout/search?${qs.toString()}`, auth: ctx.auth
7917
+ });
7918
+ assertApiOk(res, "iconscout search");
7919
+ const body = (res.json ?? {});
7920
+ if (ctx.json) {
7921
+ printJson(body);
7922
+ return;
7923
+ }
7924
+ const items = Array.isArray(body.items) ? body.items : [];
7925
+ console.log(`${DIM}${items.length} of ${body.total ?? items.length} ${asset} result(s) for "${query}" (page ${body.page ?? 1}/${body.last_page ?? 1})${RESET}`);
7926
+ if (!items.length) {
7927
+ console.log(`${DIM}No results. Try a broader query, another --asset, or drop --style.${RESET}`);
7928
+ return;
7929
+ }
7930
+ for (const it of items) {
7931
+ const price = it.is_free ? `${GREEN}free${RESET}` : `${DIM}premium${RESET}`;
7932
+ console.log(`${GREEN}${it.uuid}${RESET} ${it.name} [${price}${DIM}]${RESET}`);
7933
+ console.log(`${DIM} ${it.asset} · formats ${(it.formats ?? []).join("/")} · preview ${it.preview_url ?? "—"}${RESET}`);
7934
+ }
7935
+ const perDownload = Number(body.download_usd ?? 0);
7936
+ console.log(`${DIM}Download one: vidfarm iconscout get <uuid> --format svg${RESET}`);
7937
+ if (body.account === "platform" && perDownload > 0) {
7938
+ console.log(`${DIM}Free assets cost $0 (credit required). Premium downloads run on vidfarm's IconScout subscription at ~$${perDownload} wallet each — still far cheaper than generating one with AI.${RESET}`);
7939
+ }
7940
+ }
7713
7941
  async function runSttCommand(argv) {
7714
7942
  const parsed = parseArgs({
7715
7943
  args: argv,
@@ -9276,6 +9504,8 @@ async function runExperimentCommand(argv) {
9276
9504
  console.log(`${DIM}Format defaulted to ${BOLD}${DEFAULT_FORMAT}${RESET}${DIM}. Offer the director the menu (--format sets it):${RESET}`);
9277
9505
  for (const f of EASY_FORMATS)
9278
9506
  console.log(` ${DIM}·${RESET} ${f.label.padEnd(38)} ${DIM}${f.note}${RESET}`);
9507
+ // The script's grammatical person is the fastest way to pick from that menu.
9508
+ console.log(`${DIM}Rule of thumb: copy that says ${BOLD}"I"${RESET}${DIM} → show the speaker's world (POV b-roll / talking head / process). Copy that says ${BOLD}"you"${RESET}${DIM} → meme recaption (greenscreen raw over a background image). Both finish with TikTok-native type, kinetic captions and free Kokoro VO.${RESET}`);
9279
9509
  }
9280
9510
  console.log(`${DIM}Then plan the first round: ${BOLD}vidfarm experiment round --variable angle --videos 8 --why "awareness level is the largest unknown"${RESET}`);
9281
9511
  return;
@@ -9623,6 +9853,143 @@ async function runHandoffCommand(argv) {
9623
9853
  }
9624
9854
  throw new Error('handoff needs a kind: `vidfarm handoff image --theme "…" --items "a,b,c"` (free web image gen → sticker pack) or `vidfarm handoff raws --keywords "…"` (manual clip sourcing).');
9625
9855
  }
9856
+ // `vidfarm consult [step]` — the consultation / brainstorm chain, run KEYLESS
9857
+ // and LOCAL. The cloud version of each step is a `brainstorm/*` primitive that
9858
+ // needs a provider key or wallet credits; this prints the identical prompt for
9859
+ // the agent in this terminal to answer itself, for $0.
9860
+ async function runConsultCommand(argv) {
9861
+ const parsed = parseArgs({
9862
+ args: argv,
9863
+ allowPositionals: true,
9864
+ options: {
9865
+ ...commonOptions(),
9866
+ offer: { type: "string" },
9867
+ message: { type: "string" },
9868
+ video: { type: "string" },
9869
+ count: { type: "string" },
9870
+ dir: { type: "string" },
9871
+ "problem-awareness": { type: "string" },
9872
+ "solution-awareness": { type: "string" },
9873
+ refs: { type: "boolean", default: false },
9874
+ short: { type: "boolean", default: false }
9875
+ }
9876
+ });
9877
+ const json = Boolean(parsed.values.json);
9878
+ const dir = parsed.values.dir ?? ".";
9879
+ const rawStep = (parsed.positionals[0] ?? "").trim();
9880
+ // Bare `vidfarm consult` = the map, not a wall of prompt. A director who says
9881
+ // "give me a consultation" needs to see the four steps and where they land.
9882
+ if (!rawStep) {
9883
+ const plan = planConsultation(dir);
9884
+ const context = consultContextState(dir);
9885
+ if (json)
9886
+ return printJson({ ok: true, dir: path.resolve(dir), plan, context });
9887
+ console.log(`${BOLD}Vidfarm consultation${RESET} ${DIM}— keyless and local. No provider key, no wallet, no network.${RESET}`);
9888
+ console.log(`${DIM}Each step prints the same prompt the cloud brainstorm primitive would send. YOU answer it.${RESET}\n`);
9889
+ for (const row of plan) {
9890
+ const mark = row.done ? `${GREEN}✓${RESET}` : `${DIM}·${RESET}`;
9891
+ console.log(` ${mark} ${row.command.padEnd(28)} ${DIM}→ ${row.artifact}${row.done ? " (exists)" : ""}${RESET}`);
9892
+ }
9893
+ const first = plan.find((row) => !row.done) ?? plan[0];
9894
+ console.log(`\n ${context.exists ? `${GREEN}✓${RESET}` : `${DIM}·${RESET}`} ${"saved answers".padEnd(28)} ${DIM}→ ${context.file}${context.exists ? " (read it before you ask anything)" : " (written by the first step)"}${RESET}`);
9895
+ console.log(`\nStart here: ${BOLD}${first.command}${RESET}`);
9896
+ console.log(`${DIM}In a hurry: vidfarm consult coldstart --short (6 fixed questions instead of the full interview)${RESET}`);
9897
+ console.log(`${DIM}Run every step from ONE working folder (--dir), so the artifacts and ${context.file} stay together.${RESET}`);
9898
+ console.log(`${DIM}Also: vidfarm consult placement --video <path|url> (native product placement inside an existing video)${RESET}`);
9899
+ return;
9900
+ }
9901
+ const step = resolveConsultStep(rawStep);
9902
+ if (!step) {
9903
+ throw new Error(`Unknown consult step "${rawStep}". Use one of: coldstart, awareness, angles, hooks, placement — or bare \`vidfarm consult\` for the map.`);
9904
+ }
9905
+ // coldstart is the step that PRODUCES the offer document, so it is the only
9906
+ // one that runs without one.
9907
+ let offer = "";
9908
+ if (step !== "coldstart") {
9909
+ const inline = parsed.values.offer?.trim();
9910
+ // --offer takes either a path or the offer text itself. A real file wins; a
9911
+ // string that READS like a path but resolves to nothing is an error, never
9912
+ // offer text — otherwise a typo silently consults on the filename.
9913
+ if (inline && !resolveOfferPath(dir, inline) && !looksLikeOfferPath(inline)) {
9914
+ offer = inline;
9915
+ }
9916
+ else {
9917
+ const found = findOfferFile(dir, inline);
9918
+ if ("error" in found) {
9919
+ throw new Error(found.error);
9920
+ }
9921
+ offer = found.text;
9922
+ }
9923
+ if (offer.trim().length < 10) {
9924
+ throw new Error("The offer text is too thin to consult on (under 10 characters). Fill in OFFER.md, or pass --offer \"<a paragraph about the offer>\".");
9925
+ }
9926
+ }
9927
+ const awarenessValue = (raw, allowed, flag) => {
9928
+ if (raw === undefined)
9929
+ return undefined;
9930
+ const value = raw.trim().toLowerCase();
9931
+ if (!allowed.includes(value)) {
9932
+ throw new Error(`${flag} must be one of: ${allowed.join(", ")}.`);
9933
+ }
9934
+ return value;
9935
+ };
9936
+ // --short is a fixed six-question set, so it belongs to the interview only.
9937
+ // On the other steps the equivalent knob is --count, and silently ignoring the
9938
+ // flag would let a director believe they ran a shorter angles pass.
9939
+ const short = Boolean(parsed.values.short);
9940
+ if (short && step !== "coldstart") {
9941
+ throw new Error(`--short is the short-form interview, so it only applies to \`vidfarm consult coldstart\`. For a shorter ${step} run, use --count.`);
9942
+ }
9943
+ const countRaw = parsed.values.count;
9944
+ const range = consultCountRange(step);
9945
+ if (!range && countRaw !== undefined) {
9946
+ throw new Error("consult awareness takes no --count — it returns one markdown recommendation, not a list.");
9947
+ }
9948
+ if (short && countRaw !== undefined) {
9949
+ throw new Error("--short is a fixed six-question set, so it takes no --count. Drop one of the two.");
9950
+ }
9951
+ const count = countRaw === undefined ? defaultConsultCount(step) : Number(countRaw);
9952
+ if (range && (!Number.isInteger(count) || count < range.min || count > range.max)) {
9953
+ throw new Error(`--count for ${step} must be a whole number between ${range.min} and ${range.max} (the cloud primitive enforces the same range).`);
9954
+ }
9955
+ const brief = buildConsultBrief({
9956
+ step,
9957
+ offer,
9958
+ userMessage: parsed.values.message,
9959
+ videoRef: parsed.values.video,
9960
+ count,
9961
+ problemAwareness: awarenessValue(parsed.values["problem-awareness"], ["problem_unaware", "problem_aware"], "--problem-awareness"),
9962
+ solutionAwareness: awarenessValue(parsed.values["solution-awareness"], ["solution_unaware", "solution_aware"], "--solution-awareness"),
9963
+ references: parsed.values.refs ? readSellingReferences() : undefined,
9964
+ dir,
9965
+ short
9966
+ });
9967
+ if (json) {
9968
+ return printJson({ ok: true, keyless: true, cost_usd: 0, artifact_name: CONSULT_ARTIFACTS[step], ...brief });
9969
+ }
9970
+ console.log(formatConsultBrief(brief, { bold: BOLD, dim: DIM, reset: RESET }));
9971
+ }
9972
+ // The two selling documents the CLOUD prompt inlines. Only read on --refs: they
9973
+ // are ~34KB together, which is real context spend for the local agent.
9974
+ function readSellingReferences() {
9975
+ const read = (name) => {
9976
+ for (const candidate of resolveRootFileCandidates(path.join("src", "assets", name))) {
9977
+ try {
9978
+ return readFileSync(candidate, "utf8");
9979
+ }
9980
+ catch {
9981
+ continue;
9982
+ }
9983
+ }
9984
+ return undefined;
9985
+ };
9986
+ const hooks = read("SELLING_WITH_HOOKS.md");
9987
+ const awareness = read("SELLING_AWARENESS_STAGES.md");
9988
+ if (!hooks && !awareness) {
9989
+ throw new Error("--refs needs the bundled selling references (src/assets/SELLING_*.md) and neither was found in this install. Drop --refs to use the skill-pack reference instead.");
9990
+ }
9991
+ return { hooks, awareness };
9992
+ }
9626
9993
  async function runProviderKeysCommand(argv) {
9627
9994
  const parsed = parseArgs({ args: argv, allowPositionals: false, options: commonOptions() });
9628
9995
  const ctx = commonContext(parsed.values);
@@ -9635,7 +10002,7 @@ async function runAddProviderKeyCommand(argv) {
9635
10002
  const provider = parsed.positionals[0];
9636
10003
  const secret = parsed.positionals[1];
9637
10004
  if (!provider || !secret)
9638
- throw new Error("add-provider-key requires <provider> <secret> (provider: openai|gemini|openrouter|perplexity|nvidia|elevenlabs|pixabay).");
10005
+ throw new Error("add-provider-key requires <provider> <secret> (provider: openai|gemini|openrouter|perplexity|nvidia|elevenlabs|pixabay|iconscout). IconScout packs BOTH values into one secret: <client_id>:<client_secret>.");
9639
10006
  const ctx = commonContext(parsed.values);
9640
10007
  const result = await apiRequest({ method: "POST", host: ctx.host, path: "/api/v1/user/me/provider-keys", auth: ctx.auth, body: { provider, secret, label: parsed.values.label } });
9641
10008
  assertApiOk(result, "add-provider-key");
@@ -11087,7 +11454,10 @@ async function runQaCommand(argv) {
11087
11454
  "no-harness": { type: "boolean", default: false },
11088
11455
  // Pre-rename aliases; `harness` is the name everywhere else now.
11089
11456
  regime: { type: "string", multiple: true },
11090
- "no-regime": { type: "boolean", default: false }
11457
+ "no-regime": { type: "boolean", default: false },
11458
+ // Revision governor — the base case that stops a qa→fix→qa loop.
11459
+ "max-revisions": { type: "string" },
11460
+ "reset-revisions": { type: "boolean", default: false }
11091
11461
  }
11092
11462
  });
11093
11463
  const target = parsed.positionals[0];
@@ -11095,6 +11465,19 @@ async function runQaCommand(argv) {
11095
11465
  throw new Error("qa requires a composition path: `vidfarm qa <dir-or-composition.html> [--harness <name|path>] [--json] [--strict]`.");
11096
11466
  const htmlPath = resolveCompositionHtmlPath(target);
11097
11467
  const html = readFileSync(htmlPath, "utf8");
11468
+ // Count this pass BEFORE anything is printed: at the limit qa withholds the
11469
+ // finding list, because handing an agent a fresh list of things to fix is the
11470
+ // fuel the revise-forever loop runs on.
11471
+ const maxRevisionsRaw = parsed.values["max-revisions"];
11472
+ const maxRevisions = maxRevisionsRaw !== undefined ? Number(maxRevisionsRaw) : undefined;
11473
+ if (maxRevisionsRaw !== undefined && !Number.isFinite(maxRevisions)) {
11474
+ throw new Error(`--max-revisions must be a number (0 disables the limit), got "${maxRevisionsRaw}".`);
11475
+ }
11476
+ const governor = recordQaPass(htmlPath, html, {
11477
+ max: maxRevisions,
11478
+ reset: Boolean(parsed.values["reset-revisions"]),
11479
+ now: new Date().toISOString()
11480
+ });
11098
11481
  let report = qaCompositionHtml(html);
11099
11482
  // Harness resolution, in precedence order: explicit --harness flags
11100
11483
  // (stackable) → VIDFARM_HARNESS (a default for a whole scripting run) → the
@@ -11130,11 +11513,31 @@ async function runQaCommand(argv) {
11130
11513
  watch_the_video: watchTheVideoDirective(pastablePath(workDir), render ? pastablePath(render) : null)
11131
11514
  };
11132
11515
  if (parsed.values.json) {
11133
- printJson(report);
11516
+ printJson({ ...report, revision_governor: governor });
11134
11517
  if (!report.ok && parsed.values.strict)
11135
11518
  process.exitCode = 1;
11136
11519
  return;
11137
11520
  }
11521
+ // ---- the base case ------------------------------------------------------
11522
+ // Findings are withheld, not deleted: --max-revisions raises the ceiling and
11523
+ // --reset-revisions starts the count over, both printed here so nothing is
11524
+ // hidden from a human who genuinely wants another pass.
11525
+ if (governor.limit_reached) {
11526
+ const issues = report.errors.length + report.warnings.length;
11527
+ console.log("");
11528
+ console.log(`${RED}${BOLD}■ REVISION LIMIT REACHED — STOP REVISING THIS VIDEO.${RESET}`);
11529
+ console.log(` ${DIM}${governor.revisions} revision(s) of ${path.basename(htmlPath)}, limit ${governor.max}.${RESET}`);
11530
+ console.log("");
11531
+ console.log(` ${issues === 0 ? "No findings this pass." : `${issues} finding(s) withheld.`} ${DIM}Past the limit, what's left is nearly always taste, not a defect — and re-running qa to find more is how an agent loops forever.${RESET}`);
11532
+ console.log("");
11533
+ console.log(` ${BOLD}Do one of these instead:${RESET}`);
11534
+ console.log(` ${DIM}1.${RESET} Ship it. ${DIM}Watch the render once, then publish.${RESET}`);
11535
+ console.log(` ${DIM}2.${RESET} Ask the human. ${DIM}Show them the video and let them call it.${RESET}`);
11536
+ console.log(` ${DIM}3.${RESET} Genuinely need another pass? ${BOLD}vidfarm qa ${pastablePath(path.dirname(htmlPath))} --max-revisions ${governor.max + 1}${RESET}${DIM} (or --reset-revisions to start over).${RESET}`);
11537
+ console.log("");
11538
+ console.log(formatWatchTheVideoNotice(report.watch_the_video, { yellow: YELLOW, dim: DIM, reset: RESET, bold: BOLD }));
11539
+ return;
11540
+ }
11138
11541
  const body = formatQaReport(report, { red: RED, yellow: YELLOW, green: GREEN, dim: DIM, reset: RESET });
11139
11542
  if (body)
11140
11543
  console.log(body);
@@ -11164,6 +11567,10 @@ async function runQaCommand(argv) {
11164
11567
  console.log(`${DIM}Checked mechanics only — nothing here grades the hook, the loop, the payoff, or the bait.${RESET}`);
11165
11568
  console.log(`${DIM}Structure: vidfarm harness show hooks · grade this video: vidfarm qa <dir> --harness short-form${RESET}`);
11166
11569
  }
11570
+ if (!governor.disabled && governor.revisions > 0) {
11571
+ const left = governor.max - governor.revisions;
11572
+ console.log(`${DIM}Revision ${governor.revisions} of ${governor.max}${left === 1 ? " — one more, then qa stops and you ship or ask the human." : "."}${RESET}`);
11573
+ }
11167
11574
  // Last word on every run, clean ones included: this tool never saw the video.
11168
11575
  console.log(formatWatchTheVideoNotice(report.watch_the_video, { yellow: YELLOW, dim: DIM, reset: RESET, bold: BOLD }));
11169
11576
  if (!report.ok && parsed.values.strict)
@@ -11642,6 +12049,131 @@ function devcliVersion() {
11642
12049
  * genuinely offline. Every surface below says so rather than letting an offline
11643
12050
  * read imply an offline entitlement.
11644
12051
  */
12052
+ /**
12053
+ * `vidfarm ideas` — the content-ideas angle bank, offline and free.
12054
+ *
12055
+ * WHY A COMMAND AND NOT JUST A DOC: "give me content ideas for <offer>" is one
12056
+ * of the most common asks a director makes, and the honest answer is volume —
12057
+ * 20+ titled ideas, each a DIFFERENT subject rather than 20 rewrites of one.
12058
+ * The bank of 50 reusable frames is what makes that possible without an AI call
12059
+ * and without inventing a list from memory (which drifts, repeats, and forgets
12060
+ * the contrast/pivot shapes entirely). The frames are parsed straight out of
12061
+ * the bundled reference, so the CLI and the skill can never disagree.
12062
+ *
12063
+ * It deliberately does NOT generate the titles: filling a frame needs the
12064
+ * director's offer, audience and vocabulary, which is the agent's job (or the
12065
+ * human's). This hands over the instrument and the loop, for $0.
12066
+ */
12067
+ /**
12068
+ * Join a frame to the director's topic with the connector English wants.
12069
+ * "the history of" + X is "the history of X", but "the biggest mistakes" + X is
12070
+ * "the biggest mistakes IN X" and "then vs now" + X is "X: then vs now". Naive
12071
+ * concatenation produces lines an agent then has to un-mangle, which defeats
12072
+ * the point of handing it a starter at all.
12073
+ */
12074
+ function joinIdeaFrame(frame, topic) {
12075
+ const lower = frame.toLowerCase();
12076
+ if (/\bof$/.test(lower))
12077
+ return `${frame} ${topic}`;
12078
+ if (lower.includes(" vs "))
12079
+ return `${topic}: ${frame}`;
12080
+ if (/^(the biggest|the chain reaction)/.test(lower) || lower.startsWith("one "))
12081
+ return `${frame} in ${topic}`;
12082
+ if (/^(the hidden side|the untold story|the complete|the rabbit hole)/.test(lower))
12083
+ return `${frame} of ${topic}`;
12084
+ return `${frame} — ${topic}`;
12085
+ }
12086
+ async function runIdeasCommand(argv) {
12087
+ const parsed = parseArgs({
12088
+ args: argv,
12089
+ allowPositionals: true,
12090
+ options: {
12091
+ json: { type: "boolean", default: false },
12092
+ family: { type: "string" },
12093
+ topic: { type: "string" },
12094
+ count: { type: "string" },
12095
+ families: { type: "boolean", default: false }
12096
+ }
12097
+ });
12098
+ const json = Boolean(parsed.values.json);
12099
+ const topic = String(parsed.values.topic ?? parsed.positionals.join(" ") ?? "").trim();
12100
+ const { frames, families } = loadIdeaBank();
12101
+ if (!frames.length)
12102
+ throw new Error("No bundled content-ideas reference found next to this devcli install. Fetch it with `vidfarm skills add vidfarm`.");
12103
+ if (parsed.values.families) {
12104
+ if (json)
12105
+ return printJson({ ok: true, families, frames: frames.length });
12106
+ console.log(`${DIM}${frames.length} frames in ${families.length} families:${RESET}`);
12107
+ for (const family of families) {
12108
+ console.log(` ${GREEN}${family.padEnd(22)}${RESET} ${DIM}${frames.filter((entry) => entry.family === family).length} frames${RESET}`);
12109
+ }
12110
+ console.log(`\n${DIM}vidfarm ideas --family contrast · vidfarm ideas --topic "<your offer>"${RESET}`);
12111
+ return;
12112
+ }
12113
+ const familyFilter = String(parsed.values.family ?? "").trim().toLowerCase();
12114
+ let picked = familyFilter ? frames.filter((entry) => entry.family.toLowerCase().includes(familyFilter)) : frames;
12115
+ if (familyFilter && !picked.length) {
12116
+ throw new Error(`No family matches "${familyFilter}". Families: ${families.join(", ")} (see \`vidfarm ideas --families\`).`);
12117
+ }
12118
+ const requested = Number(parsed.values.count ?? (topic ? 20 : picked.length));
12119
+ const limit = Number.isFinite(requested) && requested > 0 ? Math.min(requested, picked.length) : picked.length;
12120
+ if (limit < picked.length) {
12121
+ // Spread the sample across families rather than truncating the list — a
12122
+ // top-N slice would hand back eight arc frames and no contrast frames, and
12123
+ // the variety across shapes is the entire value of the bank.
12124
+ const buckets = families.map((family) => picked.filter((entry) => entry.family === family)).filter((bucket) => bucket.length);
12125
+ const spread = [];
12126
+ for (let round = 0; spread.length < limit; round += 1) {
12127
+ let addedThisRound = false;
12128
+ for (const bucket of buckets) {
12129
+ if (round >= bucket.length)
12130
+ continue;
12131
+ spread.push(bucket[round]);
12132
+ addedThisRound = true;
12133
+ if (spread.length >= limit)
12134
+ break;
12135
+ }
12136
+ if (!addedThisRound)
12137
+ break;
12138
+ }
12139
+ picked = spread;
12140
+ }
12141
+ if (json) {
12142
+ return printJson({
12143
+ ok: true,
12144
+ source: "bundled",
12145
+ offline: true,
12146
+ topic: topic || null,
12147
+ total_frames: frames.length,
12148
+ families,
12149
+ frames: picked.map((entry) => ({ frame: entry.frame, family: entry.family, starter: topic ? joinIdeaFrame(entry.frame, topic) : null })),
12150
+ method: "references/content-ideas.md"
12151
+ });
12152
+ }
12153
+ console.log(`${BOLD}Content ideas — the angle bank${RESET} ${DIM}(${picked.length} of ${frames.length} frames · offline, free, no AI call)${RESET}`);
12154
+ if (topic)
12155
+ console.log(`${DIM}Topic: ${RESET}${topic}`);
12156
+ console.log("");
12157
+ let group = "";
12158
+ for (const entry of picked) {
12159
+ if (entry.family !== group) {
12160
+ group = entry.family;
12161
+ console.log(` ${BOLD}${group}${RESET}`);
12162
+ }
12163
+ console.log(topic ? ` ${GREEN}${joinIdeaFrame(entry.frame, topic)}${RESET}` : ` ${GREEN}${entry.frame}${RESET}`);
12164
+ }
12165
+ console.log("");
12166
+ if (topic) {
12167
+ console.log(`${DIM}Those are FRAMES filled with your topic, not finished ideas. Sharpen each into a real title${RESET}`);
12168
+ console.log(`${DIM}("The one pricing mistake that killed our first 400 orders"), then write hook/loop/payoff/bait.${RESET}`);
12169
+ }
12170
+ else {
12171
+ console.log(`${DIM}Pour ONE topic into a frame to get a video: 'the rise of' + your niche. Add --topic "<offer>" to see it.${RESET}`);
12172
+ }
12173
+ console.log(`${DIM}Method + frame→format notes: vidfarm skill show content-ideas · families: vidfarm ideas --families${RESET}`);
12174
+ console.log(`${DIM}Never ship a frame as a hook — the four charges still apply: vidfarm skill show hooks${RESET}`);
12175
+ console.log(`${DIM}Producing the whole set is a batch: vidfarm skill show bulk (one frame per video).${RESET}`);
12176
+ }
11645
12177
  async function runSkillDocsCommand(sub, argv) {
11646
12178
  const parsed = parseArgs({
11647
12179
  args: argv,
@@ -11682,9 +12214,37 @@ async function runSkillDocsCommand(sub, argv) {
11682
12214
  console.log(`${DIM}This is documentation, not entitlement: the free-local half (clips, hyperframes, \`vidfarm serve\` render, qa, harnesses, dedupe, local TTS) runs offline; AI generation, hosted render, recycle, download and marketplace still need \`vidfarm login\` and a network call.${RESET}`);
11683
12215
  return true;
11684
12216
  }
12217
+ if (sub === "topics" || sub === "topic" || sub === "craft") {
12218
+ // The spoken-name index. `skill ls` answers "what files exist"; this answers
12219
+ // "what does this thing KNOW", which is the question an agent actually has.
12220
+ const topics = listPackTopics();
12221
+ if (json)
12222
+ return printJson({ ok: true, pack, source: "bundled", offline: true, topics }), true;
12223
+ console.log(`${DIM}Craft topics in the bundled ${pack} pack — say the name, get the section (offline, no account):${RESET}`);
12224
+ for (const entry of topics) {
12225
+ const where = entry.heading ? `${entry.doc} § ${entry.heading}` : entry.doc;
12226
+ console.log(` ${GREEN}${entry.topic.padEnd(20)}${RESET} ${entry.blurb}`);
12227
+ console.log(` ${" ".repeat(20)} ${DIM}${where}${RESET}`);
12228
+ }
12229
+ console.log(`\n${DIM}vidfarm skill show <topic> · the 50-frame idea bank has its own command: vidfarm ideas${RESET}`);
12230
+ return true;
12231
+ }
11685
12232
  if (sub === "show" || sub === "read" || sub === "cat") {
11686
12233
  if (!ref)
11687
- throw new Error('skill show requires a file: `vidfarm skill show references/primitives.md` (shorthand like "primitives" works too).');
12234
+ throw new Error('skill show requires a file or topic: `vidfarm skill show references/primitives.md` (shorthand like "primitives", or a topic like "meme-recaption" — `vidfarm skill topics`).');
12235
+ // A spoken topic wins over fuzzy file matching: "meme-recaption" should print
12236
+ // the 25-line section, not the 650-line reference it lives in.
12237
+ const topic = resolvePackTopic(ref);
12238
+ if (topic) {
12239
+ const read = readPackTopic(topic, pack);
12240
+ if (json) {
12241
+ return printJson({ ok: true, pack, topic: topic.topic, path: read.doc.rel, heading: read.heading ?? null, whole_file: read.whole, source: "bundled", contents: read.contents }), true;
12242
+ }
12243
+ process.stdout.write(read.contents.endsWith("\n") ? read.contents : `${read.contents}\n`);
12244
+ if (!read.whole)
12245
+ console.log(`\n${DIM}— one section of ${read.doc.rel}. Whole file: vidfarm skill show ${read.doc.rel}${RESET}`);
12246
+ return true;
12247
+ }
11688
12248
  let resolved;
11689
12249
  try {
11690
12250
  resolved = readPackDoc(ref, pack);