Semantic documentation standard for Python with context-aware docstring keys
This plugin is not yet in any themed marketplace. To install it, you'll need to add it from GitHub directly.
Choose your preferred installation method below
A marketplace is a collection of plugins. Every plugin gets an auto-generated marketplace JSON for individual installation, plus inclusion in category and themed collections. Add a marketplace once (step 1), then install any plugin from it (step 2).
One-time setup for access to all plugins
When to use: If you plan to install multiple plugins now or later
Step 1: Add the marketplace (one-time)
/plugin marketplace add https://claudepluginhub.com/marketplaces/all.json
Run this once to access all plugins
Step 2: Install this plugin
/plugin install semantic-docstrings@all
Use this plugin's auto-generated marketplace JSON for individual installation
When to use: If you only want to try this specific plugin
Step 1: Add this plugin's marketplace
/plugin marketplace add https://claudepluginhub.com/marketplaces/plugins/semantic-docstrings.json
Step 2: Install the plugin
/plugin install semantic-docstrings@semantic-docstrings
A semantic documentation standard for Python that clarifies Responsibility, Context, and Intent — designed both as a readable specification and as a Claude Code plugin.
Semantic Docstrings is a documentation standard that extends traditional Python docstrings with a semantic layer.
It introduces one-word keys (e.g., Responsibility
, Context
, Role
, Boundaries
, Architecture
, Should
, Entry
)
that capture why code exists, not just what it does.
This repository serves a dual purpose:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/daviguides/semantic-docstrings/main/install.sh)"
The installer will:
semantic-docstrings/
to ~/.claude/semantic-docstrings/
~/.claude/CLAUDE.md
Use the extended keys in your Python docstrings (with type hints in signatures, not inside the docstring body):
def process_message(payload: dict) -> str:
"""
Responsibility:
First line of defense for input validation.
Context:
Payload comes from an untrusted external API.
Enforces that `text` is mandatory, IDs optional.
Args:
payload: Untrusted API input.
Returns:
Extracted user message.
Raises:
ValueError: If `text` key is missing.
"""
Once installed, you can use Semantic Docstrings in three ways:
Load semantic docstring context for your current session:
/load-semantic-context
Available Commands:
/load-semantic-context
- Load complete semantic docstring standards/add-module-docstring
- Add semantic docstring to current module/add-class-docstring
- Add semantic docstring to a class/add-function-docstring
- Add semantic docstring to a function/validate-docstrings
- Validate docstrings in current projectReference in your ~/.claude/CLAUDE.md
for automatic loading:
# Documentation Standards
@~/.claude/semantic-docstrings/context/semantic-guidelines.md
Reference in your project's CLAUDE.md
:
# Project Documentation Standards
## Standards Inheritance
- **INHERITS FROM**: @./semantic-docstrings/semantic_docstrings.md
- **PRECEDENCE**: Project overrides semantic-docstrings
- **FALLBACK**: Use semantic-docstrings when no overrides exist
The plugin includes specialized agents that activate automatically:
git clone https://github.com/daviguides/semantic-docstrings.git
cd semantic-docstrings
# Copy plugin files
mkdir -p ~/.claude
cp -r semantic-docstrings ~/.claude/
# Add to ~/.claude/CLAUDE.md
cat >> ~/.claude/CLAUDE.md << 'EOF'
# Project Documentation Standards
## Standards Inheritance
- **INHERITS FROM**: @./semantic-docstrings/semantic-docstrings/semantic_docstrings.md
- **PRECEDENCE**: Project-specific rules override repository defaults
- **FALLBACK**: When no override exists, semantic-docstrings applies
EOF
Contributions are welcome! You can propose new semantic keys, refine examples, or extend the plugin.
MIT License - See LICENSE for details
Built with ❤️ by Davi Luiz Guides - bridging readability, architecture, and LLM-aware coding.
1.0.0