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/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<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="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.5 | $0.00013 | $0.00734 |
| Sonnet 5.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 2mo 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.
- 2mo 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 (11 stars, last pushed 5d ago), licensed MIT. It adds 33 tokens to every session and 1,836 once invoked, about $0.0001 per session on Opus 5.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
quantum-vqe
A runnable guide to the variational quantum eigensolver (VQE), a quantum algorithm that estimates the lowest energy of a mathematical system by adjusting a parameterized circuit. It uses Pauli Hamiltonians, a specified circuit form, and SciPy optimization.
quantum-vqls
A runnable guide to the variational quantum linear solver (VQLS), a quantum method that estimates a solution to a system of linear equations by optimizing a parameterized circuit. It uses Qiskit and reports the numerical residual and why optimization stopped.
style-guide
Dedalus style guide quick reference. Key rules for writing code that lasts. Use when writing or reviewing Python code.
column-aligned-fields
Enforce column-aligned inline comments on dataclass and enum fields. Use when writing or reviewing Python dataclasses, enums, TypedDicts, or any structured type with inline field comments.
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.
model-context
MCP (Model Context Protocol) - Build AI-native servers with tools, resources, and prompts. TypeScript/Python SDKs for Claude Desktop integration.