--- name: macro-engine description: Rapid session onboarding and module debugging — context recovery, status checks, source analysis, and live testing. tags: [macro, onboarding, debug, context, recovery, development] category: system --- TODO: Category should be system+dev — primary use is debugging modules (dev) for context recovery (system). Using 'system' as primary. ## Session Onboarding (context recovery) Efficiently recover state at session start to avoid redundant queries. 1. **Session Review** — `session_recent(3)` to identify last active tasks and outcomes 2. **VFS Snapshot** — `list_files('')` to examine root directory for new files/config changes 3. **Procedure Retrieval** — `load_skills('current-task')` for applicable stored procedures 4. **User Preferences** — `user_list` for project-specific flags/persistent preferences **Workflow:** `session_recent` → `list_files` → `load_skills` → `user_list` ## Module Debugging (rapid diagnosis) 1. **Status Check** — `get_module_status` to see if module is loaded, modified, or has a remote URL mismatch 2. **Source Analysis** — `view_module(name)` to examine current implementation logic 3. **Live Testing** — `test_module(name)` to load edited version from `/_mods/` and verify the fix 4. **Synthesis** — compare test results with the original bug report to confirm resolution **Workflow:** `get_module_status` → `view_module` → `test_module` → `report`