refactor

refactor is a command for coding agents from Michael-OvO/obsidian-knowledge-agent. It costs 24 tokens per session (273 once invoked), scanned A, original, MIT.

A command for safely reorganizing linked notes and folders by renaming, moving, splitting, or merging them. A wikilink is a note link written in a form such as [[Note name]].

In plain words
What is it for?
Use it to restructure a note vault, including splitting one note into several, merging notes, updating indexes, and preserving redirects instead of deleting notes.
Why use it?
Moving or renaming notes can leave links pointing to the wrong place. The command checks links before and after the changes and updates affected references.

Command

Part of the obsidian-knowledge plugin — 1 skill, 12 commands, 2 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/michael-ovo/obsidian-knowledge-agent/refactor
Clone the repo
git clone --depth 1 https://github.com/Michael-OvO/obsidian-knowledge-agent

Or install obsidian-knowledge, the plugin that ships this one along with the rest of its 1 skill, 12 commands, 2 hooks.

Wrote 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.

agentmods badge for refactor

README.md
[![agentmods](https://agentmods.dev/badge/commands/michael-ovo/obsidian-knowledge-agent/refactor.svg)](https://agentmods.dev/commands/michael-ovo/obsidian-knowledge-agent/refactor)
Your own site
<a href="https://agentmods.dev/commands/michael-ovo/obsidian-knowledge-agent/refactor"><img src="https://agentmods.dev/badge/commands/michael-ovo/obsidian-knowledge-agent/refactor.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 273 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00024 $0.00273
Opus 5 $0.00012 $0.00137
Sonnet 5 $0.00005 $0.00055
Haiku 4.5 $0.00002 $0.00027

Measured 4d ago against content hash f9915db6404e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

refactor 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 4d 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.

plugins/obsidian-knowledge/commands/refactor.md · 18 lines

What it actually says

Carry out the restructuring in $ARGUMENTS without breaking the vault.

  1. Plan. State exactly what will move, rename, split, or merge, and which files link to the affected notes (search for wikilinks to them). Show me the plan before changing anything.
  2. Baseline. Validate links first (scripts/validate_links.py) so we know the starting point is clean.
  3. Execute with git mv where possible (preserve history). For a split, create the new notes and move the relevant content; for a merge, combine and redirect. Preserve frontmatter.
  4. Rewire EVERY wikilink that pointed at a moved/renamed/merged note — including aliased and table-escaped (\|) links — and update any indexes and concept-graph canvas.
  5. Re-validate links (must be zero broken) and commit. Never delete a note without my explicit approval — leave a redirect stub or archive it instead.
Changes

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.

  1. 4d ago First seen · 18 lines · 24 tokens per session scan A f9915db6404e

Subscribe to this mod's changes

refactor is a command published in the GitHub repository Michael-OvO/obsidian-knowledge-agent (207 stars, last pushed 2mo ago), licensed MIT. It adds 24 tokens to every session and 273 once invoked, about $0.0001 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-30.

Related

Other commands, from other repositories

pseo-refresh

Use when: kullanıcı "verileri freshle", "veri tazele", "GSC SF DFS yenile", "master excel yenile", "tüm veriyi güncelle", "pillar cluster kontrol et", "aktif taskları revize et", "adstark taskları güncelle", "refresh audit" der ya da /pseo-refresh [project-slug] [daysback] çağırırsa. Also use when: aktif proje için…

popiliadam/platinum-seo-engine · 275 tokens

pseo-content-decay

Use when: kullanıcı "içerik decay", "content decay", "tıklama düşen sayfalar", "ctr düştü", "90 gün öncesine göre azalma", "trafik kaybeden sayfalar", "decay analizi", "contentdecay sheet yenile", "ranking decay" der ya da /pseo-content-decay çağırırsa. Also use when: aktif projenin GSC verisi master.xlsx'te mevcut…

popiliadam/platinum-seo-engine · 227 tokens

pseo-driftcheck

Use when: kullanıcı "drift", "drift kontrol", "tutarsızlık", "schema kontrol", "cross-sheet invariant", "tutarlılık raporu" der ya da /pseo-driftcheck çağırırsa. Also use when: master.xlsx'e büyük bir ingestion (sf-import, gsc-pull, dfs-pull, sf-crawl-orchestrator) sonrası logical sheet'ler arasındaki cross-sheet…

popiliadam/platinum-seo-engine · 202 tokens

pseo-new-blog

Use when: kullanıcı "yeni blog yaz", "blog üret", "new content", "pillar/cluster yaz", "blog draft", "makale üret" der ya da /pseo-new-blog çağırırsa. Also use when: aktif projede master.xlsx[newcontentplan] sheet'inde bekleyen NCP satırı var; pillar content production tetiklenmek isteniyor; Foundational Principles…

popiliadam/platinum-seo-engine · 167 tokens

pseo-monthly

Use when: kullanıcı "aylık rapor", "monthly report", "ay sonu özet", "geçen ay neler oldu", "ay raporu üret" der ya da /pseo-monthly çağırırsa. Also use when: bir ayın sonunda aktif proje için outputs/reports/{YYYY-MM}-monthly.md üretilecek; master.xlsx'te trafik/sıralama/içerik verileri ay boyunca toplanmış ve…

popiliadam/platinum-seo-engine · 162 tokens

pseo-quickwin

Use when: kullanıcı "quick win", "hızlı kazanım", "11-20 sıradaki keyword", "low-hanging fruit", "kolay yükselebilir sayfalar" der ya da /pseo-quickwin çağırırsa. Also use when: aktif projenin GSC verisi master.xlsx içinde mevcut; sıralamada eşik bandında olan sorgular için gsc-pull → quick-wins skill chain'i…

popiliadam/platinum-seo-engine · 156 tokens