Loading...
Loading...
macOS system resource optimization with 40 specialized agents for memory, disk, CPU, and process management
npx skill4agent add rdmptv/adbautoplayer macos-resource-optimizer| Script | Purpose | Agents | Execution Time |
|---|---|---|---|
| 40-agent parallel orchestrator | 40 agents (6 phases) | 4-5s |
# Execute all 40 agents in 6 parallel phases
uv run scripts/coordinator.py
# JSON output
uv run scripts/coordinator.py --json# Memory pressure detector
uv run scripts/agent_memory_pressure_detector.py
# Browser tab manager
uv run scripts/agent_browser_tab_manager.py
# Docker cleanup
uv run scripts/agent_docker_deep_cleanup.py --dry-run# Kill zombie processes
uv run scripts/kill_zombies_parallel.py
# Report memory usage
uv run scripts/report_memory.py
# Analyze running processes
uv run scripts/analyze_processes.py --json# Execute full 40-agent orchestration
result = Bash("uv run .claude/skills/macos-resource-optimizer/scripts/coordinator.py --json")
data = json.loads(result.stdout)
# Parse results by phase
phase1_results = data["phases"]["disk_cleanup"]
phase2_results = data["phases"]["ram_optimization"]
# Return aggregated recommendations# Execute memory-specific agents
result = Bash("uv run scripts/agent_memory_pressure_detector.py --json")
memory_data = json.loads(result.stdout)
# Generate recommendations based on memory analysisagent_python_zombies.pyagent_node_process_scanner.pyagent_workerd_zombies.pyagent_generic_idle.pyagent_jvm_memory_hog_detector.pyagent_ssh_git_process_zombies.pyagent_browser_helpers.pyagent_language_servers.pyagent_electron_helpers.pyagent_network_connection_leaks.pyagent_orphaned_process_groups.pyagent_docker_container_scanner.pyagent_database_connection_pooler.pyagent_ssh_connection_scanner.pyagent_file_cache_optimizer.pyagent_memory_pressure_detector.pyagent_browser_tab_manager.pyagent_browser_helper_consolidator.pyagent_browser_cache_optimizer.pyagent_inactive_app_detector.pyagent_electron_app_optimizer.pyagent_background_app_suspender.pyagent_swap_optimizer.pyagent_memory_leak_hunter.pyagent_timemachine_snapshot_cleaner.pyagent_developer_cache_cleaner.pyagent_xcode_cache_cleaner.pyagent_build_cache_cleaner.pyagent_system_log_cleaner.pyagent_swap_purgeable_hunter.pyagent_window_server_optimizer.pyagent_spotlight_mds_hunter.pyagent_memory_leak_hunter.pyagent_chrome_deep_cleanup.pyagent_safari_optimizer.pyagent_firefox_deep_cleanup.pyagent_messaging_app_hunter.pyagent_vscode_deep_cleanup.pyagent_dns_connection_scanner.pyUser Command (slash command)
↓
MoAI Command (Python orchestrator)
↓
Task() delegation to manager agents
↓
Manager-Resource-Coordinator (MoAI agent)
↓
Bash(uv run coordinator.py) → UV Script execution
↓
asyncio.gather() parallel execution
├─ Phase 1: Disk Cleanup (15 agents)
├─ Phase 2: RAM Optimization (9 agents)
├─ Phase 3: Developer Cache (5 agents)
├─ Phase 4: Advanced Memory (4 agents)
├─ Phase 5: Browser Cleanup (3 agents)
└─ Phase 6: App & System (3 agents)
↓
JSON results aggregation
↓
User-facing report (Korean)#!/usr/bin/env uv run
# /// script
# requires-python = ">=3.11"
# dependencies = ["psutil", "pyyaml"]
# ///
import asyncio
import psutil
# Scripts run directly via: uv run script.py
# No Python virtual environment setup required# Manager agent receives command
# Delegates to Bash tool: uv run .claude/skills/.../scripts/coordinator.py
# Coordinator spawns async tasks for 40 agents
# Results aggregated and returned# coordinator.py executes agents
{
"phases": {
"disk_cleanup": {
"agents_executed": 15,
"duration": 2.1,
"savings_gb": 5.3,
"results": [...]
},
"ram_optimization": {
"agents_executed": 9,
"duration": 1.8,
"memory_freed_gb": 2.1,
"results": [...]
},
...
},
"summary": {
"total_agents": 40,
"total_duration": 2.5,
"total_savings_gb": 12.4,
"total_memory_freed_gb": 4.2
}
}config/cleanup-rules.jsonconfig/cleanup-rules.json| Metric | Value |
|---|---|
| Total Agents | 40+ specialized agents |
| Orchestrators | 1 (coordinator only) |
| Execution Time (parallel) | 4-5s (first run), 2-3s (cached) |
| Execution Time (sequential) | ~40s (estimated) |
| Speed Improvement | 8× faster (parallel vs sequential) |
| Memory Saved (typical) | 1-3 GB |
| Disk Saved (typical) | 0.4-2.5 GB |
| Actual Results (2025-11-30) | +413MB disk, 18% of goal |
Execute full system analysis via coordinator.py.
## Workflow
1. Delegate to manager-resource-coordinator
2. Coordinator executes: `uv run scripts/coordinator.py --json`
3. Parse JSON results
4. Return formatted analysis with recommendationsExecute system optimization via coordinator.py.
## Workflow
1. Delegate to manager-resource-coordinator
2. Coordinator executes: `uv run scripts/coordinator.py --json`
3. Parse and validate results
4. Apply optimizations if approved
5. Return optimization resultsmanager-resource-coordinatorexpert-memory-optimizerexpert-cpu-optimizerexpert-disk-optimizermoai-lang-pythonmoai-foundation-coremoai-essentials-debug/macos-resource-optimizer:0-init/macos-resource-optimizer:1-analyze/macos-resource-optimizer:2-optimize/macos-resource-optimizer:3-monitor/macos-resource-optimizer:9-feedback.claude/skills/macos-resource-optimizer/scripts/