{
  "title": "Test import directly",
  "content": "node -e \"import('./path/to/handler.ts').then(console.log)\"\njson theme={null}\n{\n  \"hooks\": {\n    \"internal\": {\n      \"enabled\": true,\n      \"handlers\": [\n        {\n          \"event\": \"command:new\",\n          \"module\": \"./hooks/handlers/my-handler.ts\"\n        }\n      ]\n    }\n  }\n}\nbash theme={null}\n   mkdir -p ~/.openclaw/hooks/my-hook\n   mv ./hooks/handlers/my-handler.ts ~/.openclaw/hooks/my-hook/handler.ts\n   markdown theme={null}\n   ---\n   name: my-hook\n   description: \"My custom hook\"\n   metadata: { \"openclaw\": { \"emoji\": \"🎯\", \"events\": [\"command:new\"] } }\n   ---\n\nDoes something useful.\n   json theme={null}\n   {\n     \"hooks\": {\n       \"internal\": {\n         \"enabled\": true,\n         \"entries\": {\n           \"my-hook\": { \"enabled\": true }\n         }\n       }\n     }\n   }\n   bash theme={null}\n   openclaw hooks list\n   # Should show: 🎯 my-hook ✓\n   ```\n\n**Benefits of migration**:\n\n* Automatic discovery\n* CLI management\n* Eligibility checking\n* Better documentation\n* Consistent structure\n\n* [CLI Reference: hooks](/cli/hooks)\n* [Bundled Hooks README](https://github.com/openclaw/openclaw/tree/main/src/hooks/bundled)\n* [Webhook Hooks](/automation/webhook)\n* [Configuration](/gateway/configuration#hooks)",
  "code_samples": [
    {
      "code": "## Migration Guide\n\n### From Legacy Config to Discovery\n\n**Before**:",
      "language": "unknown"
    },
    {
      "code": "**After**:\n\n1. Create hook directory:",
      "language": "unknown"
    },
    {
      "code": "2. Create HOOK.md:",
      "language": "unknown"
    },
    {
      "code": "3. Update config:",
      "language": "unknown"
    },
    {
      "code": "4. Verify and restart your gateway process:",
      "language": "unknown"
    }
  ],
  "headings": [
    {
      "level": "h2",
      "text": "Migration Guide",
      "id": "migration-guide"
    },
    {
      "level": "h3",
      "text": "From Legacy Config to Discovery",
      "id": "from-legacy-config-to-discovery"
    },
    {
      "level": "h2",
      "text": "See Also",
      "id": "see-also"
    }
  ],
  "url": "llms-txt#test-import-directly",
  "links": []
}