Search by

vectorbross / vb_ai_ckeditor

vectorbross

Adds the AI CKEditor integration on top of VB AI Core and configures the toolbar, AI tools and a tone of voice vocabulary.

Package info

bitbucket.org/vectorbross/vb_ai_ckeditor

Type:drupal-recipe

pkg:composer/vectorbross/vb_ai_ckeditor

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

dev-master 2026-11-27 11:19 UTC

This package is not auto-updated.

Last update: 2026-12-03 21:54:40 UTC


README

Adds the AI CKEditor 5 integration on top of vb_ai_core. Editors get an AI tools button in the rich text toolbar for completion, summarize, tone, spellfix and more.

What it installs

ModulePurpose
ai_ckeditorAI tools in the CKEditor 5 toolbar
taxonomyHolds the tone of voice vocabulary

It also applies these recipes first:

  • vb_ai_core (ai, key, token)
  • core/recipes/full_html_format_editor
  • core/recipes/basic_html_format_editor

What it configures

Text formats

The Full HTML and Basic HTML editors get the same toolbar, with the AI buttons first:

AI CKEditor, AI balloon menu | bold, italic | link | bulleted list,
numbered list | block quote, insert image | heading, code | source

The AI dialog opens at 900 × 800 px (autoresize min-width: 600px).

AI tools

ToolEnabledProvider
ai_ckeditor_completionyesdefault chat
ai_ckeditor_modify_promptyesdefault chat
ai_ckeditor_reformat_htmlyesdefault chat
ai_ckeditor_spellfixyesdefault chat
ai_ckeditor_summarizeyesdefault chat
ai_ckeditor_toneyesdefault chat

An empty provider means the default chat provider set by the provider recipe is used.

Tone of voice

The recipe creates a Tone of voice (tone_of_voice) vocabulary with five default terms, imported from content/taxonomy_term:

TermDescription sent to the model
FormalPolite, correct and distant. No slang or contractions.
ProfessionalClear, confident and businesslike. Direct without being stiff.
FriendlyWarm, approachable and conversational.
InformalRelaxed and casual, as if talking to a peer.
PersuasiveConvincing and benefit driven, with a clear call to action.

The tone tool offers these terms as choices and sends the term description to the model (use_description: true). New terms are not created automatically (autocreate: false). Add or edit terms at /admin/structure/taxonomy/manage/tone_of_voice. Applying the recipe again skips terms that already exist, so local edits are kept.

Tone prompt

The recipe adds its own prompt entity, ai_ckeditor_tone__vb (config/ai.ai_prompt.ai_ckeditor_tone__vb.yml), and sets it as the tone prompt in ai_ckeditor.settings. Compared to the module's default prompt, it also tells the model to preserve the meaning and HTML formatting. It is written in English and keeps the language of the input text.

prompts.tone holds the ID of an ai_prompt entity, not the prompt text. To change the prompt, edit the entity in config/ or under the AI prompt management pages, and keep the {tone}, {toneDescription} and {inputText} placeholders.

Requirements

  • Drupal 11.4+
  • Drush 13+
  • The project setup from vb_ai_core (composer/installers 2.3+, the recipes/{$name} installer path and the VB repositories entry)
  • A chat capable provider recipe, already required and applied, for example vb_ai_provider_anthropic. The provider recipe sets the default for the chat operation, which the AI tools use.

Install

Require the recipe. Composer pulls in vb_ai_core and drupal/ai (which contains the ai_ckeditor module) as dependencies.

ddev composer require vectorbross/vb_ai_ckeditor

Apply the recipe

Make sure a provider recipe has been applied first (see Requirements). Run from the project root; Drush runs from the web docroot, so the path starts with ../recipes.

ddev drush recipe ../recipes/vb_ai_ckeditor
ddev drush cr

Permissions

The recipe grants the Use AI CKEditor permission to the content_editor and webmaster roles, but only if they already exist. The actions are marked optional with a ? prefix (supported by Drupal core recipes), so missing roles are skipped, not created. The administrator role already has every permission. Grant it manually if another role needs access.

Verify

ddev drush pm:list --status=enabled --filter=ai_ckeditor

Then edit content with a body field, select Full HTML or Basic HTML and click the AI CKEditor button in the toolbar. Pick a tool, such as Summarize, and the result is generated by the chat model.

Options

  • Toolbar and AI tool settings live per text format at /admin/config/content/formats. Changes made there are overwritten when the recipe is applied again; to change them for every site, update recipe.yml.
  • To use a different provider or model for one tool, set its provider in recipe.yml instead of leaving it empty.
  • To use another tone prompt, point prompts.tone in recipe.yml to a different ai_prompt entity ID, for example ai_ckeditor_tone__default for the module's own prompt.

License

GPL-2.0-or-later. See LICENSE.txt.