Reorg

From flonat/flonat-research · View interactive version

Reorg is an AI agent skill from the GitHub repository flonat/flonat-research. Propose and, after approval, execute content-aware file reorganization or deduplication using a local Mac Mini model with a reversible undo record. Use when sorting a folder by file contents or finding exact and near duplicates. Always dry-runs first.

How to use this skill

Skill file

reorg — local-model file reorganiser

Conversational front-end for the local-reorg CLI (scripts/local-reorg/). The CLI runs a

local Ollama model on the Mac Mini that reads each file's content and proposes where it

should go, or finds duplicates. Nothing is ever moved without your approval, and every run

is reversible.

When to use

just pattern-match filenames.

For research-project structural changes use an installed project-renaming or

project-initialization workflow; if none is available, use a normal reviewed git mv

plan with explicit backlink and configuration checks. For meeting to-sort/ inboxes,

use the project's inbox-processing workflow. This skill is general-purpose file tidying.

How to invoke the CLI

First hostname:

ssh mini '~/.local/bin/reorg <args>'

The model + files both live on the Mini, so resolve the target using the Mini's

Task Management path registries before invoking the wrapper. Do not embed

either machine's physical Dropbox root. If you cannot resolve the path

unambiguously, ask.

Workflow

  1. Confirm the target folder and pick a mode with the user if unclear:
  1. Dry-run — never skip this:

The CLI writes <folder>/.reorg/plan.md (reorg) or .reorg/duplicates.md (dedup).

  1. Read the plan file and summarise it for the user — group counts, notable moves, and

any ⚠low-conf items. Do not dump the whole file; give a scannable summary and the path.

  1. Get approval. The user may edit .reorg/plan.json first (trim/retarget moves).
  2. Execute only after a clear yes:

break-the-glass threshold)

  1. Offer undo: reorg <folder> --undo reverses the most recent applied/quarantined run

(LIFO). Mention it after any execution.

Options worth surfacing

Suggest it for large folders.

Safety (the CLI enforces; restate to the user)

anything under data/raw/ or .git/. Don't try to work around this.

before showing the plan and getting a yes.

Requirements

Ollama must be running on the Mini with gemma4:e4b (or the chosen model) + nomic-embed-text

for dedup, plus pdftotext. All present as of setup. If Ollama is unreachable the CLI exits

with a clear message — relay it rather than guessing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.