writing-docstrings
How to write Python docstrings in TVBO so that quartodoc renders them correctly in the API site.
Skill by virtual-twin
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/virtual-twin-writing-docstrings-1a9c80
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, backend, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
writing-docstrings- Description
- How to write Python docstrings in TVBO so that quartodoc renders them correctly in the API site. Google style, markdown body, type info on signature (not in the docstring).
- License
- EUPL-1.2
- Metadata
- audience: maintainer
- Instructions
- 315 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Writing Docstrings for Quarto / quartodoc
The API site at `docs/api/**` is generated by **quartodoc** from Python docstrings. Whether your code shows up well in the rendered site depends entirely on how you write them. This skill is the contract.
## TL;DR — the canonical form
```python
def render_code(experiment: SimulationExperiment, format: str = "jax") -> str:
"""Render the simulator code for *experiment* without executing it.
Useful for debugging or for running the kernel outside TVBO. Supported
formats are listed in [`tvbo.codegen.registry`](../codegen/registry.qmd).
Args:
experiment: The `SimulationExperiment` to render.
format: Backend identifier (e.g. `"jax"`, `"tvb"`, `"pyrates"`).
Defaults to `"jax"`.
Returns:
The rendered source code as a single string.
Raises:
ValueError: If *format* is not a registered backend.
Examples:
>>> code = render_code(exp, format="jax")
>>> "def integrate" in code
True
"""
```
That's the shape every docstring should approximate. The rules behind it:
## 1. Style is Google
The quartodoc config in `docs/api/_quartodoc_config.yml` sets `parser: google`. Use `Args:` / `Returns:` / `Raises:` / `Yields:` / `Examples:` blocks — **not** NumPy's `Parameters\n----------\n` underline form.
Google style is also less line-noise than NumPy and renders predictably as parameter tables in the Quarto site.
## 2. Type info goes on the **signature**, not in the docstring
```python
# ✗ Wrong — type duplicated in docstring
def foo(x):
"""Args:
x (int): The thing.
"""
# ✓ Right — type on signature only
def foo(x: int) -> str:
"""Args:
x: The thing.
Returns:
Description (no type — quartodoc reads it from `-> str`).
"""
```
Quartodoc displays the type from the annotation. Repeating it in the docstring desyncs over time and clutters the rendered table.
Exception: if a parameter is `Any`, `object`, or accepts heterogenous inputs, document the accepted forms in prose.
## 3. The body is **markdown**
Inside the docstring, write CommonMark/Quarto-flavored markdown:
- Backticks for code: `` `SimulationExperiment` ``, `` `from_db()` ``
- Links: `[CodeGen](../codegen/index.qmd)` for cross-references
- Lists, bold/italic, code blocks — all work
- Math: `$\dot{x} = -\gamma x$` inline, `$$ … $$` block
Quarto's renderer processes the body as markdown after quartodoc lifts the parameter blocks into tables.
## 4. First line is a one-sentence summary
Imperative, period-terminated, fits on one line. This becomes the entry in the module's summary table.
```python
"""Render a SimulationExperiment to YAML.""" # ✓
"""Renders a SimulationExperiment to YAML""" # ✗ (no period, "Renders" not imperative)
"""This function renders a SimulationExperiment.""" # ✗ (filler words)
```
After a blank line, free-form prose can elaborate.
## 5. `Args:` block — only required when there are parameters
Each parameter gets its own line. Indent continuation lines by 4 spaces.
```python
def foo(x: int, y: str = "z", *args, **kwargs):
"""Summary.
Args:
x: Description.
y: Description that spans
multiple lines — indent the continuation by 4 spaces.
*args: Positional varargs (document if meaningful).
**kwargs: Forwarded to `something.else()`.
"""
```
Skip `self` / `cls`. Don't write `Args:` at all when the function takes no documented parameters.
**Never** group multiple parameter names on one line — `foo, bar: Both are ...` makes quartodoc emit a warning and the entry won't render correctly. Give each parameter its own line, even if the body is duplicated:
```python
# ✗ Wrong — quartodoc can't parse this
Args:
edge_cmap, node_cmap: Matplotlib colormap names.
# ✓ Right
Args:
edge_cmap: Matplotlib colormap name for edges.
node_cmap: Matplotlib colormap name for nodes.
```
## 6. `Returns:` — describe what comes backFrom virtual-twin/tvbo, EUPL-1.2.
More from virtual-twin/tvbo
- 0.529score
overview
virtual-twin
What TVBO is — the three pillars (LinkML datamodel, ontology, Python package) plus the Odoo platform.
SkillCFreshness: C★ 5Claude Code +9 - 0.529score
git
virtual-twin
Rules for git operations in TVBO.
SkillCFreshness: C★ 5Claude Code +9 - 0.529score
writing-code
virtual-twin
Behavioral guidelines to reduce common LLM coding mistakes: think before coding, simplicity first, surgical changes, goal-driven execution.
SkillCFreshness: C★ 5Claude Code +9 - 0.526score
platform
virtual-twin
How to use the Odoo-based TVBO platform at tvbo.charite.de — retrieve curated knowledge, manage your account, share SimulationExperiments and Studies (public…
SkillCFreshness: C★ 5Claude Code +9 - 0.526score
running-simulations
virtual-twin
How to run a SimulationExperiment in TVBO — choosing a backend, calling run/plot, and what each optional extra (jax, tvb, pyrates, julia) provides.
SkillCFreshness: C★ 5Claude Code +9 - 0.526score
writing-docstrings
virtual-twin
How to write Python docstrings in TVBO so that quartodoc renders them correctly in the API site.
SkillCFreshness: C★ 5Claude Code +9 - 0.526score
codegen-templates
virtual-twin
How TVBO's code generation works — template engines, backend dispatch in tvbo/codegen/, and the contract for adding a new backend.
SkillCFreshness: C★ 5Claude Code +9 - 0.526score
writing-models
virtual-twin
How to specify a Dynamics in TVBO — the YAML and Python forms, parameter / state-variable / equation conventions, and common pitfalls.
SkillCFreshness: C★ 5Claude Code +9 - 0.523score
linkml-schema
virtual-twin
How to edit the LinkML schema in schema/*.yaml and why tvbo/datamodel/** is generated and must never be hand-edited.
SkillCFreshness: C★ 5Claude Code +9 - 0.518score
Anti AI Slop Editor
virtual-twin
Ruthless editor who detects and destroys AI-generated slop — the hollow filler phrases, fake enthusiasm, recycled structures, and performative depth that make…
SkillCFreshness: C★ 5Claude Code +9 - 0.499score
grill-me
virtual-twin
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree.
SkillCFreshness: C★ 5Claude Code +9 - 0.499score
grill-me
virtual-twin
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree.
SkillCFreshness: C★ 5Claude Code +9
Signals
- Stars
- 5
- Forks
- 1
- Open issues
- 13
- Last commit (this folder)
- May 15, 2026 (5 months ago)
- Last release
- Jul 9, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- EUPL-1.2
- Repository
- github.com/virtual-twin/tvbo
- Website
- tvbo.charite.de
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from virtual-twin
- 0.529score
overview
virtual-twin
What TVBO is — the three pillars (LinkML datamodel, ontology, Python package) plus the Odoo platform.
SkillCFreshness: C★ 5Claude Code +9 - 0.529score
git
virtual-twin
Rules for git operations in TVBO.
SkillCFreshness: C★ 5Claude Code +9 - 0.529score
writing-code
virtual-twin
Behavioral guidelines to reduce common LLM coding mistakes: think before coding, simplicity first, surgical changes, goal-driven execution.
SkillCFreshness: C★ 5Claude Code +9 - 0.526score
platform
virtual-twin
How to use the Odoo-based TVBO platform at tvbo.charite.de — retrieve curated knowledge, manage your account, share SimulationExperiments and Studies (public…
SkillCFreshness: C★ 5Claude Code +9 - 0.526score
codegen-templates
virtual-twin
How TVBO's code generation works — template engines, backend dispatch in tvbo/codegen/, and the contract for adding a new backend.
SkillCFreshness: C★ 5Claude Code +9 - 0.526score
running-simulations
virtual-twin
How to run a SimulationExperiment in TVBO — choosing a backend, calling run/plot, and what each optional extra (jax, tvb, pyrates, julia) provides.
SkillCFreshness: C★ 5Claude Code +9
Cite this page
writing-docstrings skill. Agent Mart. https://agentmart.dev/skills/virtual-twin-writing-docstrings-1a9c80 (last updated 2026-10-24)