Agent skill

Interface Design

by ccashwell in ccashwell/evm-cortex

Interface and abstract contract design patterns for Solidity protocols.

MITAuto-check passedBackend & APIs

Install Interface Design

skills CLI
$ npx skills add ccashwell/evm-cortex --skill interface-design -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ccashwell/evm-cortex interface-design --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/interface-design .claude/skills/interface-design && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
interface-design
GitHub stars
131
Token cost
~1.7k tokens
SKILL.md length
191 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Interface and abstract contract design patterns for Solidity protocols.

  • Designing modular contract systems
  • SKILL.md covers Interface Principles, Abstract Contracts vs Interfaces, Virtual / Override and EIP-165: supportsInterface, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Defining protocol standards

What it does

Interface Design is an agent skill from ccashwell/evm-cortex. Interface and abstract contract design patterns for Solidity protocols. Use when designing modular contract systems, defining protocol standards, implementing EIP-165, or structuring inheritance hierarchies.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering API design, Smart contracts and Design patterns. It works with Solidity. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Designing modular contract systems
  • Defining protocol standards
  • Implementing EIP-165
  • Structuring inheritance hierarchies

Example prompts

  • “/interface-design”

What it can do on your machine

Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are solidity).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Interface Design loads about 1.7k tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 191 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~56
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 191 words, ~1,705 tokens.

Download SKILL.mdSave it as .claude/skills/interface-design/SKILL.md (or your agent's skills folder).
name
interface-design
description
Interface and abstract contract design patterns for Solidity protocols. Use when designing modular contract systems, defining protocol standards, implementing EIP-165, or structuring inheritance hierarchies.

Interface Design

Interface Principles

Interfaces define the external API of your protocol. They are the contract between your system and its integrators.

solidity
// Minimal, focused interface — one concern per interface
interface IVault {
    function deposit(address token, uint256 amount) external returns (uint256 shares);
    function withdraw(address token, uint256 shares) external returns (uint256 amount);
    function balanceOf(address user, address token) external view returns (uint256);
}

// Separate admin interface
interface IVaultAdmin {
    function setFee(uint256 feeBps) external;
    function pause() external;
    function unpause() external;
}

// Separate events interface — inheritable without implementation obligation
interface IVaultEvents {
    event Deposited(address indexed user, address indexed token, uint256 amount, uint256 shares);
    event Withdrawn(address indexed user, address indexed token, uint256 amount, uint256 shares);
}

Abstract Contracts vs Interfaces

FeatureInterfaceAbstract Contract
State variablesNoYes
ConstructorNoYes
Function implementationsNoPartial
InheritanceMultipleMultiple (with care)
Use caseExternal API definitionShared base logic
solidity
// Abstract contract: provides base implementation with extension points
abstract contract BaseVault is IVault, IVaultEvents, ReentrancyGuard {
    mapping(address => mapping(address => uint256)) internal _shares;

    function deposit(address token, uint256 amount)
        external
        virtual
        nonReentrant
        returns (uint256 shares)
    {
        shares = _convertToShares(token, amount);
        _shares[msg.sender][token] += shares;
        IERC20(token).safeTransferFrom(msg.sender, address(this), amount);
        emit Deposited(msg.sender, token, amount, shares);
    }

    // Extension point — subclasses define share calculation
    function _convertToShares(address token, uint256 amount)
        internal
        view
        virtual
        returns (uint256);
}

Virtual / Override

Use virtual to mark functions that can be overridden. Use override to implement them. Use both when a middle-layer contract overrides but allows further overriding.

solidity
abstract contract Pausable {
    bool public paused;

    modifier whenNotPaused() virtual {
        require(!paused, "Paused");
        _;
    }

    function _pause() internal virtual {
        paused = true;
    }
}

contract Vault is Pausable {
    function deposit(uint256 amount) external whenNotPaused {
        // ...
    }

    // Override to add event emission
    function _pause() internal override {
        super._pause();
        emit VaultPaused(block.timestamp);
    }
}

EIP-165: supportsInterface

Implement supportsInterface to allow onchain interface detection.

solidity
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

contract MyToken is IERC165, IERC721 {
    function supportsInterface(bytes4 interfaceId) external pure override returns (bool) {
        return
            interfaceId == type(IERC165).interfaceId ||   // 0x01ffc9a7
            interfaceId == type(IERC721).interfaceId ||   // 0x80ac58cd
            interfaceId == type(IERC721Metadata).interfaceId; // 0x5b5e139f
    }
}
Computing Interface IDs
solidity
// Interface ID = XOR of all function selectors in the interface
bytes4 constant IERC721_ID = bytes4(
    keccak256("balanceOf(address)") ^
    keccak256("ownerOf(uint256)") ^
    keccak256("safeTransferFrom(address,address,uint256,bytes)") ^
    keccak256("safeTransferFrom(address,address,uint256)") ^
    keccak256("transferFrom(address,address,uint256)") ^
    keccak256("approve(address,uint256)") ^
    keccak256("setApprovalForAll(address,bool)") ^
    keccak256("getApproved(uint256)") ^
    keccak256("isApprovedForAll(address,address)")
);

// Or use Solidity's built-in:
bytes4 id = type(IERC721).interfaceId;

Callback Interfaces

Define callback interfaces for contracts that need to be notified of actions (flash loans, token receipts).

solidity
interface IFlashLoanReceiver {
    /// @notice Called by the lending pool after transferring the flash loan amount.
    /// @param token The address of the token borrowed.
    /// @param amount The amount borrowed.
    /// @param fee The fee to be paid on top of the borrowed amount.
    /// @param data Arbitrary data passed through from the flash loan initiator.
    /// @return Must return the keccak256 hash of "IFlashLoanReceiver.onFlashLoan"
    function onFlashLoan(
        address token,
        uint256 amount,
        uint256 fee,
        bytes calldata data
    ) external returns (bytes32);
}

// Verify callback return value
bytes32 constant CALLBACK_SUCCESS = keccak256("IFlashLoanReceiver.onFlashLoan");

function flashLoan(address receiver, address token, uint256 amount, bytes calldata data) external {
    IERC20(token).safeTransfer(receiver, amount);

    bytes32 result = IFlashLoanReceiver(receiver).onFlashLoan(token, amount, fee, data);
    if (result != CALLBACK_SUCCESS) revert InvalidCallbackReturn();

    IERC20(token).safeTransferFrom(receiver, address(this), amount + fee);
}

Diamond Inheritance

Solidity uses C3 linearization for multiple inheritance. Be explicit about resolution.

solidity
contract A {
    function foo() public virtual returns (string memory) { return "A"; }
}

contract B is A {
    function foo() public virtual override returns (string memory) { return "B"; }
}

contract C is A {
    function foo() public virtual override returns (string memory) { return "C"; }
}

// Must explicitly override — compiler enforces it
contract D is B, C {
    function foo() public override(B, C) returns (string memory) {
        return super.foo(); // calls C.foo() (rightmost parent in linearization)
    }
}

Interface Design Checklist

  • One concern per interface (separate user-facing from admin)
  • Events in their own interface for clean inheritance
  • EIP-165 supportsInterface implemented for discoverable contracts
  • Callback interfaces return a magic value for verification
  • virtual on functions intended for extension
  • NatSpec on all interface functions
  • Abstract contracts for shared base logic with extension points
  • Inheritance order consistent across the codebase
  • No diamond inheritance without explicit override(A, B) resolution

© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/interface-design of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Interface Design next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Interface Design compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Interface Design this skillccashwell/evm-cortex131—~1.7kAutomated safety check: PassMIT
Auditsablier-labs/evm-monorepo353—~1.8kAutomated safety check: PassCustom licence
Foundry Reference Modelaviggiano/security144—~516Automated safety check: PassMIT
CLI Designcitypaul/.dotfiles739—~6.6kAutomated safety check: NotesCC-BY-SA-4.0
API Design Principlesjh941213/my-cc-harness12619 repos~3.4kAutomated safety check: PassNone
Fizz Convertpashov/skills1.2k2 repos~3.7kAutomated safety check: PassMIT

Similar skills

  • Audit

    sablier-labs/evm-monorepo

    Security audit and code review for Solidity smart contracts.

    353 GitHub stars~1.8k tokensUpdated 13 days ago
    Backend & APIsAuto-check passed
  • Foundry Reference Model

    aviggiano/security

    Build a simple independent Solidity reference implementation for Foundry tests.

    144 GitHub stars~516 tokensUpdated 22 days ago
    Backend & APIsAuto-check passed
  • CLI Design

    citypaul/.dotfiles

    Unix-composable CLI design patterns. An agent skill from citypaul/.dotfiles.

    739 GitHub stars~6.6k tokensUpdated 5 days ago
    Backend & APIsAuto-check: notes
  • API Design Principles

    jh941213/my-cc-harness

    REST 및 GraphQL API 설계 원칙 가이드. An agent skill from jh941213/my-cc-harness.

    126 GitHub starsUsed in 19 repos~3.4k tokens
    Backend & APIsAuto-check passed
  • Fizz Convert

    pashov/skills

    Convert English-language properties in PROPERTIES.md (produced by the Fizz skill) into Solidity assertions inside the existing fuzz harness, then flip their checkboxes.

    1.2k GitHub starsUsed in 2 repos~3.7k tokens
    Backend & APIsAuto-check passed
  • Feynman Auditor

    0xiehnnkta/nemesis-auditor

    Deep business logic bug finder using the Feynman technique. An agent skill from 0xiehnnkta/nemesis-auditor.

    244 GitHub starsUsed in 1 repo~11k tokens
    Backend & APIsAuto-check passed

More from ccashwell/evm-cortex

All 89 skills in this repo
  • Xray Pre Audit

    ccashwell/evm-cortex

    A skill your agent uses when preparing for a security audit, performing reconnaissance on a new codebase, or creating a protocol overview.

    131 GitHub stars~25k tokensUpdated 8 days ago
    Auto-check passed
  • Aave Integration

    ccashwell/evm-cortex

    A skill your agent uses when integrating with Aave V3 for lending, borrowing, flash loans, or building on top of Aave markets.

    131 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Access Control Patterns

    ccashwell/evm-cortex

    Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.

    131 GitHub stars~1.8k tokensUpdated 8 days ago
    Auto-check passed
  • Anvil Patterns

    ccashwell/evm-cortex

    A skill your agent uses when running a local Ethereum node with Anvil.

    131 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Audit Breadth Scan

    ccashwell/evm-cortex

    A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.

    131 GitHub stars~1.4k tokensUpdated 8 days ago
    Auto-check passed
  • Audit Depth Analysis

    ccashwell/evm-cortex

    A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.

    131 GitHub stars~1.6k tokensUpdated 8 days ago
    Auto-check passed

Works with

Questions about Interface Design

What does Interface Design do?

Interface and abstract contract design patterns for Solidity protocols. Interface Design is an agent skill from ccashwell/evm-cortex. Interface and abstract contract design patterns for Solidity protocols.

When should I use Interface Design?

Interface Design fits situations like: designing modular contract systems; defining protocol standards; implementing EIP-165; structuring inheritance hierarchies.

How do I install Interface Design in Claude Code?

Run `npx skills add ccashwell/evm-cortex --skill interface-design -a claude-code`. Or copy the skill folder (skills/interface-design in ccashwell/evm-cortex) into .claude/skills/interface-design in your project. Claude Code loads it when a task matches its description.

How do I install Interface Design in Codex?

Run `npx skills add ccashwell/evm-cortex --skill interface-design -a codex`. Or copy the skill folder (skills/interface-design in ccashwell/evm-cortex) into .agents/skills/interface-design in your project. Codex loads it when a task matches its description.

Can I use Interface Design in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill interface-design -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/interface-design, .gemini/skills/interface-design, .github/skills/interface-design and .opencode/skills/interface-design in your project.

What does Interface Design need to run?

SKILL.md names no scripts, command-line tools or credentials: Interface Design is instructions for the agent only.

Does Interface Design access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Interface Design safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Interface Design use?

Interface Design is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Interface Design use?

About 1.7k tokens (SKILL.md is roughly 6.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Interface Design?

Skills that share tags, products or a category with Interface Design: Audit (sablier-labs/evm-monorepo, 353 stars), Foundry Reference Model (aviggiano/security, 144 stars), CLI Design (citypaul/.dotfiles, 739 stars) and API Design Principles (jh941213/my-cc-harness, 126 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Interface Design?

ccashwell (a GitHub user) maintains it in ccashwell/evm-cortex, which has 131 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on September 30, 2026.

Source: ccashwell/evm-cortex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.