{
  "schemaVersion": "1.0",
  "item": {
    "slug": "swarm-janitor",
    "name": "Swarm Janitor",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/LvcidPsyche/swarm-janitor",
    "canonicalUrl": "https://clawhub.ai/LvcidPsyche/swarm-janitor",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/swarm-janitor",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=swarm-janitor",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "references/config.yaml"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/swarm-janitor"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/swarm-janitor",
    "agentPageUrl": "https://openagent3.xyz/skills/swarm-janitor/agent",
    "manifestUrl": "https://openagent3.xyz/skills/swarm-janitor/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/swarm-janitor/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Swarm Janitor",
        "body": "Enterprise-grade cleanup tool for OpenClaw subagent management."
      },
      {
        "title": "What It Does",
        "body": "Automatically identifies and cleans up orphaned subagent sessions while preserving important work through SuperMemory archival."
      },
      {
        "title": "Core Functions",
        "body": "Scan: Analyze session directory for orphaned/abandoned subagents\nArchive: Save transcripts to SuperMemory before deletion\nClean: Safely remove orphaned sessions freeing disk space\nReport: Generate detailed cleanup reports"
      },
      {
        "title": "Safety First",
        "body": "This skill implements multiple safety layers:\n\n✅ Never deletes active sessions — checks process status\n✅ Dry-run mode — preview changes before executing\n✅ SuperMemory backup — transcripts archived before deletion\n✅ Configurable retention — customize age thresholds\n✅ Detailed logging — full audit trail of all actions"
      },
      {
        "title": "Quick Start",
        "body": "# Preview what would be cleaned (dry-run)\npython3 scripts/swarm_janitor.py --dry-run\n\n# Archive old sessions to SuperMemory, then clean\npython3 scripts/swarm_janitor.py --archive --clean\n\n# Custom retention (7 days instead of default 3)\npython3 scripts/swarm_janitor.py --retention-days 7 --clean"
      },
      {
        "title": "Installation",
        "body": "Copy this skill to your OpenClaw workspace:\ncp -r skills/swarm-janitor ~/.openclaw/workspace/skills/\n\n\n\nConfigure retention policy (optional):\n# Edit config to customize\nnano references/config.yaml\n\n\n\nRun first scan:\npython3 ~/.openclaw/workspace/skills/swarm-janitor/scripts/swarm_janitor.py --dry-run"
      },
      {
        "title": "Daily Maintenance (Cron)",
        "body": "# Run daily at 3 AM, archive sessions older than 3 days\n0 3 * * * python3 ~/.openclaw/workspace/skills/swarm-janitor/scripts/swarm_janitor.py --archive --clean --retention-days 3 >> /var/log/swarm-janitor.log 2>&1"
      },
      {
        "title": "Manual Cleanup",
        "body": "# See what would be deleted\npython3 scripts/swarm_janitor.py --dry-run --verbose\n\n# Archive transcripts to SuperMemory\npython3 scripts/swarm_janitor.py --archive\n\n# Clean without archiving (not recommended)\npython3 scripts/swarm_janitor.py --clean --no-archive\n\n# Full report\npython3 scripts/swarm_janitor.py --report --output json"
      },
      {
        "title": "Emergency Cleanup",
        "body": "# Aggressive cleanup with 1-day retention\npython3 scripts/swarm_janitor.py --clean --retention-days 1 --force"
      },
      {
        "title": "Configuration",
        "body": "See references/config.yaml for:\n\nRetention policies\nArchive destinations\nSafety thresholds\nLogging options"
      },
      {
        "title": "How It Works",
        "body": "Discovery: Scans ~/.openclaw/agents/main/sessions/\nAnalysis: Determines session age, activity status, size\nClassification: Identifies orphaned vs active sessions\nArchival: Saves transcripts to SuperMemory (if enabled)\nCleanup: Safely removes orphaned session files\nReporting: Generates summary of actions taken"
      },
      {
        "title": "Safety Mechanisms",
        "body": "CheckDescriptionProcess CheckVerifies no active process owns the sessionAge VerificationOnly processes sessions older than thresholdSize LimitsWarns on unusually large deletionsDry-Run DefaultPreview mode is default — explicit action requiredBackup FirstArchives to SuperMemory before any deletion"
      },
      {
        "title": "Troubleshooting",
        "body": "Q: It says \"permission denied\"\nA: Ensure you have write access to the sessions directory\n\nQ: Sessions not being detected\nA: Check the path in config.yaml matches your OpenClaw installation\n\nQ: SuperMemory archive failing\nA: Verify SuperMemory skill is configured with valid API key"
      },
      {
        "title": "Enterprise Features",
        "body": "Audit Logging: All actions logged with timestamps\nConfigurable Policies: YAML-based configuration\nMetrics Export: JSON/CSV output for monitoring\nDry-Run Mode: Test changes before applying\nRetention Policies: Age-based and count-based rules"
      },
      {
        "title": "License",
        "body": "MIT - Created by OpenClawdad (Redclay) for the OpenClaw community."
      }
    ],
    "body": "Swarm Janitor\n\nEnterprise-grade cleanup tool for OpenClaw subagent management.\n\nWhat It Does\n\nAutomatically identifies and cleans up orphaned subagent sessions while preserving important work through SuperMemory archival.\n\nCore Functions\nScan: Analyze session directory for orphaned/abandoned subagents\nArchive: Save transcripts to SuperMemory before deletion\nClean: Safely remove orphaned sessions freeing disk space\nReport: Generate detailed cleanup reports\nSafety First\n\nThis skill implements multiple safety layers:\n\n✅ Never deletes active sessions — checks process status\n✅ Dry-run mode — preview changes before executing\n✅ SuperMemory backup — transcripts archived before deletion\n✅ Configurable retention — customize age thresholds\n✅ Detailed logging — full audit trail of all actions\nQuick Start\n# Preview what would be cleaned (dry-run)\npython3 scripts/swarm_janitor.py --dry-run\n\n# Archive old sessions to SuperMemory, then clean\npython3 scripts/swarm_janitor.py --archive --clean\n\n# Custom retention (7 days instead of default 3)\npython3 scripts/swarm_janitor.py --retention-days 7 --clean\n\nInstallation\n\nCopy this skill to your OpenClaw workspace:\n\ncp -r skills/swarm-janitor ~/.openclaw/workspace/skills/\n\n\nConfigure retention policy (optional):\n\n# Edit config to customize\nnano references/config.yaml\n\n\nRun first scan:\n\npython3 ~/.openclaw/workspace/skills/swarm-janitor/scripts/swarm_janitor.py --dry-run\n\nUsage Patterns\nDaily Maintenance (Cron)\n# Run daily at 3 AM, archive sessions older than 3 days\n0 3 * * * python3 ~/.openclaw/workspace/skills/swarm-janitor/scripts/swarm_janitor.py --archive --clean --retention-days 3 >> /var/log/swarm-janitor.log 2>&1\n\nManual Cleanup\n# See what would be deleted\npython3 scripts/swarm_janitor.py --dry-run --verbose\n\n# Archive transcripts to SuperMemory\npython3 scripts/swarm_janitor.py --archive\n\n# Clean without archiving (not recommended)\npython3 scripts/swarm_janitor.py --clean --no-archive\n\n# Full report\npython3 scripts/swarm_janitor.py --report --output json\n\nEmergency Cleanup\n# Aggressive cleanup with 1-day retention\npython3 scripts/swarm_janitor.py --clean --retention-days 1 --force\n\nConfiguration\n\nSee references/config.yaml for:\n\nRetention policies\nArchive destinations\nSafety thresholds\nLogging options\nHow It Works\nDiscovery: Scans ~/.openclaw/agents/main/sessions/\nAnalysis: Determines session age, activity status, size\nClassification: Identifies orphaned vs active sessions\nArchival: Saves transcripts to SuperMemory (if enabled)\nCleanup: Safely removes orphaned session files\nReporting: Generates summary of actions taken\nSafety Mechanisms\nCheck\tDescription\nProcess Check\tVerifies no active process owns the session\nAge Verification\tOnly processes sessions older than threshold\nSize Limits\tWarns on unusually large deletions\nDry-Run Default\tPreview mode is default — explicit action required\nBackup First\tArchives to SuperMemory before any deletion\nTroubleshooting\n\nQ: It says \"permission denied\" A: Ensure you have write access to the sessions directory\n\nQ: Sessions not being detected A: Check the path in config.yaml matches your OpenClaw installation\n\nQ: SuperMemory archive failing A: Verify SuperMemory skill is configured with valid API key\n\nEnterprise Features\nAudit Logging: All actions logged with timestamps\nConfigurable Policies: YAML-based configuration\nMetrics Export: JSON/CSV output for monitoring\nDry-Run Mode: Test changes before applying\nRetention Policies: Age-based and count-based rules\nLicense\n\nMIT - Created by OpenClawdad (Redclay) for the OpenClaw community."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/LvcidPsyche/swarm-janitor",
    "publisherUrl": "https://clawhub.ai/LvcidPsyche/swarm-janitor",
    "owner": "LvcidPsyche",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/swarm-janitor",
    "downloadUrl": "https://openagent3.xyz/downloads/swarm-janitor",
    "agentUrl": "https://openagent3.xyz/skills/swarm-janitor/agent",
    "manifestUrl": "https://openagent3.xyz/skills/swarm-janitor/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/swarm-janitor/agent.md"
  }
}