build-docs
Skill592 starsChanged 9 months agoMITView on GitHub
Guide for building documentation and validating docstrings. Use this when asked to build docs, check docstrings, or validate documentation.
- Installs packages
We split this skill into the rules it gives an agent
10 rules. 0 are common, 10 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this skill when you need to:
- Distinctive: line 15
Check for documentation warnings or errors
- Distinctive: line 16
Ensure new functions have proper documentation
- Distinctive: line 183
Always include links to API documentation:
- Distinctive: line 209
Fix: Add complete numpydoc-style docstring with all required sections.
- Distinctive: line 215
Fix: Ensure docstring parameter types match function signature type hints.
- Distinctive: line 239
Fix: Use consistent 4-space indentation in docstrings.
- Distinctive: line 245
Fix: Verify URLs are correct and use proper RST link syntax:
- Distinctive: line 305
Before committing changes with new or modified functions:
- Distinctive: line 309
All parameters documented with types
“Common” is measured: kept by at least 6 in 10 of the 3 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
Building and Validating Documentation
This skill covers documentation building and docstring validation workflows for the Semantic Link Labs project.
When to Use This Skill
Use this skill when you need to:
- Build documentation locally
- Validate docstrings are properly formatted
- Check for documentation warnings or errors
- Ensure new functions have proper documentation
- Preview documentation before pushing
Documentation Framework
| Component | Details |
| Framework | Sphinx with numpydoc |
| Theme | sphinx_rtd_theme |
| Hosting | ReadTheDocs |
| Source location | docs/source/ |
| Build output | docs/build/html/ |
| Config | docs/source/conf.py |
Building Documentation Locally
Prerequisites
Install documentation dependencies:
pip install -r docs/requirements.txtBuild Commands
# Navigate to docs directory
cd docs
# Generate API documentation from source code
sphinx-apidoc -f -o source ../src/sempy_labs/
# Build HTML documentation
make html
# Or on Windows
make.bat htmlView Built Documentation
Open docs/build/html/index.html in a browser.
ReadTheDocs Configuration
The project uses .readthedocs.yaml for automated builds:
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.12"
jobs:
pre_build:
- sphinx-apidoc -f -o docs/source src/sempy_labs/
sphinx:
configuration: docs/source/conf.py
python:
install:
- requirements: docs/requirements.txtDocstring Standards
Docstring Style
This project uses numpydoc style for all docstrings.
Required Sections
- Short description — One-line summary of what the function does
- Extended description — Detailed explanation (optional but recommended)
- Parameters — Document each parameter with type and description
- Returns — Document return value(s)
Optional Sections
- Raises — Document exceptions that may be raised
- Examples — Provide usage examples
- Notes — Additional context or implementation details
- See Also — Related functions
Example Docstring
@log
def list_workspaces(
capacity: Optional[str | UUID] = None,
workspace_state: Optional[str] = None,
) -> pd.DataFrame:
"""
Lists workspaces for the organization.
This is a wrapper function for the following API: `Workspaces - List Workspaces <https://learn.microsoft.com/rest/api/fabric/admin/workspaces/list-workspaces>`_.
Service Principal Authentication is supported (see `here <https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Service%20Principal.ipynb>`_ for examples).
Parameters
----------
capacity : str | uuid.UUID, default=None
Returns only the workspaces in the specified Capacity.
workspace_state : str, default=None
Return only the workspace with the requested state.
You can find the possible states in `Workspace States <https://learn.microsoft.com/rest/api/fabric/admin/workspaces/list-workspaces?tabs=HTTP#workspacestate>`_.
Returns
-------
pandas.DataFrame
A pandas dataframe showing a list of workspaces for the organization.
Columns include: 'Id', 'Name', 'State', 'Type', 'Capacity Id'.
Raises
------
FabricHTTPException
If the API request fails.
Examples
--------
>>> import sempy_labs as labs
>>> df = labs.list_workspaces()
>>> df = labs.list_workspaces(capacity="My Capacity")
"""
passParameter Documentation Patterns
Standard Parameter Formats
# Simple parameter
item_type : str
The type of item to filter by.
# Parameter with default
item_type : str, default=None
The type of item to filter by. If None, returns all types.
# Union type parameter
workspace : str | uuid.UUID, default=None
The Fabric workspace name or ID.
Defaults to None which resolves to the workspace of the attached lakehouse
or if no lakehouse attached, resolves to the workspace of the notebook.
# Boolean parameter
readonly : bool, default=True
If True, opens in read-only mode. If False, allows modifications.
# List parameter
columns : List[str], default=None
A list of column names to include. If None, includes all columns.API Reference Links
Always include links to API documentation:
"""
This is a wrapper function for the following API: `Items - List Items <https://learn.microsoft.com/rest/api/fabric/core/items/list-items>`_.
"""Service Principal Note
For functions supporting Service Principal authentication:
"""
Service Principal Authentication is supported (see `here <https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Service%20Principal.ipynb>`_ for examples).
"""Common Documentation Issues
Missing or Incomplete Docstrings
Symptom: Sphinx warning about missing docstring.
Fix: Add complete numpydoc-style docstring with all required sections.
Type Annotation Mismatches
Symptom: Warning about type mismatch between signature and docstring.
Fix: Ensure docstring parameter types match function signature type hints.
# Function signature
def my_func(workspace: Optional[str | UUID] = None) -> pd.DataFrame:
# Docstring should match
"""
Parameters
----------
workspace : str | uuid.UUID, default=None
...
Returns
-------
pandas.DataFrame
...
"""Indentation Errors
Symptom: Warning about unexpected indentation.
Fix: Use consistent 4-space indentation in docstrings.
Broken Links
Symptom: Warning about broken reference.
Fix: Verify URLs are correct and use proper RST link syntax:
`Link Text <https://example.com>`_Sphinx Configuration
Key settings in docs/source/conf.py:
# Extensions
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.intersphinx',
]
# Napoleon settings for numpydoc
napoleon_numpy_docstring = True
# Mock imports for packages not available during build
autodoc_mock_imports = [
'delta', 'synapse', 'jwt', 'semantic-link-sempy',
'pyspark', 'anywidget', 'sqlglot'
]Validating Documentation
Check for Warnings
cd docs
make html 2>&1 | grep -i warningClean Build
cd docs
make clean
make htmlVerify Specific Module
# Generate docs for specific module
sphinx-apidoc -f -o source ../src/sempy_labs/admin/
make htmlPre-Commit Documentation Check
Before committing changes with new or modified functions:
- Verify docstring completeness:
- Short description present
- All parameters documented with types
- Return value documented
- API reference link included (if applicable)
- Build documentation locally:
cd docs && make html - Check for warnings in build output
- Preview the generated HTML to ensure proper rendering
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- CliMA/Oceananigans.jl★ 1.4ksame name
- olorehq/olore★ 103same name
- NumericalEarth/Breeze.jl★ 87same name
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.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-functionSkill
- code-styleSkill
- dax-optimizationSkill
- direct-lake-operationsSkill
- github-repo-exploreSkill
- planning-with-filesSkill
- pr-review-commentsSkill
- query-builder-daxSkill
- rest-api-patternsSkill
- run-testsSkill
- sql_to_daxSkill
- tom-operationsSkill
- ui-stylingSkill
- write-testsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

