Migrate Existing Notes
Help the user migrate their existing notes to the lab notebook structure.
Your Task
Guide the user through migrating their existing notes into the organized note-taking protocol.
Arguments
If the user provided a source path (e.g., /migrate-notes ./docs), use that path directly instead of asking.
Step 1: Discover Existing Notes
If a source path was provided as argument, use it. Otherwise, ask the user where their existing notes are located. Common locations:
- •
./notes/or./docs/ - •
./README.mdwith embedded notes - •Scattered markdown files in project root
- •A different notes directory
If they're unsure, search for markdown files:
find . -name "*.md" -type f | grep -v node_modules | grep -v .git
Step 2: Ensure Structure Exists
Check if the lab notebook structure exists. If not, suggest running /setup-notes first:
- •
notes/INDEX.md - •
notes/experiments/ - •
notes/decisions/ - •
notes/troubleshooting/ - •
notes/research/
Step 3: Analyze Each Note
For each existing note file:
- •
Read the content to understand what it contains
- •
Determine the type:
- •Time-stamped experiments/attempts →
experiments/ - •Architectural/design choices →
decisions/ - •Error solutions/fixes →
troubleshooting/ - •External references/papers →
research/ - •Current working state →
quick-reference.md - •Mixed content → Split into multiple files
- •Time-stamped experiments/attempts →
- •
Extract or estimate a date:
- •Check git history:
git log --follow --format="%ai" -- "filename" | tail -1 - •Use file modification time if no git history
- •Use today's date if truly unknown (note this in the file)
- •Check git history:
- •
Propose new filename:
YYYY-MM-DD-descriptive-name.md
Step 4: Present Migration Plan
Before making changes, show the user a migration plan:
## Migration Plan | Original File | Type | New Location | |--------------|------|--------------| | old-notes.md | experiment | notes/experiments/2025-01-10-old-notes.md | | config-ideas.md | decision | notes/decisions/2025-01-08-config-architecture.md | | error-fixes.md | troubleshooting | notes/troubleshooting/common-errors.md | ### Actions: 1. Move X files to experiments/ 2. Move Y files to decisions/ 3. Move Z files to troubleshooting/ 4. Split W mixed-content files 5. Update INDEX.md with findings 6. Archive originals to notes/archive/ Proceed with migration? (yes/no)
Step 5: Execute Migration
After user approval:
- •
Create archive directory for originals:
bashmkdir -p notes/archive/pre-migration
- •
For each file:
- •Copy original to archive
- •Create new file in correct location with proper template structure
- •Preserve original content within the template
- •Add date header if missing
- •
Extract key findings from each file for INDEX.md
- •
Update INDEX.md with:
- •Summary of migrated experiments
- •Key decisions documented
- •Known issues/solutions
- •
Create/update quick-reference.md with current working state if found
Step 6: Verify Migration
After migration:
- •List all new files created
- •Show updated INDEX.md
- •Confirm all original files are archived
- •Test that notes can be found by topic
Migration Templates
When restructuring content, use these formats:
For experiments:
# YYYY-MM-DD: [Title from original] ## Goal [Extract from original or ask user] ## What I Tried [Extract from original] ## Key Findings [Extract from original] ## Failed Approaches | What I Tried | Why It Failed | Lesson Learned | |--------------|---------------|----------------| [Extract from original] ## Original Content > [Preserve any content that doesn't fit above]
For decisions:
# Decision: [Title] Date: YYYY-MM-DD ## Context [Extract from original] ## Options Considered [Extract from original] ## Decision [Extract from original] ## Rationale [Extract from original]
For troubleshooting:
# Troubleshooting: [Error/Issue Name] ## Symptom [Extract error messages from original] ## Cause [Extract from original] ## Solution [Extract steps from original] ## Prevention [Extract or suggest based on content]
Important Notes
- •Always preserve original content - never delete without archiving
- •Ask before proceeding with each major step
- •If a note doesn't fit cleanly into one category, ask the user
- •Mixed-content files should be split into separate notes
- •Update all internal links after moving files