diff --git a/composer.json b/composer.json
index 4bf8985..430a1f9 100644
--- a/composer.json
+++ b/composer.json
@@ -28,7 +28,7 @@
         "php": ">=8.1",
         "ext-dom": "*",
         "ext-json": "*",
-        "drupal/core": "^10.3 || ^11"
+        "drupal/core": "^11.2 || ^12"
     },
     "suggest": {
         "drupal/ai": "Recommended: enables the schema_jsonld_manager_ai submodule, which generates JSON-LD with AI for every page not covered by an SEO document.",
diff --git a/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.info.yml b/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.info.yml
index 291b09b..9fed6e9 100644
--- a/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.info.yml
+++ b/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.info.yml
@@ -2,7 +2,7 @@ name: Schema JSON-LD Manager AI
 type: module
 description: 'Generates Schema.org JSON-LD with AI for pages not covered by an SEO document.'
 package: SEO
-core_version_requirement: ^10.3 || ^11
+core_version_requirement: ^11.2 || ^12
 configure: schema_jsonld_manager_ai.settings
 dependencies:
   - ai:ai
diff --git a/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.install b/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.install
index 922918d..d8a5edc 100644
--- a/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.install
+++ b/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.install
@@ -7,11 +7,14 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ModuleWeight;
+
 /**
  * Implements hook_install().
  */
 function schema_jsonld_manager_ai_install(): void {
   // Run after the base module so its node form alterations exist when this
   // module adds to them.
-  module_set_weight('schema_jsonld_manager_ai', 1);
+  DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.5.0', fn() => \Drupal::service(ModuleWeight::class)->set('schema_jsonld_manager_ai', 1), fn() => module_set_weight('schema_jsonld_manager_ai', 1));
 }
diff --git a/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.module b/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.module
index 6435fa4..ea5da5b 100644
--- a/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.module
+++ b/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.module
@@ -7,25 +7,17 @@
 
 declare(strict_types=1);
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\schema_jsonld_manager_ai\Hook\SchemaJsonldManagerAiHooks;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
-use Drupal\Core\Url;
 
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function schema_jsonld_manager_ai_help(string $route_name, RouteMatchInterface $route_match): ?string {
-  if ($route_name !== 'help.page.schema_jsonld_manager_ai') {
-    return NULL;
-  }
-
-  $output = '<h2>' . t('About') . '</h2>';
-  $output .= '<p>' . t('Adds AI generation to Schema JSON-LD Manager. When a page is not in the active SEO document, its title, text, breadcrumb trail, site name and selected taxonomy terms are sent to the default "Chat" provider of the AI module. The answer is repaired and validated before it is shown for review.') . '</p>';
-  $output .= '<p>' . t('Configure it on the <a href=":url">AI generation settings</a> page.', [
-    ':url' => Url::fromRoute('schema_jsonld_manager_ai.settings')->toString(),
-  ]) . '</p>';
-
-  return $output;
+  return \Drupal::service(SchemaJsonldManagerAiHooks::class)->help($route_name, $route_match);
 }
 
 /**
@@ -35,24 +27,9 @@ function schema_jsonld_manager_ai_help(string $route_name, RouteMatchInterface $
  * adds the node's taxonomy reference fields to the sections the "Generate
  * schema" button validates, so unsaved terms reach the AI prompt.
  */
+#[LegacyHook]
 function schema_jsonld_manager_ai_form_node_form_alter(array &$form, FormStateInterface $form_state, string $form_id): void {
-  if (!isset($form['schema_jsonld']['wrapper']['generate'])) {
-    return;
-  }
-
-  /** @var \Drupal\node\NodeInterface $node */
-  $node = $form_state->getFormObject()->getEntity();
-  $sections = &$form['schema_jsonld']['wrapper']['generate']['#limit_validation_errors'];
-
-  foreach ($node->getFieldDefinitions() as $name => $definition) {
-    if (
-      isset($form[$name])
-      && $definition->getType() === 'entity_reference'
-      && $definition->getSetting('target_type') === 'taxonomy_term'
-    ) {
-      $sections[] = [$name];
-    }
-  }
+  \Drupal::service(SchemaJsonldManagerAiHooks::class)->formNodeFormAlter($form, $form_state, $form_id);
 }
 
 /**
@@ -61,48 +38,9 @@ function schema_jsonld_manager_ai_form_node_form_alter(array &$form, FormStateIn
  * Adds "Taxonomy context" to the main settings page. It is stored in this
  * submodule's configuration, because only AI generation uses it.
  */
+#[LegacyHook]
 function schema_jsonld_manager_ai_form_schema_jsonld_manager_settings_alter(array &$form, FormStateInterface $form_state): void {
-  $title = t('Taxonomy context');
-
-  if (!\Drupal::moduleHandler()->moduleExists('taxonomy')) {
-    $form['taxonomy_vocabularies'] = [
-      '#type' => 'item',
-      '#title' => $title,
-      '#markup' => t('Enable the Taxonomy module to send taxonomy terms to the AI as context.'),
-      '#weight' => 5,
-    ];
-    return;
-  }
-
-  $options = [];
-  foreach (\Drupal::entityTypeManager()->getStorage('taxonomy_vocabulary')->loadMultiple() as $vocabulary) {
-    $options[$vocabulary->id()] = $vocabulary->label();
-  }
-  natcasesort($options);
-
-  if ($options === []) {
-    $form['taxonomy_vocabularies'] = [
-      '#type' => 'item',
-      '#title' => $title,
-      '#markup' => t('No taxonomy vocabularies exist yet. <a href=":url">Add a vocabulary</a>, then come back to select it.', [
-        ':url' => Url::fromRoute('entity.taxonomy_vocabulary.collection')->toString(),
-      ]),
-      '#weight' => 5,
-    ];
-    return;
-  }
-
-  $selected = (array) (\Drupal::config('schema_jsonld_manager_ai.settings')->get('taxonomy_vocabularies') ?? []);
-  $form['taxonomy_vocabularies'] = [
-    '#type' => 'checkboxes',
-    '#title' => $title,
-    '#description' => t('Terms selected on the content from these vocabularies are sent to the AI. Vocabularies about language, places, audiences or organizations map to the matching schema.org properties; all others become keywords.'),
-    '#options' => $options,
-    // Drop vocabularies that have been deleted since they were saved.
-    '#default_value' => array_values(array_intersect($selected, array_keys($options))),
-    '#weight' => 5,
-  ];
-  $form['#submit'][] = '_schema_jsonld_manager_ai_settings_submit';
+  \Drupal::service(SchemaJsonldManagerAiHooks::class)->formSchemaJsonldManagerSettingsAlter($form, $form_state);
 }
 
 /**
diff --git a/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.services.yml b/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.services.yml
index 5a59126..8f7ee6a 100644
--- a/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.services.yml
+++ b/modules/schema_jsonld_manager_ai/schema_jsonld_manager_ai.services.yml
@@ -56,3 +56,7 @@ services:
       - '@schema_jsonld_manager_ai.prompt_builder'
       - '@schema_jsonld_manager_ai.adapter'
       - '@schema_jsonld_manager_ai.validator'
+
+  Drupal\schema_jsonld_manager_ai\Hook\SchemaJsonldManagerAiHooks:
+    class: Drupal\schema_jsonld_manager_ai\Hook\SchemaJsonldManagerAiHooks
+    autowire: true
diff --git a/modules/schema_jsonld_manager_ai/src/Hook/SchemaJsonldManagerAiHooks.php b/modules/schema_jsonld_manager_ai/src/Hook/SchemaJsonldManagerAiHooks.php
new file mode 100644
index 0000000..255f18f
--- /dev/null
+++ b/modules/schema_jsonld_manager_ai/src/Hook/SchemaJsonldManagerAiHooks.php
@@ -0,0 +1,104 @@
+<?php
+
+namespace Drupal\schema_jsonld_manager_ai\Hook;
+
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Url;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+
+/**
+ * Hook implementations for schema_jsonld_manager_ai.
+ */
+class SchemaJsonldManagerAiHooks {
+  use StringTranslationTrait;
+
+  /**
+   * Implements hook_help().
+   */
+  #[Hook('help')]
+  public function help(string $route_name, RouteMatchInterface $route_match): ?string {
+    if ($route_name !== 'help.page.schema_jsonld_manager_ai') {
+      return NULL;
+    }
+    $output = '<h2>' . $this->t('About') . '</h2>';
+    $output .= '<p>' . $this->t('Adds AI generation to Schema JSON-LD Manager. When a page is not in the active SEO document, its title, text, breadcrumb trail, site name and selected taxonomy terms are sent to the default "Chat" provider of the AI module. The answer is repaired and validated before it is shown for review.') . '</p>';
+    $output .= '<p>' . $this->t('Configure it on the <a href=":url">AI generation settings</a> page.', [
+      ':url' => Url::fromRoute('schema_jsonld_manager_ai.settings')->toString(),
+    ]) . '</p>';
+    return $output;
+  }
+
+  /**
+   * Implements hook_form_BASE_FORM_ID_alter() for node_form.
+   *
+   * Runs after the base module's alter (module order is alphabetical) and
+   * adds the node's taxonomy reference fields to the sections the "Generate
+   * schema" button validates, so unsaved terms reach the AI prompt.
+   */
+  #[Hook('form_node_form_alter')]
+  public function formNodeFormAlter(array &$form, FormStateInterface $form_state, string $form_id): void {
+    if (!isset($form['schema_jsonld']['wrapper']['generate'])) {
+      return;
+    }
+    /** @var \Drupal\node\NodeInterface $node */
+    $node = $form_state->getFormObject()->getEntity();
+    $sections =& $form['schema_jsonld']['wrapper']['generate']['#limit_validation_errors'];
+    foreach ($node->getFieldDefinitions() as $name => $definition) {
+      if (isset($form[$name]) && $definition->getType() === 'entity_reference' && $definition->getSetting('target_type') === 'taxonomy_term') {
+        $sections[] = [
+          $name,
+        ];
+      }
+    }
+  }
+
+  /**
+   * Implements hook_form_FORM_ID_alter() for schema_jsonld_manager_settings.
+   *
+   * Adds "Taxonomy context" to the main settings page. It is stored in this
+   * submodule's configuration, because only AI generation uses it.
+   */
+  #[Hook('form_schema_jsonld_manager_settings_alter')]
+  public function formSchemaJsonldManagerSettingsAlter(array &$form, FormStateInterface $form_state): void {
+    $title = $this->t('Taxonomy context');
+    if (!\Drupal::moduleHandler()->moduleExists('taxonomy')) {
+      $form['taxonomy_vocabularies'] = [
+        '#type' => 'item',
+        '#title' => $title,
+        '#markup' => $this->t('Enable the Taxonomy module to send taxonomy terms to the AI as context.'),
+        '#weight' => 5,
+      ];
+      return;
+    }
+    $options = [];
+    foreach (\Drupal::entityTypeManager()->getStorage('taxonomy_vocabulary')->loadMultiple() as $vocabulary) {
+      $options[$vocabulary->id()] = $vocabulary->label();
+    }
+    natcasesort($options);
+    if ($options === []) {
+      $form['taxonomy_vocabularies'] = [
+        '#type' => 'item',
+        '#title' => $title,
+        '#markup' => $this->t('No taxonomy vocabularies exist yet. <a href=":url">Add a vocabulary</a>, then come back to select it.', [
+          ':url' => Url::fromRoute('entity.taxonomy_vocabulary.collection')->toString(),
+        ]),
+        '#weight' => 5,
+      ];
+      return;
+    }
+    $selected = (array) (\Drupal::config('schema_jsonld_manager_ai.settings')->get('taxonomy_vocabularies') ?? []);
+    $form['taxonomy_vocabularies'] = [
+      '#type' => 'checkboxes',
+      '#title' => $title,
+      '#description' => $this->t('Terms selected on the content from these vocabularies are sent to the AI. Vocabularies about language, places, audiences or organizations map to the matching schema.org properties; all others become keywords.'),
+      '#options' => $options,
+          // Drop vocabularies that have been deleted since they were saved.
+      '#default_value' => array_values(array_intersect($selected, array_keys($options))),
+      '#weight' => 5,
+    ];
+    $form['#submit'][] = '_schema_jsonld_manager_ai_settings_submit';
+  }
+
+}
diff --git a/modules/schema_jsonld_manager_ai/tests/src/Unit/AiSchemaGeneratorTest.php b/modules/schema_jsonld_manager_ai/tests/src/Unit/AiSchemaGeneratorTest.php
index 2755e94..80a5aa1 100644
--- a/modules/schema_jsonld_manager_ai/tests/src/Unit/AiSchemaGeneratorTest.php
+++ b/modules/schema_jsonld_manager_ai/tests/src/Unit/AiSchemaGeneratorTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\schema_jsonld_manager_ai\Unit;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Tests\UnitTestCase;
 use Drupal\schema_jsonld_manager\Service\SchemaGeneratorInterface;
 use Drupal\schema_jsonld_manager\ValueObject\SchemaGenerationRequest;
@@ -23,6 +24,7 @@ use Drupal\schema_jsonld_manager_ai\ValueObject\PageContext;
  * @coversDefaultClass \Drupal\schema_jsonld_manager_ai\Service\AiSchemaGenerator
  * @group schema_jsonld_manager_ai
  */
+#[Group('schema_jsonld_manager_ai')]
 class AiSchemaGeneratorTest extends UnitTestCase {
 
   /**
diff --git a/modules/schema_jsonld_manager_ai/tests/src/Unit/JsonRepairTest.php b/modules/schema_jsonld_manager_ai/tests/src/Unit/JsonRepairTest.php
index 8ac53da..c282bbc 100644
--- a/modules/schema_jsonld_manager_ai/tests/src/Unit/JsonRepairTest.php
+++ b/modules/schema_jsonld_manager_ai/tests/src/Unit/JsonRepairTest.php
@@ -4,6 +4,8 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\schema_jsonld_manager_ai\Unit;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Drupal\Tests\UnitTestCase;
 use Drupal\schema_jsonld_manager_ai\Utility\JsonRepair;
 
@@ -13,6 +15,7 @@ use Drupal\schema_jsonld_manager_ai\Utility\JsonRepair;
  * @coversDefaultClass \Drupal\schema_jsonld_manager_ai\Utility\JsonRepair
  * @group schema_jsonld_manager_ai
  */
+#[Group('schema_jsonld_manager_ai')]
 class JsonRepairTest extends UnitTestCase {
 
   /**
@@ -21,6 +24,7 @@ class JsonRepairTest extends UnitTestCase {
    * @covers ::extract
    * @dataProvider providerExtract
    */
+  #[DataProvider('providerExtract')]
   public function testExtract(string $raw, array $expected): void {
     $json = JsonRepair::extract($raw);
     $this->assertTrue(JsonRepair::isParseableJson($json), 'Repaired output parses: ' . $json);
diff --git a/modules/schema_jsonld_manager_ai/tests/src/Unit/PromptBuilderTest.php b/modules/schema_jsonld_manager_ai/tests/src/Unit/PromptBuilderTest.php
index 118a2c2..f58a6e7 100644
--- a/modules/schema_jsonld_manager_ai/tests/src/Unit/PromptBuilderTest.php
+++ b/modules/schema_jsonld_manager_ai/tests/src/Unit/PromptBuilderTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\schema_jsonld_manager_ai\Unit;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Tests\UnitTestCase;
 use Drupal\schema_jsonld_manager_ai\Service\PromptBuilder;
 use Drupal\schema_jsonld_manager_ai\Service\SchemaInstructionResolver;
@@ -15,6 +16,7 @@ use Drupal\schema_jsonld_manager_ai\ValueObject\PageContext;
  * @coversDefaultClass \Drupal\schema_jsonld_manager_ai\Service\PromptBuilder
  * @group schema_jsonld_manager_ai
  */
+#[Group('schema_jsonld_manager_ai')]
 class PromptBuilderTest extends UnitTestCase {
 
   /**
diff --git a/modules/schema_jsonld_manager_ai/tests/src/Unit/SchemaValidatorTest.php b/modules/schema_jsonld_manager_ai/tests/src/Unit/SchemaValidatorTest.php
index 55e0f5b..9fbcdd6 100644
--- a/modules/schema_jsonld_manager_ai/tests/src/Unit/SchemaValidatorTest.php
+++ b/modules/schema_jsonld_manager_ai/tests/src/Unit/SchemaValidatorTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\schema_jsonld_manager_ai\Unit;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Tests\UnitTestCase;
 use Drupal\schema_jsonld_manager_ai\Service\SchemaValidator;
 use Drupal\schema_jsonld_manager\ValueObject\SchemaGenerationResult;
@@ -14,6 +15,7 @@ use Drupal\schema_jsonld_manager\ValueObject\SchemaGenerationResult;
  * @coversDefaultClass \Drupal\schema_jsonld_manager_ai\Service\SchemaValidator
  * @group schema_jsonld_manager_ai
  */
+#[Group('schema_jsonld_manager_ai')]
 class SchemaValidatorTest extends UnitTestCase {
 
   /**
diff --git a/schema_jsonld_manager.info.yml b/schema_jsonld_manager.info.yml
index b520cf6..3f0fa55 100644
--- a/schema_jsonld_manager.info.yml
+++ b/schema_jsonld_manager.info.yml
@@ -2,7 +2,7 @@ name: Schema JSON-LD Manager
 type: module
 description: 'Manage Schema.org JSON-LD structured data for content and any site path, entered by hand or imported from an SEO document.'
 package: SEO
-core_version_requirement: ^10.3 || ^11
+core_version_requirement: ^11.2 || ^12
 configure: schema_jsonld_manager.settings
 dependencies:
   - drupal:field
diff --git a/schema_jsonld_manager.install b/schema_jsonld_manager.install
index ad3b9cb..5adfa0b 100644
--- a/schema_jsonld_manager.install
+++ b/schema_jsonld_manager.install
@@ -7,6 +7,8 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\Requirement\RequirementSeverity;
 use Drupal\Core\Url;
 
 /**
@@ -23,7 +25,7 @@ function schema_jsonld_manager_requirements(string $phase): array {
     'title' => t('Schema JSON-LD Manager: SEO documents'),
     'value' => class_exists(\ZipArchive::class) ? t('PHP zip extension available') : t('PHP zip extension missing'),
     'description' => class_exists(\ZipArchive::class) ? '' : t('The PHP "zip" extension is needed to read uploaded .docx SEO documents.'),
-    'severity' => class_exists(\ZipArchive::class) ? REQUIREMENT_OK : REQUIREMENT_WARNING,
+    'severity' => class_exists(\ZipArchive::class) ? DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::OK, fn() => REQUIREMENT_OK) : DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Warning, fn() => REQUIREMENT_WARNING),
   ];
 
   /** @var \Drupal\schema_jsonld_manager\Service\AiSetupStatus $ai_status */
@@ -36,7 +38,7 @@ function schema_jsonld_manager_requirements(string $phase): array {
       : t('Not set up'),
     'description' => $next_step ?? '',
     // Information only: the module works without AI.
-    'severity' => $next_step === NULL ? REQUIREMENT_OK : REQUIREMENT_INFO,
+    'severity' => $next_step === NULL ? DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::OK, fn() => REQUIREMENT_OK) : DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Info, fn() => REQUIREMENT_INFO),
   ];
 
   $field_type = \Drupal::service('schema_jsonld_manager.field_manager')->getStorageType();
@@ -47,7 +49,7 @@ function schema_jsonld_manager_requirements(string $phase): array {
       'description' => t('The Schema JSON-LD field should be plain text (long). It still works, but see the <a href=":url">settings page</a> for how to change it.', [
         ':url' => Url::fromRoute('schema_jsonld_manager.settings')->toString(),
       ]),
-      'severity' => REQUIREMENT_WARNING,
+      'severity' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Warning, fn() => REQUIREMENT_WARNING),
     ];
   }
 
diff --git a/schema_jsonld_manager.module b/schema_jsonld_manager.module
index f14e890..82b2eba 100644
--- a/schema_jsonld_manager.module
+++ b/schema_jsonld_manager.module
@@ -7,6 +7,8 @@
 
 declare(strict_types=1);
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\schema_jsonld_manager\Hook\SchemaJsonldManagerHooks;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Field\FieldDefinitionInterface;
@@ -14,8 +16,6 @@ use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Session\AccountInterface;
-use Drupal\Core\Url;
-use Drupal\node\NodeInterface;
 use Drupal\schema_jsonld_manager\Service\JsonLdRenderer;
 use Drupal\schema_jsonld_manager\Service\SchemaFieldManager;
 use Drupal\schema_jsonld_manager\ValueObject\SchemaGenerationRequest;
@@ -24,28 +24,9 @@ use Drupal\schema_jsonld_manager\ValueObject\SchemaGenerationResult;
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function schema_jsonld_manager_help(string $route_name, RouteMatchInterface $route_match): ?string {
-  switch ($route_name) {
-    case 'help.page.schema_jsonld_manager':
-      $output = '<h2>' . t('About') . '</h2>';
-      $output .= '<p>' . t('Schema JSON-LD Manager adds Schema.org structured data (JSON-LD) to content and to any other page of your site, to help search engines show rich results.') . '</p>';
-      $output .= '<h2>' . t('Uses') . '</h2><dl>';
-      $output .= '<dt>' . t('Content') . '</dt><dd>' . t('Choose content types on the <a href=":settings">settings page</a>. Their edit form gets a "Schema JSON-LD" field with a Generate button.', [
-        ':settings' => Url::fromRoute('schema_jsonld_manager.settings')->toString(),
-      ]) . '</dd>';
-      $output .= '<dt>' . t('Other pages') . '</dt><dd>' . t('Add <a href=":pages">path schemas</a> for Views, landing pages or any other route.', [
-        ':pages' => Url::fromRoute('entity.schema_jsonld_page.collection')->toString(),
-      ]) . '</dd>';
-      $output .= '<dt>' . t('SEO documents') . '</dt><dd>' . t('Upload a <a href=":docs">.docx document</a> from your SEO team; its JSON-LD is copied into the matching pages. Enable the Schema JSON-LD Manager AI submodule to generate JSON-LD for pages the document does not cover.', [
-        ':docs' => Url::fromRoute('entity.schema_jsonld_seo_document.collection')->toString(),
-      ]) . '</dd></dl>';
-      return $output;
-
-    case 'entity.schema_jsonld_page.collection':
-      return '<p>' . t('JSON-LD for pages that are not content items. Content pages use their own "Schema JSON-LD" field.') . '</p>';
-  }
-
-  return NULL;
+  return \Drupal::service(SchemaJsonldManagerHooks::class)->help($route_name, $route_match);
 }
 
 /**
@@ -55,63 +36,17 @@ function schema_jsonld_manager_help(string $route_name, RouteMatchInterface $rou
  * setup step. Runs after the whole batch, so installing both modules at
  * once shows nothing.
  */
+#[LegacyHook]
 function schema_jsonld_manager_modules_installed(array $modules, bool $is_syncing = FALSE): void {
-  if ($is_syncing || !in_array('schema_jsonld_manager', $modules, TRUE)) {
-    return;
-  }
-
-  $message = \Drupal::service('schema_jsonld_manager.ai_setup_status')->getNextStepMessage(TRUE);
-  if ($message !== NULL) {
-    \Drupal::messenger()->addStatus($message);
-  }
+  \Drupal::service(SchemaJsonldManagerHooks::class)->modulesInstalled($modules, $is_syncing);
 }
 
 /**
  * Implements hook_page_attachments().
  */
+#[LegacyHook]
 function schema_jsonld_manager_page_attachments(array &$attachments): void {
-  // Output depends on the path, the host (multi-domain) and the path
-  // schema config entities.
-  $attachments['#cache']['contexts'][] = 'url.path';
-  $attachments['#cache']['contexts'][] = 'url.site';
-  $attachments['#cache']['tags'][] = 'config:schema_jsonld_page_list';
-
-  /** @var \Drupal\schema_jsonld_manager\Service\JsonLdRenderer $renderer */
-  $renderer = \Drupal::service('schema_jsonld_manager.renderer');
-  $route_match = \Drupal::routeMatch();
-
-  if ($route_match->getRouteName() === 'entity.node.canonical') {
-    $node = $route_match->getParameter('node');
-
-    if (
-      $node instanceof NodeInterface
-      && $node->hasField(SchemaFieldManager::FIELD_NAME)
-      && !$node->get(SchemaFieldManager::FIELD_NAME)->isEmpty()
-    ) {
-      $attachments['#cache']['tags'] = array_merge($attachments['#cache']['tags'], $node->getCacheTags());
-
-      // Point own-site URLs at the host being served: covers Domain Access
-      // (one node, several domains) and schemas generated on another
-      // environment. External links are never changed.
-      $request = \Drupal::request();
-      $schema = (string) $node->get(SchemaFieldManager::FIELD_NAME)->value;
-      $own_hosts = _schema_jsonld_manager_domain_hostnames();
-      $origin_host = JsonLdRenderer::detectOriginHost($schema);
-      if ($origin_host !== NULL) {
-        $own_hosts[] = $origin_host;
-      }
-      $schema = JsonLdRenderer::rewriteDomainUrls($schema, $request->getScheme(), $request->getHost(), $own_hosts);
-
-      if ($renderer->attach($schema, 'schema_jsonld_node_' . $node->id(), $attachments)) {
-        return;
-      }
-    }
-  }
-
-  $page_schema = _schema_jsonld_manager_find_page_schema();
-  if ($page_schema) {
-    $renderer->attach($page_schema->getSchemaJson(), 'schema_jsonld_page_' . $page_schema->id(), $attachments);
-  }
+  \Drupal::service(SchemaJsonldManagerHooks::class)->pageAttachments($attachments);
 }
 
 /**
@@ -198,92 +133,17 @@ function _schema_jsonld_manager_domain_hostnames(): array {
 /**
  * Implements hook_entity_field_access().
  */
+#[LegacyHook]
 function schema_jsonld_manager_entity_field_access(string $operation, FieldDefinitionInterface $field_definition, AccountInterface $account, ?FieldItemListInterface $items = NULL): AccessResult {
-  if ($operation === 'edit' && $field_definition->getName() === SchemaFieldManager::FIELD_NAME) {
-    return AccessResult::forbiddenIf(!$account->hasPermission('edit schema jsonld field'))->cachePerPermissions();
-  }
-  return AccessResult::neutral();
+  return \Drupal::service(SchemaJsonldManagerHooks::class)->entityFieldAccess($operation, $field_definition, $account, $items);
 }
 
 /**
  * Implements hook_form_BASE_FORM_ID_alter() for node_form.
  */
+#[LegacyHook]
 function schema_jsonld_manager_form_node_form_alter(array &$form, FormStateInterface $form_state, string $form_id): void {
-  $field_name = SchemaFieldManager::FIELD_NAME;
-
-  if (!isset($form[$field_name]) || (isset($form[$field_name]['#access']) && !$form[$field_name]['#access'])) {
-    return;
-  }
-
-  $field = $form[$field_name];
-  unset($form[$field_name]);
-
-  // A formatted text field (e.g. created by hand as "Text (formatted,
-  // long)") gets a WYSIWYG editor that wraps the JSON in HTML. Force plain
-  // text: no editor, no format selector.
-  if (($field['widget'][0]['#type'] ?? NULL) === 'text_format') {
-    $field['widget'][0]['#format'] = 'plain_text';
-    $field['widget'][0]['#allowed_formats'] = ['plain_text'];
-    $field['widget'][0]['#after_build'][] = '_schema_jsonld_manager_hide_text_format';
-    // Show the JSON without the HTML an editor may have saved earlier.
-    $field['widget'][0]['#default_value'] = JsonLdRenderer::normalize((string) ($field['widget'][0]['#default_value'] ?? ''));
-  }
-
-  $form['schema_jsonld'] = [
-    '#type' => 'details',
-    '#title' => t('Schema JSON-LD'),
-    '#open' => FALSE,
-    '#weight' => 50,
-  ];
-  if (isset($form['advanced'])) {
-    $form['schema_jsonld']['#group'] = 'advanced';
-  }
-
-  $form['schema_jsonld']['wrapper'] = [
-    '#type' => 'container',
-    '#attributes' => ['id' => 'schema-jsonld-node-wrapper'],
-  ];
-  // The field keeps its form display weight (often 100); reset it so the
-  // textarea comes first and the button below it, as its help text says.
-  $field['#weight'] = 0;
-  $form['schema_jsonld']['wrapper'][$field_name] = $field;
-
-  $current = (string) ($form_state->getValue([$field_name, 0, 'value']) ?? '');
-  if ($current === '') {
-    /** @var \Drupal\node\NodeInterface $node */
-    $node = $form_state->getFormObject()->getEntity();
-    $current = $node->hasField($field_name) ? (string) $node->get($field_name)->value : '';
-  }
-
-  /** @var \Drupal\schema_jsonld_manager\Service\SchemaGeneratorInterface $generator */
-  $generator = \Drupal::service('schema_jsonld_manager.generator');
-
-  $form['schema_jsonld']['wrapper']['generate'] = [
-    '#type' => 'submit',
-    '#weight' => 1,
-    '#value' => $generator->getButtonLabel(trim($current) !== ''),
-    '#name' => 'schema_jsonld_generate',
-    '#submit' => ['schema_jsonld_manager_node_generate_submit'],
-    // Only validate (and so process) the fields generation reads from.
-    // Other modules can add sections, e.g. the AI submodule adds taxonomy
-    // reference fields.
-    '#limit_validation_errors' => _schema_jsonld_manager_generation_sections($form),
-    '#ajax' => [
-      'callback' => 'schema_jsonld_manager_node_generate_ajax',
-      'wrapper' => 'schema-jsonld-node-wrapper',
-      'progress' => [
-        'type' => 'throbber',
-        'message' => t('Working…'),
-      ],
-    ],
-  ];
-
-  $form['schema_jsonld']['wrapper']['help'] = [
-    '#weight' => 2,
-    '#markup' => '<div class="description">' . $generator->getDescription() . '</div>',
-  ];
-
-  $form['#validate'][] = 'schema_jsonld_manager_node_form_validate';
+  \Drupal::service(SchemaJsonldManagerHooks::class)->formNodeFormAlter($form, $form_state, $form_id);
 }
 
 /**
diff --git a/schema_jsonld_manager.services.yml b/schema_jsonld_manager.services.yml
index dae5384..fd81905 100644
--- a/schema_jsonld_manager.services.yml
+++ b/schema_jsonld_manager.services.yml
@@ -53,3 +53,7 @@ services:
       - '@?domain.negotiator'
 
   Drupal\schema_jsonld_manager\Service\SchemaGeneratorInterface: '@schema_jsonld_manager.generator'
+
+  Drupal\schema_jsonld_manager\Hook\SchemaJsonldManagerHooks:
+    class: Drupal\schema_jsonld_manager\Hook\SchemaJsonldManagerHooks
+    autowire: true
diff --git a/src/Hook/SchemaJsonldManagerHooks.php b/src/Hook/SchemaJsonldManagerHooks.php
new file mode 100644
index 0000000..b78e05b
--- /dev/null
+++ b/src/Hook/SchemaJsonldManagerHooks.php
@@ -0,0 +1,201 @@
+<?php
+
+namespace Drupal\schema_jsonld_manager\Hook;
+
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Access\AccessResult;
+use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Session\AccountInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\schema_jsonld_manager\Service\JsonLdRenderer;
+use Drupal\schema_jsonld_manager\Service\SchemaFieldManager;
+use Drupal\node\NodeInterface;
+use Drupal\Core\Url;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+
+/**
+ * Hook implementations for schema_jsonld_manager.
+ */
+class SchemaJsonldManagerHooks {
+  use StringTranslationTrait;
+
+  /**
+   * Implements hook_help().
+   */
+  #[Hook('help')]
+  public function help(string $route_name, RouteMatchInterface $route_match): ?string {
+    switch ($route_name) {
+      case 'help.page.schema_jsonld_manager':
+        $output = '<h2>' . $this->t('About') . '</h2>';
+        $output .= '<p>' . $this->t('Schema JSON-LD Manager adds Schema.org structured data (JSON-LD) to content and to any other page of your site, to help search engines show rich results.') . '</p>';
+        $output .= '<h2>' . $this->t('Uses') . '</h2><dl>';
+        $output .= '<dt>' . $this->t('Content') . '</dt><dd>' . $this->t('Choose content types on the <a href=":settings">settings page</a>. Their edit form gets a "Schema JSON-LD" field with a Generate button.', [
+          ':settings' => Url::fromRoute('schema_jsonld_manager.settings')->toString(),
+        ]) . '</dd>';
+        $output .= '<dt>' . $this->t('Other pages') . '</dt><dd>' . $this->t('Add <a href=":pages">path schemas</a> for Views, landing pages or any other route.', [
+          ':pages' => Url::fromRoute('entity.schema_jsonld_page.collection')->toString(),
+        ]) . '</dd>';
+        $output .= '<dt>' . $this->t('SEO documents') . '</dt><dd>' . $this->t('Upload a <a href=":docs">.docx document</a> from your SEO team; its JSON-LD is copied into the matching pages. Enable the Schema JSON-LD Manager AI submodule to generate JSON-LD for pages the document does not cover.', [
+          ':docs' => Url::fromRoute('entity.schema_jsonld_seo_document.collection')->toString(),
+        ]) . '</dd></dl>';
+        return $output;
+
+      case 'entity.schema_jsonld_page.collection':
+        return '<p>' . $this->t('JSON-LD for pages that are not content items. Content pages use their own "Schema JSON-LD" field.') . '</p>';
+    }
+    return NULL;
+  }
+
+  /**
+   * Implements hook_modules_installed().
+   *
+   * After installing the module without its AI submodule, points to the next
+   * setup step. Runs after the whole batch, so installing both modules at
+   * once shows nothing.
+   */
+  #[Hook('modules_installed')]
+  public function modulesInstalled(array $modules, bool $is_syncing = FALSE): void {
+    if ($is_syncing || !in_array('schema_jsonld_manager', $modules, TRUE)) {
+      return;
+    }
+    $message = \Drupal::service('schema_jsonld_manager.ai_setup_status')->getNextStepMessage(TRUE);
+    if ($message !== NULL) {
+      \Drupal::messenger()->addStatus($message);
+    }
+  }
+
+  /**
+   * Implements hook_page_attachments().
+   */
+  #[Hook('page_attachments')]
+  public function pageAttachments(array &$attachments): void {
+    // Output depends on the path, the host (multi-domain) and the path
+    // schema config entities.
+    $attachments['#cache']['contexts'][] = 'url.path';
+    $attachments['#cache']['contexts'][] = 'url.site';
+    $attachments['#cache']['tags'][] = 'config:schema_jsonld_page_list';
+    /** @var \Drupal\schema_jsonld_manager\Service\JsonLdRenderer $renderer */
+    $renderer = \Drupal::service('schema_jsonld_manager.renderer');
+    $route_match = \Drupal::routeMatch();
+    if ($route_match->getRouteName() === 'entity.node.canonical') {
+      $node = $route_match->getParameter('node');
+      if ($node instanceof NodeInterface && $node->hasField(SchemaFieldManager::FIELD_NAME) && !$node->get(SchemaFieldManager::FIELD_NAME)->isEmpty()) {
+        $attachments['#cache']['tags'] = array_merge($attachments['#cache']['tags'], $node->getCacheTags());
+        // Point own-site URLs at the host being served: covers Domain Access
+        // (one node, several domains) and schemas generated on another
+        // environment. External links are never changed.
+        $request = \Drupal::request();
+        $schema = (string) $node->get(SchemaFieldManager::FIELD_NAME)->value;
+        $own_hosts = _schema_jsonld_manager_domain_hostnames();
+        $origin_host = JsonLdRenderer::detectOriginHost($schema);
+        if ($origin_host !== NULL) {
+          $own_hosts[] = $origin_host;
+        }
+        $schema = JsonLdRenderer::rewriteDomainUrls($schema, $request->getScheme(), $request->getHost(), $own_hosts);
+        if ($renderer->attach($schema, 'schema_jsonld_node_' . $node->id(), $attachments)) {
+          return;
+        }
+      }
+    }
+    $page_schema = _schema_jsonld_manager_find_page_schema();
+    if ($page_schema) {
+      $renderer->attach($page_schema->getSchemaJson(), 'schema_jsonld_page_' . $page_schema->id(), $attachments);
+    }
+  }
+
+  /**
+   * Implements hook_entity_field_access().
+   */
+  #[Hook('entity_field_access')]
+  public function entityFieldAccess(string $operation, FieldDefinitionInterface $field_definition, AccountInterface $account, ?FieldItemListInterface $items = NULL): AccessResult {
+    if ($operation === 'edit' && $field_definition->getName() === SchemaFieldManager::FIELD_NAME) {
+      return AccessResult::forbiddenIf(!$account->hasPermission('edit schema jsonld field'))->cachePerPermissions();
+    }
+    return AccessResult::neutral();
+  }
+
+  /**
+   * Implements hook_form_BASE_FORM_ID_alter() for node_form.
+   */
+  #[Hook('form_node_form_alter')]
+  public function formNodeFormAlter(array &$form, FormStateInterface $form_state, string $form_id): void {
+    $field_name = SchemaFieldManager::FIELD_NAME;
+    if (!isset($form[$field_name]) || isset($form[$field_name]['#access']) && !$form[$field_name]['#access']) {
+      return;
+    }
+    $field = $form[$field_name];
+    unset($form[$field_name]);
+    // A formatted text field (e.g. created by hand as "Text (formatted,
+    // long)") gets a WYSIWYG editor that wraps the JSON in HTML. Force plain
+    // text: no editor, no format selector.
+    if (($field['widget'][0]['#type'] ?? NULL) === 'text_format') {
+      $field['widget'][0]['#format'] = 'plain_text';
+      $field['widget'][0]['#allowed_formats'] = [
+        'plain_text',
+      ];
+      $field['widget'][0]['#after_build'][] = '_schema_jsonld_manager_hide_text_format';
+      // Show the JSON without the HTML an editor may have saved earlier.
+      $field['widget'][0]['#default_value'] = JsonLdRenderer::normalize((string) ($field['widget'][0]['#default_value'] ?? ''));
+    }
+    $form['schema_jsonld'] = [
+      '#type' => 'details',
+      '#title' => $this->t('Schema JSON-LD'),
+      '#open' => FALSE,
+      '#weight' => 50,
+    ];
+    if (isset($form['advanced'])) {
+      $form['schema_jsonld']['#group'] = 'advanced';
+    }
+    $form['schema_jsonld']['wrapper'] = [
+      '#type' => 'container',
+      '#attributes' => [
+        'id' => 'schema-jsonld-node-wrapper',
+      ],
+    ];
+    // The field keeps its form display weight (often 100); reset it so the
+    // textarea comes first and the button below it, as its help text says.
+    $field['#weight'] = 0;
+    $form['schema_jsonld']['wrapper'][$field_name] = $field;
+    $current = (string) ($form_state->getValue([
+      $field_name,
+      0,
+      'value',
+    ]) ?? '');
+    if ($current === '') {
+      /** @var \Drupal\node\NodeInterface $node */
+      $node = $form_state->getFormObject()->getEntity();
+      $current = $node->hasField($field_name) ? (string) $node->get($field_name)->value : '';
+    }
+    /** @var \Drupal\schema_jsonld_manager\Service\SchemaGeneratorInterface $generator */
+    $generator = \Drupal::service('schema_jsonld_manager.generator');
+    $form['schema_jsonld']['wrapper']['generate'] = [
+      '#type' => 'submit',
+      '#weight' => 1,
+      '#value' => $generator->getButtonLabel(trim($current) !== ''),
+      '#name' => 'schema_jsonld_generate',
+      '#submit' => [
+        'schema_jsonld_manager_node_generate_submit',
+      ],
+          // Only validate (and so process) the fields generation reads from.
+          // Other modules can add sections, e.g. the AI submodule adds taxonomy
+          // reference fields.
+      '#limit_validation_errors' => _schema_jsonld_manager_generation_sections($form),
+      '#ajax' => [
+        'callback' => 'schema_jsonld_manager_node_generate_ajax',
+        'wrapper' => 'schema-jsonld-node-wrapper',
+        'progress' => [
+          'type' => 'throbber',
+          'message' => $this->t('Working…'),
+        ],
+      ],
+    ];
+    $form['schema_jsonld']['wrapper']['help'] = [
+      '#weight' => 2,
+      '#markup' => '<div class="description">' . $generator->getDescription() . '</div>',
+    ];
+    $form['#validate'][] = 'schema_jsonld_manager_node_form_validate';
+  }
+
+}
diff --git a/tests/src/Functional/SchemaOutputTest.php b/tests/src/Functional/SchemaOutputTest.php
index a2b81cc..788d53e 100644
--- a/tests/src/Functional/SchemaOutputTest.php
+++ b/tests/src/Functional/SchemaOutputTest.php
@@ -4,6 +4,8 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\schema_jsonld_manager\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\Tests\BrowserTestBase;
 use Drupal\schema_jsonld_manager\Entity\PageSchema;
 use Drupal\schema_jsonld_manager\Service\SchemaFieldManager;
@@ -14,6 +16,8 @@ use Drupal\taxonomy\Entity\Vocabulary;
  *
  * @group schema_jsonld_manager
  */
+#[Group('schema_jsonld_manager')]
+#[RunTestsInSeparateProcesses]
 class SchemaOutputTest extends BrowserTestBase {
 
   /**
diff --git a/tests/src/Kernel/SchemaJsonldManagerKernelTest.php b/tests/src/Kernel/SchemaJsonldManagerKernelTest.php
index f266423..ed82161 100644
--- a/tests/src/Kernel/SchemaJsonldManagerKernelTest.php
+++ b/tests/src/Kernel/SchemaJsonldManagerKernelTest.php
@@ -4,6 +4,8 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\schema_jsonld_manager\Kernel;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\KernelTests\KernelTestBase;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
@@ -21,6 +23,8 @@ use Drupal\schema_jsonld_manager\ValueObject\SchemaGenerationRequest;
  *
  * @group schema_jsonld_manager
  */
+#[Group('schema_jsonld_manager')]
+#[RunTestsInSeparateProcesses]
 class SchemaJsonldManagerKernelTest extends KernelTestBase {
 
   /**
diff --git a/tests/src/Unit/JsonLdRendererTest.php b/tests/src/Unit/JsonLdRendererTest.php
index 8c04bc1..8be9a6b 100644
--- a/tests/src/Unit/JsonLdRendererTest.php
+++ b/tests/src/Unit/JsonLdRendererTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\schema_jsonld_manager\Unit;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Tests\UnitTestCase;
 use Drupal\schema_jsonld_manager\Service\JsonLdRenderer;
 use Psr\Log\NullLogger;
@@ -14,6 +15,7 @@ use Psr\Log\NullLogger;
  * @coversDefaultClass \Drupal\schema_jsonld_manager\Service\JsonLdRenderer
  * @group schema_jsonld_manager
  */
+#[Group('schema_jsonld_manager')]
 class JsonLdRendererTest extends UnitTestCase {
 
   /**
diff --git a/tests/src/Unit/SeoDocumentParserTest.php b/tests/src/Unit/SeoDocumentParserTest.php
index 1e92c96..e38db04 100644
--- a/tests/src/Unit/SeoDocumentParserTest.php
+++ b/tests/src/Unit/SeoDocumentParserTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\schema_jsonld_manager\Unit;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Tests\UnitTestCase;
 use Drupal\schema_jsonld_manager\Service\SeoDocumentParser;
 
@@ -13,6 +14,7 @@ use Drupal\schema_jsonld_manager\Service\SeoDocumentParser;
  * @coversDefaultClass \Drupal\schema_jsonld_manager\Service\SeoDocumentParser
  * @group schema_jsonld_manager
  */
+#[Group('schema_jsonld_manager')]
 class SeoDocumentParserTest extends UnitTestCase {
 
   /**
