“Document code in this repository.”

— description from SKILL.md by leanEthereum
MITAuto-check passedDevelopment

Install Doc

skills CLI
$ npx skills add leanEthereum/leanSpec --skill doc -a claude-code

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

GitHub CLI
$ gh skill install leanEthereum/leanSpec doc --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/leanEthereum/leanSpec.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/doc .claude/skills/doc && 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
doc
GitHub stars
143
Token cost
~1.9k tokens
SKILL.md length
669 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

  • Works in 3 steps: No argument — document only new or… → File or folder path — document… → Module, class, or function name — locate…
  • SKILL.md covers Scope, What to document, Standard sections — use these… and Workflow, plus 5 more sections
  • Calls git

About this skill

Doc is a skill in leanEthereum/leanSpec (143 stars). Its SKILL.md is about 1.9k tokens. Licence: MIT.

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. No argument — document only new or modified code.
  2. File or folder path — document everything inside that path recursively.
  3. Module, class, or function name — locate the item in the codebase, then document it and everything inside it.

What it can do on your machine

Read from SKILL.md and the folder at commit 0b7d33e. 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

    Shell commands in SKILL.md call:

    • git

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

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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

Doc loads about 1.9k tokens when it runs. Until then it costs about 9 tokens; SKILL.md has 669 words of instructions outside code blocks.

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

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 leanEthereum/leanSpec at commit 0b7d33e, republished under its MIT licence (© leanEthereum). 669 words, ~1,939 tokens.

Download SKILL.mdSave it as .claude/skills/doc/SKILL.md (or your agent's skills folder).
name
doc
description
Document code in this repository.

/doc — document code

Write or refine documentation for leanSpec code. The atomic style rules live in .claude/rules/documentation.md — defer to that file. This skill defines what to document, how to scope the work, and shows a gold-standard exemplar.

Scope

Determine what to document from the argument passed to /doc:

  1. No argument — document only new or modified code. Run git diff and git diff --cached to identify scope. Do not touch unchanged code.
  2. File or folder path — document everything inside that path recursively.
  3. Module, class, or function name — locate the item in the codebase, then document it and everything inside it.

When an argument is provided, document the target fully — not just uncommitted changes. The argument overrides the diff-only restriction.

What to document

  • Module-level docstrings — single short line unless the module introduces complex math or non-obvious domain context.
  • All public items — classes, methods, functions, constants, type aliases, module-level Pydantic fields.
  • Constants — explain the WHY behind the value, with the constraint or protocol reference that drives the choice.
  • Inline comments — add them only where the WHY is non-obvious. Do not paper every line.

Standard sections — use these names

When a header doc grows past one overview line, organize the detail under these section names:

  • Overview — what and why at a high level.
  • Algorithm — step-by-step, only for genuinely non-obvious math or CS concepts.
  • Performance — complexity, allocation, hot-path notes.
  • Invariants — preconditions and rules the caller must preserve.
  • Args / Returns / Raises — Google style, bullets.

Never title a section "Why ..." (for example "# Why the finalized slot is the cutoff"). That phrasing reads as AI filler. State the rationale as plain prose, the way an engineer would explain it to a colleague.

Workflow

  1. Read the implementation carefully before writing a single line of documentation.
  2. Identify the educational angle. What does a reader new to Ethereum consensus need to know?
  3. Write the header tightly. Use the standard section vocabulary when overview alone is not enough.
  4. Add inline WHY comments. Glue each comment to the code it explains.
  5. Re-read as a learner. If a fresh reader would stall, add one more comment — and only one.

Test-specific format

Test docstrings stay short. A one-line summary is usually enough. Education goes inline in structured blocks:

Invariant: <rule the test enforces>

Fixture state: <concrete numbers>

Mutation: <what we change and why>

    <ASCII diagram of before/after>

Never write essay-style prose blocks in test docstrings.

Show full SKILL.md (290 more words)Show less

Consensus test-vector format

Tests under tests/consensus/ follow one fixed skeleton so any vector reads the same way. The full standard lives in .claude/rules/documentation.md under "Consensus test-vector docstrings". The module-level file header is exactly one line. The body carries no inline comments — the docstring is the single source of truth.

The skeleton is a one-line summary, then Given, When, Then. One atomic fact per bullet, fixed notation for blocks, validators, votes, and the chain.

python
def test_justified_divergence_self_heals_in_next_block(
    fork_choice_test: ForkChoiceTestFiller,
) -> None:
    """
    A block adopts the votes that justify a slot from a fork it did not extend.

    Given
    -----
    - 4 validators; a slot needs 3 votes (2/3) to be justified.
    - the chain:
        genesis
        - common(1)
          - block_2(2) -> block_3(3)
          - fork_4(4)
    - block_3 includes V0's vote for block_2.
    - fork_4 includes V1, V2, V3's votes for common.
    - fork_4 reaches 3 votes, so it justifies slot 1.
    - block_3 has only 1 vote, so it justifies nothing.
    - the views diverge: node = slot 1, head chain = slot 0.

    When
    ----
    - block_5 is built on block_3, carrying no votes of its own.

    Then
    ----
    - block_5 pulls the slot-1 votes from the pool and includes them.
    - the head chain justifies slot 1, matching the node.
    - finalized stays at slot 0.
    """

Reference exemplar: tests/consensus/lstar/fork_choice/test_attestation_source_divergence.py.

Project-specific anti-patterns

These are the failure modes most likely to slip into leanSpec PRs:

  • Backticks in docstrings or comments. Banned everywhere — single or double backticks alike. See .claude/rules/documentation.md rule 2.
  • Function names in prose. Names rot. Describe behavior in plain English.
  • Module docstring listing every class inside. The module name and public exports describe the module. Do not pad with a class roster.
  • Algorithm recap in both docstring and inline comments. Pick one. Default: phase-labeled inline comments in the body, short overview in the header.
  • Backward-compatibility justifications. The project mandates no backward compatibility. Do not write docs that pretend a deprecated path still exists.
  • Documenting code outside the requested scope. Respect the scope rules above.

Gold-standard exemplar

The target style for a well-documented Python function in this project. Note the tight one-sentence-per-line header, the plain-prose rationale, the phase-labeled body, and the ASCII layout diagram.

python
def encode_bitlist(bits: Sequence[Boolean]) -> bytes:
    """
    Encode a variable-length bitlist to SSZ bytes.

    # Overview

    Data bits are packed little-endian within each byte.
    A single 1 bit is placed immediately after the last data bit.
    The trailing bit lets the decoder recover the original count.

    SSZ encodes bitlists as raw bytes with no length prefix.
    Without that trailing bit, [1, 0] and [1, 0, 0, 0, 0, 0, 0, 0] would share the byte 0x01.
    A trailing 1 bit is the smallest sentinel that disambiguates them.

    # Layout

        bits = [1, 0, 1]   ->  byte 0:  0 0 0 0 [1] 1 0 1   (delimiter at bit 3)
        bits = [1] * 8     ->  byte 0:  1 1 1 1 1 1 1 1
                               byte 1:  0 0 0 0 0 0 0 [1]   (delimiter spills)

    Args:
        bits: The variable-length bit data.

    Returns:
        SSZ-encoded bytes containing the data bits and the delimiter.
    """
    # Phase 1: handle the empty case.
    #
    # No data bits means the encoding is just the delimiter.
    num_bits = len(bits)
    if num_bits == 0:
        return b"\x01"

    # Phase 2: pack data bits little-endian into a byte array.
    #
    # Bit i of the input lands in byte i // 8 at position i % 8.
    byte_len = (num_bits + 7) // 8
    byte_array = bytearray(byte_len)
    for i, bit in enumerate(bits):
        if bit:
            byte_array[i // 8] |= 1 << (i % 8)

    # Phase 3: place the delimiter immediately after the last data bit.
    #
    # When the bit count is a multiple of 8, the delimiter has no room
    # in the existing array and spills into a fresh trailing byte.
    if num_bits % 8 == 0:
        return bytes(byte_array) + b"\x01"
    byte_array[num_bits // 8] |= 1 << (num_bits % 8)
    return bytes(byte_array)

Match this density of structure, brevity of lines, and use of concrete numbers and diagrams.

Workflow checklist

Before finishing a documentation pass, verify:

  • Every sentence is on its own line.
  • No backticks anywhere.
  • No function or variable names referenced in prose.
  • All non-obvious WHYs are documented.
  • No banner-style separator comments.
  • No documentation added to code that was not in scope.
  • Standard section names used where headers expand past one line.

© leanEthereum, 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 .claude/skills/doc of leanEthereum/leanSpec.

Open the folder on GitHubat commit 0b7d33e

Compare with similar skills

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

Doc compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Doc this skillleanEthereum/leanSpec143—~1.9kAutomated safety check: PassMIT
Wagmi Feature Developmentwevm/wagmi6.8k—~3.8kAutomated safety check: PassMIT
Release Roundethereumjs/ethereumjs-monorepo2.8k—~2kAutomated safety check: PassNone
Update Est Fixturesethereumjs/ethereumjs-monorepo2.8k—~3.3kAutomated safety check: PassNone
Starknet JSstarknet-io/starknet.js1.3k—~1.2kAutomated safety check: PassMIT
Lean Reviewgeanlabs/gean177—~1.5kAutomated safety check: PassNone

Similar skills

  • Walks through adding a Wagmi feature across its layers: a Viem-based core action, TanStack Query options, and React and Vue bindings.

    6.8k GitHub stars~3.8k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Release Round

    ethereumjs/ethereumjs-monorepo

    Runs a coordinated EthereumJS npm release round in six human-gated phases — intent and readiness, CHANGELOG, version bump, publish (human executes), post-publish verification, and announcements.

    2.8k GitHub stars~2k tokensUpdated 19 days ago
    DevelopmentAuto-check passed
  • Update Est Fixtures

    ethereumjs/ethereumjs-monorepo

    Updates EthereumJS execution-spec test fixtures from an ethereum/execution-specs release, then (after a human merge) points the monorepo submodule, updates VM npm scripts, reports a first test run…

    2.8k GitHub stars~3.3k tokensUpdated 19 days ago
    DevelopmentAuto-check passed
  • Starknet JS

    starknet-io/starknet.js

    A skill your agent uses when writing or debugging JavaScript/TypeScript that interacts with Starknet through the starknet.js SDK — building Call objects or calldata, encoding/decoding Cairo types…

    1.3k GitHub stars~1.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Lean Review

    geanlabs/gean

    Review a branch or PR's diff against main and report opportunities to subtract — simplify, delete, and reduce the number of concepts a reader has to hold in their head.

    177 GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Boundless CLI

    boundless-xyz/boundless

    How to use the Boundless CLI — the primary interface for the Boundless ZK proof marketplace.

    193 GitHub starsUsed in 1 repo~1.8k tokens
    DevelopmentAuto-check passed

More from leanEthereum/leanSpec

All 9 skills in this repo
  • Audit

    leanEthereum/leanSpec

    Read-only, multi-agent audit of the leanSpec codebase. An agent skill from leanEthereum/leanSpec.

    143 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Client Test

    leanEthereum/leanSpec

    Run leanSpec fixtures against a client implementation. An agent skill from leanEthereum/leanSpec.

    143 GitHub stars~594 tokensUpdated 1 mo ago
    Auto-check passed
  • Review

    leanEthereum/leanSpec

    Quick-reference checklist for code review conventions in leanSpec

    143 GitHub stars~468 tokensUpdated 1 mo ago
    Auto-check passed
  • Spec Diff

    leanEthereum/leanSpec

    Show what changed in leanSpec between devnet versions or HEAD

    143 GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Workflows

    leanEthereum/leanSpec

    Common developer workflows, commands, and troubleshooting for leanSpec

    143 GitHub stars~496 tokensUpdated 1 mo ago
    Auto-check passed
  • Fill

    leanEthereum/leanSpec

    Generate consensus layer test fixtures

    143 GitHub stars~202 tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Doc

How do I install Doc in Claude Code?

Run `npx skills add leanEthereum/leanSpec --skill doc -a claude-code`. Or copy the skill folder (.claude/skills/doc in leanEthereum/leanSpec) into .claude/skills/doc in your project. Claude Code loads it when a task matches its description.

How do I install Doc in Codex?

Run `npx skills add leanEthereum/leanSpec --skill doc -a codex`. Or copy the skill folder (.claude/skills/doc in leanEthereum/leanSpec) into .agents/skills/doc in your project. Codex loads it when a task matches its description.

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

What does Doc need to run?

Going by SKILL.md and its folder, Doc needs the command-line tools its instructions call (git).

Does Doc access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Doc 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 Doc use?

Doc 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 Doc use?

About 1.9k tokens (SKILL.md is roughly 7.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 Doc?

Skills that share tags, products or a category with Doc: Wagmi Feature Development (wevm/wagmi, 6.8k stars), Release Round (ethereumjs/ethereumjs-monorepo, 2.8k stars), Update Est Fixtures (ethereumjs/ethereumjs-monorepo, 2.8k stars) and Starknet JS (starknet-io/starknet.js, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Doc?

leanEthereum (a GitHub organization) maintains it in leanEthereum/leanSpec, which has 143 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on September 2, 2026.

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