Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

interface-lint

БесплатноБез исполняемых скриптовНе проверен

Format and lint Solidity interface files following EigenLayer conventions. Use when the user asks to format an interface, add documentation to an interface…

Layr-Labsот Layr-Labs★ 721 звезда на GitHub17 установок в других каталогах

Об этом скилле

Interface Lint

Format Solidity interface files following EigenLayer's established conventions for organization, documentation, and error code generation.

Interface Structure

Every interface file should contain four interface contracts in this order:

  1. I{ContractName}Errors - All custom errors
  2. I{ContractName}Types - All structs and enums
  3. I{ContractName}Events - All events (inherits Types for struct access)
  4. I{ContractName} - Main interface (inherits Errors and Events)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.27;

// Imports

interface I{ContractName}Errors {
    // All errors with error codes
}

interface I{ContractName}Types {
    // All structs and enums
}

interface I{ContractName}Events is I{ContractName}Types {
    // All events
}

interface I{ContractName} is I{ContractName}Errors, I{ContractName}Events {
    // All function declarations
}

Error Documentation

Each error MUST include:

  1. @notice describing when the error is thrown
  2. @dev Error code: 0x... with the 4-byte selector from cast sig

Generating Error Codes

Use cast sig to generate the error code:

cast sig "InvalidOperatorSet()"
# Output: 0x7ec5c154

Error Format

interface IContractNameErrors {
    /// @notice Thrown when the operator set is not valid
    /// @dev Error code: 0x7ec5c154
    error InvalidOperatorSet();

    /// @notice Thrown when the chainId is invalid
    /// @dev Error code: 0x7a47c9a2
    error InvalidChainId();

    /// @notice Thrown when the key type is not set for the operatorSet
    /// @dev Error code: 0xe57cacbd
    /// @dev Additional context about why this is required
    error KeyTypeNotSet();
}

Types Documentation

Each struct/enum MUST include:

  1. @notice with a brief description
  2. @param for each field in structs
interface IContractNameTypes {
    /// @notice A per-operatorSet configuration struct
    /// @param owner the permissioned owner of the OperatorSet
    /// @param maxStalenessPeriod the maximum staleness period in seconds
    struct OperatorSetConfig {
        address owner;
        uint32 maxStalenessPeriod;
    }

    /// @notice Represents the status of an operator's registration
    /// @param registered Whether the operator is currently registered
    /// @param slashableUntil Block until which the operator remains slashable
    struct RegistrationStatus {
        bool registered;
        uint32 slashableUntil;
    }
}

Event Documentation

Each event MUST include a singular @notice describing when the event is emitted:

interface IContractNameEvents is IContractNameTypes {
    /// @notice Emitted when a generation reservation is created
    event GenerationReservationCreated(OperatorSet operatorSet);

    /// @notice Emitted when an operator set config is set
    event OperatorSetConfigSet(OperatorSet operatorSet, OperatorSetConfig config);

    /// @notice Emitted when a chainID is added to the whitelist
    event ChainIDAddedToWhitelist(uint256 chainID, address operatorTableUpdater);
}

Function Documentation

Each function in the main interface MUST include:

  1. @notice - What the function does
  2. @param - Description for each parameter
  3. @return - Description for each return value (for view functions)
  4. @dev - Additional context (optional, but include caller requirements)
  5. @dev Reverts for: - List ALL revert conditions
  6. @dev Emits the following events: - List ALL events emitted

Function Documentation Format

interface IContractName is IContractNameErrors, IContractNameEvents {
    /// @notice Creates a generation reservation for cross-chain transport
    /// @param operatorSet the operatorSet to make a reservation for
    /// @param operatorTableCalculator the calculator contract address
    /// @param config the config containing owner and staleness period
    /// @dev msg.sender must be an authorized caller for operatorSet.avs
    /// @dev Reverts for:
    ///      - CurrentlyPaused: Generation reservations are paused
    ///      - InvalidPermissions: Caller is not authorized
    ///      - InvalidOperatorSet: The operatorSet does not exist
    ///      - GenerationReservationAlreadyExists: Reservation already exists
    ///      - InvalidStalenessPeriod: The maxStalenessPeriod is invalid
    /// @dev Emits the following events:
    ///      - GenerationReservationCreated: When the reservation is created
    ///      - OperatorTableCalculatorSet: When the calculator is set
    ///      - OperatorSetConfigSet: When the config is set
    function createGenerationReservation(
        OperatorSet calldata operatorSet,
        IOperatorTableCalculator operatorTableCalculator,
        OperatorSetConfig calldata config
    ) external;

    /// @notice Gets the operator set config
    /// @param operatorSet the operatorSet to query
    /// @return The OperatorSetConfig for the given ope
Полный SKILL.md на GitHub

Установить interface-lint в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Glob
Grep
Edit
Write
Bash(cast:*)

FAQ

Что делает скилл interface-lint?

Format and lint Solidity interface files following EigenLayer conventions. Use when the user asks to format an interface, add documentation to an interface, or create a new interface. Ensures proper organization with Errors/Events/Types sub-interfaces.

Как установить скилл interface-lint?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл interface-lint запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить interface-lint с