/auto-tag
Batch auto-tag Markdown notes by analysing their content and suggesting appropriate hierarchical tags. Uses parallel Haiku agents processing notes in batches of 15-20 for cost-effective, high-throughput tagging.
When to Use This Skill
- Tagging a batch of newly created notes
- Applying a consistent tag taxonomy to existing notes
- Re-tagging notes after a taxonomy migration
- Ensuring all notes meet minimum tag requirements
- Filling in missing tags across the vault
Usage
/auto-tag [--scope path/to/folder] [--mode suggest|apply] [--taxonomy path/to/taxonomy.md]
/auto-tag --type Meeting # Only process notes of a specific type
/auto-tag --limit 50 # Process at most 50 notes
Parameters
| Parameter |
Description |
Required |
--scope |
Folder or glob pattern (default: notes missing tags) |
No |
--mode |
suggest shows tags; apply writes them (default: suggest) |
No |
--taxonomy |
Path to tag taxonomy file for reference |
No |
--type |
Only process notes of a specific frontmatter type |
No |
--limit |
Maximum number of notes to process |
No |
Instructions
Phase 1: Identify Notes Needing Tags
- Scan notes in scope -- Find all Markdown files
- Parse frontmatter -- Extract existing tags
- Filter to candidates:
- Notes with no tags field
- Notes with empty tags (
tags: [])
- Notes with fewer than 2 tags
- Notes with flat (non-hierarchical) tags
- Exclude directories:
Templates/, .obsidian/, .claude/, Archive/, Attachments/
- Load taxonomy -- If
--taxonomy provided, use it as the tag reference. Otherwise, scan existing tags across the vault to build a frequency-based taxonomy.
- Sort by type for batch efficiency
- Divide into batches of 15-20 notes per agent
Phase 2: Batch Tagging -- Agent Team (Parallel Haiku Agents)
Use the Batch Processing pattern. Launch N parallel agents, each processing 15-20 notes.
Agent 1-N: Tag Analyst (Haiku)
Task: Analyse content and suggest tags for assigned batch
For each note in the batch:
- Read frontmatter -- extract
type, title, project, status
- Read body content -- first 500 words
- Apply type-based auto-tags -- deterministic tags from the Type-Based Auto-Tags table below
- Apply content keyword matching -- use the Content Keyword-to-Tag Mapping table below
- Apply project field matching -- if
project: field exists, derive a project/ tag
- Suggest 2-5 hierarchical tags per note total
- Validate tags -- check all suggested tags against the taxonomy (if provided); flag any tag not in the taxonomy as "novel"
Quality rules:
- No
# prefix in YAML tags
- All lowercase
- Hierarchical format required (e.g.,
domain/data not just data)
- Hyphens for multi-word tags (e.g.,
domain/supply-chain)
- Minimum 2 tags, maximum 5 tags per note
- Prefer fewer, more accurate tags over many vague ones
Return: List of { filename, existingTags[], suggestedTags[], confidence, reason } per note
Tag Mapping Reference
Customise these tables for your vault. The mappings below are generic starting points. Replace or extend them with your own domain-specific keywords, project names, and technology stack.
Type-Based Auto-Tags
These deterministic tags are always added based on the note's type frontmatter field. They require no content analysis.
| Type |
Auto-tags |
Notes |
| ADR |
type/adr, activity/architecture |
Architecture Decision Records |
| Project |
activity/delivery |
Also add project/<name> from title |
| Meeting |
activity/meeting |
Infer topic tags from title/content |
| Task |
activity/task |
Infer project from project: field |
| Research |
activity/research |
Research and investigation notes |
| Incubator |
activity/research |
Early-stage ideas and explorations |
| Concept |
type/concept |
Infer domain tags from content |
| Pattern |
type/pattern |
Infer domain tags from content |
| Reference |
type/reference |
Also infer from referenceType if set |
| System |
type/system |
Technology entity notes |
| Daily |
daily |
Daily journal entries |
| Email |
(infer from content) |
No deterministic tags |
| Trip |
(skip) |
Typically no tags needed |
Content Keyword-to-Tag Mapping
When note content (title + body) contains these keywords, suggest the corresponding tag. This table is a template -- adapt the keywords and tags to match your vault's domain and technology stack.
| Content Keywords |
Suggested Tag |
| AWS, Lambda, S3, EC2, CloudFormation |
technology/aws |
| Kafka, streaming, event-driven |
technology/kafka |
| API, REST, GraphQL, endpoint, OpenAPI |
technology/api |
| database, SQL, migration, schema, ORM |
technology/database |
| Docker, Kubernetes, container, helm |
technology/containers |
| CI/CD, pipeline, deployment, GitHub Actions |
technology/cicd |
| Python, JavaScript, TypeScript, Go, Rust |
technology/<language> |
| security, IAM, encryption, authentication |
domain/security |
| data, analytics, pipeline, warehouse |
domain/data |
| cloud, infrastructure, networking |
domain/cloud |
| integration, middleware, message broker |
domain/integration |
| architecture, design, pattern, C4 |
activity/architecture |
| research, investigation, POC, spike |
activity/research |
| governance, compliance, policy, audit |
activity/governance |
| meeting, standup, review, retrospective |
activity/meeting |
| risk, threat, vulnerability, CVE |
domain/security |
| documentation, guide, how-to, runbook |
activity/documentation |
| planning, roadmap, strategy, vision |
activity/planning |
| monitoring, observability, logging, alerts |
domain/operations |
Project Field Mapping
If the note has a project: frontmatter field containing a wiki-link, derive a project tag:
project: "[[Project - Orders Platform]]" --> project/orders-platform
project: "[[Project - Cloud Migration]]" --> project/cloud-migration
Rule: Lowercase the project name, replace spaces with hyphens, strip the Project - prefix.
Phase 3: Synthesise and Validate
- Compile suggestions from all agents
- Validate against taxonomy:
- Check every suggested tag exists in the taxonomy file (if provided)
- Flag tags not in the taxonomy as "novel" -- these need manual review
- Do not auto-apply novel tags
- Group by confidence:
- High: Tags from the type-based auto-tags table, or exact matches in the taxonomy
- Medium: Tags inferred from content keyword matching against known taxonomy entries
- Low: Novel tags not found in the taxonomy
- De-duplicate -- remove tags already present on the note
Phase 4: Apply Tags
If --mode apply:
- Apply high-confidence tags automatically
- Present medium/low confidence tags for user review before applying
For each note with approved tags:
- Read current frontmatter
- If
tags: [] -- replace with suggested tags
- If no tags field -- add
tags: with suggested tags
- Never overwrite existing non-empty tags -- only add to them
- Write updated file using Edit tool
YAML Formatting Rules
# Inline format for 1-3 tags:
tags: [activity/research, domain/data]
# Multi-line format for 4+ tags:
tags:
- activity/architecture
- technology/aws
- domain/cloud
- project/cloud-migration
Rules:
- Use inline
[tag1, tag2] format when there are 1-3 tags
- Switch to multi-line format (one tag per line with
- prefix) when there are 4 or more tags
- Match whichever format the file already uses, if tags were previously present
- No
# prefix -- ever -- in frontmatter YAML
Phase 5: Report
# Auto-Tag Report
**Date:** YYYY-MM-DD | **Notes Processed:** X | **Tags Suggested:** X
## Summary
| Confidence | Notes | Tags Added | Action |
|------------|-------|------------|----------------|
| High | X | X | Auto-applied |
| Medium | X | X | Needs review |
| Low | X | X | Manual review |
## Tag Suggestions
### High Confidence
| Note | Existing Tags | Suggested Tags |
|------------------------|------------------------|-----------------------------------------|
| `ADR - API Gateway.md` | `[]` | + `type/adr`, `activity/architecture` |
### Medium Confidence
| Note | Existing Tags | Suggested Tags | Reason |
|------------------------|---------------|-----------------------------|---------------------------------|
| `Meeting - 2026-01...` | `[]` | `activity/meeting`, `domain/data` | Title mentions data review |
### New Tags Introduced
| Tag | Suggested For | In Taxonomy? |
|-------------------------|---------------|--------------|
| `domain/observability` | 3 notes | No |
## By Type
| Type | Tagged | Common Tags Applied |
|---------|--------|-----------------------------|
| Meeting | 45 | `activity/meeting`, domain/* |
| ADR | 20 | `type/adr`, technology/* |
| Concept | 30 | `type/concept`, domain/* |
Safety
- Always use
--mode suggest first for vault-wide operations
- Never overwrite existing non-empty tags -- tags are additive only
- Commit to git before running
--mode apply
- Review novel tags before applying -- they may indicate taxonomy gaps
- Validate against taxonomy to prevent tag drift and inconsistency
Examples
Example 1: Preview Tags for All Untagged Notes
/auto-tag --mode suggest
Example 2: Apply Tags to a Specific Folder
/auto-tag --scope Meetings/2026/ --mode apply
Example 3: With Custom Taxonomy
/auto-tag --taxonomy .claude/context/tag-taxonomy.md --mode suggest
Example 4: Process Only ADRs
/auto-tag --type ADR --mode suggest
Invoke with: /auto-tag to batch-tag notes with AI-suggested hierarchical tags
1---2name: when-to-use-this-skill-223description: Batch auto-tag Markdown notes by analysing their content and suggesting appropriate hierarchical tags. Uses parallel Haiku agents processing notes in batches of 15-20 for cost-effective, high-throughput tagging.4---56# /auto-tag78Batch auto-tag Markdown notes by analysing their content and suggesting appropriate hierarchical tags. Uses parallel Haiku agents processing notes in batches of 15-20 for cost-effective, high-throughput tagging.910## When to Use This Skill1112- Tagging a batch of newly created notes13- Applying a consistent tag taxonomy to existing notes14- Re-tagging notes after a taxonomy migration15- Ensuring all notes meet minimum tag requirements16- Filling in missing tags across the vault1718## Usage1920```21/auto-tag [--scope path/to/folder] [--mode suggest|apply] [--taxonomy path/to/taxonomy.md]22/auto-tag --type Meeting # Only process notes of a specific type23/auto-tag --limit 50 # Process at most 50 notes24```2526### Parameters2728| Parameter | Description | Required |29|---------------|------------------------------------------------------|----------|30| `--scope` | Folder or glob pattern (default: notes missing tags) | No |31| `--mode` | `suggest` shows tags; `apply` writes them (default: `suggest`) | No |32| `--taxonomy` | Path to tag taxonomy file for reference | No |33| `--type` | Only process notes of a specific frontmatter type | No |34| `--limit` | Maximum number of notes to process | No |3536## Instructions3738### Phase 1: Identify Notes Needing Tags39401. **Scan notes in scope** -- Find all Markdown files412. **Parse frontmatter** -- Extract existing tags423. **Filter to candidates:**43 - Notes with no tags field44 - Notes with empty tags (`tags: []`)45 - Notes with fewer than 2 tags46 - Notes with flat (non-hierarchical) tags474. **Exclude directories:** `Templates/`, `.obsidian/`, `.claude/`, `Archive/`, `Attachments/`485. **Load taxonomy** -- If `--taxonomy` provided, use it as the tag reference. Otherwise, scan existing tags across the vault to build a frequency-based taxonomy.496. **Sort by type** for batch efficiency507. **Divide into batches** of 15-20 notes per agent5152### Phase 2: Batch Tagging -- Agent Team (Parallel Haiku Agents)5354Use the Batch Processing pattern. Launch N parallel agents, each processing 15-20 notes.5556**Agent 1-N: Tag Analyst** (Haiku)57Task: Analyse content and suggest tags for assigned batch5859For each note in the batch:60611. **Read frontmatter** -- extract `type`, `title`, `project`, `status`622. **Read body content** -- first 500 words633. **Apply type-based auto-tags** -- deterministic tags from the Type-Based Auto-Tags table below644. **Apply content keyword matching** -- use the Content Keyword-to-Tag Mapping table below655. **Apply project field matching** -- if `project:` field exists, derive a `project/` tag666. **Suggest 2-5 hierarchical tags** per note total677. **Validate tags** -- check all suggested tags against the taxonomy (if provided); flag any tag not in the taxonomy as "novel"6869Quality rules:70- No `#` prefix in YAML tags71- All lowercase72- Hierarchical format required (e.g., `domain/data` not just `data`)73- Hyphens for multi-word tags (e.g., `domain/supply-chain`)74- Minimum 2 tags, maximum 5 tags per note75- Prefer fewer, more accurate tags over many vague ones7677Return: List of `{ filename, existingTags[], suggestedTags[], confidence, reason }` per note7879---8081## Tag Mapping Reference8283> **Customise these tables for your vault.** The mappings below are generic starting points. Replace or extend them with your own domain-specific keywords, project names, and technology stack.8485### Type-Based Auto-Tags8687These deterministic tags are **always** added based on the note's `type` frontmatter field. They require no content analysis.8889| Type | Auto-tags | Notes |90|-------------|-----------------------------------------|------------------------------------------|91| ADR | `type/adr`, `activity/architecture` | Architecture Decision Records |92| Project | `activity/delivery` | Also add `project/<name>` from title |93| Meeting | `activity/meeting` | Infer topic tags from title/content |94| Task | `activity/task` | Infer project from `project:` field |95| Research | `activity/research` | Research and investigation notes |96| Incubator | `activity/research` | Early-stage ideas and explorations |97| Concept | `type/concept` | Infer domain tags from content |98| Pattern | `type/pattern` | Infer domain tags from content |99| Reference | `type/reference` | Also infer from `referenceType` if set |100| System | `type/system` | Technology entity notes |101| Daily | `daily` | Daily journal entries |102| Email | _(infer from content)_ | No deterministic tags |103| Trip | _(skip)_ | Typically no tags needed |104105### Content Keyword-to-Tag Mapping106107When note content (title + body) contains these keywords, suggest the corresponding tag. This table is a **template** -- adapt the keywords and tags to match your vault's domain and technology stack.108109| Content Keywords | Suggested Tag |110|--------------------------------------------|---------------------------|111| AWS, Lambda, S3, EC2, CloudFormation | `technology/aws` |112| Kafka, streaming, event-driven | `technology/kafka` |113| API, REST, GraphQL, endpoint, OpenAPI | `technology/api` |114| database, SQL, migration, schema, ORM | `technology/database` |115| Docker, Kubernetes, container, helm | `technology/containers` |116| CI/CD, pipeline, deployment, GitHub Actions| `technology/cicd` |117| Python, JavaScript, TypeScript, Go, Rust | `technology/<language>` |118| security, IAM, encryption, authentication | `domain/security` |119| data, analytics, pipeline, warehouse | `domain/data` |120| cloud, infrastructure, networking | `domain/cloud` |121| integration, middleware, message broker | `domain/integration` |122| architecture, design, pattern, C4 | `activity/architecture` |123| research, investigation, POC, spike | `activity/research` |124| governance, compliance, policy, audit | `activity/governance` |125| meeting, standup, review, retrospective | `activity/meeting` |126| risk, threat, vulnerability, CVE | `domain/security` |127| documentation, guide, how-to, runbook | `activity/documentation` |128| planning, roadmap, strategy, vision | `activity/planning` |129| monitoring, observability, logging, alerts | `domain/operations` |130131### Project Field Mapping132133If the note has a `project:` frontmatter field containing a wiki-link, derive a project tag:134135```136project: "[[Project - Orders Platform]]" --> project/orders-platform137project: "[[Project - Cloud Migration]]" --> project/cloud-migration138```139140**Rule:** Lowercase the project name, replace spaces with hyphens, strip the `Project - ` prefix.141142---143144### Phase 3: Synthesise and Validate1451461. **Compile suggestions** from all agents1472. **Validate against taxonomy:**148 - Check every suggested tag exists in the taxonomy file (if provided)149 - Flag tags not in the taxonomy as "novel" -- these need manual review150 - Do not auto-apply novel tags1513. **Group by confidence:**152 - **High:** Tags from the type-based auto-tags table, or exact matches in the taxonomy153 - **Medium:** Tags inferred from content keyword matching against known taxonomy entries154 - **Low:** Novel tags not found in the taxonomy1554. **De-duplicate** -- remove tags already present on the note156157### Phase 4: Apply Tags158159If `--mode apply`:1601611. Apply high-confidence tags automatically1622. Present medium/low confidence tags for user review before applying163164For each note with approved tags:1651661. Read current frontmatter1672. If `tags: []` -- replace with suggested tags1683. If no tags field -- add `tags:` with suggested tags1694. **Never overwrite existing non-empty tags** -- only add to them1705. Write updated file using Edit tool171172#### YAML Formatting Rules173174```yaml175# Inline format for 1-3 tags:176tags: [activity/research, domain/data]177178# Multi-line format for 4+ tags:179tags:180 - activity/architecture181 - technology/aws182 - domain/cloud183 - project/cloud-migration184```185186**Rules:**187- Use inline `[tag1, tag2]` format when there are 1-3 tags188- Switch to multi-line format (one tag per line with `- ` prefix) when there are 4 or more tags189- Match whichever format the file already uses, if tags were previously present190- No `#` prefix -- ever -- in frontmatter YAML191192### Phase 5: Report193194```markdown195# Auto-Tag Report196197**Date:** YYYY-MM-DD | **Notes Processed:** X | **Tags Suggested:** X198199## Summary200201| Confidence | Notes | Tags Added | Action |202|------------|-------|------------|----------------|203| High | X | X | Auto-applied |204| Medium | X | X | Needs review |205| Low | X | X | Manual review |206207## Tag Suggestions208209### High Confidence210211| Note | Existing Tags | Suggested Tags |212|------------------------|------------------------|-----------------------------------------|213| `ADR - API Gateway.md` | `[]` | + `type/adr`, `activity/architecture` |214215### Medium Confidence216217| Note | Existing Tags | Suggested Tags | Reason |218|------------------------|---------------|-----------------------------|---------------------------------|219| `Meeting - 2026-01...` | `[]` | `activity/meeting`, `domain/data` | Title mentions data review |220221### New Tags Introduced222223| Tag | Suggested For | In Taxonomy? |224|-------------------------|---------------|--------------|225| `domain/observability` | 3 notes | No |226227## By Type228229| Type | Tagged | Common Tags Applied |230|---------|--------|-----------------------------|231| Meeting | 45 | `activity/meeting`, domain/* |232| ADR | 20 | `type/adr`, technology/* |233| Concept | 30 | `type/concept`, domain/* |234```235236## Safety237238- **Always use `--mode suggest` first** for vault-wide operations239- **Never overwrite** existing non-empty tags -- tags are additive only240- **Commit to git** before running `--mode apply`241- **Review novel tags** before applying -- they may indicate taxonomy gaps242- **Validate against taxonomy** to prevent tag drift and inconsistency243244## Examples245246### Example 1: Preview Tags for All Untagged Notes247248```249/auto-tag --mode suggest250```251252### Example 2: Apply Tags to a Specific Folder253254```255/auto-tag --scope Meetings/2026/ --mode apply256```257258### Example 3: With Custom Taxonomy259260```261/auto-tag --taxonomy .claude/context/tag-taxonomy.md --mode suggest262```263264### Example 4: Process Only ADRs265266```267/auto-tag --type ADR --mode suggest268```269270---271272**Invoke with:** `/auto-tag` to batch-tag notes with AI-suggested hierarchical tags