Agent skill

Write Docstring

by ethereum in ethereum/execution-specs

Write specification docstrings using repository conventions.

CC0-1.0Auto-check passedDevelopment

Install Write Docstring

skills CLI
$ npx skills add ethereum/execution-specs --skill write-docstring -a claude-code

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

GitHub CLI
$ gh skill install ethereum/execution-specs write-docstring --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/ethereum/execution-specs.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/write-docstring .claude/skills/write-docstring && 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
write-docstring
GitHub stars
1.2k
Token cost
~2.6k tokens
SKILL.md length
633 words
Files
1
Skills in repo
13
Repo updated
First seen
Licence
CC0-1.0

At a glance

Write specification docstrings using repository conventions.

  • Tasks that involve Technical documentation
  • SKILL.md covers General Rules, Module Docstrings, Function Docstrings and Class Docstrings, plus 5 more sections
  • Reaches en.wikipedia.org and eips.ethereum.org

What it does

Write Docstring is an agent skill from ethereum/execution-specs. Write specification docstrings using repository conventions.

Its SKILL.md is about 2.6k 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 Development, covering Technical documentation. It works with Ethereum and Python. The repository describes itself as: Specification for the Execution Layer. Tracking network upgrades. The licence is CC0-1.0.

When your agent uses it

  • Tasks that involve Technical documentation

Example prompts

  • “/write-docstring”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit d7a84b8. 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 python).

    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:

    • en.wikipedia.org
    • eips.ethereum.org
    • docs.python.org
    • github.com

    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

Write Docstring loads about 2.6k tokens when it runs. Until then it costs about 19 tokens; SKILL.md has 633 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~19
When it runs · the whole SKILL.md, loaded when a task matches
~2.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 ethereum/execution-specs at commit d7a84b8, republished under its CC0-1.0 licence (© ethereum). 633 words, ~2,598 tokens.

Download SKILL.mdSave it as .claude/skills/write-docstring/SKILL.md (or your agent's skills folder).
name
write-docstring
description
Write specification docstrings using repository conventions.

Write Docstring

Conventions for writing docstrings in src/ethereum/. Docstrings are the primary prose of the specification — they read as a narrative explaining how Ethereum works, not as traditional Python API documentation. They are rendered into HTML by docc, which parses them as Markdown (via mistletoe). Run this skill before writing or modifying docstrings.

General Rules

  • Markdown only — no reStructuredText (.. directives::, :param:, RST section underlines)
  • 79-character line limit (same as code)
  • Imperative mood for summaries ("Obtain" not "Obtains", "Return" not "Returns")
  • Summary on the line after opening """
  • Blank line after the summary for multi-line docstrings
  • For multi-line docstrings, the closing """ should be on its own line
  • No __init__ docstrings (D107 is disabled), only the class itself is documented
  • Reference link definitions go at the end of the docstring, after a blank line
  • Do not include constants/numeric values in the docstring (values in docstrings can easily desync with the code, and no tool will detect it)
  • Avoid restating what the code is doing (the code should speak for itself)
  • Avoid mentioning the current fork unnecessarily (creates noisy diffs between forks)
  • Docstrings should be reserved for meaningful specification, while comments (# ...) can be used to explain particulars of the Python reference implementation

Module Docstrings

Module docstrings introduce the concepts in the module. They should read as narrative prose — imagine a textbook chapter opening.

Start with a one-line summary, then expand with paragraphs that explain what the module contains and why. Use cross-references to link to the key types and functions defined in the module.

python
"""
Ethash is a proof-of-work algorithm designed to be [ASIC] resistant through
[memory hardness][mem-hard].

To achieve memory hardness, computing Ethash requires access to subsets of a
large structure. The particular subsets chosen are based on the nonce and block
header, while the set itself is changed every [`epoch`].

At a high level, the Ethash algorithm is as follows:

1. Create a **seed** value, generated with [`generate_seed`] and based on the
   preceding block numbers.
1. From the seed, compute a pseudorandom **cache** with [`generate_cache`].
1. From the cache, generate a **dataset** with [`generate_dataset`]. The
   dataset grows over time based on [`DATASET_EPOCH_GROWTH_SIZE`].
1. Miners hash slices of the dataset together, which is where the memory
   hardness is introduced. Verification of the proof-of-work only requires the
   cache to be able to recompute a much smaller subset of the full dataset.

[`DATASET_EPOCH_GROWTH_SIZE`]: ref:ethereum.ethash.DATASET_EPOCH_GROWTH_SIZE
[`generate_dataset`]: ref:ethereum.ethash.generate_dataset
[`generate_cache`]: ref:ethereum.ethash.generate_cache
[`generate_seed`]: ref:ethereum.ethash.generate_seed
[`epoch`]: ref:ethereum.ethash.epoch
[ASIC]: https://en.wikipedia.org/wiki/Application-specific_integrated_circuit
[mem-hard]: https://en.wikipedia.org/wiki/Memory-hard_function
"""

Short modules that need no narrative can use a single-line summary:

python
"""
Utility functions used in this specification.
"""

Function Docstrings

Function docstrings describe what the function does and why, as part of the specification narrative. Reference parameters inline with backticks — do not use formal Parameters, Returns, or Raises sections.

Short (summary only)
python
def convert(balance: str) -> U256:
    """
    Convert a string in either hexadecimal or base-10 to a `U256`.
    """
Multi-paragraph (with context)
python
def add_genesis_block(
    hardfork: GenesisFork, chain: Any, genesis: GenesisConfiguration
) -> None:
    """
    Add the genesis block to an empty blockchain.

    The genesis block is an entirely sui generis block (unique) that is not
    governed by the general rules applying to all other Ethereum blocks.
    Instead, the only consensus requirement is that it must be identical to
    the block added by this function.

    The initial state is populated with balances based on the Ethereum presale
    that happened on the Bitcoin blockchain. Additional ether worth 1.98% of
    the presale was given to the foundation.

    The `nonce` field is `0x42` referencing Douglas Adams' "HitchHiker's Guide
    to the Galaxy".

    On testnets the genesis configuration usually allocates 1 wei to addresses
    `0x00` to `0xFF` to avoid edge cases around precompiles being created or
    cleared (by [EIP-161]).

    [EIP-161]: https://eips.ethereum.org/EIPS/eip-161
    """
With cross-references
python
def cache_size(block_number: Uint) -> Uint:
    """
    Obtain the cache size (in bytes) of the epoch to which `block_number`
    belongs.

    See [`INITIAL_CACHE_SIZE`] and [`CACHE_EPOCH_GROWTH_SIZE`] for the initial
    size and linear growth rate, respectively. The cache is generated in
    [`generate_cache`].

    The actual cache size is smaller than simply multiplying
    `CACHE_EPOCH_GROWTH_SIZE` by the epoch number to minimize the risk of
    unintended cyclic behavior. It is defined as the highest prime number below
    what linear growth would calculate.

    [`INITIAL_CACHE_SIZE`]: ref:ethereum.ethash.INITIAL_CACHE_SIZE
    [`CACHE_EPOCH_GROWTH_SIZE`]: ref:ethereum.ethash.CACHE_EPOCH_GROWTH_SIZE
    [`generate_cache`]: ref:ethereum.ethash.generate_cache
    """

Class Docstrings

Brief summary of what the class represents, with optional narrative and cross-references.

python
class GenesisConfiguration:
    """
    Configuration for the first block of an Ethereum chain.

    Specifies the allocation of ether set out in the pre-sale, and some of
    the fields of the genesis block.
    """
python
class EvmTracer(Protocol):
    """
    [`Protocol`] that describes tracer functions.

    See [`ethereum.trace`] for details about tracing in general, and
    [`__call__`] for more on how to implement a tracer.

    [`Protocol`]: https://docs.python.org/3/library/typing.html#typing.Protocol
    [`ethereum.trace`]: ref:ethereum.trace
    [`__call__`]: ref:ethereum.trace.EvmTracer.__call__
    """

Attribute Docstrings

docc documents any assignment that is followed by a bare string literal. This is non-standard Python — normally only modules, classes, and functions can have docstrings. Place a triple-quoted string immediately after the assignment.

This works for constants, class fields, module-level variables, and type aliases.

Constants
python
EPOCH_SIZE = Uint(30000)
"""
Number of blocks before a dataset needs to be regenerated (known as an
"epoch".) See [`epoch`].

[`epoch`]: ref:ethereum.ethash.epoch
"""
Class fields
python
class Example:
    chain_id: U64
    """
    Discriminant between diverged blockchains; `1` for Ethereum's main network.
    """
Module-level variables
python
_evm_trace: EvmTracer = discard_evm_trace
"""
Active [`EvmTracer`] that is used for generating traces.

[`EvmTracer`]: ref:ethereum.trace.EvmTracer
"""
Type aliases
python
TraceEvent = (
    TransactionStart
    | TransactionEnd
    | PrecompileStart
    | PrecompileEnd
    | OpStart
    | OpEnd
    | OpException
    | EvmStop
    | GasAndRefund
)
"""
All possible types of events that an [`EvmTracer`] is expected to handle.

[`EvmTracer`]: ref:ethereum.trace.EvmTracer
"""

Cross-References

docc resolves Markdown reference links with the ref: scheme into hyperlinks in the generated documentation.

Show full SKILL.md (250 more words)Show less
Internal (to other Python objects)

Use backtick-wrapped names as the link text, with ref: pointing to the fully-qualified path:

[`ForkCriteria`]: ref:ethereum.fork_criteria.ForkCriteria
[`generate_cache`]: ref:ethereum.ethash.generate_cache

Short aliases work when the full name is unwieldy:

[ds]: ref:ethereum.ethash.DATASET_EPOCH_GROWTH_SIZE
External URLs

Standard Markdown reference links:

[ASIC]: https://en.wikipedia.org/wiki/Application-specific_integrated_circuit
[EIP-3155]: https://eips.ethereum.org/EIPS/eip-3155

Bare URLs in angle brackets for inline use:

Available at <https://github.com/ethereum/genesis_block_generator>.

If a URL is too long to include because of the line length limit, you can add # noqa: E501 after the trailing """ to squelch the warning (but this should be a last resort).

Usage in text

Reference links are used inline with brackets:

For these intentional forks to succeed, all participants need to agree on
exactly when to switch rules. The agreed upon criteria are represented by
subclasses of [`ForkCriteria`], like [`ByBlockNumber`] and [`ByTimestamp`].

Markdown Formatting

  • _italic_ to introduce domain terms: _Genesis_ is the term for...
  • **bold** to highlight key concepts: Create a **seed** value
  • Backticks for code references: `block_number`, `0x42`
  • Numbered lists (1.) for sequential steps
  • Bullet lists (-) for unordered items
  • Markdown headings are rarely needed inside docstrings; use paragraphs instead

Anti-Patterns

  • No RST directives: .. contents::, .. note::, :param:, :returns: — these are outdated
  • No NumPy/Google sections: no Parameters\n---------- or Args: blocks
  • No RST section underlines: Introduction\n------------ is RST, not Markdown
  • No type repetition in docstrings: types come from annotations, not prose
  • No empty boilerplate: don't write """Ethereum Specification.""" with a .. contents:: block — write real narrative or a concise summary
  • Don't skip attribute docstrings: constants and fields deserve explanations

Reference Files

For examples of well-written docstrings, see:

  • src/ethereum/ethash.py — narrative module + function docstrings
  • src/ethereum/genesis.py — class, attribute, and multi-paragraph function docstrings
  • src/ethereum/trace.py — class, attribute, and protocol docstrings
  • src/ethereum/fork_criteria.py — narrative module docstring with Markdown formatting

If these files no longer exist or are no longer good examples, abort with an appropriate error message.

© ethereum, CC0-1.0. 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 .agents/skills/write-docstring of ethereum/execution-specs.

Open the folder on GitHubat commit d7a84b8

Compare with similar skills

Write Docstring 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.

Write Docstring compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Write Docstring this skillethereum/execution-specs1.2k—~2.6kAutomated safety check: PassCC0-1.0
Adk Sample Creatorgoogle/adk-python22k—~1.3kAutomated safety check: PassApache-2.0
Crafting Effective Readmescumbucadev/cinemaempoa1465 repos~669Automated safety check: PassGPL-3.0
Acquire Codebase Knowledgegithub/awesome-copilot40k1 repos~2.3kAutomated safety check: PassMIT
Docs Conventionsflet-dev/flet17k—~1.6kAutomated safety check: PassApache-2.0
DDNS Provider DevelopmentNewFuture/DDNS4.7k—~558Automated safety check: PassMIT

Similar skills

  • Adk Sample Creator

    google/adk-python

    Official

    Creates a new sample agent in the ADK Python repository — the sample directory, its agent.py, and its README.md — following the conventions the existing samples already use.

    22k GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Crafting Effective Readmes

    cumbucadev/cinemaempoa

    A skill your agent uses when writing or improving README files.

    146 GitHub starsUsed in 5 repos~669 tokens
    DevelopmentAuto-check passed
  • Acquire Codebase Knowledge

    github/awesome-copilot

    Official

    Maps an unfamiliar codebase into seven evidence-backed documents in docs/codebase/, using a scan script and templates, for onboarding or architecture write-ups.

    40k GitHub starsUsed in 1 repo~2.3k tokens
    DevelopmentAuto-check passed
  • Docs Conventions

    flet-dev/flet

    A skill your agent uses when writing or reviewing Flet documentation, including Python docstrings (Google style, reST roles, admonitions), Markdown docs (cross-references, images, code examples)…

    17k GitHub stars~1.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Adds or changes a DNS provider in the DDNS project while keeping its code, schemas, tests and Chinese and English docs consistent.

    4.7k GitHub stars~558 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Mkdocs

    jeka-dev/jeka

    MkDocs documentation project reference covering CLI commands, mkdocs.yml configuration, Material theme setup, and plugin integration.

    176 GitHub stars~2k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed

More from ethereum/execution-specs

All 13 skills in this repo
  • Consume Hive

    ethereum/execution-specs

    Run locally filled fixtures against execution clients with a selected Hive simulator and a network client configuration from hive-tests.

    1.2k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Eip Checklist

    ethereum/execution-specs

    Track EIP test coverage with the repository checklist system.

    1.2k GitHub stars~804 tokensUpdated today
    Auto-check passed
  • Fill Tests

    ethereum/execution-specs

    Fill test fixtures with the repository fill command. An agent skill from ethereum/execution-specs.

    1.2k GitHub stars~793 tokensUpdated today
    Auto-check passed
  • Grammar Check

    ethereum/execution-specs

    Audit grammar in documentation and code comments. An agent skill from ethereum/execution-specs.

    1.2k GitHub stars~424 tokensUpdated today
    Auto-check passed
  • Implement Eip

    ethereum/execution-specs

    Implement EIP specification changes using repository conventions.

    1.2k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Pytester

    ethereum/execution-specs

    Write and run isolated pytester-based plugin tests. An agent skill from ethereum/execution-specs.

    1.2k GitHub stars~403 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Write Docstring

What does Write Docstring do?

Write specification docstrings using repository conventions. Write Docstring is an agent skill from ethereum/execution-specs. Write specification docstrings using repository conventions.

When should I use Write Docstring?

Write Docstring fits situations like: tasks that involve Technical documentation.

How do I install Write Docstring in Claude Code?

Run `npx skills add ethereum/execution-specs --skill write-docstring -a claude-code`. Or copy the skill folder (.agents/skills/write-docstring in ethereum/execution-specs) into .claude/skills/write-docstring in your project. Claude Code loads it when a task matches its description.

How do I install Write Docstring in Codex?

Run `npx skills add ethereum/execution-specs --skill write-docstring -a codex`. Or copy the skill folder (.agents/skills/write-docstring in ethereum/execution-specs) into .agents/skills/write-docstring in your project. Codex loads it when a task matches its description.

Can I use Write Docstring 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 ethereum/execution-specs --skill write-docstring -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-docstring, .gemini/skills/write-docstring, .github/skills/write-docstring and .opencode/skills/write-docstring in your project.

What does Write Docstring need to run?

SKILL.md names no scripts, command-line tools or credentials: Write Docstring is instructions for the agent only. Our summary lists: Python 3.

Does Write Docstring access the network?

SKILL.md names 4 domains. In commands or code: en.wikipedia.org, eips.ethereum.org, docs.python.org and github.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Write Docstring 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 Write Docstring use?

Write Docstring is published under the CC0-1.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Write Docstring use?

About 2.6k tokens (SKILL.md is roughly 10k 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 Write Docstring?

Skills that share tags, products or a category with Write Docstring: Adk Sample Creator (google/adk-python, 22k stars), Crafting Effective Readmes (cumbucadev/cinemaempoa, 146 stars), Acquire Codebase Knowledge (github/awesome-copilot, 40k stars) and Docs Conventions (flet-dev/flet, 17k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Write Docstring?

ethereum (a GitHub organization) maintains it in ethereum/execution-specs, which has 1,195 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on October 7, 2026.

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