📦 Widgetジェネレーター
プロンプトチャットのフィードシステム向けに、カスタマイズ可能なウィジェットプラグインを自動生成するSkill。
📺 まず動画で見る(YouTube)
▶ 【Claude Code完全入門】誰でも使える/Skills活用法/経営者こそ使うべき ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
Generate customizable widget plugins for the prompts.chat feed system
🇯🇵 日本人クリエイター向け解説
プロンプトチャットのフィードシステム向けに、カスタマイズ可能なウィジェットプラグインを自動生成するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o widget-generator.zip https://jpskill.com/download/1084.zip && unzip -o widget-generator.zip && rm widget-generator.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/1084.zip -OutFile "$d\widget-generator.zip"; Expand-Archive "$d\widget-generator.zip" -DestinationPath $d -Force; ri "$d\widget-generator.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
widget-generator.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
widget-generatorフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
💬 こう話しかけるだけ — サンプルプロンプト
- › Widget Generator の使い方を教えて
- › Widget Generator で何ができるか具体例で見せて
- › Widget Generator を初めて使う人向けにステップを案内して
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Claude が読む原文 SKILL.md(中身を展開)
この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。
Widget Generator Skill
This skill guides creation of widget plugins for prompts.chat. Widgets are injected into prompt feeds to display promotional content, sponsor cards, or custom interactive components.
Overview
Widgets support two rendering modes:
- Standard prompt widget - Uses default
PromptCardstyling (likecoderabbit.ts) - Custom render widget - Full custom React component (like
book.tsx)
Prerequisites
Before creating a widget, gather from the user:
| Parameter | Required | Description |
|---|---|---|
| Widget ID | ✅ | Unique identifier (kebab-case, e.g., my-sponsor) |
| Widget Name | ✅ | Display name for the plugin |
| Rendering Mode | ✅ | standard or custom |
| Sponsor Info | ❌ | Name, logo, logoDark, URL (for sponsored widgets) |
Step 1: Gather Widget Configuration
Ask the user for the following configuration options:
Basic Info
- id: string (unique, kebab-case)
- name: string (display name)
- slug: string (URL-friendly identifier)
- title: string (card title)
- description: string (card description)
Content (for standard mode)
- content: string (prompt content, can be multi-line markdown)
- type: "TEXT" | "STRUCTURED"
- structuredFormat?: "json" | "yaml" (if type is STRUCTURED)
Categorization
- tags?: string[] (e.g., ["AI", "Development"])
- category?: string (e.g., "Development", "Writing")
Action Button
- actionUrl?: string (CTA link)
- actionLabel?: string (CTA button text)
Sponsor (optional)
- sponsor?: {
name: string
logo: string (path to light mode logo)
logoDark?: string (path to dark mode logo)
url: string (sponsor website)
}
Positioning Strategy
- positioning: {
position: number (0-indexed start position, default: 2)
mode: "once" | "repeat" (default: "once")
repeatEvery?: number (for repeat mode, e.g., 30)
maxCount?: number (max occurrences, default: 1 for once, unlimited for repeat)
}
Injection Logic
- shouldInject?: (context) => boolean
Context contains:
- filters.q: search query
- filters.category: category name
- filters.categorySlug: category slug
- filters.tag: tag filter
- filters.sort: sort option
- itemCount: total items in feed
Step 2: Create Widget File
Standard Widget (TypeScript only)
Create file: src/lib/plugins/widgets/{widget-id}.ts
import type { WidgetPlugin } from "./types";
export const {widgetId}Widget: WidgetPlugin = {
id: "{widget-id}",
name: "{Widget Name}",
prompts: [
{
id: "{prompt-id}",
slug: "{prompt-slug}",
title: "{Title}",
description: "{Description}",
content: `{Multi-line content here}`,
type: "TEXT",
// Optional sponsor
sponsor: {
name: "{Sponsor Name}",
logo: "/sponsors/{sponsor}.svg",
logoDark: "/sponsors/{sponsor}-dark.svg",
url: "{sponsor-url}",
},
tags: ["{Tag1}", "{Tag2}"],
category: "{Category}",
actionUrl: "{action-url}",
actionLabel: "{Action Label}",
positioning: {
position: 2,
mode: "repeat",
repeatEvery: 50,
maxCount: 3,
},
shouldInject: (context) => {
const { filters } = context;
// Always show when no filters active
if (!filters?.q && !filters?.category && !filters?.tag) {
return true;
}
// Add custom filter logic here
return false;
},
},
],
};
Custom Render Widget (TSX with React)
Create file: src/lib/plugins/widgets/{widget-id}.tsx
import Link from "next/link";
import Image from "next/image";
import { Button } from "@/components/ui/button";
import type { WidgetPlugin } from "./types";
function {WidgetName}Widget() {
return (
<div className="group border rounded-[var(--radius)] overflow-hidden hover:border-foreground/20 transition-colors bg-gradient-to-br from-primary/5 via-background to-primary/10 p-5">
{/* Custom widget content */}
<div className="flex flex-col items-center gap-4">
{/* Image/visual element */}
<div className="relative w-full aspect-video">
<Image
src="/path/to/image.jpg"
alt="{Alt text}"
fill
className="object-cover rounded-lg"
/>
</div>
{/* Content */}
<div className="w-full text-center">
<h3 className="font-semibold text-base mb-1.5">{Title}</h3>
<p className="text-xs text-muted-foreground mb-4">{Description}</p>
<Button asChild size="sm" className="w-full">
<Link href="{action-url}">{Action Label}</Link>
</Button>
</div>
</div>
</div>
);
}
export const {widgetId}Widget: WidgetPlugin = {
id: "{widget-id}",
name: "{Widget Name}",
prompts: [
{
id: "{prompt-id}",
slug: "{prompt-slug}",
title: "{Title}",
description: "{Description}",
content: "",
type: "TEXT",
tags: ["{Tag1}", "{Tag2}"],
category: "{Category}",
actionUrl: "{action-url}",
actionLabel: "{Action Label}",
positioning: {
position: 10,
mode: "repeat",
repeatEvery: 60,
maxCount: 4,
},
shouldInject: () => true,
render: () => <{WidgetName}Widget />,
},
],
};
Step 3: Register Widget
Edit src/lib/plugins/widgets/index.ts:
-
Add import at top:
import { {widgetId}Widget } from "./{widget-id}"; -
Add to
widgetPluginsarray:const widgetPlugins: WidgetPlugin[] = [ coderabbitWidget, bookWidget, {widgetId}Widget, // Add new widget ];
Step 4: Add Sponsor Assets (if applicable)
If the widget has a sponsor:
- Add light logo:
public/sponsors/{sponsor}.svg - Add dark logo (optional):
public/sponsors/{sponsor}-dark.svg
Positioning Examples
Show once at position 5
positioning: {
position: 5,
mode: "once",
}
Repeat every 30 items, max 5 times
positioning: {
position: 3,
mode: "repeat",
repeatEvery: 30,
maxCount: 5,
}
Unlimited repeating
positioning: {
position: 2,
mode: "repeat",
repeatEvery: 25,
// No maxCount = unlimited
}
shouldInject Examples
Always show
shouldInject: () => true,
Only when no filters active
shouldInject: (context) => {
const { filters } = context;
return !filters?.q && !filters?.category && !filters?.tag;
},
Show for specific categories
shouldInject: (context) => {
const slug = context.filters?.categorySlug?.toLowerCase();
return slug?.includes("development") || slug?.includes("coding");
},
Show when search matches keywords
shouldInject: (context) => {
const query = context.filters?.q?.toLowerCase() || "";
return ["ai", "automation", "workflow"].some(kw => query.includes(kw));
},
Show only when enough items
shouldInject: (context) => {
return (context.itemCount ?? 0) >= 10;
},
Custom Render Patterns
Card with gradient background
<div className="border rounded-[var(--radius)] overflow-hidden bg-gradient-to-br from-primary/5 via-background to-primary/10 p-5">
Sponsor badge
<div className="flex items-center gap-2 mb-2">
<span className="text-xs font-medium text-primary">Sponsored</span>
</div>
Responsive image
<div className="relative w-full aspect-video">
<Image src="/image.jpg" alt="..." fill className="object-cover" />
</div>
CTA button
<Button asChild size="sm" className="w-full">
<Link href="https://example.com">
Learn More
<ArrowRight className="ml-2 h-3.5 w-3.5" />
</Link>
</Button>
Verification
-
Run type check:
npx tsc --noEmit -
Start dev server:
npm run dev -
Navigate to
/discoveror/feedto verify widget appears at configured positions
Type Reference
interface WidgetPrompt {
id: string;
slug: string;
title: string;
description: string;
content: string;
type: "TEXT" | "STRUCTURED";
structuredFormat?: "json" | "yaml";
sponsor?: {
name: string;
logo: string;
logoDark?: string;
url: string;
};
tags?: string[];
category?: string;
actionUrl?: string;
actionLabel?: string;
positioning?: {
position?: number; // Default: 2
mode?: "once" | "repeat"; // Default: "once"
repeatEvery?: number; // For repeat mode
maxCount?: number; // Max occurrences
};
shouldInject?: (context: WidgetContext) => boolean;
render?: () => ReactNode; // For custom rendering
}
interface WidgetPlugin {
id: string;
name: string;
prompts: WidgetPrompt[];
}
Common Issues
| Issue | Solution |
|---|---|
| Widget not showing | Check shouldInject logic, verify registration in index.ts |
| TypeScript errors | Ensure imports from ./types, check sponsor object shape |
| Styling issues | Use Tailwind classes, match existing widget patterns |
| Position wrong | Remember positions are 0-indexed, check repeatEvery value |