Agent Skill · Limit Break
tokenmaster-integrator
Generate TokenMaster transaction integration code -- buy/sell/spend flows, advanced orders, EIP-712 signing, oracles
Skill body
TokenMaster Integrator
Generate transaction integration code for TokenMaster buy/sell/spend flows.
Project Setup
Before generating code, check the user’s project is configured:
- Foundry:
foundry.tomlmust exist. If not:forge init - TokenMaster:
lib/tm-tokenmaster/must exist. If not:forge install limitbreakinc/tm-tokenmaster - Remappings:
remappings.txtneeds@limitbreak/tm-tokenmaster/=lib/tm-tokenmaster/. Append if missing – do not overwrite existing entries. - Local testing: For local development, use
apptoken-devto bootstrap an Anvil node with all Apptoken protocols at their deterministic addresses – seeapptoken-general/references/project-setup.md.
Instructions
- Parse requirements from $ARGUMENTS
- Resolve ambiguities before generating – if $ARGUMENTS references specific tokens or hooks without addresses, or the transaction type (basic vs advanced, with/without cosigner) isn’t clear, ask in a single message. If clear, proceed.
- Determine transaction type: basic buy/sell, advanced buy/sell with signed orders, spend (always requires signed order)
- Generate integration code with proper struct construction, approvals, and signing
- Handle: native token via msg.value, ERC20 approvals, PermitC transfers, cosigning, oracle integration
Reference Files
references/transaction-flows.md– Buy, sell, spend flows with code examplesreferences/advanced-orders.md– Signed orders, oracle integration, cosigning- Protocol knowledge:
tokenmaster-protocol
Common Mistakes
sellTokensAdvancedALWAYS calls the hook – there is noaddress(0)guard. IfsignedOrder.hookisaddress(0), the call reverts. Every advanced sell order MUST specify a valid hook contract.buyTokensAdvancedandspendTokensDO haveaddress(0)guards – hooks are optional for these.withdrawFeescan be called by EITHER theTOKENMASTER_FEE_COLLECTOR_ROLEholder OR thepartnerFeeRecipientfor a specific token.
When to Use This vs Other Skills
- This skill (tokenmaster-integrator): Generate transaction integration code – buy, sell, spend flows, EIP-712 signing, advanced orders. Use when building frontends, backends, or contracts that submit transactions to the TokenMaster Router.
- tokenmaster-hook: Generate hook contracts for post-execution logic. Use when you need custom behavior triggered after a transaction completes.
- tokenmaster-deployer: Generate deployment scripts. Use before integration – you need a deployed token first.
Related Skills
- tokenmaster-hook – Generate hook contracts that execute after advanced order transactions
- tokenmaster-deployer – Generate token deployment scripts (prerequisite for trading)
- permitc-protocol – PermitC fundamentals (approvals, signing, nonces) used for advanced buy orders
Skill frontmatter
user-invocable: true
disable-model-invocation: true
argument-hint: [description of transaction or integration requirements]