xguilxr/claudio-enterprises/docstring-google-style

Claude Code and agent skill by xguilxr/claudio-enterprises

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Escribe docstrings de Python en formato Google. Úsala al documentar funciones, clases o módulos.

Install

npx vskill@latest install xguilxr/claudio-enterprises/docstring-google-style

SKILL.md

The same SKILL.md was published earlier as xguilxr/claudio-enterprises/docstring-google-style.

Docstrings — Google Style

Función simple

python
def calculate_total(prices: list[float], tax_rate: float = 0.21) -> float:
"""Calcula el total con impuesto aplicado.
Args:
prices: Lista de precios unitarios sin impuesto.
tax_rate: Tasa de impuesto como decimal (0.21 = 21%). Default: 0.21.
Returns:
Total con impuesto aplicado, redondeado a 2 decimales.
Raises:
ValueError: Si algún precio es negativo.
"""
if any(p < 0 for p in prices):
raise ValueError("Prices cannot be negative")
return round(sum(prices) * (1 + tax_rate), 2)

Función async

python
async def fetch_user(user_id: int, db: AsyncSession) -> User | None:
"""Recupera un usuario por ID.
Args:
user_id: ID del usuario.
db: Sesión async de SQLAlchemy.
Returns:
Instancia de User si existe, None si no.
"""

Clase

python
class OrderService:
"""Servicio para gestión de órdenes.
Encapsula la lógica de negocio de órdenes: creación, actualización,
cancelación y queries. No toca HTTP, solo DB y reglas de negocio.
Attributes:
db: Sesión async de SQLAlchemy usada para todas las operaciones.
cache: Cliente Redis opcional para caching de órdenes recientes.
"""
def __init__(self, db: AsyncSession, cache: Redis | None = None):
self.db = db
self.cache = cache

Módulo (al inicio del archivo)

python
"""Módulo de procesamiento de ETL para inventario FarmaX.
Este módulo implementa el pipeline que:
1. Extrae inventario desde CSVs del ERP del cliente.
2. Normaliza SKUs y aplica el catálogo maestro.
3. Carga en la tabla `inventory_snapshots` de PostgreSQL.
Uso:
python -m app.etl.farmax_inventory --date 2026-04-18
Variables de entorno requeridas:
- DATABASE_URL
- FARMAX_SFTP_HOST
"""

Qué SÍ incluir

  • Descripción en 1 línea (imperativo: "Calcula", no "Calculates")
  • Args: cada parámetro no obvio, con tipo si ayuda
  • Returns: qué devuelve y bajo qué condiciones
  • Raises: excepciones que el llamador debe conocer
  • Ejemplo si el uso no es obvio

Qué NO incluir

  • Tipos cuando ya están en el type hint ("Args: user_id (int)..." cuando el firm ya dice user_id: int)
  • Descripciones que solo repiten el nombre ("Get user: gets a user")
  • Historia de cambios (eso va en CHANGELOG, no en docstring)

Ejemplos opcional

Para funciones que se van a usar mucho:

python
def merge_dataframes_safe(left: pd.DataFrame, right: pd.DataFrame, on: str) -> pd.DataFrame:
"""Hace un merge y valida que no haya inflado filas.
Args:
left: DataFrame izquierdo.
right: DataFrame derecho.
on: Columna por la que se hace el merge.
Returns:
DataFrame mergeado.
Raises:
ValueError: Si el merge aumentó el row count (indica duplicados en right).
Example:
>>> orders = pd.DataFrame({"user_id": [1, 2], "amount": [100, 200]})
>>> users = pd.DataFrame({"user_id": [1, 2], "name": ["Ana", "Bob"]})
>>> merge_dataframes_safe(orders, users, on="user_id")
user_id amount name
0 1 100 Ana
1 2 200 Bob
"""

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/xguilxr/claudio-enterprises/docstring-google-style/badge)](https://verified-skill.com/skills/xguilxr/claudio-enterprises/docstring-google-style)

Something wrong with this skill or its page? Tell us.