agentleFS
MarceltovMarceltov/trilium-plugin/skills/manage-note-attributes/SKILL.md

manage-note-attributes

Skill0 starsChanged 2 months agoMITView on GitHub

Add, update, or remove labels and relations on a Trilium note via postAttribute, patchAttributeById, and deleteAttributeById. Use when the user asks to tag a note, add or remove a label/relation, or change an attribute's value — general attribute management, not specifically template promoted attributes (those are covered inline by the template skills).

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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. Very specific:

    Add a new attribute: ask for the name, whether it's a label or relation, and the value (for a relation, resolve the target note first).

    line 19

≈ “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

Manage Note Attributes

Labels (#name / #name=value) and relations (~name pointing at another note) are both "attributes" in Trilium's model. This skill covers ad-hoc tagging and relations generally; the template skills (create-note-from-template, apply-template-to-note) already handle the ~template relation and promoted-attribute values inline.

Patching is limited (verified by the tool descriptions and consistent with patchNoteById/patchBranchById behavior elsewhere in this plugin): patchAttributeById can only update a label's value/position, or a relation's position. It cannot change an attribute's name, type, or (for a relation) its target. To change any of those, delete the old attribute (deleteAttributeById) and create a new one (postAttribute) — don't attempt to patch around it.

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 target note (by title via searchNotes or by noteId if given).
  2. Determine the operation:
    • Add a new attribute: ask for the name, whether it's a label or relation, and the value (for a relation, resolve the target note first). postAttribute with noteId, type, name, value.
    • Change an existing label's value: find the attribute (via getNoteById's attributes array, matching name), then patchAttributeById with attributeId__path and the new value.
    • Change a relation's target, or rename any attribute: this isn't a patch — deleteAttributeById the old one, then postAttribute a new one with the desired name/type/value.
    • Remove an attribute: find its attributeId the same way, then deleteAttributeById.
  3. Confirm before removing an attribute that looks structurally significant — a ~template relation, a #template label, or a label:<field>=promoted,... definition — since removing these changes how the note behaves, not just its metadata. Plain tags/labels don't need this.
  4. Report back: which attribute(s) changed and their new state. Don't dump the note's full attribute list unless the user asks for it.

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.