/auto-tag
Batch auto-tag notes that have empty or missing tags by analysing their content and type. Addresses the 61% empty tag rate in the vault.
Usage
/auto-tag # Process all untagged notes
/auto-tag <path> # Process specific file or folder
/auto-tag --dry-run # Preview changes without applying
/auto-tag --type Meeting # Only process untagged notes of a specific type
/auto-tag --limit 50 # Process at most 50 notes
Instructions
Phase 1: Find Untagged Notes
Use Grep and Glob to find notes with empty tags:
# Find files with empty tags arrays
Grep for "tags: \[\]" in *.md files (exclude Templates/, .obsidian/, .claude/, Archive/)
# Also find files with no tags field at all
# Notes with tags containing only template variables
Filter results:
- Exclude
Templates/, .obsidian/, .claude/, Archive/, Attachments/
- If
--type specified, filter by frontmatter type field
- If
<path> specified, scope to that path
- Sort by type for batch efficiency
Phase 2: Analyse and Tag (Parallel)
Launch parallel Haiku sub-agents, batching 20 notes per agent:
For each note, the agent should:
- Read frontmatter — extract
type, title, project, status
- Read body content — first 500 words
- Determine tags using these rules:
Tag Selection Rules
By note type (always apply):
| Type |
Auto-tags |
| ADR |
type/adr, activity/architecture |
| Meeting |
(infer from title/content) |
| Task |
(infer project from project: field) |
| Project |
activity/delivery + self-referencing project/ tag |
| System |
type/system |
| Incubator |
activity/research |
| Research |
activity/research |
| Concept |
(infer from content) |
| Pattern |
(infer from content) |
| Email |
(infer from content) |
| Reference |
(infer from referenceType and content) |
| Trip |
(no tags needed — skip) |
| Daily |
daily |
By content analysis (keyword matching):
| Content Keywords |
Suggested Tag |
| AWS, Lambda, S3, EC2, Bedrock |
technology/aws |
| SAP, BTP, S/4HANA, UI5 |
technology/sap |
| ERPSystem, MRO Vendor |
technology/erp |
| Kafka, streaming, event |
technology/kafka |
| Snowflake, data warehouse |
technology/snowflake |
| security, IAM, encryption |
domain/security |
| data, analytics, pipeline |
domain/data |
| engineering, maintenance, MRO |
domain/engineering |
| integration, API, middleware |
domain/integration |
| cloud, infrastructure |
domain/cloud |
| architecture, design, pattern |
activity/architecture |
| research, investigation, POC |
activity/research |
| governance, compliance, policy |
activity/governance |
By project: field (if present):
| Project Link |
Tag |
[[Project - Alpha]] |
project/alpha |
[[Project - Beta]] or [[Project - Beta]] |
project/beta |
[[Project - AlertHub]] |
project/alerthub |
[[Project - Gamma]] |
project/gamma |
[[Project - Delta]] |
project/delta |
[[Project - Epsilon]] |
project/epsilon |
[[Project - Cyber Uplift]] |
project/cyber-uplift |
Tag count target: 2-5 tags per note. Prefer fewer, more accurate tags over many vague ones.
- Format tags — all lowercase, hierarchical, no
# prefix
- Return — list of (filepath, suggested_tags) tuples
Phase 3: Apply Tags
For each note with suggested tags:
- Read current frontmatter
- If
tags: [] — replace with suggested tags
- If no tags field — add
tags: with suggested tags
- Write updated file using Edit tool
Format:
# Inline for 1-3 tags:
tags: [activity/research, domain/data]
# Multi-line for 4+ tags:
tags:
- activity/architecture
- technology/aws
- domain/cloud
- project/alerthub
Phase 4: Report
## Auto-Tag Results
**Notes processed:** {{count}}
**Notes tagged:** {{tagged_count}}
**Notes skipped:** {{skipped_count}} (already tagged or no suggestions)
### By Type
| Type | Tagged | Example Tags |
|------|--------|-------------|
| Meeting | 45 | project/*, domain/* |
| Concept | 30 | activity/*, domain/* |
| ADR | 20 | type/adr, technology/* |
### Sample Changes
| Note | Tags Added |
|------|-----------|
| {{note}} | {{tags}} |
| {{note}} | {{tags}} |
Safety
- Always use
--dry-run first for vault-wide operations
- Never overwrite existing non-empty tags
- Commit to git before running
- Tags are additive only — never removes existing tags
- Use the
.claude/context/tag-taxonomy.md reference for valid hierarchies
Related Skills
/tag-management — Manual tag analysis and refactoring
/quality-report — Includes tag coverage metrics
/vault-maintenance — Includes tag health checks
1---2name: auto-tag3description: Batch auto-tag untagged notes using content analysis4---5
6# /auto-tag
7
8Batch auto-tag notes that have empty or missing tags by analysing their content and type. Addresses the 61% empty tag rate in the vault.
9
10## Usage
11
12```
13/auto-tag # Process all untagged notes
14/auto-tag <path> # Process specific file or folder
15/auto-tag --dry-run # Preview changes without applying
16/auto-tag --type Meeting # Only process untagged notes of a specific type
17/auto-tag --limit 50 # Process at most 50 notes
18```
19
20## Instructions
21
22### Phase 1: Find Untagged Notes
23
24Use Grep and Glob to find notes with empty tags:
25
26```bash
27# Find files with empty tags arrays
28Grep for "tags: \[\]" in *.md files (exclude Templates/, .obsidian/, .claude/, Archive/)
29
30# Also find files with no tags field at all
31# Notes with tags containing only template variables
32```
33
34Filter results:
35- Exclude `Templates/`, `.obsidian/`, `.claude/`, `Archive/`, `Attachments/`
36- If `--type` specified, filter by frontmatter type field
37- If `<path>` specified, scope to that path
38- Sort by type for batch efficiency
39
40### Phase 2: Analyse and Tag (Parallel)
41
42Launch parallel Haiku sub-agents, batching 20 notes per agent:
43
44For each note, the agent should:
45
461. **Read frontmatter** — extract `type`, `title`, `project`, `status`
472. **Read body content** — first 500 words
483. **Determine tags** using these rules:
49
50#### Tag Selection Rules
51
52**By note type** (always apply):
53
54| Type | Auto-tags |
55|------|-----------|
56| ADR | `type/adr`, `activity/architecture` |
57| Meeting | (infer from title/content) |
58| Task | (infer project from `project:` field) |
59| Project | `activity/delivery` + self-referencing `project/` tag |
60| System | `type/system` |
61| Incubator | `activity/research` |
62| Research | `activity/research` |
63| Concept | (infer from content) |
64| Pattern | (infer from content) |
65| Email | (infer from content) |
66| Reference | (infer from referenceType and content) |
67| Trip | (no tags needed — skip) |
68| Daily | `daily` |
69
70**By content analysis** (keyword matching):
71
72| Content Keywords | Suggested Tag |
73|-----------------|---------------|
74| AWS, Lambda, S3, EC2, Bedrock | `technology/aws` |
75| SAP, BTP, S/4HANA, UI5 | `technology/sap` |
76| ERPSystem, MRO Vendor | `technology/erp` |
77| Kafka, streaming, event | `technology/kafka` |
78| Snowflake, data warehouse | `technology/snowflake` |
79| security, IAM, encryption | `domain/security` |
80| data, analytics, pipeline | `domain/data` |
81| engineering, maintenance, MRO | `domain/engineering` |
82| integration, API, middleware | `domain/integration` |
83| cloud, infrastructure | `domain/cloud` |
84| architecture, design, pattern | `activity/architecture` |
85| research, investigation, POC | `activity/research` |
86| governance, compliance, policy | `activity/governance` |
87
88**By `project:` field** (if present):
89
90| Project Link | Tag |
91|-------------|-----|
92| `[[Project - Alpha]]` | `project/alpha` |
93| `[[Project - Beta]]` or `[[Project - Beta]]` | `project/beta` |
94| `[[Project - AlertHub]]` | `project/alerthub` |
95| `[[Project - Gamma]]` | `project/gamma` |
96| `[[Project - Delta]]` | `project/delta` |
97| `[[Project - Epsilon]]` | `project/epsilon` |
98| `[[Project - Cyber Uplift]]` | `project/cyber-uplift` |
99
100**Tag count target:** 2-5 tags per note. Prefer fewer, more accurate tags over many vague ones.
101
1024. **Format tags** — all lowercase, hierarchical, no `#` prefix
1035. **Return** — list of (filepath, suggested_tags) tuples
104
105### Phase 3: Apply Tags
106
107For each note with suggested tags:
108
1091. Read current frontmatter
1102. If `tags: []` — replace with suggested tags
1113. If no tags field — add `tags:` with suggested tags
1124. Write updated file using Edit tool
113
114**Format:**
115```yaml
116# Inline for 1-3 tags:
117tags: [activity/research, domain/data]
118
119# Multi-line for 4+ tags:
120tags:
121 - activity/architecture
122 - technology/aws
123 - domain/cloud
124 - project/alerthub
125```
126
127### Phase 4: Report
128
129```markdown
130## Auto-Tag Results
131
132**Notes processed:** {{count}}
133**Notes tagged:** {{tagged_count}}
134**Notes skipped:** {{skipped_count}} (already tagged or no suggestions)
135
136### By Type
137| Type | Tagged | Example Tags |
138|------|--------|-------------|
139| Meeting | 45 | project/*, domain/* |
140| Concept | 30 | activity/*, domain/* |
141| ADR | 20 | type/adr, technology/* |
142
143### Sample Changes
144| Note | Tags Added |
145|------|-----------|
146| {{note}} | {{tags}} |
147| {{note}} | {{tags}} |
148```
149
150## Safety
151
152- Always use `--dry-run` first for vault-wide operations
153- Never overwrite existing non-empty tags
154- Commit to git before running
155- Tags are additive only — never removes existing tags
156- Use the `.claude/context/tag-taxonomy.md` reference for valid hierarchies
157
158## Related Skills
159
160- `/tag-management` — Manual tag analysis and refactoring
161- `/quality-report` — Includes tag coverage metrics
162- `/vault-maintenance` — Includes tag health checks