Agent skill

Event Design

by ccashwell in ccashwell/evm-cortex

Event-first contract design for efficient onchain data indexing.

MITAuto-check passed

Install Event Design

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

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

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

At a glance

Event-first contract design for efficient onchain data indexing.

  • Designing contracts for The Graph
  • SKILL.md covers Design Contracts Event-First, Indexed Parameters, Event Naming Conventions and Log Gas Costs, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Any offchain indexing system

What it does

Event Design is an agent skill from ccashwell/evm-cortex. Event-first contract design for efficient onchain data indexing. Use when designing contracts for The Graph, Dune, or any offchain indexing system. Covers indexed parameters, naming conventions, event costs, and designing contracts event-first.

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

The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Designing contracts for The Graph
  • Any offchain indexing system

Example prompts

  • “/event-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 and typescript).

    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

Event Design loads about 1.6k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 340 words of instructions outside code blocks.

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

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). 340 words, ~1,561 tokens.

Download SKILL.mdSave it as .claude/skills/event-design/SKILL.md (or your agent's skills folder).
name
event-design
description
Event-first contract design for efficient onchain data indexing. Use when designing contracts for The Graph, Dune, or any offchain indexing system. Covers indexed parameters, naming conventions, event costs, and designing contracts event-first.

Event Design

Design Contracts Event-First

Events are the primary interface between onchain state and offchain systems. Design events before writing contract logic. Every state-changing function should emit at least one event.

solidity
// Define events FIRST, then build the contract around them
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);
    event FeeCollected(address indexed collector, uint256 amount);
    event StrategyUpdated(address indexed oldStrategy, address indexed newStrategy);
    event EmergencyShutdown(address indexed triggeredBy, uint256 timestamp);
}

Indexed Parameters

  • Max 3 indexed parameters per event (4 for anonymous events)
  • Indexed parameters become log topics — filterable by indexers
  • Non-indexed parameters go in the data section — cheaper, not filterable
  • Value types (address, uint, bool, bytes32) are stored directly as topics
  • Reference types (string, bytes, arrays) are stored as their keccak256 hash when indexed
solidity
// GOOD: key actors indexed for filtering, amounts in data for reading
event Transfer(address indexed from, address indexed to, uint256 amount);

// GOOD: token indexed for per-token queries
event Swap(
    address indexed sender,
    address indexed tokenIn,
    address indexed tokenOut,
    uint256 amountIn,
    uint256 amountOut,
    uint256 fee
);

// BAD: indexing a string hashes it — you can't read the original value from the topic
event NameChanged(string indexed name); // topic = keccak256(name), not the string
What to Index
ParameterIndex?Reason
User/sender addressYesFilter by user
Token addressYesFilter by token
Pool/vault IDYesFilter by pool
AmountsNoRead from data, not filtered
TimestampsNoBlock timestamp available anyway
Strings/bytesNoIndexed = hashed = unreadable

Event Naming Conventions

  • Use past tense for completed actions: Deposited, Withdrawn, Transferred
  • Use present/descriptive for config changes: FeeUpdated, OwnershipTransferred
  • Avoid generic names: Updated (updated what?), Action (what action?)
solidity
// GOOD: specific, past tense
event LiquidityAdded(address indexed provider, uint256 amount0, uint256 amount1, uint256 liquidity);
event PositionLiquidated(address indexed owner, address indexed liquidator, uint256 debt, uint256 collateral);
event OracleUpdated(address indexed oldOracle, address indexed newOracle);

// BAD: vague
event Updated(uint256 value);
event Action(address user, uint256 amount);

Log Gas Costs

ComponentGas Cost
Base log cost375 gas
Per topic375 gas
Per byte of data8 gas
Total for 3-topic event with 64 bytes data~2,137 gas

Events are cheap relative to storage operations (~20,000 gas). Always emit events for state changes.

Events for Offchain Indexing (The Graph)

Design events to match your subgraph schema. Each entity in your subgraph should map to one or more events.

solidity
// Subgraph entity: Position
// Maps to events: PositionOpened, PositionClosed, PositionModified
event PositionOpened(
    uint256 indexed positionId,
    address indexed owner,
    address indexed market,
    bool isLong,
    uint256 size,
    uint256 collateral,
    uint256 entryPrice
);

event PositionClosed(
    uint256 indexed positionId,
    address indexed owner,
    uint256 exitPrice,
    int256 pnl,
    uint256 fee
);

// Include all fields the subgraph handler needs — avoid requiring
// additional contract reads in the handler (those are slow and expensive)
Subgraph Mapping Example
typescript
// subgraph handler — events should contain all data needed
export function handlePositionOpened(event: PositionOpened): void {
  let position = new Position(event.params.positionId.toString());
  position.owner = event.params.owner;
  position.market = event.params.market;
  position.isLong = event.params.isLong;
  position.size = event.params.size;
  position.collateral = event.params.collateral;
  position.entryPrice = event.params.entryPrice;
  position.openedAt = event.block.timestamp;
  position.openTxHash = event.transaction.hash;
  position.save();
}

Anonymous Events

Anonymous events don't store the event signature as topic[0]. This allows 4 indexed parameters but events can't be filtered by name.

solidity
// Saves ~375 gas (one fewer topic), but indexers can't filter by event name
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId, uint256 amount) anonymous;

Use anonymous events sparingly — only when the gas savings justify the indexing difficulty.

Semantic Events for Protocol History

Emit enough data to reconstruct protocol history without reading storage.

solidity
// A governance proposal should log everything needed for a governance dashboard
event ProposalCreated(
    uint256 indexed proposalId,
    address indexed proposer,
    address[] targets,
    uint256[] values,
    bytes[] calldatas,
    string description,
    uint256 startBlock,
    uint256 endBlock
);

event VoteCast(
    uint256 indexed proposalId,
    address indexed voter,
    uint8 support,      // 0=against, 1=for, 2=abstain
    uint256 weight,
    string reason
);

Event Design Checklist

  • Every state-changing function emits an event
  • Key actors (user, token, pool) are indexed
  • Amounts and computed values are in data (not indexed)
  • Event names use past tense for actions
  • Events contain all data needed by subgraph handlers
  • No indexed strings/bytes (they're hashed and unreadable)
  • Configuration change events include both old and new values
  • Events documented with NatSpec

© 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/event-design of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Event 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.

Event Design compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Event Design this skillccashwell/evm-cortex131—~1.6kAutomated safety check: PassMIT
Indexabilitythedaviddias/Front-End-Checklist74k—~814Automated safety check: PassMIT
Eventscoreyhaines31/marketingskills54k—~3kAutomated safety check: PassMIT
Event Sourcing Architectdavila7/claude-code-templates32k4 repos~659Automated safety check: PassMIT
Event Store Designwshobson/agents40k9 repos~828Automated safety check: PassMIT
Indexability Conflictsthedaviddias/Front-End-Checklist74k—~876Automated safety check: PassMIT

Similar skills

  • Indexability

    thedaviddias/Front-End-Checklist

    A skill your agent uses when auditing a site for accidental noindex directives, investigating why important pages are not appearing in Google Search, or reviewing CMS settings that control indexing…

    74k GitHub stars~814 tokensUpdated 2 days ago
    Marketing & SEOAuto-check passed
  • Events

    coreyhaines31/marketingskills

    When the user wants to plan, run, sponsor, speak at, or get pipeline from events — webinars, conferences, trade shows, meetups, dinners, workshops, virtual summits, or user conferences.

    54k GitHub stars~3k tokensUpdated today
    Marketing & SEOAuto-check passed
  • Event Sourcing Architect

    davila7/claude-code-templates

    Expert in event sourcing, CQRS, and event-driven architecture patterns.

    32k GitHub starsUsed in 4 repos~659 tokens
    Backend & APIsAuto-check passed
  • Event Store Design

    wshobson/agents

    Designs event stores for event-sourced systems: requirements, a comparison of EventStoreDB, PostgreSQL, Kafka, DynamoDB and Marten, and stream and versioning practices.

    40k GitHub starsUsed in 9 repos~828 tokens
    Backend & APIsAuto-check passed
  • Indexability Conflicts

    thedaviddias/Front-End-Checklist

    A skill your agent uses when auditing a site for indexability issues, investigating why pages appear in Google's index that should be excluded (or vice versa), or reviewing robots.txt and meta…

    74k GitHub stars~876 tokensUpdated 2 days ago
    Marketing & SEOAuto-check passed
  • Index Refresh

    paperclipai/paperclip

    A skill your agent uses when an LLM Wiki operation issue requests an index refresh.

    99k GitHub stars~994 tokensUpdated today
    Knowledge ManagementAuto-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

Questions about Event Design

What does Event Design do?

Event-first contract design for efficient onchain data indexing. Event Design is an agent skill from ccashwell/evm-cortex. Event-first contract design for efficient onchain data indexing.

When should I use Event Design?

Event Design fits situations like: designing contracts for The Graph; any offchain indexing system.

How do I install Event Design in Claude Code?

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

How do I install Event Design in Codex?

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

Can I use Event 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 event-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/event-design, .gemini/skills/event-design, .github/skills/event-design and .opencode/skills/event-design in your project.

What does Event Design need to run?

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

Does Event 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 Event 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 Event Design use?

Event 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 Event Design use?

About 1.6k tokens (SKILL.md is roughly 6.2k 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 Event Design?

Skills that share tags, products or a category with Event Design: Indexability (thedaviddias/Front-End-Checklist, 74k stars), Events (coreyhaines31/marketingskills, 54k stars), Event Sourcing Architect (davila7/claude-code-templates, 32k stars) and Event Store Design (wshobson/agents, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Event 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.