agentleFS
MarceltovMarceltov/trilium-plugin/skills/move-note/SKILL.md

move-note

Skill0 starsChanged 2 months agoMITView on GitHub

Move a Trilium note to a different parent note, by creating a branch under the new parent and deleting the old one. Use when the user asks to move, relocate, or file a note under a different note.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If more than one Trilium instance is connected this session, resolve which one to use first — see Working with multiple instances.

    line 12
  2. Distinctive:

    If there's exactly one parent, that's the branch to remove.

    line 19
  3. Very specific:

    If there's more than one, ask the user which current location they mean to move (unless they already specified the source parent), and …

    line 20

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Move a Trilium Note

There is no move-specific endpoint. Verified against a live instance: patchBranchById rejects parentNoteId outright (PROPERTY_NOT_ALLOWED — it only accepts prefix, notePosition, isExpanded). A note's placement in the tree is its branch, and moving a note means creating a new branch under the destination parent (postBranch) and deleting the old branch (deleteBranchById) — not the note itself.

Note that a Trilium note can be cloned into multiple parents at once (multiple branches, one note). If the note has more than one parentBranchIds entry, moving one placement must not touch the others — be precise about which branch you're deleting.

If more than one Trilium instance is connected this session, resolve which one to use first — see Working with multiple instances.

Steps

  1. Resolve the note to move (by title via searchNotes or by noteId if given) and the destination parent note (same resolution).
  2. Fetch the note via getNoteById and look at parentBranchIds/parentNoteIds:
    • If there's exactly one parent, that's the branch to remove.
    • If there's more than one, ask the user which current location they mean to move (unless they already specified the source parent), and match it to the corresponding branch id (<parentNoteId>_<noteId>).
  3. Create the new placement: postBranch with noteId: <note's id>, parentNoteId: <destination parent id> (and notePosition if the user cares about ordering).
  4. Remove the old placement: deleteBranchById with the branch id identified in step 2. Do this only after step 3 succeeds — never delete the old branch first, since a note must always have at least one placement.
  5. Confirm the move: getNoteById on the note and check parentNoteIds now shows the destination (and, if there was only one parent before, no longer shows the old one).
  6. Report back: the note's title and its new location.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.