refactor

A planning workflow for reorganizing an Obsidian-style knowledge vault when its configuration changes.

In plain words
What is it for?
Use `/refactor` to detect or target configuration changes, produce a restructuring plan, run a dry run, and execute the approved reorganization.
Why use it?
It compares the current configuration with the original design record so proposed folder or naming changes are visible before anything is altered.

Skill for Claude CodeCodex

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 skills/agenticnotetaking/arscontexta/refactor
Any agent
npx skills add agenticnotetaking/arscontexta --skill refactor
Clone the repo
git clone --depth 1 https://github.com/agenticnotetaking/arscontexta

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,976 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.00043 $0.03976
Opus 5 $0.00022 $0.01988
Sonnet 5 $0.00009 $0.00795
Haiku 4.5 $0.00004 $0.00398

Measured 2d ago against content hash 2e4eca2612ce, 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 2d 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.

skill-sources/refactor/SKILL.md · 448 lines

How it starts

The opening of the file, as written. The whole thing — 448 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Runtime Configuration (Step 0 — before any processing)

Read these files to configure domain-specific behavior:

  1. ops/derivation-manifest.md — vocabulary mapping, dimension positions, platform hints

    • Use vocabulary.notes for the notes folder name
    • Use vocabulary.note / vocabulary.note_plural for note type references
    • Use vocabulary.topic_map / vocabulary.topic_map_plural for MOC references
    • Use vocabulary.inbox for the inbox folder name
  2. ops/config.yaml — current live configuration (the "after" state)

  3. ops/derivation.md — original derivation record (the "before" state)

If these files don't exist, report error: "Cannot refactor without both ops/config.yaml and ops/derivation.md. These files establish the baseline and current configuration."


EXECUTE NOW

INVARIANT: /refactor never executes without approval. The plan is always shown first.

Target: $ARGUMENTS

Parse immediately:

  • If target is empty: detect ALL config changes and plan restructuring
  • If target names a specific dimension (e.g., "granularity", "organization"): focus on that dimension only
  • If target is --dry-run: show plan without asking for approval

Execute these phases:

  1. Detect changes between config.yaml and derivation.md
  2. Plan restructuring for each changed dimension
  3. Show the plan with affected artifacts and risk assessment
  4. Execute on approval (unless --dry-run)
  5. Validate post-restructuring

START NOW. Reference below defines the workflow.


Philosophy

Configuration changes cascade.

Changing a dimension is not just editing a value in config.yaml. Each dimension affects multiple artifacts — skills, templates, context file sections, hooks, MOC structure. Changing organization from "flat" to "hierarchical" means restructuring the notes directory, updating MOC templates, adjusting navigation references in the context file, and regenerating skills that reference folder structure.

/refactor makes these cascades visible and manages them. Without it, dimension changes create drift: config says one thing, artifacts say another. With it, every change is planned, approved, and validated.

Read the full file on GitHub · 448 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 448 lines · 43 tokens per session scan A 2e4eca2612ce

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository agenticnotetaking/arscontexta (3,486 stars, last pushed 6mo ago), licensed MIT. It adds 43 tokens to every session and 3,976 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-30.

Related

Other skills, from other repositories

dogfood

Run a dogfooding session for hyalo — build from source, exercise the CLI against real knowledgebases (own KB, MDN, GitHub Docs, VS Code docs), find bugs, verify recent fixes, assess UX, measure performance, and write a structured report. Use this skill whenever the user says /dogfood, "dogfood", "run a dogfood…

ractive/hyalo · 102 tokens

release

Cut a hyalo release end-to-end — verify/bump the workspace version, rotate the changelog with hyalo itself, sync the winget fork, publish the GitHub release with curated + auto-generated notes, and watch the pipeline. Use this skill whenever the user wants to release a new hyalo version, cut/tag/publish vX.Y.Z, says…

ractive/hyalo · 102 tokens

review-rust

Perform critical Rust code reviews covering correctness, edition 2024 compliance, error handling, API design, async pitfalls, and dependency hygiene. ALWAYS use this skill when the user wants to review, audit, or critically evaluate Rust code — whether that's a PR diff, a specific crate or module, a cross-cutting…

ractive/hyalo · 177 tokens

security-audit

REQUIRED skill for any security-related request. Use this skill whenever the user wants to find anything dangerous, sensitive, or risky in their code, files, or repository. This includes but is not limited to: scanning for secrets/keys/tokens/credentials, checking dependencies for vulnerabilities, auditing destructive…

ractive/hyalo · 150 tokens

hyalo-tidy

../../../crates/hyalo-cli/templates/skill-hyalo-tidy.md.

ractive/hyalo · 0 tokens

hyalo

../../../crates/hyalo-cli/templates/skill-hyalo.md.

ractive/hyalo · 0 tokens