本文へスキップ
Skillpedia
プロンプトとLLM8.1k · #12582

webiny-ai-powerups-content

できること

このスキルは、モデルを直接呼び出すのではなく、WebinyのCMSでAI Power Upsの機能を通じてエントリーの文章を作る方法をAIに示します。自分のコードから自動化されたコンテンツがほしい開発者向けです。

使う場面

  • ✓CMSエントリーの内容を要約または書き直す、一括アクションやフックがほしいとき。
  • ✓生成されたコンテンツを、プロジェクトに設定されたトーンや読者のペルソナに従わせたいとき。
  • ✓モデルを選ばず、APIキーも扱わずに、カスタムのミューテーションの中でAIのコンテンツを作りたいとき。

スキルのリンク

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/ai-powerups-content/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/ai-powerups-content/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“AI Power Upsの設定を使って、各製品のエントリーに短いマーケティングの要約を生成する一括アクションを書いてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

スキルは、プロンプトと、任意のプロジェクトIDやペルソナIDを指定して、生成のユースケースを呼び出す方法を説明します。ユースケースは生成されたエントリーの値を返し、それをコードが解析して使います。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

AI content generation via AI Power Ups

TL;DR

Inject CmsGenerateEntryContentUseCase (from webiny/api/ai-powerups) and call execute(...). It uses the provider the user configured in AI Power Ups and applies an optional Project, Writer Persona, or Reader Persona — so you never pick models, decrypt API keys, or hardcode prompts. It returns the AI-generated entry values as a JSON string; parse it and take the field(s) you want.

Prefer this over a raw Ai.generateText call whenever the point is "apply the user's configured AI setup" — it composes the product with itself and is far less plumbing.

Generate content

import { CmsGenerateEntryContentUseCase } from "webiny/api/ai-powerups";

class MyThing {
  constructor(private generate: CmsGenerateEntryContentUseCase.Interface) {}

  async run(model, entry, ctx) {
    const result = await this.generate.execute({
      modelId: model.modelId,
      prompt: `Write a one-sentence marketing summary for "${entry.values.name}". Fill only the "aiSummary" field.`,
      // Any of these are optional; they map to what the user configured in AI Power Ups:
      projectId: ctx?.projectId, // a bundled context (instructions + files + default personas)
      writerPersonaId: ctx?.writerPersonaId, // tone
      readerPersonaId: ctx?.readerPersonaId // audience
    });
    if (result.isFail()) {
      throw result.error; // e.g. "No AI provider configured. Add a provider in AI Power Ups settings."
    }
    return result.value; // { values, telemetry }
  }
}

Register the dependency: dependencies: [CmsGenerateEntryContentUseCase].

Output shape — important

result.value.values is an entry-shaped object keyed by the model's field ids (the use case is built to fill an entry from its schema). The AI decides which fields it fills, so:

  • Read only the field(s) you want (e.g. result.value.values.aiSummary) — do NOT blindly write the whole object back, or the AI could overwrite name, price, etc.
  • Type the values at the call site if you like: execute<{ aiSummary?: string }>(...), which makes result.value.values.aiSummary typed (defaults to Record<string, any>).
  • Guard for the field being absent (the model may not have filled it): fall back to "" and, if you're inside a converging background task, still mark the entry done so it doesn't loop.

Then persist with UpdateEntryUseCase (values nested; skipValidation: true for a targeted field write).

Admin — list configured contexts (for a picker)

To let the user pick a Project/Persona in the Admin UI, read AI Power Ups settings with GetSettingsFeature (from webiny/admin/ai-powerups):

import { useFeature } from "webiny/admin";
import { GetSettingsFeature } from "webiny/admin/ai-powerups";

const { useCase: getSettings } = useFeature(GetSettingsFeature);
const settings = await getSettings.execute();
// settings.writerPersonas.presets / settings.readerPersonas.presets / settings.projects.presets
// each preset: { id, name, description, ... }

Forward the chosen id(s) to your backend (e.g. via a bulk action's data).

Related

  • webiny-cms-bulk-actions — the common host for this: a bulk action whose processData calls CmsGenerateEntryContentUseCase and writes the result, as a background task.
  • @webiny/ai-powerups's AiImageEnrichmentTask shows the alternative (raw, hardcoded Ai.generateText) — use that only when you deliberately don't want the configured setup.
よくある質問

モデルを選んだりAPIキーを扱ったりする必要がありますか?

いいえ。スキルによると、ユースケースは、ユーザーがAI Power Upsで設定済みのプロバイダーを使います。

生成は何を返しますか?

コードが解析する、JSON文字列としてのAIが生成したエントリーの値です。

ペルソナとは何ですか?

ライターのペルソナはトーンを、読者のペルソナは対象を設定します。どちらも任意です。

詳細

作者による元の説明

Generating Headless CMS entry content with AI from your own code, by delegating to the AI Power Ups extension instead of calling an LLM directly. Use this skill when the developer wants to generate/summarize/rewrite entry content programmatically (e.g. from a bulk action, a lifecycle hook, or a custom mutation) using the provider and the Writer/Reader Personas and Projects the user configured in AI Power Ups. Requires the AI Power Ups extension (with a provider configured) and Webiny 6.5.0 or newer.

repo: webiny/webiny-js

人気

GitHubのスター
8.1k
ランキング
#12582
ライセンス
—
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル