# Webiny AI Powerups Content

Generating Headless CMS entry content with AI from your own code, by delegating to the...

- Repository: https://github.com/webiny/webiny-js (8051 stars)
- Category: AI and agents
- License: see repository
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add webiny/webiny-js --skill webiny-ai-powerups-content -g -a claude-code -y`
Codex: `npx skills add webiny/webiny-js --skill webiny-ai-powerups-content -g -a codex -y`
Cursor: `npx skills add webiny/webiny-js --skill webiny-ai-powerups-content -g -a cursor -y`
Gemini CLI: `npx skills add webiny/webiny-js --skill webiny-ai-powerups-content -g -a gemini-cli -y`

## 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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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

```typescript
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:

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