diff --git a/dify.module b/dify.module
index 476e632..bf90dec 100644
--- a/dify.module
+++ b/dify.module
@@ -5,14 +5,14 @@
  * Hook implementations for the Dify module.
  */
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\dify\Hook\DifyHooks;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function dify_help($route_name, RouteMatchInterface $route_match) {
-  switch ($route_name) {
-    case 'help.page.dify':
-      return '<p>' . t('Provides integration with the Dify LLM application platform. This base module offers a shared API client and configuration service used by all Dify sub-modules.') . '</p>';
-  }
+  return \Drupal::service(DifyHooks::class)->help($route_name, $route_match);
 }
diff --git a/dify.services.yml b/dify.services.yml
index 7af4709..c9ab7df 100644
--- a/dify.services.yml
+++ b/dify.services.yml
@@ -9,3 +9,7 @@ services:
   logger.channel.dify:
     parent: logger.channel_base
     arguments: ['dify']
+
+  Drupal\dify\Hook\DifyHooks:
+    class: Drupal\dify\Hook\DifyHooks
+    autowire: true
diff --git a/modules/dify_augmented_search/dify_augmented_search.module b/modules/dify_augmented_search/dify_augmented_search.module
index ee9af21..5abcd56 100644
--- a/modules/dify_augmented_search/dify_augmented_search.module
+++ b/modules/dify_augmented_search/dify_augmented_search.module
@@ -5,29 +5,22 @@
  * Hook implementations for the Dify Augmented Search module.
  */
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\dify_augmented_search\Hook\DifyAugmentedSearchHooks;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function dify_augmented_search_help($route_name, RouteMatchInterface $route_match) {
-  switch ($route_name) {
-    case 'help.page.dify_augmented_search':
-      return '<p>' . t('Provides AI-powered search enhancement using the Dify API. Place the "Dify Augmented Search" block on a page with a search form to add AI-generated answers alongside traditional search results.') . '</p>';
-  }
+  return \Drupal::service(DifyAugmentedSearchHooks::class)->help($route_name, $route_match);
 }
 
 /**
  * Implements hook_theme().
  */
+#[LegacyHook]
 function dify_augmented_search_theme() {
-  return [
-    'dify_augmented_search_block' => [
-      'variables' => [
-        'block_uuid' => NULL,
-        'custom_colors' => NULL,
-      ],
-      'template' => 'dify-augmented-search-block',
-    ],
-  ];
+  return \Drupal::service(DifyAugmentedSearchHooks::class)->theme();
 }
diff --git a/modules/dify_augmented_search/dify_augmented_search.services.yml b/modules/dify_augmented_search/dify_augmented_search.services.yml
new file mode 100644
index 0000000..57ce440
--- /dev/null
+++ b/modules/dify_augmented_search/dify_augmented_search.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\dify_augmented_search\Hook\DifyAugmentedSearchHooks:
+    class: Drupal\dify_augmented_search\Hook\DifyAugmentedSearchHooks
+    autowire: true
diff --git a/modules/dify_augmented_search/src/Hook/DifyAugmentedSearchHooks.php b/modules/dify_augmented_search/src/Hook/DifyAugmentedSearchHooks.php
new file mode 100644
index 0000000..81ffa11
--- /dev/null
+++ b/modules/dify_augmented_search/src/Hook/DifyAugmentedSearchHooks.php
@@ -0,0 +1,42 @@
+<?php
+
+namespace Drupal\dify_augmented_search\Hook;
+
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+
+/**
+ * Hook implementations for dify_augmented_search.
+ */
+class DifyAugmentedSearchHooks {
+  use StringTranslationTrait;
+
+  /**
+   * Implements hook_help().
+   */
+  #[Hook('help')]
+  public function help($route_name, RouteMatchInterface $route_match) {
+    switch ($route_name) {
+      case 'help.page.dify_augmented_search':
+        return '<p>' . $this->t('Provides AI-powered search enhancement using the Dify API. Place the "Dify Augmented Search" block on a page with a search form to add AI-generated answers alongside traditional search results.') . '</p>';
+    }
+  }
+
+  /**
+   * Implements hook_theme().
+   */
+  #[Hook('theme')]
+  public function theme() {
+    return [
+      'dify_augmented_search_block' => [
+        'variables' => [
+          'block_uuid' => NULL,
+          'custom_colors' => NULL,
+        ],
+        'template' => 'dify-augmented-search-block',
+      ],
+    ];
+  }
+
+}
diff --git a/modules/dify_widget_official/dify_widget_official.module b/modules/dify_widget_official/dify_widget_official.module
index 3bc3864..aa520f8 100644
--- a/modules/dify_widget_official/dify_widget_official.module
+++ b/modules/dify_widget_official/dify_widget_official.module
@@ -5,14 +5,14 @@
  * Hook implementations for the Dify Widget Official module.
  */
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\dify_widget_official\Hook\DifyWidgetOfficialHooks;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function dify_widget_official_help($route_name, RouteMatchInterface $route_match) {
-  switch ($route_name) {
-    case 'help.page.dify_widget_official':
-      return '<p>' . t('Embeds the official Dify chatbot widget via a placeable block. Place the <em>Dify Official Chatbot Widget</em> block in your block layout and configure the base URL and token directly in the block settings.') . '</p>';
-  }
+  return \Drupal::service(DifyWidgetOfficialHooks::class)->help($route_name, $route_match);
 }
diff --git a/modules/dify_widget_official/dify_widget_official.services.yml b/modules/dify_widget_official/dify_widget_official.services.yml
new file mode 100644
index 0000000..5684fca
--- /dev/null
+++ b/modules/dify_widget_official/dify_widget_official.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\dify_widget_official\Hook\DifyWidgetOfficialHooks:
+    class: Drupal\dify_widget_official\Hook\DifyWidgetOfficialHooks
+    autowire: true
diff --git a/modules/dify_widget_official/src/Hook/DifyWidgetOfficialHooks.php b/modules/dify_widget_official/src/Hook/DifyWidgetOfficialHooks.php
new file mode 100644
index 0000000..4942e8c
--- /dev/null
+++ b/modules/dify_widget_official/src/Hook/DifyWidgetOfficialHooks.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace Drupal\dify_widget_official\Hook;
+
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+
+/**
+ * Hook implementations for dify_widget_official.
+ */
+class DifyWidgetOfficialHooks {
+  use StringTranslationTrait;
+
+  /**
+   * Implements hook_help().
+   */
+  #[Hook('help')]
+  public function help($route_name, RouteMatchInterface $route_match) {
+    switch ($route_name) {
+      case 'help.page.dify_widget_official':
+        return '<p>' . $this->t('Embeds the official Dify chatbot widget via a placeable block. Place the <em>Dify Official Chatbot Widget</em> block in your block layout and configure the base URL and token directly in the block settings.') . '</p>';
+    }
+  }
+
+}
diff --git a/modules/dify_widget_vanilla/dify_widget_vanilla.module b/modules/dify_widget_vanilla/dify_widget_vanilla.module
index 79b44b4..25f18de 100644
--- a/modules/dify_widget_vanilla/dify_widget_vanilla.module
+++ b/modules/dify_widget_vanilla/dify_widget_vanilla.module
@@ -5,58 +5,30 @@
  * Hook implementations for the Dify Widget Vanilla module.
  */
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\dify_widget_vanilla\Hook\DifyWidgetVanillaHooks;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function dify_widget_vanilla_help($route_name, RouteMatchInterface $route_match) {
-  switch ($route_name) {
-    case 'help.page.dify_widget_vanilla':
-      return '<p>' . t('Provides a floating chatbot widget for Dify with direct API integration. Use the "Dify Chat Widget" block to add the floating widget to your pages.') . '</p>';
-  }
+  return \Drupal::service(DifyWidgetVanillaHooks::class)->help($route_name, $route_match);
 }
 
 /**
  * Implements hook_theme().
  */
+#[LegacyHook]
 function dify_widget_vanilla_theme() {
-  return [
-    'dify_widget_vanilla_widget' => [
-      'variables' => [
-        'widget_id' => NULL,
-        'title' => NULL,
-        'placeholder' => NULL,
-        'custom_colors' => NULL,
-        'bot_avatar' => '🤖',
-        'user_avatar' => '👤',
-      ],
-      'template' => 'dify-widget-vanilla',
-    ],
-  ];
+  return \Drupal::service(DifyWidgetVanillaHooks::class)->theme();
 }
 
 /**
  * Implements hook_library_info_build().
  */
+#[LegacyHook]
 function dify_widget_vanilla_library_info_build() {
-  $libraries = [];
-
-  // Get all CSS hashes that need dynamic libraries.
-  $state = \Drupal::service('state');
-  $css_hashes = $state->get('dify_widget_css_hashes', []);
-
-  foreach ($css_hashes as $hash) {
-    $libraries["custom-css-{$hash}"] = [
-      'css' => [
-        'theme' => [
-          "/dify-widget-vanilla/css/{$hash}" => [
-            'type' => 'external',
-          ],
-        ],
-      ],
-    ];
-  }
-
-  return $libraries;
+  return \Drupal::service(DifyWidgetVanillaHooks::class)->libraryInfoBuild();
 }
diff --git a/modules/dify_widget_vanilla/dify_widget_vanilla.services.yml b/modules/dify_widget_vanilla/dify_widget_vanilla.services.yml
new file mode 100644
index 0000000..9aecb9b
--- /dev/null
+++ b/modules/dify_widget_vanilla/dify_widget_vanilla.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\dify_widget_vanilla\Hook\DifyWidgetVanillaHooks:
+    class: Drupal\dify_widget_vanilla\Hook\DifyWidgetVanillaHooks
+    autowire: true
diff --git a/modules/dify_widget_vanilla/src/Hook/DifyWidgetVanillaHooks.php b/modules/dify_widget_vanilla/src/Hook/DifyWidgetVanillaHooks.php
new file mode 100644
index 0000000..c89e239
--- /dev/null
+++ b/modules/dify_widget_vanilla/src/Hook/DifyWidgetVanillaHooks.php
@@ -0,0 +1,69 @@
+<?php
+
+namespace Drupal\dify_widget_vanilla\Hook;
+
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+
+/**
+ * Hook implementations for dify_widget_vanilla.
+ */
+class DifyWidgetVanillaHooks {
+  use StringTranslationTrait;
+
+  /**
+   * Implements hook_help().
+   */
+  #[Hook('help')]
+  public function help($route_name, RouteMatchInterface $route_match) {
+    switch ($route_name) {
+      case 'help.page.dify_widget_vanilla':
+        return '<p>' . $this->t('Provides a floating chatbot widget for Dify with direct API integration. Use the "Dify Chat Widget" block to add the floating widget to your pages.') . '</p>';
+    }
+  }
+
+  /**
+   * Implements hook_theme().
+   */
+  #[Hook('theme')]
+  public function theme() {
+    return [
+      'dify_widget_vanilla_widget' => [
+        'variables' => [
+          'widget_id' => NULL,
+          'title' => NULL,
+          'placeholder' => NULL,
+          'custom_colors' => NULL,
+          'bot_avatar' => '🤖',
+          'user_avatar' => '👤',
+        ],
+        'template' => 'dify-widget-vanilla',
+      ],
+    ];
+  }
+
+  /**
+   * Implements hook_library_info_build().
+   */
+  #[Hook('library_info_build')]
+  public function libraryInfoBuild() {
+    $libraries = [];
+    // Get all CSS hashes that need dynamic libraries.
+    $state = \Drupal::service('state');
+    $css_hashes = $state->get('dify_widget_css_hashes', []);
+    foreach ($css_hashes as $hash) {
+      $libraries["custom-css-{$hash}"] = [
+        'css' => [
+          'theme' => [
+            "/dify-widget-vanilla/css/{$hash}" => [
+              'type' => 'external',
+            ],
+          ],
+        ],
+      ];
+    }
+    return $libraries;
+  }
+
+}
diff --git a/src/Hook/DifyHooks.php b/src/Hook/DifyHooks.php
new file mode 100644
index 0000000..3878f0b
--- /dev/null
+++ b/src/Hook/DifyHooks.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace Drupal\dify\Hook;
+
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+
+/**
+ * Hook implementations for dify.
+ */
+class DifyHooks {
+  use StringTranslationTrait;
+
+  /**
+   * Implements hook_help().
+   */
+  #[Hook('help')]
+  public function help($route_name, RouteMatchInterface $route_match) {
+    switch ($route_name) {
+      case 'help.page.dify':
+        return '<p>' . $this->t('Provides integration with the Dify LLM application platform. This base module offers a shared API client and configuration service used by all Dify sub-modules.') . '</p>';
+    }
+  }
+
+}
