@growthub/cli 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/assets/worker-kits/growthub-creative-video-pipeline-v1/.env.example +28 -0
  2. package/assets/worker-kits/growthub-creative-video-pipeline-v1/QUICKSTART.md +118 -0
  3. package/assets/worker-kits/growthub-creative-video-pipeline-v1/SKILL.md +124 -0
  4. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/.env.example +20 -0
  5. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/README.md +33 -0
  6. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/app/api/pipeline/route.js +27 -0
  7. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/app/globals.css +203 -0
  8. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/app/layout.jsx +14 -0
  9. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/app/page.jsx +131 -0
  10. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/app/settings/keys/page.jsx +154 -0
  11. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/lib/adapters/env.js +14 -0
  12. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/lib/adapters/generative/index.js +31 -0
  13. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/lib/domain/pipeline.js +30 -0
  14. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/next.config.js +10 -0
  15. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/package-lock.json +17 -0
  16. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/package.json +17 -0
  17. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/postcss.config.mjs +3 -0
  18. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/vercel.json +5 -0
  19. package/assets/worker-kits/growthub-creative-video-pipeline-v1/brands/NEW-CLIENT.md +21 -0
  20. package/assets/worker-kits/growthub-creative-video-pipeline-v1/brands/_template/brand-kit.md +123 -0
  21. package/assets/worker-kits/growthub-creative-video-pipeline-v1/brands/growthub/brand-kit.md +123 -0
  22. package/assets/worker-kits/growthub-creative-video-pipeline-v1/bundles/growthub-creative-video-pipeline-v1.json +87 -0
  23. package/assets/worker-kits/growthub-creative-video-pipeline-v1/docs/adapter-contracts.md +73 -0
  24. package/assets/worker-kits/growthub-creative-video-pipeline-v1/docs/governed-workspace-primitives.md +50 -0
  25. package/assets/worker-kits/growthub-creative-video-pipeline-v1/docs/pipeline-architecture.md +61 -0
  26. package/assets/worker-kits/growthub-creative-video-pipeline-v1/docs/starter-kit-overview.md +33 -0
  27. package/assets/worker-kits/growthub-creative-video-pipeline-v1/docs/vercel-deployment.md +42 -0
  28. package/assets/worker-kits/growthub-creative-video-pipeline-v1/examples/pipeline-brief-sample.md +56 -0
  29. package/assets/worker-kits/growthub-creative-video-pipeline-v1/growthub-meta/README.md +9 -0
  30. package/assets/worker-kits/growthub-creative-video-pipeline-v1/growthub-meta/kit-standard.md +24 -0
  31. package/assets/worker-kits/growthub-creative-video-pipeline-v1/helpers/README.md +9 -0
  32. package/assets/worker-kits/growthub-creative-video-pipeline-v1/helpers/check-generative-adapter.sh +41 -0
  33. package/assets/worker-kits/growthub-creative-video-pipeline-v1/helpers/check-pipeline-health.sh +154 -0
  34. package/assets/worker-kits/growthub-creative-video-pipeline-v1/helpers/run-pipeline.sh +30 -0
  35. package/assets/worker-kits/growthub-creative-video-pipeline-v1/kit.json +154 -0
  36. package/assets/worker-kits/growthub-creative-video-pipeline-v1/output/README.md +23 -0
  37. package/assets/worker-kits/growthub-creative-video-pipeline-v1/output-standards.md +63 -0
  38. package/assets/worker-kits/growthub-creative-video-pipeline-v1/pipeline.manifest.json +83 -0
  39. package/assets/worker-kits/growthub-creative-video-pipeline-v1/runtime-assumptions.md +61 -0
  40. package/assets/worker-kits/growthub-creative-video-pipeline-v1/setup/check-deps.sh +63 -0
  41. package/assets/worker-kits/growthub-creative-video-pipeline-v1/setup/clone-fork.sh +18 -0
  42. package/assets/worker-kits/growthub-creative-video-pipeline-v1/setup/install-skill.sh +10 -0
  43. package/assets/worker-kits/growthub-creative-video-pipeline-v1/setup/verify-env.mjs +50 -0
  44. package/assets/worker-kits/growthub-creative-video-pipeline-v1/skills/README.md +11 -0
  45. package/assets/worker-kits/growthub-creative-video-pipeline-v1/skills/brief-generation/SKILL.md +42 -0
  46. package/assets/worker-kits/growthub-creative-video-pipeline-v1/skills/generative-execution/SKILL.md +86 -0
  47. package/assets/worker-kits/growthub-creative-video-pipeline-v1/skills/video-edit/SKILL.md +41 -0
  48. package/assets/worker-kits/growthub-creative-video-pipeline-v1/skills.md +302 -0
  49. package/assets/worker-kits/growthub-creative-video-pipeline-v1/studio/index.html +12 -0
  50. package/assets/worker-kits/growthub-creative-video-pipeline-v1/studio/package-lock.json +20 -0
  51. package/assets/worker-kits/growthub-creative-video-pipeline-v1/studio/package.json +20 -0
  52. package/assets/worker-kits/growthub-creative-video-pipeline-v1/studio/serve.mjs +41 -0
  53. package/assets/worker-kits/growthub-creative-video-pipeline-v1/studio/src/App.jsx +210 -0
  54. package/assets/worker-kits/growthub-creative-video-pipeline-v1/studio/src/app.css +194 -0
  55. package/assets/worker-kits/growthub-creative-video-pipeline-v1/studio/src/main.jsx +10 -0
  56. package/assets/worker-kits/growthub-creative-video-pipeline-v1/studio/vite.config.js +8 -0
  57. package/assets/worker-kits/growthub-creative-video-pipeline-v1/templates/edit-plan.md +66 -0
  58. package/assets/worker-kits/growthub-creative-video-pipeline-v1/templates/generative-plan.md +83 -0
  59. package/assets/worker-kits/growthub-creative-video-pipeline-v1/templates/pipeline-brief.md +129 -0
  60. package/assets/worker-kits/growthub-creative-video-pipeline-v1/templates/project.md +68 -0
  61. package/assets/worker-kits/growthub-creative-video-pipeline-v1/templates/self-eval.md +67 -0
  62. package/assets/worker-kits/growthub-creative-video-pipeline-v1/validation/e2e-reference.md +166 -0
  63. package/assets/worker-kits/growthub-creative-video-pipeline-v1/validation-checklist.md +56 -0
  64. package/assets/worker-kits/growthub-creative-video-pipeline-v1/workers/creative-video-pipeline-operator/CLAUDE.md +109 -0
  65. package/assets/worker-kits/growthub-creative-video-pipeline-v1/workspace.dependencies.json +26 -0
  66. package/dist/index.js +3032 -1676
  67. package/package.json +2 -2
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ import { readFileSync, existsSync } from "fs";
3
+ import { resolve } from "path";
4
+
5
+ const ROOT = new URL("..", import.meta.url).pathname;
6
+ const envFile = resolve(ROOT, ".env.local");
7
+
8
+ if (existsSync(envFile)) {
9
+ const lines = readFileSync(envFile, "utf8").split("\n");
10
+ for (const line of lines) {
11
+ const trimmed = line.trim();
12
+ if (!trimmed || trimmed.startsWith("#")) continue;
13
+ const [key, ...rest] = trimmed.split("=");
14
+ if (key && rest.join("=")) process.env[key] = rest.join("=");
15
+ }
16
+ }
17
+
18
+ const REQUIRED = [
19
+ "CREATIVE_VIDEO_PIPELINE_GENERATIVE_ADAPTER",
20
+ "ELEVENLABS_API_KEY",
21
+ ];
22
+
23
+ const ADAPTER_DEPS = {
24
+ "growthub-pipeline": ["GROWTHUB_BRIDGE_ACCESS_TOKEN", "GROWTHUB_BRIDGE_BASE_URL"],
25
+ "byo-api-key": ["VIDEO_MODEL_PROVIDER"],
26
+ };
27
+
28
+ const errors = [];
29
+
30
+ for (const key of REQUIRED) {
31
+ if (!process.env[key]) errors.push(`Missing required: ${key}`);
32
+ }
33
+
34
+ const adapter = process.env.CREATIVE_VIDEO_PIPELINE_GENERATIVE_ADAPTER ?? "growthub-pipeline";
35
+ const adapterDeps = ADAPTER_DEPS[adapter] ?? [];
36
+ for (const key of adapterDeps) {
37
+ if (!process.env[key]) errors.push(`Missing for ${adapter} adapter: ${key}`);
38
+ }
39
+
40
+ if (!process.env.VIDEO_USE_HOME) {
41
+ errors.push("Missing VIDEO_USE_HOME (required for Stage 3)");
42
+ }
43
+
44
+ if (errors.length) {
45
+ console.error("Environment verification failed:");
46
+ for (const e of errors) console.error(` - ${e}`);
47
+ process.exit(1);
48
+ } else {
49
+ console.log("Environment verified.");
50
+ }
@@ -0,0 +1,11 @@
1
+ # skills/
2
+
3
+ Sub-skills for the creative-video-pipeline operator. Each sub-skill is a self-contained governed primitive with its own SKILL.md.
4
+
5
+ | Sub-skill | Stage | Purpose |
6
+ |-----------|-------|---------|
7
+ | brief-generation | Stage 1 | Brand-grounded creative brief from brand-kit.md |
8
+ | generative-execution | Stage 2 | Adapter-routed generative image/video execution |
9
+ | video-edit | Stage 3 | video-use fork delegation: Scribe → EDL → FFmpeg |
10
+
11
+ The top-level `SKILL.md` at the kit root composes all three sub-skills into the full three-stage pipeline.
@@ -0,0 +1,42 @@
1
+ ---
2
+ id: creative-video-pipeline/brief-generation
3
+ name: creative-video-pipeline-brief-generation
4
+ description: Generate the Stage 1 brand-grounded pipeline brief from the worker kit brand kit and write output artifacts.
5
+ version: 1.0.0
6
+ triggers:
7
+ - "generate creative brief"
8
+ - "run brief stage"
9
+ - "stage 1 brief"
10
+ - "write pipeline brief"
11
+ selfEval:
12
+ criteria:
13
+ - "Brief is sourced exclusively from brand-kit.md — no invented brand attributes"
14
+ - "Scene structure matches brand hook patterns"
15
+ - "pipeline-brief.md written to output/<client>/<project>/brief/"
16
+ - "project.md appended with Stage 1 completion"
17
+ - "trace.jsonl event written for stage-complete"
18
+ maxRetries: 3
19
+ ---
20
+
21
+ # Brief Generation Sub-Skill
22
+
23
+ ## Role
24
+ Generate a brand-grounded creative brief for Stage 1 of the creative video pipeline.
25
+
26
+ ## Input
27
+ - `brands/<client>/brand-kit.md` — brand constraints, audience, hooks, tone
28
+ - `CREATIVE_STRATEGIST_HOME` (optional) — for 500-winning-hooks.csv reference
29
+ - Client name + project name
30
+
31
+ ## Process
32
+ 1. Read `brands/<client>/brand-kit.md` in full
33
+ 2. Identify brand tone, audience, hook patterns, and platform format
34
+ 3. Populate `templates/pipeline-brief.md` — do not invent brand attributes
35
+ 4. Write output to `output/<client>/<project>/brief/pipeline-brief.md`
36
+ 5. Append Stage 1 completion entry to `.growthub-fork/project.md`
37
+ 6. Append `{"type":"stage-complete","stage":"brief","ts":"<iso>"}` to `trace.jsonl`
38
+
39
+ ## Output
40
+ - `output/<client>/<project>/brief/pipeline-brief.md`
41
+ - Updated `.growthub-fork/project.md`
42
+ - Updated `trace.jsonl`
@@ -0,0 +1,86 @@
1
+ ---
2
+ id: creative-video-pipeline/generative-execution
3
+ name: creative-video-pipeline-generative-execution
4
+ description: Run Stage 2 generative execution through the selected adapter and write the generative manifest.
5
+ version: 1.0.0
6
+ triggers:
7
+ - "run generative stage"
8
+ - "stage 2 generate"
9
+ - "generate video"
10
+ - "execute pipeline generation"
11
+ selfEval:
12
+ criteria:
13
+ - "Adapter selected from CREATIVE_VIDEO_PIPELINE_GENERATIVE_ADAPTER env var"
14
+ - "growthub-pipeline path: DynamicRegistryPipeline JSON assembled from brief, growthub pipeline execute called directly"
15
+ - "byo-api-key path: VIDEO_MODEL_PROVIDER resolved, provider SDK called"
16
+ - "manifest.json written to output/<client>/<project>/generative/ with execution results"
17
+ - "project.md and trace.jsonl updated with Stage 2 completion"
18
+ maxRetries: 3
19
+ helpers:
20
+ - "helpers/check-generative-adapter.sh"
21
+ - "helpers/run-pipeline.sh"
22
+ ---
23
+
24
+ # Generative Execution Sub-Skill
25
+
26
+ ## Role
27
+ Execute Stage 2 via the official growthub CLI + `@growthub/api-contract` SDK. No custom execution layer.
28
+
29
+ ## Adapter: growthub-pipeline (primary)
30
+
31
+ ```bash
32
+ # Auth pre-flight
33
+ growthub auth whoami --json || { echo "Run: growthub auth login"; exit 1; }
34
+
35
+ # Assemble DynamicRegistryPipeline from the Stage 1 brief, then execute:
36
+ growthub pipeline execute '<DynamicRegistryPipeline JSON>'
37
+ ```
38
+
39
+ **`DynamicRegistryPipeline` shape (from `@growthub/api-contract`):**
40
+ ```json
41
+ {
42
+ "pipelineId": "<uuid>",
43
+ "executionMode": "hosted",
44
+ "nodes": [
45
+ {
46
+ "nodeId": "video-gen-1",
47
+ "slug": "video-generation",
48
+ "bindings": {
49
+ "videoModel": "veo-3.1-generate-001",
50
+ "prompt": "<scene prompt from brief>",
51
+ "seconds": 8,
52
+ "aspectRatio": "9:16",
53
+ "creativeCount": 1,
54
+ "refs": [
55
+ { "name": "brand_reference", "dataUrl": "data:image/jpeg;base64,<base64>" }
56
+ ]
57
+ }
58
+ }
59
+ ]
60
+ }
61
+ ```
62
+
63
+ The CLI streams NDJSON `ExecutionEvent` objects typed by `@growthub/api-contract`. Use `isExecutionEvent()` to validate each line. The `complete` event signals success; the `error` event signals failure.
64
+
65
+ ## Adapter: byo-api-key (secondary)
66
+ Resolve `VIDEO_MODEL_PROVIDER` (veo | fal | runway), call the provider SDK directly.
67
+
68
+ ## Output
69
+ Write `output/<client>/<project>/generative/manifest.json`:
70
+ ```json
71
+ {
72
+ "kitId": "growthub-creative-video-pipeline-v1",
73
+ "adapter": "growthub-pipeline",
74
+ "executionId": "<from complete event>",
75
+ "createdAt": "<iso>",
76
+ "artifacts": [/* urls/paths from execution output */]
77
+ }
78
+ ```
79
+
80
+ ## Process
81
+ 1. Read `CREATIVE_VIDEO_PIPELINE_GENERATIVE_ADAPTER`
82
+ 2. Run `helpers/check-generative-adapter.sh`
83
+ 3. Assemble `DynamicRegistryPipeline` JSON from Stage 1 brief prompts and reference images
84
+ 4. Execute: `bash helpers/run-pipeline.sh '<payload>'`
85
+ 5. Write `manifest.json` from the execution result
86
+ 6. Append Stage 2 completion to `project.md` and `trace.jsonl`
@@ -0,0 +1,41 @@
1
+ ---
2
+ id: creative-video-pipeline/video-edit
3
+ name: creative-video-pipeline-video-edit
4
+ description: Prepare the Stage 3 edit handoff for the VIDEO_USE_HOME fork and collect final video output.
5
+ version: 1.0.0
6
+ triggers:
7
+ - "run edit stage"
8
+ - "stage 3 edit"
9
+ - "assemble final video"
10
+ - "video-use edit"
11
+ selfEval:
12
+ criteria:
13
+ - "edit-plan.md written from generative manifest and brief"
14
+ - "VIDEO_USE_HOME is set and resolves to a cloned video-use fork"
15
+ - "Handoff to video-use fork executed — do not duplicate video-use pipeline logic"
16
+ - "final.mp4 copied to output/<client>/<project>/final/"
17
+ - "project.md and trace.jsonl updated with Stage 3 completion"
18
+ maxRetries: 3
19
+ ---
20
+
21
+ # Video Edit Sub-Skill
22
+
23
+ ## Role
24
+ Execute Stage 3: delegate edit to the `VIDEO_USE_HOME` video-use fork and collect final output.
25
+
26
+ ## Dependencies
27
+ - `VIDEO_USE_HOME` — absolute path to video-use fork clone
28
+ - `ELEVENLABS_API_KEY` — for ElevenLabs Scribe word-level transcription
29
+ - `ffmpeg` — must be on PATH inside the video-use fork environment
30
+
31
+ ## Process
32
+ 1. Read `output/<client>/<project>/generative/manifest.json` to identify source clips
33
+ 2. Read `output/<client>/<project>/brief/pipeline-brief.md` for editing guidelines
34
+ 3. Write `output/<client>/<project>/edit-plan.md` from `templates/edit-plan.md`
35
+ 4. Delegate to video-use fork — do NOT inline video-use logic here
36
+ 5. Copy final rendered `final.mp4` to `output/<client>/<project>/final/final.mp4`
37
+ 6. Append Stage 3 completion to `project.md` and `trace.jsonl`
38
+
39
+ ## Handoff
40
+ The video-use fork owns the full Scribe → word-boundary EDL → FFmpeg render pipeline.
41
+ This sub-skill's only job is to form the `edit-plan.md` handoff and collect the output artifact.
@@ -0,0 +1,302 @@
1
+ # Creative Video Pipeline — Operator Runbook
2
+
3
+ > **Who this is for:** Any agent operating inside `${CREATIVE_VIDEO_PIPELINE_HOME:-$HOME/creative-video-pipeline}/` and running the three-stage creative video pipeline.
4
+ > Read this file fully before starting. Every section is a required step.
5
+
6
+ ---
7
+
8
+ ## QUICK REFERENCE
9
+
10
+ | What you need | Where to find it |
11
+ |---|---|
12
+ | This runbook | `skills.md` ← you are here |
13
+ | Routing menu | `SKILL.md` |
14
+ | Agent contract | `workers/creative-video-pipeline-operator/CLAUDE.md` |
15
+ | Brief template | `templates/pipeline-brief.md` |
16
+ | Brand kit template | `brands/_template/brand-kit.md` |
17
+ | Generative plan template | `templates/generative-plan.md` |
18
+ | Edit plan template | `templates/edit-plan.md` |
19
+ | Session memory | `.growthub-fork/project.md` |
20
+ | Output directory | `output/<client-slug>/<project-slug>/` |
21
+ | Adapter contracts | `docs/adapter-contracts.md` |
22
+ | Pipeline architecture | `docs/pipeline-architecture.md` |
23
+
24
+ ---
25
+
26
+ ## STAGE 0 — PREPARE
27
+
28
+ ### 0a. Environment check
29
+
30
+ ```bash
31
+ bash setup/check-deps.sh
32
+ node setup/verify-env.mjs
33
+ ```
34
+
35
+ If deps fail, stop and return remediation only. Do not invent API keys or hardcode paths.
36
+
37
+ ### 0b. Verify generative adapter
38
+
39
+ ```bash
40
+ bash helpers/check-generative-adapter.sh
41
+ ```
42
+
43
+ Prints active adapter (`growthub-pipeline` or `byo-api-key`) and which keys are set.
44
+
45
+ ### 0c. Auth pre-flight (growthub-pipeline adapter only)
46
+
47
+ ```bash
48
+ growthub auth whoami --json
49
+ ```
50
+
51
+ If not authenticated, run `growthub auth login` before proceeding.
52
+
53
+ ### 0d. Create or load brand kit
54
+
55
+ ```bash
56
+ # New client
57
+ cp ${CREATIVE_VIDEO_PIPELINE_HOME:-$HOME/creative-video-pipeline}/brands/_template/brand-kit.md \
58
+ ${CREATIVE_VIDEO_PIPELINE_HOME:-$HOME/creative-video-pipeline}/brands/<client-slug>/brand-kit.md
59
+
60
+ # Existing client
61
+ cat ${CREATIVE_VIDEO_PIPELINE_HOME:-$HOME/creative-video-pipeline}/brands/<client-slug>/brand-kit.md
62
+ ```
63
+
64
+ Required fields: `client_name`, `slug`, `primary_service`, `tone`, `messaging_guardrails`, `cta_text`, `colors`.
65
+
66
+ ---
67
+
68
+ ## STAGE 1 — BRIEF
69
+
70
+ Sub-skill: `skills/brief-generation/SKILL.md`
71
+
72
+ ### 1a. Build scene structure
73
+
74
+ From the brand kit and campaign intent, produce a scene table:
75
+
76
+ ```
77
+ Scene 1 — Hook N variations (A–E), same creative concept
78
+ Scene 2 — Problem consistent across all hook variations
79
+ Scene 3 — Solution consistent across all hook variations
80
+ Scene N — CTA consistent across all hook variations
81
+ ```
82
+
83
+ Hook sources (in priority order):
84
+ 1. `${CREATIVE_STRATEGIST_HOME:-$HOME/creative-strategist}/templates/hooks-library/500-winning-hooks.csv` — if the creative-strategist kit is installed
85
+ 2. Inline hook reasoning from brand kit tone and `approved_phrases`
86
+
87
+ ### 1b. Write the brief
88
+
89
+ Fill `templates/pipeline-brief.md` and write the output to:
90
+
91
+ ```
92
+ output/<client-slug>/<project-slug>/brief/pipeline-brief.md
93
+ ```
94
+
95
+ Required sections:
96
+ 1. Brand constraints box — from `messaging_guardrails`
97
+ 2. Scene structure table
98
+ 3. Hook variations A–E for Scene 1
99
+ 4. Per-scene production notes (visual direction, VO, on-screen text)
100
+ 5. Editing guidelines
101
+ 6. Appendix: AI generation prompts (labeled OPTIONAL) — used in Stage 2
102
+
103
+ ### 1c. Append to session memory
104
+
105
+ ```bash
106
+ # After completing Stage 1:
107
+ # Append to .growthub-fork/project.md with: stage, client, brief path, hook count, scene count
108
+ ```
109
+
110
+ **Self-eval unit for Stage 1:** The completed `pipeline-brief.md` for one creative concept.
111
+
112
+ ---
113
+
114
+ ## STAGE 2 — GENERATE
115
+
116
+ Sub-skill: `skills/generative-execution/SKILL.md`
117
+
118
+ ### 2a. Resolve adapter
119
+
120
+ ```bash
121
+ bash helpers/check-generative-adapter.sh
122
+ ```
123
+
124
+ ### 2b. Build generative plan
125
+
126
+ Fill `templates/generative-plan.md` with:
127
+ - Node bindings (which scenes become video clips, which become images)
128
+ - Reference images (if any — as typed data URLs per `@growthub/api-contract` ref spec)
129
+ - Provider model choice
130
+ - Prompts from Stage 1 brief Appendix
131
+
132
+ ### 2c. Execute — growthub-pipeline path (primary)
133
+
134
+ ```bash
135
+ bash helpers/run-pipeline.sh
136
+ ```
137
+
138
+ Or directly:
139
+
140
+ ```bash
141
+ # Auth pre-flight
142
+ growthub auth whoami --json || { echo "Not authenticated. Run: growthub auth login"; exit 1; }
143
+
144
+ # Execute
145
+ growthub pipeline execute '<json-payload>'
146
+ ```
147
+
148
+ Pipeline payload shape (`DynamicRegistryPipeline`):
149
+ ```json
150
+ {
151
+ "pipelineId": "<uuid>",
152
+ "executionMode": "hosted",
153
+ "nodes": [
154
+ {
155
+ "nodeId": "video-gen-1",
156
+ "slug": "video-generation",
157
+ "bindings": {
158
+ "videoModel": "veo-3.1-generate-001",
159
+ "prompt": "<scene prompt from brief>",
160
+ "seconds": 8,
161
+ "aspectRatio": "9:16",
162
+ "creativeCount": 1,
163
+ "refs": [
164
+ { "name": "brand_reference", "dataUrl": "data:image/jpeg;base64,<base64>" }
165
+ ]
166
+ }
167
+ }
168
+ ]
169
+ }
170
+ ```
171
+
172
+ Parse streaming NDJSON output with `isExecutionEvent` from `@growthub/api-contract/events`.
173
+
174
+ ### 2d. Execute — byo-api-key path (secondary)
175
+
176
+ Set `VIDEO_MODEL_PROVIDER` and the corresponding provider key in `.env`.
177
+ The adapter in `lib/adapters/generative/index.js` routes to the correct provider SDK.
178
+
179
+ ### 2e. Write generative manifest
180
+
181
+ After execution, write `output/<client>/<project>/generative/manifest.json` per `output-standards.md`.
182
+
183
+ ### 2f. Append to session memory
184
+
185
+ Record: execution id, artifact count, provider used, artifact URLs.
186
+
187
+ **Self-eval unit for Stage 2:** `manifest.json` with at least one artifact URL per scene in the brief.
188
+
189
+ ---
190
+
191
+ ## STAGE 3 — EDIT
192
+
193
+ Sub-skill: `skills/video-edit/SKILL.md`
194
+
195
+ ### 3a. Verify video-use fork
196
+
197
+ ```bash
198
+ ls "${VIDEO_USE_HOME:-$HOME/video-use}/skills.md" || {
199
+ echo "video-use fork not found. Run: bash setup/clone-fork.sh"
200
+ exit 1
201
+ }
202
+ ```
203
+
204
+ ### 3b. Stage generated clips
205
+
206
+ Copy/link generated clips from `output/<client>/<project>/generative/` into `${VIDEO_USE_HOME}/<project>/`.
207
+
208
+ ### 3c. Write edit plan
209
+
210
+ Fill `templates/edit-plan.md` and write to `output/<client>/<project>/final/edit-plan.md`.
211
+
212
+ Minimum contents:
213
+ - Source clips list (from generative manifest)
214
+ - Cut strategy aligned to scene structure from brief
215
+ - Overlay plan (captions, on-screen text from brief scenes)
216
+ - Music direction
217
+ - Final duration target
218
+
219
+ ### 3d. Hand off to video-use agent
220
+
221
+ The video-use agent reads from its `${VIDEO_USE_HOME}/skills.md` runbook. Pass:
222
+ 1. `output/<client>/<project>/brief/pipeline-brief.md` — scene + VO structure
223
+ 2. `output/<client>/<project>/final/edit-plan.md` — cut strategy
224
+
225
+ The video-use fork pipeline:
226
+ ```
227
+ inventory → transcribe (ElevenLabs Scribe) → pack phrase-level transcript
228
+ → EDL generation (word-boundary cuts)
229
+ → render (FFmpeg + overlays)
230
+ → self-eval (up to 3 iterations)
231
+ → final.mp4 at ${VIDEO_USE_HOME}/<project>/edit/final.mp4
232
+ ```
233
+
234
+ ### 3e. Copy final output
235
+
236
+ ```bash
237
+ mkdir -p output/<client>/<project>/final
238
+ cp "${VIDEO_USE_HOME}/<project>/edit/final.mp4" output/<client>/<project>/final/final.mp4
239
+ ```
240
+
241
+ ### 3f. Append to session memory
242
+
243
+ Record: edit decision count, render duration, final.mp4 path, QA pass status.
244
+
245
+ **Self-eval unit for Stage 3:** `final.mp4` exists, passes QA checklist, duration matches target.
246
+
247
+ ---
248
+
249
+ ## NON-NEGOTIABLE RULES
250
+
251
+ 1. Stage 1 brief must be sourced from `brand-kit.md` — no brand details from memory.
252
+ 2. Stage 2 generative execution goes through the adapter contract — never raw API calls outside it.
253
+ 3. Stage 3 edit delegates to `VIDEO_USE_HOME` fork — never duplicate its pipeline inline.
254
+ 4. `output/<client>/<project>/` is the single output root — no other write locations.
255
+ 5. Append to `.growthub-fork/project.md` at every stage boundary.
256
+ 6. `ELEVENLABS_API_KEY` never appears in any output artifact.
257
+ 7. Provider API keys never appear in any output artifact.
258
+ 8. Brief AI generation prompts live in the Appendix only — never inline in scene blocks.
259
+
260
+ ---
261
+
262
+ ## FOLDER STRUCTURE
263
+
264
+ ```
265
+ ${CREATIVE_VIDEO_PIPELINE_HOME:-$HOME/creative-video-pipeline}/
266
+ ├── skills.md ← this file — read first, every session
267
+ ├── SKILL.md ← routing menu — read before skills.md
268
+ ├── QUICKSTART.md
269
+ ├── .env.example
270
+ ├── workers/
271
+ │ └── creative-video-pipeline-operator/CLAUDE.md
272
+ ├── brands/
273
+ │ ├── _template/brand-kit.md
274
+ │ ├── growthub/brand-kit.md
275
+ │ └── NEW-CLIENT.md
276
+ ├── templates/
277
+ │ ├── pipeline-brief.md
278
+ │ ├── generative-plan.md
279
+ │ └── edit-plan.md
280
+ ├── setup/
281
+ │ ├── check-deps.sh
282
+ │ ├── verify-env.mjs
283
+ │ ├── clone-fork.sh
284
+ │ └── install-skill.sh
285
+ ├── helpers/
286
+ │ ├── run-pipeline.sh
287
+ │ └── check-generative-adapter.sh
288
+ ├── skills/
289
+ │ ├── brief-generation/SKILL.md
290
+ │ ├── generative-execution/SKILL.md
291
+ │ └── video-edit/SKILL.md
292
+ ├── docs/
293
+ │ ├── adapter-contracts.md
294
+ │ ├── pipeline-architecture.md
295
+ │ ├── governed-workspace-primitives.md
296
+ │ └── vercel-deployment.md
297
+ ├── output/
298
+ │ └── <client-slug>/<project-slug>/{brief/,generative/,final/}
299
+ ├── studio/ ← Vite local shell
300
+ └── apps/
301
+ └── creative-video-pipeline/ ← Next.js / Vercel app
302
+ ```
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Creative Video Pipeline</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/main.jsx"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "growthub-creative-video-pipeline-studio",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "growthub-creative-video-pipeline-studio",
9
+ "version": "1.0.0",
10
+ "dependencies": {
11
+ "react": "^18.3.1",
12
+ "react-dom": "^18.3.1"
13
+ },
14
+ "devDependencies": {
15
+ "@vitejs/plugin-react": "^4.3.1",
16
+ "vite": "^5.4.2"
17
+ }
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "growthub-creative-video-pipeline-studio",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build",
9
+ "preview": "vite preview",
10
+ "serve": "node serve.mjs"
11
+ },
12
+ "dependencies": {
13
+ "react": "^18.3.1",
14
+ "react-dom": "^18.3.1"
15
+ },
16
+ "devDependencies": {
17
+ "@vitejs/plugin-react": "^4.3.1",
18
+ "vite": "^5.4.2"
19
+ }
20
+ }
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ // Minimal static server for the built Vite shell.
3
+ // Usage: node serve.mjs [--port 5180]
4
+ import http from "node:http";
5
+ import fs from "node:fs";
6
+ import path from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+
9
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
10
+ const DIST = path.resolve(__dirname, "dist");
11
+ const PORT = Number(process.env.PORT ?? 5180);
12
+
13
+ const mime = {
14
+ ".html": "text/html; charset=utf-8",
15
+ ".js": "application/javascript; charset=utf-8",
16
+ ".css": "text/css; charset=utf-8",
17
+ ".svg": "image/svg+xml",
18
+ ".json": "application/json; charset=utf-8",
19
+ };
20
+
21
+ function serve(req, res) {
22
+ const url = decodeURIComponent(req.url?.split("?")[0] ?? "/");
23
+ const file = url === "/" ? "/index.html" : url;
24
+ const full = path.resolve(DIST, "." + file);
25
+ if (!full.startsWith(DIST)) { res.statusCode = 403; res.end("Forbidden"); return; }
26
+ fs.readFile(full, (err, buf) => {
27
+ if (err) {
28
+ fs.readFile(path.resolve(DIST, "index.html"), (err2, fallback) => {
29
+ if (err2) { res.statusCode = 404; res.end("Not found"); return; }
30
+ res.setHeader("Content-Type", mime[".html"]); res.end(fallback);
31
+ });
32
+ return;
33
+ }
34
+ res.setHeader("Content-Type", mime[path.extname(full)] ?? "application/octet-stream");
35
+ res.end(buf);
36
+ });
37
+ }
38
+
39
+ http.createServer(serve).listen(PORT, () => {
40
+ console.log(`[creative-video-pipeline-studio] serving ${DIST} on http://localhost:${PORT}`);
41
+ });