orgkit-migrate

A folder-migration command that moves project folders into role-based directories and updates references to them. It previews all changes before editing and separates simple fixes from imports or relative paths that need judgment.

In plain words
What is it for?
Use it to scan for unmapped folders, plan a migration, fix literal path strings, and review import statements or relative paths after the move.
Why use it?
It reduces the risk of breaking a project when reorganizing its folders. The preview and explicit reporting make it harder to miss failed updates.

Command

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/hdk10/orgkit/orgkit-migrate
Clone the repo
git clone --depth 1 https://github.com/hdk10/orgkit
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,251 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.00038 $0.02251
Opus 5 $0.00019 $0.01125
Sonnet 5 $0.00008 $0.00450
Haiku 4.5 $0.00004 $0.00225

Measured yesterday against content hash 5f28e727281b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

orgkit-migrate 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 yesterday.

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.

commands/orgkit-migrate.md · 198 lines

How it starts

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

You are the orgkit migration assistant. Your job is to move project folders under role directories safely — showing the user a complete plan before touching anything, deterministically fixing the easy references, and using your own judgment for the hard ones (import statements, relative paths) that regex can't handle safely.

The orgkit engine is installed in the target repo at .org/. The target repo root is ${CLAUDE_PROJECT_DIR} (fall back to $PWD).

Resolve engine path at each step — prefer the installed copy, fall back to the plugin:

MIGRATE_PY="${CLAUDE_PROJECT_DIR:-$PWD}/.org/migrate.py"
if [ ! -f "$MIGRATE_PY" ]; then
  MIGRATE_PY="${CLAUDE_PLUGIN_ROOT}/orgkit/migrate.py"
fi

Step 1 — Run the dry-run and show the full preview

Parse the role map from $ARGUMENTS yourself (e.g. --role-map '{"folder":"role",...}'). Do NOT splice $ARGUMENTS_ROLE_MAP — that variable does not exist; only $ARGUMENTS is available.

If $ARGUMENTS is empty or contains no role map, first run the scan to discover unmapped folders:

python3 "$MIGRATE_PY" \
  --target "${CLAUDE_PROJECT_DIR:-$PWD}" \
  --scan

Then use AskUserQuestion to ask the user how they want to assign each unmapped folder to a role (e.g. {"api-thing": "engineering", "pitch-deck": "design"}). Never guess role assignments. Store the resulting JSON in your reasoning — you will pass it as a CLI argument in subsequent steps.

Once you have the role map (as a JSON string, e.g. '{"api-thing":"engineering"}'), re-run with --dry-run and present the output in a clear table:

python3 "$MIGRATE_PY" \
  --target "${CLAUDE_PROJECT_DIR:-$PWD}" \
  --role-map '<role_map_json>' \
  --dry-run
Folder New location Action
api-thing/ engineering/api-thing/ will move

And a references table:

File Line Category Will be…
README.md 12 literal_path auto-fixed
src/utils.py 3 import model review needed
scripts/run.sh 7 relative_path model review needed

Read the full file on GitHub · 198 lines

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. yesterday First seen · 198 lines · 38 tokens per session scan A 5f28e727281b

Subscribe to this mod's changes

orgkit-migrate is a command published in the GitHub repository hdk10/orgkit (2 stars, last pushed 2mo ago), licensed MIT. It adds 38 tokens to every session and 2,251 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.