Agent Skill · Limit Break

tokenmaster-hook

Generate TokenMaster hook contracts -- buy hooks, sell hooks, spend hooks for advanced order post-execution logic

Provider: Limit Break Path in repo: SKILL.md

Skill body

TokenMaster Hook Generator

Generate hook contracts for TokenMaster advanced order post-execution logic.

Project Setup

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

  1. Foundry: foundry.toml must exist. If not: forge init
  2. TokenMaster: lib/tm-tokenmaster/ must exist. If not: forge install limitbreakinc/tm-tokenmaster
  3. Remappings: remappings.txt needs @limitbreak/tm-tokenmaster/=lib/tm-tokenmaster/. Append if missing – do not overwrite existing entries.
  4. Local testing: For local development, use apptoken-dev to bootstrap an Anvil node with all Apptoken protocols at their deterministic addresses – see apptoken-general/references/project-setup.md.

Instructions

  1. Parse requirements from $ARGUMENTS
  2. Resolve ambiguities before generating – if $ARGUMENTS references external contracts (reward tokens, staking contracts, NFT collections) without addresses, ask whether to use existing deployments (get addresses) or generate placeholders. Clarify hook type if multiple could fit. Ask in a single message. If clear, proceed.
  3. Determine hook type(s): ITokenMasterBuyHook, ITokenMasterSellHook, ITokenMasterSpendHook
  4. Generate complete hook contract with: interface implementation, caller validation (must be Router), token/identifier validation, custom logic
  5. Hooks execute AFTER the core transaction completes
  6. hookExtraData decoding is the hook’s responsibility

Reference Files

Common Mistakes

When to Use This vs Other Skills

Skill frontmatter

user-invocable: true disable-model-invocation: true argument-hint: [description of hook requirements - what should happen after buy/sell/spend]