Skip to content
Content
Skill

/ai-powerups-content

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

From plugin
webiny-js
8.1k78 skills3 MCP

Claude Code

$ npx -y skills add webiny/webiny-js --skill ai-powerups-content --agent claude-code

SKILL.md

ai-powerups-content.SKILL.md
name: webiny-ai-powerups-content
description: >
  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.

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.

Read more
@webiny
Ships withwebiny-js

Open-source content platform. Self-hosted on AWS serverless. Built as a TypeScript framework you extend with code, not a closed product you configure through a UI. Runs on Lambda, DynamoDB, S3, and CloudFront inside your own AWS account. Scales automatically.

8.1k78 skills3 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
8.1k
Star history of webiny/webiny-js on GitHub, a chart by star-history.com

Other skills on webiny-js.

design-ask

design-ask

Turn open design questions into a paste-ready prompt for Claude Design, log them with Q-IDs and copy the prompt to the clipboard.…

@webiny@webinyInstall Skill
design-pull

design-pull

Pull a Claude Design project into a local, git-ignored design folder and keep a catalogue of what was pulled and implemented. Use…

@webiny@webinyInstall Skill
grill-me

grill-me

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision…

@webiny@webinyInstall Skill
prd-to-plan

prd-to-plan

Turn a PRD into a multi-phase implementation plan using tracer-bullet vertical slices, saved as a local Markdown file in…

@webiny@webinyInstall Skill
preflight

preflight

Webiny-only. Run all checks required before packages are ready for publish: deps, build, lint, format, tests.

@webiny@webinyInstall Skill
tester

tester

Use when running tests. Shows how to run tests for a single package, including OpenSearch (ddb-os) tests when applicable.

@webiny@webinyInstall Skill

More skills from other plugins.

prompt-lookup

prompt-lookup

Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use…

@gh-f@gh-fInstall Skill
ppt-master

ppt-master

AI-driven presentation workflow for generating editable PPTX decks and slides, reconstructing page visuals, creating reusable…

@hugohe3@hugohe3Install Skill
morph-ppt

morph-ppt

Use this skill when the user wants a .pptx with smooth cross-slide animation — PowerPoint Morph transitions, Keynote-style…

@iofficeai@iofficeaiInstall Skill

Questions about ai-powerups-content.

Which coding agents can use ai-powerups-content?
ai-powerups-content installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.