renami-obsidian: Renami: CSS Selectors for Your Filenames

An Obsidian plugin that treats note names as the output of a rule engine, not a manual decision. AST queries, stacked overrides, and chained formatters make naming feel programmable.

9 min read • View on GitHub • More from kitschpatrol

A wide editorial scene shows messy note cards and metadata tags feeding into an elegant mechanical press that produces a single filename strip. The image explains that Renami turns note content into derived output instead of asking the user to type names by hand.
Renami treats filenames like compiled output. Content goes in, rules resolve it, and a filename comes out.
Key Takeaways

Most note tools treat filenames as a convenience layer. Renami treats them like a derived artifact. That shift matters, because once naming is derived from note structure, the question is no longer “what should I call this?” It becomes “what should this note resolve to, under which rule, and in what order?”

The filename is not the source of truth

Basic auto-rename plugins usually stop at the title, or maybe the first heading. Renami goes further. It can pull from frontmatter, headings, list items, and other AST-selected Markdown nodes, which means the source of the filename is the note’s structure, not just a single text field.

That is the conceptual leap. The plugin behaves less like a rename button and more like a query engine. You define selectors, combine them with templates, and let the note resolve into a filename the way a build step resolves source into output.

Renami’s pipeline is selection, precedence, then formatting. The filename is the last step, not the first assumption.

CSS selectors, but for Markdown trees

The most interesting technical move is the use of AST queries. Instead of brittle regular expressions, Renami can ask for structural elements like heading[depth=1] or list-item. That makes the naming logic feel closer to querying a document tree than parsing a blob of text.

A close-up diagram shows three transparent layers over a Markdown document. One layer highlights a top-level heading, another highlights a list item, and a third highlights frontmatter. A rule stack to the side determines which selection wins and how the output string is assembled.
Renami selects structure first, then resolves conflicts. That is why it feels programmable instead of heuristic.

The rule stack decides what wins

Renami’s settings UI treats folder rules as a precedence system. Global rules sit at the top. Specific overrides can be dragged lower in the stack. That order matters, because it determines which selector wins when multiple rules match the same note.

DimensionConventional Obsidian naming toolsRenami
Input sourceTitle or first headingFrontmatter, AST-selected nodes, templates
Rule handlingOne mapping or a global conventionOrdered folder rules with precedence
TransformationBasic slugging or direct renameChained inline formatters
Mental modelRename this noteResolve this note

That stack is the difference between a convenience feature and a system. It lets broad conventions coexist with local exceptions without forcing you to maintain a maze of special cases.

Formatters turn raw values into filenames

Renami does not just extract text. It transforms it. Chained formatters let a value pass through steps like date formatting and case conversion, so a raw field can become a filename-ready string without leaving the template language.

{Date|yyyy-MM-dd}
{title|kebab-case}
{frontmatter.project|snake-case}
{heading[depth=1]|trim|slugify}

That composability is the point. Extraction, formatting, and precedence stay separate. You can change one part of the pipeline without rewriting the whole naming scheme.

Why the plugin is split from the core library

The architecture is library-first. The standalone @kitschpatrol/renami package holds the naming logic, while the Obsidian plugin wraps it in workspace events, settings, and file-system integration. That separation makes the core easier to test and reuse outside one editor.

LayerResponsibilityWhy it matters
Core libraryQuerying, selecting, transforming, resolving filenamesKeeps the logic portable and testable
Obsidian pluginEvents, settings UI, vault integrationHandles editor-specific plumbing
Build toolingHot reload and local deploymentSpeeds iteration and tightens feedback loops

The developer workflow is part of the product

The repo reads like infrastructure. TypeScript strict mode, a custom esbuild pipeline, a demo vault, hot reload, and local deployment scripts all point to a project built for iterative use. The developer experience is not decoration here. It is part of the quality story.

That matters because tooling like this only earns trust when it behaves predictably. A naming engine that touches real files has to be boring in the best way: clear rules, stable outputs, and fast feedback when something changes.

What Renami changes about personal knowledge systems

Renami suggests a different model for note organization. Instead of treating filenames as handcrafted labels, it treats them as projections of structure and policy. For power users, that turns naming into a declarative system, closer to configuration than clerical work.

That is a subtle but important shift. Once filenames become query results, your note vault starts to behave less like a folder of documents and more like a managed data set.