agentleFS
Vasallo94Vasallo94/obsidian-mcp-server/.agents/skills/code-quality/SKILL.md

Code Quality

Skill9 starsChanged 7 months agoMITView on GitHub

Skill para mantener la calidad del código: linting, formatting, type checking. Garantiza que el código cumple con los estándares del proyecto.

The file

Files
SKILL.md

Code Quality Skill

Cuándo usar esta skill

  • Antes de hacer commit de cualquier cambio.
  • Cuando corrijas errores de linting o tipos.
  • Cuando formatees código nuevo.
  • Cuando necesites verificar la calidad general del código.

Herramientas de Calidad

Este proyecto usa:

HerramientaPropósito
RuffLinting + Formatting
PyrightType checking

Flujo de Verificación Completo

Paso 1: Formatear código

uv run ruff format .

Aplica formato automático a todo el código.

Paso 2: Verificar y corregir linting

# Solo verificar
uv run ruff check .

# Corregir automáticamente lo posible
uv run ruff check . --fix

Paso 3: Verificar tipos

uv run pyright

Errores Comunes y Soluciones

E501: Line too long

Problema: Línea excede 88 caracteres.

Soluciones:

# Antes
mensaje = "Este es un mensaje muy largo que excede el límite de caracteres permitidos por el linter"

# Después - usando paréntesis
mensaje = (
    "Este es un mensaje muy largo que excede "
    "el límite de caracteres permitidos por el linter"
)

# Después - para docstrings, usar noqa
"""Línea muy larga que es difícil de partir.  # noqa: E501"""

Missing type hints

Problema: Función sin anotaciones de tipo.

Solución:

# Antes
def process(data):
    return data.upper()

# Después
def process(data: str) -> str:
    return data.upper()

Import ordering

Problema: Imports desordenados.

Solución: Ruff format los ordena automáticamente. Orden correcto:

  1. Standard library
  2. Third-party
  3. Local imports
import os
from pathlib import Path

from fastmcp import FastMCP
import anyio

from ..config import get_vault_path
from ..utils import get_logger

Configuración Actual

Ver pyproject.toml para configuración:

[tool.ruff]
line-length = 88

[tool.ruff.lint]
select = ["E", "F", "I", "W"]

[tool.pyright]
pythonVersion = "3.12"
typeCheckingMode = "standard"

Comando Todo-en-Uno

Script para verificar todo antes de commit:

# Formatear + Lint + Tipos
uv run ruff format . && uv run ruff check . --fix && uv run pyright

Ignorar Reglas (Casos Excepcionales)

Si necesitas ignorar una regla específica:

# Ignorar línea específica
long_string = "..."  # noqa: E501

# Ignorar bloque
# ruff: noqa: E501
def function_with_long_lines():
    ...

⚠️ Usar con moderación. Preferir corregir el código.

Checklist de Calidad

Antes de considerar el código listo:

  • uv run ruff format . - Sin cambios pendientes
  • uv run ruff check . - Sin errores
  • uv run pyright - Sin errores de tipos
  • Docstrings en funciones públicas
  • Nombres descriptivos (snake_case)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.