integration-test-writer
БесплатноБез исполняемых скриптовНе проверенWrite Solidity integration tests for EigenLayer contracts. Use when the user asks to write integration tests, test user flows, test cross-contract…
Об этом скилле
Integration Test Writer
Write comprehensive integration tests for EigenLayer Solidity contracts following the project's established conventions.
Overview
Integration tests orchestrate the deployment of all EigenLayer core contracts to test high-level user flows across multiple contracts. There are three test modes:
- Local Integration Tests - Deploy fresh contracts and test user flows
- Fork Tests - Fork mainnet, upgrade all contracts to latest implementations, then run the integration test suite
- Upgrade Tests - Fork mainnet, perform actions on OLD contracts, then upgrade and verify compatibility
Test Function Signature
All integration test functions MUST:
- Be named
testFuzz_action1_action2_...describing the flow - Take
uint24 _random(or_r) as the only parameter - this seeds randomness - Use the
rand(_random)modifier to initialize the random seed
function testFuzz_deposit_delegate_queue_complete(uint24 _random) public rand(_random) {
// Test implementation
}
The rand() modifier initializes the test's random seed, which is used by helper functions like _newRandomStaker() to generate deterministic random values for reproducible tests.
Test File Locations
| Type | Location |
|---|---|
| Normal integration tests | src/test/integration/tests/ |
| Upgrade tests | src/test/integration/tests/upgrade/ |
| Check functions | src/test/integration/IntegrationChecks.t.sol |
| Multichain checks | src/test/integration/MultichainIntegrationChecks.t.sol |
Core Principles
1. All Actions Must Be Called Through User Contracts
Never call contracts directly. Use the User or AVS actor contracts:
// ✅ CORRECT - Actions through User/AVS
staker.depositIntoEigenlayer(strategies, tokenBalances);
operator.delegateTo(operator);
avs.createOperatorSet(strategies);
// ❌ WRONG - Direct contract calls
strategyManager.depositIntoStrategy(...);
delegationManager.delegateTo(...);
2. Every Action Must Be Followed By a Check
After each numbered action, verify state changes using check_* functions from IntegrationChecks.t.sol:
// 1. Deposit Into Strategies
staker.depositIntoEigenlayer(strategies, tokenBalances);
check_Deposit_State(staker, strategies, shares);
// 2. Delegate to an operator
staker.delegateTo(operator);
check_Delegation_State(staker, operator, strategies, shares);
3. Actions Must Be Numbered
Use comments to number each action step for clarity:
// 1. Deposit Into Strategies
staker.depositIntoEigenlayer(strategies, tokenBalances);
check_Deposit_State(staker, strategies, shares);
// 2. Delegate to an operator
staker.delegateTo(operator);
check_Delegation_State(staker, operator, strategies, shares);
// 3. Queue Withdrawals
Withdrawal[] memory withdrawals = staker.queueWithdrawals(strategies, shares);
check_QueuedWithdrawal_State(staker, operator, strategies, shares, withdrawableShares, withdrawals, withdrawalRoots);
User Types
User (Staker/Operator)
Located in src/test/integration/users/User.t.sol. A User can act as both a staker AND an operator.
Key methods:
depositIntoEigenlayer(strategies, tokenBalances)- Deposit tokensdelegateTo(operator)- Delegate to an operatorregisterAsOperator()- Register as an operatorqueueWithdrawals(strategies, shares)- Queue withdrawalscompleteWithdrawalAsTokens(withdrawal)/completeWithdrawalAsShares(withdrawal)- Complete withdrawalsregisterForOperatorSet(operatorSet)- Register for an operator setmodifyAllocations(params)- Allocate magnitude to operator setsstartValidators()/verifyWithdrawalCredentials(validators)- Native ETH stakingstartCheckpoint()/completeCheckpoint()- Checkpoint EigenPod
AVS
Located in src/test/integration/users/AVS.t.sol. Represents an AVS that creates operator sets and slashes operators.
Key methods:
createOperatorSet(strategies)- Create an operator setcreateRedistributingOperatorSets(strategies, recipients)- Create redistributing operator setsslashOperator(params)- Slash an operatorupdateSlasher(operatorSetId, slasher)- Update the slasher for an operator set
Test Structure
Normal Integration Test
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.27;
import "src/test/integration/IntegrationChecks.t.sol";
/// @notice Base contract for shared setup across test variants
contract Integration_FlowName_Base is IntegrationCheckUtils {
using ArrayLib for *;
// Declare state used across tests
AVS avs;
OperatorSet operatorSet;
User operator;
User staker;
IStrategy[] strategies;
uint[] initTokenBalances;
uint[] initDepositShares;
/// @dev Setup state used across all test functions
function _init() internal virtual override {
_configAssetTypes(HOLDS_LST | HOLDS_ETH); // Configure asset types
// Create
Установить integration-test-writer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGlobGrepEditWriteBash(forge:*)FAQ
Что делает скилл integration-test-writer?
Write Solidity integration tests for EigenLayer contracts. Use when the user asks to write integration tests, test user flows, test cross-contract interactions, or test upgrade scenarios. Follows project conventions with User/AVS actors and numbered action steps.
Как установить скилл integration-test-writer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл integration-test-writer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic