Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when adding a docstring to a Python function, method, or class: write it in NumPy style with hyphen-underlined section headers, not Google or reStructuredText.
.claude/skills/numpy-docstring-format/SKILL.md| Model | Eval pass | Runs |
|---|---|---|
| gemini-3.6-flash | 100% | 1 |
| Model | Lift | Δ tokens | Δ turns | Cases | Verified |
|---|---|---|---|---|---|
| gemini-3.6-flashbest | +12% | +172% | 0% | 25 | 54d ago |
| gemini-3.5-flash | pending re-run | — | |||
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | — | — |
| case-02 | ✗→✓ | ▲ Improved | — | — |
| case-07 | ✗→✓ | ▲ Improved | — | — |
| case-03 | ✓→✓ | = Same ✓ | — | — |
| case-04 | ✓→✓ | = Same ✓ | — | — |
Every Python function, method, class, and generator is documented with a NumPy-style docstring: hyphen-underlined section headers, name : type parameter lines, and a bare-type Returns. Apply this whenever you write or edit a docstring. Do not use Google style (Args:), reStructuredText (:param:), or Epytext (@param) — those are the defaults to avoid.
""" and put the one-line summary on the lineimmediately after the opening """ — not on the same line as the quotes. The summary is a single sentence in the imperative mood ("Compute…", "Fetch…", not "Computes…" / "Returns the…") and ends with a period. Close with """ on its own line.
applicable sections in this exact order, omitting any that do not apply: Parameters → Returns (or Yields) → Raises. (Less common sections, when used, slot in as: Parameters, Returns/Yields, Other Parameters, Raises, See Also, Notes, Examples.)
immediately by a line of hyphens (-) exactly as long as the header text — never a trailing colon:
Parameters then ---------- (10 hyphens)Returns then ------- (7 hyphens)Raises then ------ (6 hyphens)Yields then ------ (6 hyphens)name : type — name, single space,colon, single space, type — on its own line. The description goes on the following line(s), indented four spaces. Multiple types are joined with or (int or None). Optional arguments append , optional after the type: page : int, optional.
description indented four spaces beneath it. A name before the colon (result : dict) is a Returns-line error; that form is only for Parameters.
ExceptionType on its own line,with the triggering condition indented four spaces beneath it. One entry per distinct exception, in the order they can be raised.
Yields section (not Returns) for the yielded value, formattedexactly like Returns — bare type, description indented beneath.
self or cls in Parameters. For a class, the Parameterssection documents the constructor (__init__) arguments.
*args as *args : type and **kwargs as **kwargs : type(keep the stars), or under their real names (*dicts : dict).
Args:, Arguments:, Attributes:, :param,:returns:, :raises:, @param, or any colon-terminated header. Headers are always underlined with hyphens.
Rule 1 + 3 — summary placement and underlines. Base default = Google style.
python# BEFORE (Google) def to_celsius(f): """Convert Fahrenheit to Celsius. Args: f: Temperature in Fahrenheit. """ # AFTER (NumPy) def to_celsius(f): """Convert Fahrenheit to Celsius. Parameters ---------- f : float Temperature in Fahrenheit. """
Rule 4 — name : type spacing. Base writes f: float or f (float):.
python# BEFORE """... Parameters ---------- f: float # no space before colon ... """ # AFTER """... Parameters ---------- f : float # space, colon, space ... """
Rule 5 — Returns is a bare type, no name. Base names the return value.
python# BEFORE """Compute cosine similarity. Returns: score (float): Similarity in [-1, 1]. """ # AFTER """Compute cosine similarity. Returns ------- float Similarity in [-1, 1]. """
Rule 6 — Raises lists bare exception types. Base uses RST or omits Raises.
python# BEFORE """Divide a by b. :raises ZeroDivisionError: if b is zero. """ # AFTER """Divide a by b. Raises ------ ZeroDivisionError If b is zero. """
Rule 7 — generators use Yields. Base writes Returns.
python# BEFORE """Yield fixed-size batches. Returns: list: Each successive batch. """ # AFTER """Yield fixed-size batches. Yields ------ list Each successive batch of items. """
Rule 8 — self is not documented. Base lists self under Args.
python# BEFORE """Withdraw from the account. Args: self: The account. amount (float): Amount to withdraw. """ # AFTER """Withdraw from the account. Parameters ---------- amount : float Amount to withdraw. """
empty Parameters header. For -> None, you may omit Returns or write a Returns section whose bare type is None; never write a Google Returns: header.
cc : list, optional. The description states the default behavior ("Defaults to None.").
or: value : int or float. Do not use Python typingsyntax like Union[int, float] in the type slot unless that is the literal annotation.
class line and document constructor args inParameters; if you also document instance state, use an Attributes NumPy section (hyphen-underlined, 10 hyphens), never Google's Attributes: colon header.
async def changes nothing about the docstring.Raisesheader; do not collapse them into one line or repeat the Raises header.
Parameters:). Always underline it withhyphens matching the header length.
name: type or name (type):. Always write name : type (spaced colon).Returns type line. Always give the bare type only.:param: / @param: / Args:. Always use the hyphen-underlined headers.self/cls. Always start Parameters at the first real argument.""". Always drop it to thenext line.
Args: / Returns:) — the single most frequent miss.name: type (Python annotation spacing) instead of name : type.Returns\n-------\nresult : dict — putting a parameter name on the Returns line.Parameters with 8 hyphens) or omitting theunderline and using a colon instead.
Returns for a generator instead of Yields.self as the first parameter.:raises:) into an otherwise NumPy docstring.""", imperative, ends with a period.name : type, description indented 4 spaces; self/cls excluded.Returns/Yields = bare type, no name. Raises = bare exception types.Args:, :param, @param, or any colon-terminated header.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-24 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-25 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-23 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +12 percentage points is the difference between those two pass rates over the 25 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.5-flash | verified | 7/2/2026 | +100% |
Other measured skills in the registry, with their headline benchmark lift.