Migrate Tags
SkillFiles & storageMigrate body-level #hashtags to frontmatter `tags:` lists so Bases can filter on them. Idempotent — leaves files that already have frontmatter tags alone.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Migrate Tags skill
What this skill tells your AI
The instructions your AI receives, as published by benoror/obsidianos_work in .agents/skills/migrate-tags/SKILL.md and read by ahel’s review.
Usage
/migrate-tags— Scan vault, present a migration plan, prompt to confirm./migrate-tags <path>— Migrate a single file./migrate-tags <folder>— Migrate all.mdfiles under a folder./migrate-tags --dry-run— Show what would change without writing.
Why this skill exists
Obsidian supports two tag styles:
- Body tags:
#frontendwritten inline in note text. - Frontmatter tags: a YAML
tags:list at the top of the file.
Bases can filter on the frontmatter style (file.hasTag("frontend")) but not the body style reliably. Migrating one to the other makes tags queryable in Bases views — e.g. a "People with #mobile tag" view becomes trivial once everyone's @Name.md has tags: [mobile].
This skill is a one-shot migration utility plus an ongoing cleanup tool for new notes.
Workflow
Step 1: Discover candidates
Use obsidian tags format=json to enumerate all tags + their usage counts and source files. Identify files where:
- A body
#tagexists, AND - The same tag is NOT already present in frontmatter
tags:.
These are the migration candidates.
Step 2: Present the plan
Show a numbered table grouped by file:
| # | File | Body tags to migrate | Existing frontmatter tags |
|---|------|----------------------|---------------------------|
| 1 | Teams/People/@Jane Doe.md | #team-engineering, #backend | (none) |
| 2 | Teams/People/@John Smith.md | #team-engineering, #remote | (none) |
| 3 | Misc/Reading.md | #to-read, #book | (none) |
Ask the user: "all", "1,2", "none", or per-file picks.
Step 3: Apply migration
For each confirmed file:
- Read the file body, collect all
#tagpatterns (respecting word boundaries —#tagnothttps://foo.com/path#section). - Use
obsidian property:set name=tags value='["a","b","c"]' type=list path="<file>"to write the frontmatter list. Iftags:already exists, merge (don't overwrite). See frontmatter-mutations. - Optionally remove the body
#tagpatterns (default: leave them — Obsidian indexes both, body tags don't hurt). Add a--strip-bodyflag for users who want clean bodies.
Step 4: Verify
Run obsidian property:read name=tags path="<file>" on each migrated file to confirm the write. Spot-check that no tags were lost.
Step 5: Commit
See /commit. Commit message: chore: migrate body #tags to frontmatter tags: list (N files).
Important Notes
- Idempotent: re-running on already-migrated files is a no-op.
- Don't strip body tags by default — users may rely on visible tags in the body for in-note navigation. Opt-in via
--strip-body. - Tag normalization: leave tag names as-is. Don't auto-convert
#team-engineering→team-engineering(the leading#is stripped automatically; nothing else). - Nested tags (
#team/engineering) are preserved. - Tags inside code blocks are skipped — they're literal, not Obsidian tags.
- After running on People files,
People.baseper-team views can usefile.hasTag("team-X")as an alternative to thefile.hasLink(file("Teams/+X.md"))filter (which works but is more verbose).
Signals
- GitHub stars
- 165
- Forks
- 13
- Last commit
- Jun 2026
Advanced
- Catalog kind
- skill
- Gateway key
migrate-tags- Source
- github.com/benoror/obsidianos_work