# Root Scripts Audit - March 9, 2026

## Recent Scripts (Active/Important)

### March 9, 2026 (TODAY - 4 scripts)
- `send-yaniv-final.py` - **ACTIVE** Email to Yaniv
- `send-yaniv-clean.py` - **ACTIVE** Email to Yaniv  
- `send_yaniv_draft_v2.py` - **ACTIVE** Email to Yaniv
- `send_yaniv_draft.py` - **ACTIVE** Email to Yaniv

### March 7, 2026 (2 days ago - 1 script)
- `migrate_thread.py` - **RECENT** Thread migration

### March 3, 2026 (6 days ago - 2 scripts)  
- `recover.py` - **RECENT** Recovery operations, saves to recover_results.json
- `generate_science_images.py` - **RECENT** Image generation

### February 24, 2026 (2 weeks ago - 1 script)
- `slide1.py` - **RECENT** Slide operations

## Legacy Scripts (February 23 - Bulk Migration)

### Email/Gmail (4 scripts)
- `gmail_scan_contacts.py` - Contact scanning
- `search_clawpod_emails.py` - ClawPod email search  
- `process_gmail_contacts.py` - Gmail contact processing
- `setup_auth.py` - Authentication setup

### Calendar (2 scripts)
- `gcal.py` - **REFERENCED** in TOOLS.md as "deprecated, hangs"
- `gcal-create.py` - Calendar creation

### Notion Integration (4 scripts)
- `import_brand_content_to_notion.py` - Brand content import
- `setup_brand_content_notion.py` - Brand content setup
- `simple_notion_import.py` - Simple import
- `import_content_directly.py` - Direct import

### Figma/Design (12 scripts)
- `mission-deck-*.cjs` (2 files) - Mission deck operations
- `scan-*.cjs` (7 files) - Various scan operations  
- `qa-scan.cjs` - Quality assurance scan
- `fix-template-scan.cjs` - Template fixing
- `get-assets.cjs` - Asset retrieval
- `list-pages.cjs` - Page listing
- `read-final-slides.cjs` - Slide reading

### Social Media (2 scripts)
- `social-power-campaign.cjs` - Social campaign
- `social-power-v2.cjs` - Social campaign v2

### Presentations (3 scripts)
- `verify_phat_deck.py` - PHAT deck verification
- `fix_presentation_v3.py` - Presentation fixing  
- `jessica-fix-slides.py` - Jessica's slide fixes

### Testing/Utils (5 scripts)
- `test_api_key.py` - API key testing
- `test_notion_api.py` - Notion API testing
- `test-rect.cjs` - Rectangle testing
- `test-relay.cjs` - Relay testing  
- `upload-image.cjs` - Image upload
- `update-notion.js` - Notion updates

## References Found

### In Documentation
- `gcal.py` - Referenced in TOOLS.md, MEMORY.md as deprecated/problematic
- No other clear references to root scripts found

### Self-References
- `recover.py` - Creates `/root/.openclaw/workspace/recover_results.json`
- `send-yaniv-final.py` - Writes to `/tmp/yaniv_email.json`

## Risk Assessment

### SAFE TO MOVE (Low Risk)
- **Recent active scripts** - Well-contained, no external dependencies
- **Testing scripts** - Self-contained utilities
- **Social media scripts** - Isolated functionality

### NEEDS INVESTIGATION (Medium Risk)  
- **Figma scripts** - May be called by other systems
- **Notion scripts** - May be part of import pipelines
- **Email scripts** (older ones) - May be referenced elsewhere

### DEPRECATED (Safe to Archive)
- `gcal.py` - Explicitly marked as deprecated in docs
- Version files where latest exists

## Recommendations

1. **Move Recent Scripts** - The 8 recent scripts can be safely moved
2. **Archive Deprecated** - `gcal.py` can be archived  
3. **Research Dependencies** - Check if Figma/Notion scripts are called externally
4. **Consolidate Versions** - Keep latest versions only

## MIGRATION COMPLETED ✅ March 9, 2026

### Phase 1: Recent Scripts (8 files) → MOVED
- Email scripts → `scripts/email/`
- Utilities → `scripts/utils/`
- Images → `scripts/images/`
- Presentations → `scripts/figma/`

### Phase 2: Legacy Scripts (30 files) → MOVED
- Figma/Design → `scripts/figma/`
- Notion integration → `scripts/notion/`
- Social media → `scripts/discord/`
- Testing utilities → `scripts/utils/`
- Email/calendar → `scripts/email/`

### Phase 3: Deprecated Scripts (1 file) → ARCHIVED
- `gcal.py` → `scripts/legacy/`

**RESULT:** All 39 root scripts successfully organized into proper subdirectories.
**STATUS:** ✅ Workspace root clean, scripts properly categorized by function.