@contractspec/example.video-marketing-clip 2.1.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.
@@ -0,0 +1,33 @@
1
+ // src/example.ts
2
+ import { defineExample } from "@contractspec/lib.contracts-spec";
3
+ var example = defineExample({
4
+ meta: {
5
+ key: "video-marketing-clip",
6
+ version: "1.0.0",
7
+ title: "Video Marketing Clips",
8
+ description: "Generate short-form marketing videos from content briefs using the deterministic video-gen pipeline.",
9
+ kind: "script",
10
+ visibility: "public",
11
+ stability: "experimental",
12
+ owners: ["@platform.core"],
13
+ tags: ["video", "marketing", "content-gen", "social-clip"]
14
+ },
15
+ docs: {
16
+ rootDocId: "docs.examples.video-marketing-clip",
17
+ usageDocId: "docs.examples.video-marketing-clip.usage"
18
+ },
19
+ entrypoints: {
20
+ packageName: "@contractspec/example.video-marketing-clip",
21
+ docs: "./docs"
22
+ },
23
+ surfaces: {
24
+ templates: true,
25
+ sandbox: { enabled: true, modes: ["markdown"] },
26
+ studio: { enabled: true, installable: true },
27
+ mcp: { enabled: true }
28
+ }
29
+ });
30
+ var example_default = example;
31
+ export {
32
+ example_default as default
33
+ };
@@ -0,0 +1,29 @@
1
+ // src/generate-clip.ts
2
+ import { VideoGenerator } from "@contractspec/lib.video-gen/generators";
3
+ import { VIDEO_FORMATS } from "@contractspec/lib.video-gen/design/layouts";
4
+ var FORMAT_MAP = {
5
+ landscape: VIDEO_FORMATS.landscape,
6
+ square: VIDEO_FORMATS.square,
7
+ portrait: VIDEO_FORMATS.portrait
8
+ };
9
+ async function generateMarketingClip(brief, format = "landscape", targetDurationSeconds) {
10
+ const generator = new VideoGenerator({ fps: 30 });
11
+ const videoBrief = {
12
+ content: brief,
13
+ format: FORMAT_MAP[format],
14
+ targetDurationSeconds
15
+ };
16
+ return generator.generate(videoBrief);
17
+ }
18
+ async function generateAllFormats(brief, targetDurationSeconds) {
19
+ const [landscape, square, portrait] = await Promise.all([
20
+ generateMarketingClip(brief, "landscape", targetDurationSeconds),
21
+ generateMarketingClip(brief, "square", targetDurationSeconds),
22
+ generateMarketingClip(brief, "portrait", targetDurationSeconds)
23
+ ]);
24
+ return { landscape, square, portrait };
25
+ }
26
+ export {
27
+ generateMarketingClip,
28
+ generateAllFormats
29
+ };
@@ -0,0 +1,201 @@
1
+ // src/briefs.ts
2
+ var productLaunchBrief = {
3
+ title: "Ship APIs 10x Faster with ContractSpec",
4
+ summary: "ContractSpec generates REST, GraphQL, DB schemas, SDKs, and MCP tools from a single spec definition.",
5
+ problems: [
6
+ "Teams rewrite the same API logic across multiple surfaces",
7
+ "Manual synchronization leads to inconsistent endpoints",
8
+ "Schema drift between frontend, backend, and documentation"
9
+ ],
10
+ solutions: [
11
+ "One spec, every surface -- define once, generate everything",
12
+ "Deterministic output -- same spec always produces the same code",
13
+ "Fully ejectable -- no lock-in, standard TypeScript"
14
+ ],
15
+ metrics: [
16
+ "10x faster API development",
17
+ "Zero schema drift across surfaces",
18
+ "18 generated files from 3 contracts"
19
+ ],
20
+ audience: {
21
+ role: "Engineering Lead",
22
+ industry: "SaaS",
23
+ painPoints: ["API maintenance burden", "Cross-surface consistency"]
24
+ },
25
+ callToAction: "Try ContractSpec today at contractspec.dev"
26
+ };
27
+ var featureAnnouncementBrief = {
28
+ title: "Now Generating MCP Tools from Your Specs",
29
+ summary: "ContractSpec v2 adds automatic MCP tool generation -- your contracts now power AI assistants natively.",
30
+ problems: [
31
+ "Building MCP tools manually is tedious and error-prone",
32
+ "AI assistants need structured tool definitions that stay in sync with APIs"
33
+ ],
34
+ solutions: [
35
+ "Automatic MCP tool generation from existing contract specs",
36
+ "Type-safe tool definitions with Zod schema validation",
37
+ "Zero additional configuration -- just build"
38
+ ],
39
+ audience: {
40
+ role: "Developer",
41
+ painPoints: ["MCP integration complexity"]
42
+ },
43
+ callToAction: "Upgrade to ContractSpec v2"
44
+ };
45
+ var caseStudyBrief = {
46
+ title: "How Acme Corp Cut API Dev Time by 80%",
47
+ summary: "Acme Corp migrated 47 endpoints to ContractSpec and eliminated manual synchronization across 5 surfaces.",
48
+ problems: [
49
+ "47 REST endpoints maintained manually across 3 teams",
50
+ "GraphQL schema constantly out of sync with REST",
51
+ "SDK updates lagged behind API changes by weeks"
52
+ ],
53
+ solutions: [
54
+ "Migrated to ContractSpec in 2 weeks",
55
+ "Single source of truth for all 47 endpoints",
56
+ "Automated SDK and documentation generation"
57
+ ],
58
+ metrics: [
59
+ "80% reduction in API development time",
60
+ "Zero sync issues since migration",
61
+ "3 teams now share one spec repository"
62
+ ],
63
+ audience: {
64
+ role: "CTO",
65
+ industry: "FinTech",
66
+ painPoints: ["API maintenance costs", "Team coordination"]
67
+ },
68
+ callToAction: "Read the full case study at contractspec.dev/customers"
69
+ };
70
+
71
+ // src/docs/video-marketing-clip.docblock.ts
72
+ import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
73
+ var blocks = [
74
+ {
75
+ id: "docs.examples.video-marketing-clip",
76
+ title: "Video Marketing Clips (example)",
77
+ summary: "End-to-end example: generate short-form social clips from content briefs using the deterministic video-gen pipeline.",
78
+ kind: "reference",
79
+ visibility: "public",
80
+ route: "/docs/examples/video-marketing-clip",
81
+ tags: ["video", "marketing", "social-clip", "example"],
82
+ body: `## What this example shows
83
+
84
+ - Building a \`VideoBrief\` from a \`ContentBrief\` with format, duration, and style settings.
85
+ - Using \`VideoGenerator\` in fully deterministic mode (no LLM) to produce a \`VideoProject\`.
86
+ - Generating video projects for all three social formats: landscape (16:9), square (1:1), and portrait (9:16).
87
+ - Accessing the resulting scene graph, durations, and composition props.
88
+
89
+ ## Key concepts
90
+
91
+ - **ContentBrief**: The narrative source (title, problems, solutions, CTA) from \`@contractspec/lib.content-gen\`.
92
+ - **VideoBrief**: Wraps ContentBrief with video-specific config (format, duration, narration, style).
93
+ - **VideoGenerator**: Orchestrates scene planning and project assembly. Deterministic by default.
94
+ - **VideoProject**: The output scene graph ready for rendering or preview.
95
+
96
+ ## Notes
97
+
98
+ - No LLM or voice provider is needed -- the pipeline is fully deterministic.
99
+ - The example does not render to MP4 (that requires Node.js + \`@remotion/renderer\`). It produces the \`VideoProject\` data structure.
100
+ `
101
+ },
102
+ {
103
+ id: "docs.examples.video-marketing-clip.usage",
104
+ title: "Video Marketing Clips -- Usage",
105
+ summary: "How to generate marketing video projects from content briefs.",
106
+ kind: "usage",
107
+ visibility: "public",
108
+ route: "/docs/examples/video-marketing-clip/usage",
109
+ tags: ["video", "marketing", "usage"],
110
+ body: `## Usage
111
+
112
+ \`\`\`ts
113
+ import { generateMarketingClip } from "@contractspec/example.video-marketing-clip/generate-clip";
114
+ import { productLaunchBrief } from "@contractspec/example.video-marketing-clip/briefs";
115
+
116
+ // Generate a landscape video project
117
+ const project = await generateMarketingClip(productLaunchBrief, "landscape");
118
+
119
+ console.log(project.scenes.length); // number of scenes
120
+ console.log(project.totalDurationInFrames); // total frames
121
+ console.log(project.format); // { type: "landscape", width: 1920, height: 1080 }
122
+
123
+ // Generate all three format variants
124
+ const landscapes = await generateMarketingClip(productLaunchBrief, "landscape");
125
+ const square = await generateMarketingClip(productLaunchBrief, "square");
126
+ const portrait = await generateMarketingClip(productLaunchBrief, "portrait");
127
+ \`\`\`
128
+
129
+ ## Guardrails
130
+
131
+ - Keep content briefs concise -- the deterministic planner maps each section to a 2-5 second scene.
132
+ - Target duration defaults to ~17 seconds if not specified. Set \`targetDurationSeconds\` for precise control.
133
+ - The generated \`VideoProject\` is a data structure, not a rendered file. Use \`LocalRenderer\` for MP4 output.
134
+ `
135
+ }
136
+ ];
137
+ registerDocBlocks(blocks);
138
+ // src/example.ts
139
+ import { defineExample } from "@contractspec/lib.contracts-spec";
140
+ var example = defineExample({
141
+ meta: {
142
+ key: "video-marketing-clip",
143
+ version: "1.0.0",
144
+ title: "Video Marketing Clips",
145
+ description: "Generate short-form marketing videos from content briefs using the deterministic video-gen pipeline.",
146
+ kind: "script",
147
+ visibility: "public",
148
+ stability: "experimental",
149
+ owners: ["@platform.core"],
150
+ tags: ["video", "marketing", "content-gen", "social-clip"]
151
+ },
152
+ docs: {
153
+ rootDocId: "docs.examples.video-marketing-clip",
154
+ usageDocId: "docs.examples.video-marketing-clip.usage"
155
+ },
156
+ entrypoints: {
157
+ packageName: "@contractspec/example.video-marketing-clip",
158
+ docs: "./docs"
159
+ },
160
+ surfaces: {
161
+ templates: true,
162
+ sandbox: { enabled: true, modes: ["markdown"] },
163
+ studio: { enabled: true, installable: true },
164
+ mcp: { enabled: true }
165
+ }
166
+ });
167
+ var example_default = example;
168
+
169
+ // src/generate-clip.ts
170
+ import { VideoGenerator } from "@contractspec/lib.video-gen/generators";
171
+ import { VIDEO_FORMATS } from "@contractspec/lib.video-gen/design/layouts";
172
+ var FORMAT_MAP = {
173
+ landscape: VIDEO_FORMATS.landscape,
174
+ square: VIDEO_FORMATS.square,
175
+ portrait: VIDEO_FORMATS.portrait
176
+ };
177
+ async function generateMarketingClip(brief, format = "landscape", targetDurationSeconds) {
178
+ const generator = new VideoGenerator({ fps: 30 });
179
+ const videoBrief = {
180
+ content: brief,
181
+ format: FORMAT_MAP[format],
182
+ targetDurationSeconds
183
+ };
184
+ return generator.generate(videoBrief);
185
+ }
186
+ async function generateAllFormats(brief, targetDurationSeconds) {
187
+ const [landscape, square, portrait] = await Promise.all([
188
+ generateMarketingClip(brief, "landscape", targetDurationSeconds),
189
+ generateMarketingClip(brief, "square", targetDurationSeconds),
190
+ generateMarketingClip(brief, "portrait", targetDurationSeconds)
191
+ ]);
192
+ return { landscape, square, portrait };
193
+ }
194
+ export {
195
+ productLaunchBrief,
196
+ generateMarketingClip,
197
+ generateAllFormats,
198
+ featureAnnouncementBrief,
199
+ example_default as example,
200
+ caseStudyBrief
201
+ };
package/package.json ADDED
@@ -0,0 +1,145 @@
1
+ {
2
+ "name": "@contractspec/example.video-marketing-clip",
3
+ "version": "2.1.0",
4
+ "description": "Generate short-form marketing videos from content briefs using the video-gen pipeline.",
5
+ "type": "module",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "bun": "./dist/index.js",
11
+ "node": "./dist/node/index.js",
12
+ "browser": "./dist/browser/index.js",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "./briefs": {
16
+ "types": "./dist/briefs.d.ts",
17
+ "bun": "./dist/briefs.js",
18
+ "node": "./dist/node/briefs.js",
19
+ "browser": "./dist/browser/briefs.js",
20
+ "default": "./dist/briefs.js"
21
+ },
22
+ "./docs": {
23
+ "types": "./dist/docs/index.d.ts",
24
+ "bun": "./dist/docs/index.js",
25
+ "node": "./dist/node/docs/index.js",
26
+ "browser": "./dist/browser/docs/index.js",
27
+ "default": "./dist/docs/index.js"
28
+ },
29
+ "./docs/index": {
30
+ "types": "./dist/docs/index.d.ts",
31
+ "bun": "./dist/docs/index.js",
32
+ "node": "./dist/node/docs/index.js",
33
+ "browser": "./dist/browser/docs/index.js",
34
+ "default": "./dist/docs/index.js"
35
+ },
36
+ "./docs/video-marketing-clip.docblock": {
37
+ "types": "./dist/docs/video-marketing-clip.docblock.d.ts",
38
+ "bun": "./dist/docs/video-marketing-clip.docblock.js",
39
+ "node": "./dist/node/docs/video-marketing-clip.docblock.js",
40
+ "browser": "./dist/browser/docs/video-marketing-clip.docblock.js",
41
+ "default": "./dist/docs/video-marketing-clip.docblock.js"
42
+ },
43
+ "./example": {
44
+ "types": "./dist/example.d.ts",
45
+ "bun": "./dist/example.js",
46
+ "node": "./dist/node/example.js",
47
+ "browser": "./dist/browser/example.js",
48
+ "default": "./dist/example.js"
49
+ },
50
+ "./generate-clip": {
51
+ "types": "./dist/generate-clip.d.ts",
52
+ "bun": "./dist/generate-clip.js",
53
+ "node": "./dist/node/generate-clip.js",
54
+ "browser": "./dist/browser/generate-clip.js",
55
+ "default": "./dist/generate-clip.js"
56
+ }
57
+ },
58
+ "scripts": {
59
+ "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
60
+ "publish:pkg:canary": "bun publish:pkg --tag canary",
61
+ "build": "bun run prebuild && bun run build:bundle && bun run build:types",
62
+ "build:bundle": "contractspec-bun-build transpile",
63
+ "build:types": "contractspec-bun-build types",
64
+ "dev": "contractspec-bun-build dev",
65
+ "clean": "rimraf dist .turbo",
66
+ "lint": "bun lint:fix",
67
+ "lint:fix": "eslint src --fix",
68
+ "lint:check": "eslint src",
69
+ "test": "bun test --pass-with-no-tests",
70
+ "prebuild": "contractspec-bun-build prebuild",
71
+ "typecheck": "tsc --noEmit"
72
+ },
73
+ "dependencies": {
74
+ "@contractspec/lib.contracts-spec": "2.1.1",
75
+ "@contractspec/lib.video-gen": "1.42.1",
76
+ "@contractspec/lib.content-gen": "2.1.1"
77
+ },
78
+ "devDependencies": {
79
+ "@contractspec/tool.typescript": "2.1.0",
80
+ "@contractspec/tool.bun": "2.1.0",
81
+ "typescript": "^5.9.3"
82
+ },
83
+ "publishConfig": {
84
+ "access": "public",
85
+ "exports": {
86
+ ".": {
87
+ "types": "./dist/index.d.ts",
88
+ "bun": "./dist/index.js",
89
+ "node": "./dist/node/index.js",
90
+ "browser": "./dist/browser/index.js",
91
+ "default": "./dist/index.js"
92
+ },
93
+ "./briefs": {
94
+ "types": "./dist/briefs.d.ts",
95
+ "bun": "./dist/briefs.js",
96
+ "node": "./dist/node/briefs.js",
97
+ "browser": "./dist/browser/briefs.js",
98
+ "default": "./dist/briefs.js"
99
+ },
100
+ "./docs": {
101
+ "types": "./dist/docs/index.d.ts",
102
+ "bun": "./dist/docs/index.js",
103
+ "node": "./dist/node/docs/index.js",
104
+ "browser": "./dist/browser/docs/index.js",
105
+ "default": "./dist/docs/index.js"
106
+ },
107
+ "./docs/index": {
108
+ "types": "./dist/docs/index.d.ts",
109
+ "bun": "./dist/docs/index.js",
110
+ "node": "./dist/node/docs/index.js",
111
+ "browser": "./dist/browser/docs/index.js",
112
+ "default": "./dist/docs/index.js"
113
+ },
114
+ "./docs/video-marketing-clip.docblock": {
115
+ "types": "./dist/docs/video-marketing-clip.docblock.d.ts",
116
+ "bun": "./dist/docs/video-marketing-clip.docblock.js",
117
+ "node": "./dist/node/docs/video-marketing-clip.docblock.js",
118
+ "browser": "./dist/browser/docs/video-marketing-clip.docblock.js",
119
+ "default": "./dist/docs/video-marketing-clip.docblock.js"
120
+ },
121
+ "./example": {
122
+ "types": "./dist/example.d.ts",
123
+ "bun": "./dist/example.js",
124
+ "node": "./dist/node/example.js",
125
+ "browser": "./dist/browser/example.js",
126
+ "default": "./dist/example.js"
127
+ },
128
+ "./generate-clip": {
129
+ "types": "./dist/generate-clip.d.ts",
130
+ "bun": "./dist/generate-clip.js",
131
+ "node": "./dist/node/generate-clip.js",
132
+ "browser": "./dist/browser/generate-clip.js",
133
+ "default": "./dist/generate-clip.js"
134
+ }
135
+ },
136
+ "registry": "https://registry.npmjs.org/"
137
+ },
138
+ "license": "MIT",
139
+ "repository": {
140
+ "type": "git",
141
+ "url": "https://github.com/lssm-tech/contractspec.git",
142
+ "directory": "packages/examples/video-marketing-clip"
143
+ },
144
+ "homepage": "https://contractspec.io"
145
+ }
package/src/briefs.ts ADDED
@@ -0,0 +1,88 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Sample Content Briefs for Marketing Video Generation
3
+ // ---------------------------------------------------------------------------
4
+
5
+ import type { ContentBrief } from '@contractspec/lib.content-gen/types';
6
+
7
+ /**
8
+ * Product launch brief -- announcing ContractSpec to the market.
9
+ */
10
+ export const productLaunchBrief: ContentBrief = {
11
+ title: 'Ship APIs 10x Faster with ContractSpec',
12
+ summary:
13
+ 'ContractSpec generates REST, GraphQL, DB schemas, SDKs, and MCP tools from a single spec definition.',
14
+ problems: [
15
+ 'Teams rewrite the same API logic across multiple surfaces',
16
+ 'Manual synchronization leads to inconsistent endpoints',
17
+ 'Schema drift between frontend, backend, and documentation',
18
+ ],
19
+ solutions: [
20
+ 'One spec, every surface -- define once, generate everything',
21
+ 'Deterministic output -- same spec always produces the same code',
22
+ 'Fully ejectable -- no lock-in, standard TypeScript',
23
+ ],
24
+ metrics: [
25
+ '10x faster API development',
26
+ 'Zero schema drift across surfaces',
27
+ '18 generated files from 3 contracts',
28
+ ],
29
+ audience: {
30
+ role: 'Engineering Lead',
31
+ industry: 'SaaS',
32
+ painPoints: ['API maintenance burden', 'Cross-surface consistency'],
33
+ },
34
+ callToAction: 'Try ContractSpec today at contractspec.dev',
35
+ };
36
+
37
+ /**
38
+ * Feature announcement brief -- new MCP tool generation.
39
+ */
40
+ export const featureAnnouncementBrief: ContentBrief = {
41
+ title: 'Now Generating MCP Tools from Your Specs',
42
+ summary:
43
+ 'ContractSpec v2 adds automatic MCP tool generation -- your contracts now power AI assistants natively.',
44
+ problems: [
45
+ 'Building MCP tools manually is tedious and error-prone',
46
+ 'AI assistants need structured tool definitions that stay in sync with APIs',
47
+ ],
48
+ solutions: [
49
+ 'Automatic MCP tool generation from existing contract specs',
50
+ 'Type-safe tool definitions with Zod schema validation',
51
+ 'Zero additional configuration -- just build',
52
+ ],
53
+ audience: {
54
+ role: 'Developer',
55
+ painPoints: ['MCP integration complexity'],
56
+ },
57
+ callToAction: 'Upgrade to ContractSpec v2',
58
+ };
59
+
60
+ /**
61
+ * Case study brief -- customer success story.
62
+ */
63
+ export const caseStudyBrief: ContentBrief = {
64
+ title: 'How Acme Corp Cut API Dev Time by 80%',
65
+ summary:
66
+ 'Acme Corp migrated 47 endpoints to ContractSpec and eliminated manual synchronization across 5 surfaces.',
67
+ problems: [
68
+ '47 REST endpoints maintained manually across 3 teams',
69
+ 'GraphQL schema constantly out of sync with REST',
70
+ 'SDK updates lagged behind API changes by weeks',
71
+ ],
72
+ solutions: [
73
+ 'Migrated to ContractSpec in 2 weeks',
74
+ 'Single source of truth for all 47 endpoints',
75
+ 'Automated SDK and documentation generation',
76
+ ],
77
+ metrics: [
78
+ '80% reduction in API development time',
79
+ 'Zero sync issues since migration',
80
+ '3 teams now share one spec repository',
81
+ ],
82
+ audience: {
83
+ role: 'CTO',
84
+ industry: 'FinTech',
85
+ painPoints: ['API maintenance costs', 'Team coordination'],
86
+ },
87
+ callToAction: 'Read the full case study at contractspec.dev/customers',
88
+ };
@@ -0,0 +1 @@
1
+ import './video-marketing-clip.docblock';
@@ -0,0 +1,70 @@
1
+ import type { DocBlock } from '@contractspec/lib.contracts-spec/docs';
2
+ import { registerDocBlocks } from '@contractspec/lib.contracts-spec/docs';
3
+
4
+ const blocks: DocBlock[] = [
5
+ {
6
+ id: 'docs.examples.video-marketing-clip',
7
+ title: 'Video Marketing Clips (example)',
8
+ summary:
9
+ 'End-to-end example: generate short-form social clips from content briefs using the deterministic video-gen pipeline.',
10
+ kind: 'reference',
11
+ visibility: 'public',
12
+ route: '/docs/examples/video-marketing-clip',
13
+ tags: ['video', 'marketing', 'social-clip', 'example'],
14
+ body: `## What this example shows
15
+
16
+ - Building a \`VideoBrief\` from a \`ContentBrief\` with format, duration, and style settings.
17
+ - Using \`VideoGenerator\` in fully deterministic mode (no LLM) to produce a \`VideoProject\`.
18
+ - Generating video projects for all three social formats: landscape (16:9), square (1:1), and portrait (9:16).
19
+ - Accessing the resulting scene graph, durations, and composition props.
20
+
21
+ ## Key concepts
22
+
23
+ - **ContentBrief**: The narrative source (title, problems, solutions, CTA) from \`@contractspec/lib.content-gen\`.
24
+ - **VideoBrief**: Wraps ContentBrief with video-specific config (format, duration, narration, style).
25
+ - **VideoGenerator**: Orchestrates scene planning and project assembly. Deterministic by default.
26
+ - **VideoProject**: The output scene graph ready for rendering or preview.
27
+
28
+ ## Notes
29
+
30
+ - No LLM or voice provider is needed -- the pipeline is fully deterministic.
31
+ - The example does not render to MP4 (that requires Node.js + \`@remotion/renderer\`). It produces the \`VideoProject\` data structure.
32
+ `,
33
+ },
34
+ {
35
+ id: 'docs.examples.video-marketing-clip.usage',
36
+ title: 'Video Marketing Clips -- Usage',
37
+ summary: 'How to generate marketing video projects from content briefs.',
38
+ kind: 'usage',
39
+ visibility: 'public',
40
+ route: '/docs/examples/video-marketing-clip/usage',
41
+ tags: ['video', 'marketing', 'usage'],
42
+ body: `## Usage
43
+
44
+ \`\`\`ts
45
+ import { generateMarketingClip } from "@contractspec/example.video-marketing-clip/generate-clip";
46
+ import { productLaunchBrief } from "@contractspec/example.video-marketing-clip/briefs";
47
+
48
+ // Generate a landscape video project
49
+ const project = await generateMarketingClip(productLaunchBrief, "landscape");
50
+
51
+ console.log(project.scenes.length); // number of scenes
52
+ console.log(project.totalDurationInFrames); // total frames
53
+ console.log(project.format); // { type: "landscape", width: 1920, height: 1080 }
54
+
55
+ // Generate all three format variants
56
+ const landscapes = await generateMarketingClip(productLaunchBrief, "landscape");
57
+ const square = await generateMarketingClip(productLaunchBrief, "square");
58
+ const portrait = await generateMarketingClip(productLaunchBrief, "portrait");
59
+ \`\`\`
60
+
61
+ ## Guardrails
62
+
63
+ - Keep content briefs concise -- the deterministic planner maps each section to a 2-5 second scene.
64
+ - Target duration defaults to ~17 seconds if not specified. Set \`targetDurationSeconds\` for precise control.
65
+ - The generated \`VideoProject\` is a data structure, not a rendered file. Use \`LocalRenderer\` for MP4 output.
66
+ `,
67
+ },
68
+ ];
69
+
70
+ registerDocBlocks(blocks);
package/src/example.ts ADDED
@@ -0,0 +1,32 @@
1
+ import { defineExample } from '@contractspec/lib.contracts-spec';
2
+
3
+ const example = defineExample({
4
+ meta: {
5
+ key: 'video-marketing-clip',
6
+ version: '1.0.0',
7
+ title: 'Video Marketing Clips',
8
+ description:
9
+ 'Generate short-form marketing videos from content briefs using the deterministic video-gen pipeline.',
10
+ kind: 'script',
11
+ visibility: 'public',
12
+ stability: 'experimental',
13
+ owners: ['@platform.core'],
14
+ tags: ['video', 'marketing', 'content-gen', 'social-clip'],
15
+ },
16
+ docs: {
17
+ rootDocId: 'docs.examples.video-marketing-clip',
18
+ usageDocId: 'docs.examples.video-marketing-clip.usage',
19
+ },
20
+ entrypoints: {
21
+ packageName: '@contractspec/example.video-marketing-clip',
22
+ docs: './docs',
23
+ },
24
+ surfaces: {
25
+ templates: true,
26
+ sandbox: { enabled: true, modes: ['markdown'] },
27
+ studio: { enabled: true, installable: true },
28
+ mcp: { enabled: true },
29
+ },
30
+ });
31
+
32
+ export default example;