webiny-ai-powerups-content
Skill này làm gì
Skill này chỉ cho AI của bạn cách tạo nội dung mục trong CMS Webiny qua tính năng AI Power Ups, thay vì gọi trực tiếp một mô hình. Dành cho lập trình viên muốn có nội dung tự động từ mã của mình.
Khi nào nên dùng
- ✓Khi bạn muốn một hành động hàng loạt hoặc hook tóm tắt hoặc viết lại nội dung mục CMS.
- ✓Khi bạn muốn nội dung được tạo theo giọng điệu hoặc đối tượng đã đặt cho dự án.
- ✓Khi bạn cần tạo nội dung AI bên trong một mutation tùy chỉnh mà không phải chọn mô hình hay xử lý khóa API.
Liên kết skill
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/ai-powerups-content/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Viết một hành động hàng loạt tạo tóm tắt marketing ngắn cho mỗi mục sản phẩm, dùng thiết lập AI Power Ups của chúng tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill giải thích cách gọi một use case tạo nội dung với một prompt và tùy chọn ID dự án và persona. Use case trả về các giá trị mục đã tạo, và mã sẽ phân tích và dùng chúng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 overwritename,price, etc. - Type the values at the call site if you like:
execute<{ aiSummary?: string }>(...), which makesresult.value.values.aiSummarytyped (defaults toRecord<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 whoseprocessDatacallsCmsGenerateEntryContentUseCaseand writes the result, as a background task.@webiny/ai-powerups'sAiImageEnrichmentTaskshows the alternative (raw, hardcodedAi.generateText) — use that only when you deliberately don't want the configured setup.
Câu hỏi thường gặp
Tôi có cần chọn mô hình hay xử lý khóa API không?
Không. Skill nói use case dùng nhà cung cấp mà người dùng đã cấu hình trong AI Power Ups.
Kết quả tạo ra trả về gì?
Các giá trị mục do AI tạo, dưới dạng chuỗi JSON mà mã của bạn phân tích.
Persona là gì?
Persona người viết đặt giọng điệu, persona người đọc đặt đối tượng, và cả hai đều tùy chọn.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 8.1k
- Vị trí xếp hạng
- #12582
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
prd-to-plan
8.1kGiúp agent của bạn biến tài liệu yêu cầu sản phẩm thành kế hoạch theo giai đoạn gồm các lát cắt đầu-cuối nhỏ, lưu thành file Markdown.
webiny-admin-architect
8.1kDạy agent của bạn cách xây dựng màn hình quản trị cho nền tảng Webiny, dùng các tầng logic nghiệp vụ và mẫu presenter.
webiny-admin-permissions
8.1kDạy agent của bạn thêm kiểm soát quyền vào màn hình quản trị Webiny, gồm form quyền tự sinh và kiểm tra ẩn hoặc hiện.
webiny-form-model
8.1kDạy agent của bạn xây dựng form trong Webiny bằng trình tạo trường khai báo, bố cục, kiểm tra hợp lệ và quy tắc có điều kiện.
Skill tương tự
writing-skills
311kDạy agent của bạn viết skill mới và kiểm thử từng skill trước, kiểm tra xem skill có thực sự thay đổi cách agent hành xử hay không.
writing-for-agents
310kGiải thích cách viết hướng dẫn rõ ràng cho agent AI, gồm skill, tệp AGENTS.md và CLAUDE.md, để agent cư xử nhất quán.
bengali-nlp
280kGiúp agent của bạn xử lý văn bản tiếng Bengali, hỗ trợ hiểu ngôn ngữ này, chuẩn hóa văn bản và xử lý các đặc điểm riêng của nó.