{
  "schemaVersion": "1.0",
  "item": {
    "slug": "design-hook",
    "name": "Design Uniswap Hook",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/wpank/design-hook",
    "canonicalUrl": "https://clawhub.ai/wpank/design-hook",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/design-hook",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=design-hook",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/design-hook"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/design-hook",
    "agentPageUrl": "https://openagent3.xyz/skills/design-hook/agent",
    "manifestUrl": "https://openagent3.xyz/skills/design-hook/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/design-hook/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Overview",
        "body": "Designs a Uniswap V4 hook architecture without generating code. Delegates to the hook-builder agent in design-only mode to produce a comprehensive design document covering: which callbacks are needed, hook flag requirements, state management approach, gas estimates, security considerations, and architecture decisions. Use this to plan before building, or to evaluate feasibility."
      },
      {
        "title": "When to Use",
        "body": "Activate when the user asks:\n\n\"Design a hook for...\"\n\"What callbacks do I need for...\"\n\"Hook architecture for...\"\n\"Plan a V4 hook\"\n\"Is it possible to build a hook that...\"\n\"What would a dynamic fee hook look like?\"\n\"Help me think through a hook design\"\n\"Which flags do I need for a TWAMM?\""
      },
      {
        "title": "Parameters",
        "body": "ParameterRequiredDefaultDescriptionbehaviorYes--Hook behavior description (e.g., \"limit orders\", \"dynamic fees\", \"oracle pricing\")constraintsNo--Gas budget, security requirements, or specific design constraintsintegrationsNo--External systems the hook needs to interact with (oracles, governance, staking)"
      },
      {
        "title": "Workflow",
        "body": "Extract parameters from the user's request: identify the hook behavior, constraints, and any external integrations.\n\n\nDelegate to hook-builder in design-only mode: Invoke Task(subagent_type:hook-builder) with explicit instruction to produce a design document only -- no code generation, no file writes. The hook-builder will:\n\nAnalyze the requirements and determine which V4 callbacks are needed\nMap callbacks to hook flags and validate the combination\nDesign the state management approach (what storage, what data structures)\nEstimate gas overhead per callback\nIdentify security considerations specific to this hook design\nEvaluate feasibility and flag any concerns\n\n\n\nPresent the design document to the user covering:\n\nCallbacks needed and why each is required\nHook flags and bitmask\nState management design (storage variables, data structures, access patterns)\nGas estimates and performance implications\nSecurity considerations and mitigations\nArchitecture decisions with rationale\nComparison with alternative approaches if applicable"
      },
      {
        "title": "Output Format",
        "body": "Present a structured design document:\n\nV4 Hook Design: Dynamic Fee Hook\n\n  Callbacks Required:\n    - beforeSwap: Read volatility oracle, calculate dynamic fee\n    - beforeInitialize: Set initial fee parameters and oracle address\n\n  Hook Flags: BEFORE_SWAP_FLAG | BEFORE_INITIALIZE_FLAG\n  Bitmask: 0x2080\n\n  State Management:\n    - volatilityOracle: IVolatilityOracle (immutable, set in constructor)\n    - baseFee: uint24 (configurable by owner)\n    - maxFee: uint24 (cap to prevent excessive fees)\n    - feeMultiplier: uint24 (scales with volatility)\n\n  Gas Estimates:\n    beforeSwap: ~30,000 gas (oracle read + fee calculation)\n    beforeInitialize: ~25,000 gas (one-time setup)\n\n  Security Considerations:\n    - Oracle manipulation: Use TWAP, not spot price\n    - Fee cap: Enforce maxFee to protect traders\n    - Owner control: Fee parameters updatable by owner only\n\n  Architecture Decisions:\n    - Using beforeSwap (not afterSwap) to set fee before execution\n    - External oracle for volatility data rather than on-chain calculation\n    - Fee bounded between baseFee and maxFee for predictability\n\n  Alternative Approaches:\n    - On-chain volatility calculation (higher gas, no oracle dependency)\n    - Fixed fee tiers with governance voting (simpler, less responsive)"
      },
      {
        "title": "Important Notes",
        "body": "This skill produces a design document only -- no code is generated and no files are written.\nThe design document provides enough detail to proceed with build-hook when the user is ready.\nIf the hook design is infeasible (e.g., requires callbacks that V4 doesn't support), this will be clearly communicated.\nGas estimates are approximations based on typical implementations -- actual gas depends on implementation details."
      },
      {
        "title": "Error Handling",
        "body": "ErrorUser-Facing MessageSuggested ActionVAGUE_REQUIREMENTS\"Need more detail about the desired hook behavior.\"Describe specific behavior (e.g., \"limit orders that execute at tick boundaries\")UNSUPPORTED_CALLBACK\"V4 does not support the requested callback.\"Review available V4 callbacks and adjust requirementsINFEASIBLE_DESIGN\"This hook design is not feasible with current V4 capabilities.\"Simplify requirements or consider alternative approaches"
      }
    ],
    "body": "Design Hook\nOverview\n\nDesigns a Uniswap V4 hook architecture without generating code. Delegates to the hook-builder agent in design-only mode to produce a comprehensive design document covering: which callbacks are needed, hook flag requirements, state management approach, gas estimates, security considerations, and architecture decisions. Use this to plan before building, or to evaluate feasibility.\n\nWhen to Use\n\nActivate when the user asks:\n\n\"Design a hook for...\"\n\"What callbacks do I need for...\"\n\"Hook architecture for...\"\n\"Plan a V4 hook\"\n\"Is it possible to build a hook that...\"\n\"What would a dynamic fee hook look like?\"\n\"Help me think through a hook design\"\n\"Which flags do I need for a TWAMM?\"\nParameters\nParameter\tRequired\tDefault\tDescription\nbehavior\tYes\t--\tHook behavior description (e.g., \"limit orders\", \"dynamic fees\", \"oracle pricing\")\nconstraints\tNo\t--\tGas budget, security requirements, or specific design constraints\nintegrations\tNo\t--\tExternal systems the hook needs to interact with (oracles, governance, staking)\nWorkflow\n\nExtract parameters from the user's request: identify the hook behavior, constraints, and any external integrations.\n\nDelegate to hook-builder in design-only mode: Invoke Task(subagent_type:hook-builder) with explicit instruction to produce a design document only -- no code generation, no file writes. The hook-builder will:\n\nAnalyze the requirements and determine which V4 callbacks are needed\nMap callbacks to hook flags and validate the combination\nDesign the state management approach (what storage, what data structures)\nEstimate gas overhead per callback\nIdentify security considerations specific to this hook design\nEvaluate feasibility and flag any concerns\n\nPresent the design document to the user covering:\n\nCallbacks needed and why each is required\nHook flags and bitmask\nState management design (storage variables, data structures, access patterns)\nGas estimates and performance implications\nSecurity considerations and mitigations\nArchitecture decisions with rationale\nComparison with alternative approaches if applicable\nOutput Format\n\nPresent a structured design document:\n\nV4 Hook Design: Dynamic Fee Hook\n\n  Callbacks Required:\n    - beforeSwap: Read volatility oracle, calculate dynamic fee\n    - beforeInitialize: Set initial fee parameters and oracle address\n\n  Hook Flags: BEFORE_SWAP_FLAG | BEFORE_INITIALIZE_FLAG\n  Bitmask: 0x2080\n\n  State Management:\n    - volatilityOracle: IVolatilityOracle (immutable, set in constructor)\n    - baseFee: uint24 (configurable by owner)\n    - maxFee: uint24 (cap to prevent excessive fees)\n    - feeMultiplier: uint24 (scales with volatility)\n\n  Gas Estimates:\n    beforeSwap: ~30,000 gas (oracle read + fee calculation)\n    beforeInitialize: ~25,000 gas (one-time setup)\n\n  Security Considerations:\n    - Oracle manipulation: Use TWAP, not spot price\n    - Fee cap: Enforce maxFee to protect traders\n    - Owner control: Fee parameters updatable by owner only\n\n  Architecture Decisions:\n    - Using beforeSwap (not afterSwap) to set fee before execution\n    - External oracle for volatility data rather than on-chain calculation\n    - Fee bounded between baseFee and maxFee for predictability\n\n  Alternative Approaches:\n    - On-chain volatility calculation (higher gas, no oracle dependency)\n    - Fixed fee tiers with governance voting (simpler, less responsive)\n\nImportant Notes\nThis skill produces a design document only -- no code is generated and no files are written.\nThe design document provides enough detail to proceed with build-hook when the user is ready.\nIf the hook design is infeasible (e.g., requires callbacks that V4 doesn't support), this will be clearly communicated.\nGas estimates are approximations based on typical implementations -- actual gas depends on implementation details.\nError Handling\nError\tUser-Facing Message\tSuggested Action\nVAGUE_REQUIREMENTS\t\"Need more detail about the desired hook behavior.\"\tDescribe specific behavior (e.g., \"limit orders that execute at tick boundaries\")\nUNSUPPORTED_CALLBACK\t\"V4 does not support the requested callback.\"\tReview available V4 callbacks and adjust requirements\nINFEASIBLE_DESIGN\t\"This hook design is not feasible with current V4 capabilities.\"\tSimplify requirements or consider alternative approaches"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/wpank/design-hook",
    "publisherUrl": "https://clawhub.ai/wpank/design-hook",
    "owner": "wpank",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/design-hook",
    "downloadUrl": "https://openagent3.xyz/downloads/design-hook",
    "agentUrl": "https://openagent3.xyz/skills/design-hook/agent",
    "manifestUrl": "https://openagent3.xyz/skills/design-hook/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/design-hook/agent.md"
  }
}