Agent Skill · Limit Break

lbamm-token-hook

Generate complete ILimitBreakAMMTokenHook Solidity implementations

Provider: Limit Break Path in repo: SKILL.md

Skill body

LBAMM Token Hook Generator

Generate a complete ILimitBreakAMMTokenHook implementation based on the user’s requirements.

Project Setup

Before generating code, check the user’s project is configured:

  1. Foundry: foundry.toml must exist. If not: forge init
  2. LBAMM Core: lib/lbamm-core/ must exist. If not: forge install limitbreakinc/lbamm-core
  3. Remappings: remappings.txt needs @limitbreak/lbamm-core/=lib/lbamm-core/. Append if missing – do not overwrite existing entries.
  4. Local testing: LBAMM is in audit and not yet on public networks. For local testing, use lbamm-examples – see lbamm-protocol/references/local-dev.md. Generated scripts should read addresses from environment variables (vm.envAddress) so they work with the local Anvil deployment.

Instructions

  1. Parse requirements from $ARGUMENTS – identify what the hook should do (fee collection, swap gating, LP restrictions, flashloan control, handler order validation, etc.)

  2. Resolve ambiguities before generating – if $ARGUMENTS mentions external contracts without addresses (e.g., “an NFT collection”, “an oracle”, “a whitelist registry”), ask the user whether they want to use an existing deployed contract (and get the address) or have a new one created as part of the example. Similarly, clarify fee percentages, admin roles, or other values if they’re unspecified and would meaningfully change the implementation. Ask everything in a single message. If the prompt is specific enough, skip this step and proceed.

  3. Determine which of the 10 hook flags are needed:
    • Bit 0: beforeSwap – validate/gate swaps, charge input-side fees
    • Bit 1: afterSwap – validate post-swap state, charge output-side fees
    • Bit 2: addLiquidity – validate/gate LP deposits, charge deposit fees
    • Bit 3: removeLiquidity – validate/gate LP withdrawals, charge withdrawal fees
    • Bit 4: collectFees – validate fee collection, charge fees on fee claims
    • Bit 5: poolCreation – validate/gate pool creation for this token
    • Bit 6: hookManagesFees – hook manages its own fee accounting (fees tracked per-hook in core)
    • Bit 7: flashloans – enable flashloans and set fees via beforeFlashloan
    • Bit 8: flashloansValidateFee – validate when another token uses this as flashloan fee token
    • Bit 9: handlerOrderValidate – validate transfer handler order creation
  4. Generate a complete Solidity contract that:
    • Uses pragma solidity 0.8.24;
    • Implements ILimitBreakAMMTokenHook
    • Implements hookFlags() returning correct (requiredFlags, supportedFlags) bitmask
    • Implements all required callback functions (even unused ones should have minimal implementations)
    • Implements tokenHookManifestUri()
    • Includes appropriate access control (Ownable or role-based as needed)
    • Stores the LBAMM core address for callbacks that need it
  5. Explain flag choices and security considerations

Reference Files

When to Use This vs Other Hook Skills

Key Rules

Dependencies

@limitbreak/lbamm-core/src/interfaces/hooks/ILimitBreakAMMTokenHook.sol
@limitbreak/lbamm-core/src/DataTypes.sol

Skill frontmatter

user-invocable: true disable-model-invocation: true argument-hint: [description of desired hook behavior]

Work with this as data

Every skill here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for agent skills

4 MCP tools reach this
  • find_skillsBrowse and filter every skill in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This skill
curl "https://apis.io/api/v1/skills/lbamm-token-hook"
All agent skills
curl "https://apis.io/api/v1/skills?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.