Agent skill

Erc8004 Patterns

by ccashwell in ccashwell/evm-cortex

A skill your agent uses when integrating ERC-8004 onchain agent identity.

MITAuto-check passedBackend & APIs

Install Erc8004 Patterns

skills CLI
$ npx skills add ccashwell/evm-cortex --skill erc8004-patterns -a claude-code

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

GitHub CLI
$ gh skill install ccashwell/evm-cortex erc8004-patterns --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/erc8004-patterns .claude/skills/erc8004-patterns && 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
erc8004-patterns
GitHub stars
131
Token cost
~2k tokens
SKILL.md length
149 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when integrating ERC-8004 onchain agent identity.

  • Integrating ERC-8004 onchain agent identity
  • SKILL.md covers Overview, Core Interface, Registry Integration and Registering an Agent, plus 5 more sections
  • Reaches acmelabs.xyz and ethskills.com

What it does

Erc8004 Patterns is an agent skill from ccashwell/evm-cortex. Use when integrating ERC-8004 onchain agent identity. Covers agent identity registry, authentication, capability declaration, trust framework for AI agents interacting onchain. Deployed January 2026 on 20+ chains.

Its SKILL.md is about 2k 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. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Integrating ERC-8004 onchain agent identity

Example prompts

  • “/erc8004-patterns”

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, json and typescript).

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • acmelabs.xyz
    • ethskills.com
    • 8004.org

    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

Erc8004 Patterns loads about 2k tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 149 words of instructions outside code blocks.

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

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). 149 words, ~1,987 tokens.

Download SKILL.mdSave it as .claude/skills/erc8004-patterns/SKILL.md (or your agent's skills folder).
name
erc8004-patterns
description
Use when integrating ERC-8004 onchain agent identity. Covers agent identity registry, authentication, capability declaration, trust framework for AI agents interacting onchain. Deployed January 2026 on 20+ chains.

ERC-8004 Onchain Agent Identity

Overview

ERC-8004 establishes a standard for AI agent identity onchain. Deployed on January 29, 2026 across 20+ chains, it provides a registry for agents to declare their identity, capabilities, and trust relationships. This enables verifiable agent-to-agent and agent-to-protocol interactions.

Core Interface

solidity
interface IERC8004 {
    struct AgentIdentity {
        address agent;         // agent's onchain address (EOA or contract)
        bytes32 identityHash;  // hash of offchain identity metadata
        uint64 registeredAt;
        uint64 expiresAt;
        address operator;      // human or org that controls the agent
        uint8 trustLevel;      // 0-255 trust score
    }

    struct Capability {
        bytes32 capabilityId;  // keccak256 of capability name
        bytes params;          // ABI-encoded capability parameters
    }

    event AgentRegistered(address indexed agent, bytes32 identityHash, address indexed operator);
    event AgentRevoked(address indexed agent, address indexed revokedBy);
    event CapabilityDeclared(address indexed agent, bytes32 indexed capabilityId);

    function registerAgent(AgentIdentity calldata identity, Capability[] calldata capabilities) external;
    function revokeAgent(address agent) external;
    function getIdentity(address agent) external view returns (AgentIdentity memory);
    function getCapabilities(address agent) external view returns (Capability[] memory);
    function isRegistered(address agent) external view returns (bool);
    function hasCapability(address agent, bytes32 capabilityId) external view returns (bool);
    function verifyAgent(address agent, bytes32 requiredCapability) external view returns (bool);
}

Registry Integration

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {IERC8004} from "./interfaces/IERC8004.sol";

contract AgentGatedProtocol {
    IERC8004 public immutable agentRegistry;
    bytes32 public constant TRADE_CAPABILITY = keccak256("trade");
    bytes32 public constant REBALANCE_CAPABILITY = keccak256("rebalance");

    modifier onlyRegisteredAgent() {
        require(agentRegistry.isRegistered(msg.sender), "Not a registered agent");
        _;
    }

    modifier requiresCapability(bytes32 capId) {
        require(agentRegistry.verifyAgent(msg.sender, capId), "Missing capability");
        _;
    }

    constructor(address registry_) {
        agentRegistry = IERC8004(registry_);
    }

    function executeTrade(bytes calldata tradeData)
        external
        onlyRegisteredAgent
        requiresCapability(TRADE_CAPABILITY)
    {
        // Agent-executed trade logic
    }

    function rebalanceVault()
        external
        onlyRegisteredAgent
        requiresCapability(REBALANCE_CAPABILITY)
    {
        // Only agents with rebalance capability
    }
}

Registering an Agent

solidity
contract AgentDeployer {
    IERC8004 public registry;

    function deployAndRegister(
        address agentAddress,
        bytes32 identityHash,
        uint64 ttl
    ) external {
        IERC8004.AgentIdentity memory identity = IERC8004.AgentIdentity({
            agent: agentAddress,
            identityHash: identityHash,
            registeredAt: uint64(block.timestamp),
            expiresAt: uint64(block.timestamp) + ttl,
            operator: msg.sender,
            trustLevel: 100
        });

        IERC8004.Capability[] memory caps = new IERC8004.Capability[](2);
        caps[0] = IERC8004.Capability({
            capabilityId: keccak256("trade"),
            params: abi.encode(1 ether) // max trade size
        });
        caps[1] = IERC8004.Capability({
            capabilityId: keccak256("rebalance"),
            params: ""
        });

        registry.registerAgent(identity, caps);
    }
}

Identity Metadata (Offchain)

The identityHash references offchain metadata stored on IPFS or a similar system:

json
{
    "name": "TradingBot-v2",
    "version": "2.1.0",
    "description": "Automated DeFi trading agent",
    "operator": {
        "name": "Acme Labs",
        "url": "https://acmelabs.xyz",
        "contact": "ops@acmelabs.xyz"
    },
    "model": "gpt-4-turbo",
    "capabilities": ["trade", "rebalance", "report"],
    "auditUrl": "https://audits.example.com/tradingbot-v2",
    "sourceCodeHash": "0xabc123..."
}

Compute the hash: keccak256(abi.encodePacked(ipfsUri))

Trust Framework

solidity
contract TrustOracle {
    IERC8004 public registry;

    mapping(address agent => mapping(address endorser => uint8 score)) public endorsements;

    function endorseAgent(address agent, uint8 score) external {
        require(registry.isRegistered(agent), "Agent not registered");
        require(registry.isRegistered(msg.sender), "Endorser not registered");
        endorsements[agent][msg.sender] = score;
    }

    function aggregateTrust(address agent, address[] calldata endorsers)
        external view returns (uint256)
    {
        uint256 total;
        for (uint256 i = 0; i < endorsers.length; i++) {
            total += endorsements[agent][endorsers[i]];
        }
        return endorsers.length > 0 ? total / endorsers.length : 0;
    }
}

Agent-to-Agent Authentication

solidity
contract AgentCollaboration {
    IERC8004 public registry;

    event TaskDelegated(address indexed from, address indexed to, bytes32 taskId);

    function delegateTask(address toAgent, bytes32 taskId, bytes calldata taskData) external {
        require(registry.verifyAgent(msg.sender, keccak256("delegate")), "Cannot delegate");
        require(registry.verifyAgent(toAgent, keccak256("execute")), "Cannot execute");

        IERC8004.AgentIdentity memory sender = registry.getIdentity(msg.sender);
        IERC8004.AgentIdentity memory receiver = registry.getIdentity(toAgent);

        require(sender.trustLevel >= 50, "Sender trust too low");
        require(receiver.trustLevel >= 50, "Receiver trust too low");

        emit TaskDelegated(msg.sender, toAgent, taskId);
    }
}

Multi-Chain Registry Lookup

ERC-8004 is deployed at the same address on 20+ chains. Query the registry on any supported chain:

typescript
import { createPublicClient, http } from 'viem';
import { base, optimism, arbitrum } from 'viem/chains';

// ERC-8004 registries (same addresses on 20+ chains). Verified with `cast code` on
// Ethereum mainnet and Base, 2026-09-25 — re-verify on any other chain before use.
// Source: https://ethskills.com/why/SKILL.md, https://www.8004.org
const ERC8004_IDENTITY_REGISTRY = '0x8004A169FB4a3325136EB29fA0ceB6D2e539a432';
const ERC8004_REPUTATION_REGISTRY = '0x8004BAa17C55a88189AE136b182e5fdA19dE9b63';
const ERC8004_REGISTRY = ERC8004_IDENTITY_REGISTRY;

async function checkAgentOnChain(agentAddress: `0x${string}`, chain: any) {
  const client = createPublicClient({ chain, transport: http() });
  const isRegistered = await client.readContract({
    address: ERC8004_REGISTRY,
    abi: erc8004Abi,
    functionName: 'isRegistered',
    args: [agentAddress],
  });
  return isRegistered;
}

Integration Checklist

  • Verify agent registration before granting protocol access
  • Check capability declarations match required permissions
  • Validate agent identity has not expired (expiresAt > block.timestamp)
  • Verify operator address for administrative actions
  • Cross-reference trust scores from multiple endorsers
  • Handle agent revocation events (listen for AgentRevoked)
  • Store identityHash for offchain metadata verification
  • Test multi-chain registry lookups for cross-chain agent operations

© 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/erc8004-patterns of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Erc8004 Patterns 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.

Erc8004 Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Erc8004 Patterns this skillccashwell/evm-cortex131—~2kAutomated safety check: PassMIT
Configuring Horizoncoollabsio/coolify63k4 repos~898Automated safety check: PassMIT
Nestjs Best Practicesrolling-scopes/rsschool-app10k6 repos~1.2kAutomated safety check: PassMIT
Sub2API AdminWei-Shaw/sub2api44k1 repos~717Automated safety check: PassLGPL-3.0
Firecrawl Build Onboardingfirecrawl/firecrawl190k1 repos~1.4kAutomated safety check: NotesISC
Obsidian BasesAtmosphere/atmosphere3.8k22 repos~3.2kAutomated safety check: PassApache-2.0

Similar skills

  • Configuring Horizon

    coollabsio/coolify

    A skill your agent uses whenever the user mentions Horizon by name in a Laravel context.

    63k GitHub starsUsed in 4 repos~898 tokens
    Backend & APIsAuto-check passed
  • Nestjs Best Practices

    rolling-scopes/rsschool-app

    NestJS best practices and architecture patterns for building production-ready applications.

    10k GitHub starsUsed in 6 repos~1.2k tokens
    Backend & APIsAuto-check passed
  • Sub2API Admin

    Wei-Shaw/sub2api

    Manages a Sub2API deployment from the command line: accounts, redeem and invitation codes, groups, proxies, imports, exports and raw admin API calls.

    44k GitHub starsUsed in 1 repo~717 tokens
    Backend & APIsAuto-check passed
  • Firecrawl Build Onboarding

    firecrawl/firecrawl

    Gets Firecrawl working in a project: signs you in through the browser, saves FIRECRAWL_API_KEY to .env and picks the first SDK or REST path.

    190k GitHub starsUsed in 1 repo~1.4k tokens
    Backend & APIsAuto-check: notes
  • Obsidian Bases

    Atmosphere/atmosphere

    Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries.

    3.8k GitHub starsUsed in 22 repos~3.2k tokens
    Backend & APIsAuto-check passed
  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k 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 9 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 9 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 9 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 9 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 9 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 9 days ago
    Auto-check passed

Categories

Questions about Erc8004 Patterns

What does Erc8004 Patterns do?

A skill your agent uses when integrating ERC-8004 onchain agent identity. Erc8004 Patterns is an agent skill from ccashwell/evm-cortex. Use when integrating ERC-8004 onchain agent identity.

When should I use Erc8004 Patterns?

Erc8004 Patterns fits situations like: integrating ERC-8004 onchain agent identity.

How do I install Erc8004 Patterns in Claude Code?

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

How do I install Erc8004 Patterns in Codex?

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

Can I use Erc8004 Patterns 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 erc8004-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/erc8004-patterns, .gemini/skills/erc8004-patterns, .github/skills/erc8004-patterns and .opencode/skills/erc8004-patterns in your project.

What does Erc8004 Patterns need to run?

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

Does Erc8004 Patterns access the network?

SKILL.md names 3 domains. In commands or code: acmelabs.xyz, ethskills.com and 8004.org; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Erc8004 Patterns 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 Erc8004 Patterns use?

Erc8004 Patterns 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 Erc8004 Patterns use?

About 2k tokens (SKILL.md is roughly 7.9k 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 Erc8004 Patterns?

Skills that share tags, products or a category with Erc8004 Patterns: Configuring Horizon (coollabsio/coolify, 63k stars), Nestjs Best Practices (rolling-scopes/rsschool-app, 10k stars), Sub2API Admin (Wei-Shaw/sub2api, 44k stars) and Firecrawl Build Onboarding (firecrawl/firecrawl, 190k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Erc8004 Patterns?

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.