← 返回
未分类 中文

workspace-health-monitor

Performs comprehensive workspace health checks including disk usage, file counts, skill health, large files, and empty directories with actionable recommenda...
执行全面的工作区健康检查,包括磁盘使用、文件数量、技能健康状态、大文件和空目录,并提供可行的建议。
jpengcheng523-netizen jpengcheng523-netizen 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 325
下载
💾 0
安装
1
版本
#latest

概述

Workspace Health Monitor

Performs comprehensive workspace health checks and generates actionable recommendations.

Usage

const monitor = require('./skills/workspace-health-monitor');

// Perform health check
const report = monitor.check('/path/to/workspace');

// Generate markdown report
console.log(monitor.generateReport(report));

API

check(workspacePath, options)

Performs comprehensive workspace health check.

Options:

  • largeFileThresholdMB (number): Size threshold for large files. Default: 10
  • includeEmptyDirs (boolean): Check for empty directories. Default: true
  • includeLargeFiles (boolean): Check for large files. Default: true

Returns:

{
  healthScore: number,      // 0-100
  status: 'healthy' | 'warning' | 'critical',
  metrics: {
    timestamp: string,
    workspace: string,
    diskUsage: {
      totalSize: number,
      totalSizeMB: number,
      totalSizeFormatted: string
    },
    files: {
      total: number,
      directories: number
    },
    skills: {
      total: number,
      healthy: number,
      broken: number,
      missingIndex: string[],
      missingSkillMd: string[],
      missingPackage: string[]
    },
    largeFiles: [{ path, size, sizeFormatted }],
    emptyDirs: string[],
    fileTypes: { [extension]: count }
  },
  recommendations: [{
    severity: 'high' | 'medium' | 'low' | 'info',
    category: string,
    message: string,
    details?: string,
    action: string
  }]
}

checkSkillHealth(skillsDir)

Checks health of all skills in a directory.

findLargeFiles(workspacePath, thresholdMB)

Finds files larger than the threshold.

findEmptyDirectories(workspacePath)

Finds empty directories in the workspace.

generateReport(report)

Generates a markdown-formatted health report.

formatBytes(bytes)

Formats bytes to human-readable size.

Example Output

# Workspace Health Report

**Status:** ✅ HEALTHY (Score: 92/100)
**Timestamp:** 2026-03-27T04:30:00.000Z

## Disk Usage

- **Total Size:** 256.78 MB
- **Files:** 3,456
- **Directories:** 234

## Skills Health

- **Total Skills:** 150
- **Healthy:** 145
- **Broken:** 5
- **Missing index.js:** skill-a, skill-b, skill-c

## Large Files (>10MB)

- `logs/evolution.log` (45.23 MB)
- `data/cache.json` (23.45 MB)

## Recommendations

🔴 **skills**: 5 broken skill(s) found
  - Missing index.js: skill-a, skill-b, skill-c
  - Action: Fix or remove broken skills

🟡 **storage**: 2 large file(s) found (>10MB)
  - logs/evolution.log (45.23 MB), data/cache.json (23.45 MB)
  - Action: Consider archiving or removing large files

Health Score Calculation

The health score (0-100) is calculated based on:

  • Broken skills: -30 points max for broken skill ratio
  • Large files: -10 points for >10 large files
  • Empty directories: -10 points for >20 empty directories
  • Workspace size: -10 points for >1GB total size

Status Levels

  • Healthy (80-100): Workspace is in good condition
  • Warning (60-79): Some issues need attention
  • Critical (0-59): Immediate action required

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 08:45 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Self-Improving Agent (Proactive Self-Reflection)

jpengcheng523-netizen
自我反思、自我批评、自主学习与自组织记忆。智能体能评估自身工作、发现错误并实现永久性改进。
★ 0 📥 1,128
it-ops-security

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 90 📥 31,084
it-ops-security

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装后可防止您和您的用户受到提示注入、数据泄露及恶意行为的侵害。
★ 116 📥 31,026