@todayai-labs/create-widget
Scaffolder. `pnpm create @todayai-labs/widget <project-name>` produces a multi-widget TCK project.
The scaffolder. Invoked via pnpm create @todayai-labs/widget <project-name>. Produces a freestanding multi-widget project — package.json with pinned SDK deps, pnpm-workspace.yaml, tsconfig.json, starter widgets under widgets/, template-specific guideline docs, and a README.md.
The scaffolded project owns no Vite config, no index.html, no preview source — pnpm dev boots tck-preview which provides those from inside its own package. pnpm build runs tck-bundle --all over widgets/*.
Usage
pnpm create @todayai-labs/widget my-widgets
pnpm create @todayai-labs/widget my-brief-latest --template latest
pnpm create @todayai-labs/widget my-brief --template daily-brief
pnpm create @todayai-labs/widget my-brief-v1 --template daily-brief-template-v1
pnpm create @todayai-labs/widget my-brief-v2 --template daily-brief-template-v2
pnpm create @todayai-labs/widget my-brief-v3 --template daily-brief-template-v3
pnpm create @todayai-labs/widget my-brief-v4 --template daily-brief-template-v4
pnpm create @todayai-labs/widget my-brief-v5 --template daily-brief-template-v5
pnpm create @todayai-labs/widget my-brief-minimal --template daily-brief-template-v6-minimal
pnpm create @todayai-labs/widget my-pinned-feed --template pinned-feeds
pnpm create @todayai-labs/widget my-interactive --template interactive-widgets
cd my-widgets
pnpm install
pnpm dev--template selects the widget source preset:
| Template | Contents | Guideline docs |
|---|---|---|
starter | The default two-widget starter: one interactive widget and one feed card. | GUIDELINES_INTERACTIVE_WIDGET.md, GUIDELINES_FEED.md |
daily-brief-template-v1 | The original canonical in-repo daily brief feed-card batch. | GUIDELINES_FEED.md, STYLE_GUIDE.md |
daily-brief-template-v2 | The second canonical in-repo daily brief feed-card batch. | GUIDELINES_FEED.md, STYLE_GUIDE.md |
daily-brief-template-v3 | The third canonical in-repo daily brief feed-card batch. | GUIDELINES_FEED.md, STYLE_GUIDE.md |
daily-brief-template-v4 | The fourth canonical in-repo daily brief feed-card batch. | GUIDELINES_FEED.md, STYLE_GUIDE.md |
daily-brief-template-v5 | The previous canonical 27-card Daily Brief V5 batch. | GUIDELINES_FEED.md, STYLE_GUIDE.md |
daily-brief-template-v5-minimal | An optional 18-card cut of Daily Brief V5. | GUIDELINES_FEED.md, STYLE_GUIDE.md |
daily-brief-template-v6-minimal | The latest 18-card Daily Brief V6 Minimal batch. Aliases: latest, daily-brief. | GUIDELINES_FEED.md, STYLE_GUIDE.md |
pinned-feeds-template-v1 | An unordered 12-card pinned feed batch. Alias: pinned-feeds. | GUIDELINES_FEED.md, STYLE_GUIDE.md |
interactive-widgets-template-v1 | The canonical in-repo interactive widget batch. Alias: interactive-widgets. | GUIDELINES_INTERACTIVE_WIDGET.md |
--list-templates prints the available presets.
The scaffolded SDK pins (@todayai-labs/tck, @todayai-labs/tck-widget-utils, tck-bundler, tck-preview) match the version of the scaffolder that was invoked, so a pnpm create @todayai-labs/widget@3.0.2 produces a project pinned to the 3.0.2 SDK. The scaffolder bakes its own version into the template at scaffold-time — not at template authoring-time — so a fresh pnpm create always installs the SDK minor it ran as.
What you get
my-widgets/
├── package.json — pinned deps on @todayai-labs/{tck,tck-widget-utils,tck-bundler,tck-preview,tck-snapshot} + react + typescript.
├── pnpm-workspace.yaml — pnpm allowBuilds for esbuild.
├── tsconfig.json — self-contained, no monorepo refs.
├── widgets/
│ ├── counter/
│ │ └── widget.tck.tsx — interactive-widget starter.
│ └── hello/
│ └── widget.tck.tsx — feed-card starter.
├── GUIDELINES_*.md — template-specific authoring guide files.
├── STYLE_GUIDE.md — optional, preset-specific visual direction.
├── README.md
└── .gitignoreThe scaffolded tsconfig.json is freestanding — no extends against this monorepo's @todayai-labs/tsconfig. The project is meant to be a starting point you take ownership of. Shape/API rules live in the guideline files selected for the template type; template-specific styling lives in STYLE_GUIDE.md when the selected preset ships one.
Live-widget manifest ids must be globally unique and stable because hosts use them for persisted state, migrations, and future edits. Feed-card ids are best-effort metadata: agent-authored feed snapshots are not edited after generation, so hosts should rely on the built bundle hash for uniqueness instead of treating the manifest id as a global key.
Source
- Package:
packages/create-widget - Template base:
packages/create-widget/templates/base - Template presets:
packages/create-widget/templates/presets - Reference consumer:
apps/preview-playgroundmirrors the project shape this scaffolder produces, but withworkspace:*SDK deps for in-tree testing.