One-time [[migration]] tool that prepends H1 titles (# {title}) to legacy [[memory]] files that lack a top-level H1 heading. Ensures all memory files follow consistent [[markdown]] structure for proper rendering and [[knowledge-graph]] integration. Safe, idempotent operation with dry-run preview mode.
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| dryRun | bool | No | Preview changes without modifying files (default: true, ALWAYS START HERE) | true |
| limit | int | No | Maximum files to modify when dryRun=false (default: 100, safety limit) | 50 |
| folder | string | No | Optional subfolder under memory root to restrict scope | ”research” |
{
"dryRun": true
}
Scans entire memory directory and shows which files would be modified. NO CHANGES MADE.
{
"dryRun": true,
"folder": "research/ai"
}
Shows only files in research/ai subfolder that need H1 headers added.
{
"dryRun": false,
"limit": 10
}
⚠️ Modifies up to 10 files. ONLY run after reviewing dry run output.
{
"dryRun": false,
"limit": 100
}
Processes up to 100 files. Use after testing with smaller batch first.
{
"dryRun": false,
"limit": 50,
"folder": "research"
}
Migrates up to 50 files in research subfolder only.
# title: in frontmatter, uses that- and _ with spaces)Example: machine-learning-notes.md → # Machine Learning Notes
Prepends # {title}\n\n before existing content, preserving frontmatter and all content.
Updates frontmatter modified: timestamp to ISO 8601 UTC format.
Migrate in batches to maintain control:
# Round 1: Test with 10 files
AddMissingH1 dryRun=false limit=10
# Round 2: Expand to 50 files
AddMissingH1 dryRun=false limit=50
# Round 3: Process remaining files
AddMissingH1 dryRun=false limit=100
Process specific folders independently:
# Migrate research files
AddMissingH1 dryRun=false limit=100 folder="research"
# Migrate projects separately
AddMissingH1 dryRun=false limit=100 folder="projects"
Cause: Provided folder parameter is outside memory directory structure Solution: Use relative paths under memory root, e.g., “research” not “/absolute/path/research”
Cause: Specified folder doesn’t exist Solution: Verify folder name spelling and existence with ListMemories tool
Cause: All files already have H1 headers (idempotent - this is success!) Solution: No action needed - files are already in correct format
Cause: Forgot to run Sync after migration Solution: Run Sync tool to rebuild [[knowledge-graph]] with updated file structure
Cause: Files in “thinking” directories are automatically excluded for safety Solution: This is expected behavior - thinking session files have different structure
Cause: Tool uses frontmatter title if present, otherwise derives from filename Solution: This is correct behavior - frontmatter title takes precedence
Scan complete. Found 23 files missing a top-level H1.
• research/machine-learning/transformers.md
• research/machine-learning/attention-mechanisms.md
• projects/2024/ai-infrastructure.md
• projects/2024/deployment-strategy.md
… and 19 more
Run with dryRun=false to apply changes. Suggested next step: Sync
✓ Updated: research/machine-learning/transformers.md
✓ Updated: research/machine-learning/attention-mechanisms.md
✓ Updated: projects/2024/ai-infrastructure.md
Migration complete. Updated 3 file(s). Errors: 0. Remaining without H1: 20.
Run 'Sync' to rebuild the knowledge graph.
✓ Updated: research/file-1.md
✗ Error: research/file-2.md — File is locked
✓ Updated: research/file-3.md
Migration complete. Updated 2 file(s). Errors: 1. Remaining without H1: 18.
---
title: Machine Learning Fundamentals
created: 2024-01-15
---
This document covers [[neural-networks]] and [[deep-learning]] concepts.
## Key Topics
Understanding [[backpropagation]] is essential.
---
title: Machine Learning Fundamentals
created: 2024-01-15
modified: 2024-10-24T18:30:00Z
---
# Machine Learning Fundamentals
This document covers [[neural-networks]] and [[deep-learning]] concepts.
## Key Topics
Understanding [[backpropagation]] is essential.
thinking/sequential/ and thinking/workflow/ are never modified.git/ folders are excluded from scanningmodified: timestamp update# {title} at top of content (after frontmatter)modified: field in frontmatterRunning multiple times is safe - files already having H1 headers are skipped. No duplicate headers created.
{
"dryRun": true
}
Output: Found 147 files missing a top-level H1
{
"dryRun": false,
"limit": 5
}
Output: Updated 5 file(s). Errors: 0. Remaining without H1: 142
Use ReadMemory to check a few migrated files - confirm H1 headers look correct.
{
"dryRun": false,
"limit": 50
}
Output: Updated 50 file(s). Errors: 0. Remaining without H1: 92
{
"dryRun": false,
"limit": 100
}
Output: Updated 92 file(s). Errors: 0. Remaining without H1: 0
{
"tool": "Sync"
}
Rebuilds [[knowledge-graph]] with updated file structure.
AddMissingH1 follows Maenifold’s Ma Protocol principles:
This tool represents Ma Protocol’s emphasis on gentle correction - fixing legacy structure issues without disrupting existing content or forcing unnecessary complexity.