Borrowing it
Nothing to install: this file belongs to Vasallo94/obsidian-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Vasallo94/obsidian-mcp-server/main/.agents/skills/refactoring/SKILL.mdgit clone --depth 1 https://github.com/Vasallo94/obsidian-mcp-serverWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/vasallo94/obsidian-mcp-server/refactoring)<a href="https://agentmods.dev/skills/vasallo94/obsidian-mcp-server/refactoring"><img src="https://agentmods.dev/badge/skills/vasallo94/obsidian-mcp-server/refactoring.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00033 | $0.01836 |
| Opus 5 | $0.00016 | $0.00918 |
| Sonnet 5 | $0.00007 | $0.00367 |
| Haiku 4.5 | $0.00003 | $0.00184 |
Grade A, and why
Refactoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 325 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactoring Skill
Cuándo usar esta skill
- Cuando detectes código duplicado.
- Cuando funciones sean demasiado largas (>50 líneas).
- Cuando módulos tengan demasiadas responsabilidades.
- Cuando quieras mejorar la legibilidad o mantenibilidad.
Regla de Oro
Nunca refactorizar sin tests. Ejecuta
uv run pytest tests/antes y después de cada refactoring para verificar que no rompiste nada.
Proceso de Refactoring Seguro
1. Verificar estado inicial
# Tests deben pasar
uv run pytest tests/ -v
# Sin errores de linting/tipos
uv run ruff check . && uv run pyright
2. Hacer cambio pequeño
Solo UN cambio a la vez. No mezclar refactorings.
3. Verificar después del cambio
uv run pytest tests/ -v
uv run ruff check . && uv run pyright
4. Commit si pasa
git add . && git commit -m "refactor(module): descripción breve"
Code Smells Comunes
1. Función Larga (>50 líneas)
Problema: Difícil de entender y testear.
Solución: Extract Method
# ❌ ANTES: Función monolítica
def process_vault(path: Path) -> str:
# 100 líneas de código...
pass
# ✅ DESPUÉS: Funciones pequeñas
def process_vault(path: Path) -> str:
"""Procesa el vault completo."""
notes = _find_notes(path)
filtered = _filter_forbidden(notes)
formatted = _format_results(filtered)
return formatted
def _find_notes(path: Path) -> List[Path]:
"""Busca notas en el vault."""
return list(path.rglob("*.md"))
def _filter_forbidden(notes: List[Path]) -> List[Path]:
"""Filtra notas prohibidas."""
return [n for n in notes if not is_forbidden(n)]
def _format_results(notes: List[Path]) -> str:
"""Formatea lista de notas."""
return "\n".join(str(n) for n in notes)
2. Código Duplicado
Problema: Cambios requieren editar múltiples lugares.
Solución: Extract Function o clase base.
# ❌ ANTES: Duplicado en cada tool
def tool1():
vault_path = get_vault_path()
if not vault_path:
return "❌ Error: La ruta del vault no está configurada."
# lógica...
def tool2():
vault_path = get_vault_path()
if not vault_path:
return "❌ Error: La ruta del vault no está configurada."
# lógica...
# ✅ DESPUÉS: Helper reutilizable
def _get_vault_or_error() -> Tuple[Optional[Path], Optional[str]]:
"""Obtiene vault path o mensaje de error."""
vault_path = get_vault_path()
if not vault_path:
return None, "❌ Error: La ruta del vault no está configurada."
return vault_path, None
def tool1():
vault_path, error = _get_vault_or_error()
if error:
return error
# lógica...
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 325 lines · 33 tokens per session scan A f6672d51e220
Refactoring is a skill published in the GitHub repository Vasallo94/obsidian-mcp-server (9 stars, last pushed 4d ago), licensed MIT. It adds 33 tokens to every session and 1,836 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
model-context
MCP (Model Context Protocol) - Build AI-native servers with tools, resources, and prompts. TypeScript/Python SDKs for Claude Desktop integration.
lock-project-stack
Detect a project's manifest (pyproject.toml / package.json / go.mod / Cargo.toml), pin its library set into wet-mcp's Cabinets projectcontext, then route subsequent docs queries to the locked versions automatically.
houdini-scripting
Bootstrap skill — controlled Python execution inside Houdini's hython interpreter. Use when no typed Houdini skill covers the task or you need session diagnostics. Not for routine scene edits — prefer houdini-scene or future domain skills.
build-mcp-server
MCP (Model Context Protocol) - Build AI-native servers with tools, resources, and prompts. TypeScript/Python SDKs for Claude Desktop integration.
gkmex-api-integration
Use when building or troubleshooting an application that consumes Gkmex's public crane inventory through REST, the official JavaScript SDK, or the Python SDK.
click-to-mcp
Auto-wrap any Click or typer Python CLI as an MCP server with zero code changes. Use this skill whenever the user wants to expose a CLI tool to an AI agent via MCP, needs to convert a Click/typer app into an MCP server, wants to run an existing CLI through an LLM, or asks about bridging command-line tools and AI…