doc
Skill143 starsChanged 2 months agoMITView on GitHub
Document code in this repository.
34 other projects use a version of this.
Adopted by
Most recently taken up by
- jeremy-farnault/claude-skillstheir own version, first seen Nov 3, 2026
- DataChuLee/Claude-Code-Settingtheir own version, first seen Nov 1, 2026
- satoh-y-0323/claude-code-conductortheir own version, first seen Oct 31, 2026
- hmjBill/skillstheir own version, first seen Oct 29, 2026
- Mazalucas/El-DT-Lightweight-Armytheir own version, first seen Oct 26, 2026
- gagoar/html-effectivenesstheir own version, first seen Oct 20, 2026
Used with
Projects with it also use explain, interview and 6 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
sunnyclinches44Skillexplain
Explains code using real-world analogies and ASCII diagrams
Also in 4 projects that use this
dazuckSkillinterview
Interview me about a plan to flesh out requirements before implementation. Asks non-obvious questions one at a time until all ambiguities are resolved.
Also in 3 projects that use this
BlockSkillplan
Draft a TDD, PRD, or lightweight plan in the conversation without committing it.
Also in 4 projects that use this
GitHubSkillrefactor
Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.
Also in 3 projects that use this
nicolasestremSkillbrainstorm
Structured idea generation and solution exploration with systematic analysis.
Also in 3 projects that use this
GoogleSkillimprove-codebase-architecture
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
Also in 3 projects that use this
Other versions34 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 34
- termio-sh/termio★ 787same name
- boshu2/agentops★ 453same name
- JetBrains/skills★ 386same name
- kv0906/pm-kit★ 138same name
- davidhozic/mujoco-rs★ 85same name
- VoDaiLocz/kilo-kit-mcp★ 28same name
- PracticalSwan/agent-skills★ 22same name
- jhy0285/monofield★ 6same name
- Mazalucas/El-DT-Lightweight-Army★ 4same name
- merchsage/workflow-skills★ 4same name
24 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. 0 are common, 22 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 26 edited versions we read keep these.
22
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Write or refine documentation for leanSpec code.
- Distinctive: line 17
Run git diff and git diff --cached to identify scope.
- Distinctive: line 18
Do not touch unchanged code.
- Distinctive: line 22
When an argument is provided, document the target fully — not just uncommitted changes.
- Distinctive: line 31
Do not paper every line.
- Distinctive: line 35
When a header doc grows past one overview line, organize the detail under these section names:
- Distinctive: line 43
Never title a section "Why ..." (for example "# Why the finalized slot is the cutoff").
- Distinctive: line 49
Read the implementation carefully before writing a single line of documentation.
- Distinctive: line 52
Write the header tightly. Use the standard section vocabulary when overview alone is not enough.
- Distinctive: line 53
Use the standard section vocabulary when overview alone is not enough.
- Distinctive: line 54
Add inline WHY comments. Glue each comment to the code it explains.
- Distinctive: line 57
If a fresh reader would stall, add one more comment — and only one.
- Distinctive: line 61
Test docstrings stay short.
- Distinctive: line 75
Never write essay-style prose blocks in test docstrings.
- Distinctive: line 134
Do not pad with a class roster.
- Distinctive: line 137
Default: phase-labeled inline comments in the body, short overview in the header.
- Distinctive: line 140
Do not write docs that pretend a deprecated path still exists.
- Distinctive: line 206
Before finishing a documentation pass, verify:
- Distinctive: line 208
Every sentence is on its own line.
- Distinctive: line 210
No function or variable names referenced in prose.
- Distinctive: line 211
All non-obvious WHYs are documented.
- Distinctive: line 212
No banner-style separator comments.
- Distinctive: line 213
No documentation added to code that was not in scope.
“Common” is measured: kept by at least 6 in 10 of the 26 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/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:
- No argument — document only new or modified code.
Run
git diffandgit diff --cachedto identify scope. Do not touch unchanged code. - File or folder path — document everything inside that path recursively.
- 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
- Read the implementation carefully before writing a single line of documentation.
- Identify the educational angle. What does a reader new to Ethereum consensus need to know?
- Write the header tightly. Use the standard section vocabulary when overview alone is not enough.
- Add inline WHY comments. Glue each comment to the code it explains.
- 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.
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.
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.mdrule 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.
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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

