Langsung ke konten
Skillpedia
Prompt & LLM8.1k Β· #12582

webiny-ai-powerups-content

Fungsinya

Skill ini menunjukkan kepada AI Anda cara membuat teks entri di CMS Webiny melalui fitur AI Power Ups, alih-alih memanggil model secara langsung. Skill ini untuk pengembang yang menginginkan konten otomatis dari kode mereka sendiri.

Kapan dipakai

  • βœ“Saat Anda menginginkan aksi massal atau hook untuk meringkas atau menulis ulang konten entri CMS.
  • βœ“Saat Anda ingin konten yang dihasilkan mengikuti nada atau persona audiens yang diatur untuk proyek.
  • βœ“Saat Anda memerlukan pembuatan konten AI di dalam mutasi khusus tanpa memilih model atau menangani kunci API.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/ai-powerups-content/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œTulis aksi massal yang membuat ringkasan pemasaran singkat untuk setiap entri produk, memakai pengaturan AI Power Ups kami.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill menjelaskan cara memanggil use case generasi dengan prompt serta ID proyek dan persona yang opsional. Use case mengembalikan nilai entri yang dihasilkan, yang kemudian di-parse dan dipakai oleh kode Anda.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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.
Pertanyaan umum

Apakah saya perlu memilih model atau menangani kunci API?

Tidak. Skill menyatakan use case memakai penyedia yang sudah Anda atur di AI Power Ups.

Apa yang dikembalikan oleh generasi?

Nilai entri yang dihasilkan AI sebagai string JSON, yang kemudian di-parse oleh kode Anda.

Apa itu persona?

Persona penulis menentukan nada, dan persona pembaca menentukan audiens. Keduanya bersifat opsional.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
8.1k
Peringkat
#12582
Lisensi
β€”
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa