entropy-manager

Entropy scanner for codebases — detect disorder and suggest cleanup actions

33 stars

Best use case

entropy-manager is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Entropy scanner for codebases — detect disorder and suggest cleanup actions

Teams using entropy-manager should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/entropy-manager/SKILL.md --create-dirs "https://raw.githubusercontent.com/aAAaqwq/AGI-Super-Team/main/skills/entropy-manager/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/entropy-manager/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How entropy-manager Compares

Feature / Agententropy-managerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Entropy scanner for codebases — detect disorder and suggest cleanup actions

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 熵管理 Skill (Entropy Manager)

> **核心信念**:AI 团队每行代码都在增加系统的混乱度。不主动减熵,系统会自然腐败。
> 灵感来源:热力学第二定律 × 软件工程 hygiene × Daniel "秩序规则" 宪章

## 触发条件
- 手动触发:`熵扫描` / `entropy scan` / `减熵` / `清理`
- 定期触发:建议每周一次 cron(`entropy-weekly-scan`)
- 重大变更后:项目上线、大规模重构后

## 熵的 6 大分类

| # | 类别 | 代号 | 说明 | 检测方式 |
|---|------|------|------|----------|
| 1 | **文档熵** | `DOC` | 过时文档、失效链接、空 TODO、错误日期 | 日期检查、TODO 统计、断链检测 |
| 2 | **命名熵** | `NAME` | 非 kebab-case/snake_case 文件、命名不一致 | 文件名模式匹配 |
| 3 | **代码熵** | `CODE` | 死代码、注释掉的块、未使用的 import、console.log 遗留 | AST/grep 扫描 |
| 4 | **配置熵** | `CONF` | 过时配置、未使用的 env var、孤立的 agent 配置 | 配置文件交叉验证 |
| 5 | **文件熵** | `FILE` | 错位文件、tmp 残留、重复文件、空 .gitkeep | 目录结构验证 |
| 6 | **依赖熵** | `DEP` | 未使用依赖、过时版本、安全漏洞 | package.json/requirements.txt 扫描 |

## 严重度分级

| 级别 | 定义 | 示例 | 处理时限 |
|------|------|------|----------|
| 🔴 **Critical** | 安全/功能影响 | 硬编码密钥、破损的入口文件 | 立即 |
| 🟡 **Warning** | 维护性影响 | 死代码>50行、过时 TODO>10个 | 本周 |
| 🟢 **Info** | 美观/一致性 | 命名不统一、空文件 | 下次顺手修 |

## 执行流程

### Phase 1: 扫描诊断
```bash
bash ~/clawd/skills/entropy-manager/scripts/entropy-scan.sh [target_dir]
```
输出:`~/clawd/tmp/entropy-report-YYYY-MM-DD.md`

### Phase 2: 报告生成
扫描结果汇总为:
- 总熵值评分(0-100,100=完美)
- 各分类得分
- Top 10 高熵文件
- 自动可修复项 vs 需人工确认项

### Phase 3: 自动修复(需确认)
对 🟢 级别问题自动修复(需 CEO 确认后执行):
- 重命名文件到规范格式
- 删除空 .gitkeep(目录有内容时)
- 清理 tmp/ 超过 7 天的文件
- 移除注释代码块(>10行连续注释代码)

### Phase 4: 记录追踪
- 每次扫描结果追加到 `~/clawd/tmp/entropy-history.jsonl`
- 趋势:熵值是否在下降?
- 对比上次:新增了多少熵?

## 报告格式

```markdown
# 熵扫描报告 — YYYY-MM-DD

## 📊 总评分: 72/100 (较上次 +5)

| 分类 | 得分 | 问题数 | Critical | Warning | Info |
|------|------|--------|----------|---------|------|
| DOC  | 65   | 12     | 0        | 4       | 8    |
| NAME | 80   | 5      | 0        | 1       | 4    |
| CODE | 70   | 8      | 1        | 3       | 4    |
| CONF | 85   | 3      | 0        | 1       | 2    |
| FILE | 60   | 10     | 0        | 5       | 5    |
| DEP  | 75   | 4      | 0        | 2       | 2    |

## 🔴 Critical (立即处理)
1. [CODE] ~/clawd/projects/xxx/config.py:5 — 硬编码 API key

## 🟡 Warning (本周处理)
1. [DOC] ~/clawd/MEMORY.md — 3 个 TODO 超过 30 天未更新
2. [FILE] ~/clawd/tmp/ — 15 个文件超过 7 天

## 🟢 Info (下次顺手修)
1. [NAME] ~/clawd/scripts/api_health_check.py → 建议 api-health-check.py

## 📈 趋势
- 上次扫描: 67/100 (YYYY-MM-DD)
- 变化: +5
- 熵增最快: FILE (+8 问题)
- 熵减最快: CODE (-3 问题)
```

## 扫描范围

### 默认范围
```
~/clawd/              # 工作主目录(排除 .git, node_modules, venv)
~/.openclaw/agents/   # Agent 配置
~/.openclaw/skills/   # 全局 Skills
```

### 项目级范围
```bash
entropy-scan.sh ~/clawd/projects/blue-blood-elite/
```

## 与宪章的关系

**秩序规则第 8 条 — 熵管理秩序**:
> 系统自然趋向混乱。AI 团队每行代码都在增加熵值。不主动减熵,等于慢性自杀。
> 每周至少一次全系统熵扫描,Critical 级别问题不过夜。

## 依赖
- bash 4+
- Python 3.11+(用于复杂分析脚本)
- git(用于历史对比)

## 文件结构
```
entropy-manager/
├── SKILL.md              # 本文件
├── scripts/
│   ├── entropy-scan.sh   # 主扫描脚本
│   └── entropy-fix.sh    # 自动修复脚本(需确认)
└── README.md
```

Related Skills

workspace-directory-manager

33
from aAAaqwq/AGI-Super-Team

Workspace directory manager — maintain cleanliness of ~/.openclaw/ and ~/clawd/

ssh-manager

33
from aAAaqwq/AGI-Super-Team

专业 SSH 连接管理工具。处理 Tailscale SSH、主机密钥、代理绕过、远程命令执行等操作。

provider-key-manager

33
from aAAaqwq/AGI-Super-Team

Provider key manager — rotate and sync API keys across multi-agent workspaces

product-manager-skills

33
from aAAaqwq/AGI-Super-Team

> 产品经理技能集——PRD、用户故事、竞品分析、路线图等产品方法论工具

portfolio-manager

33
from aAAaqwq/AGI-Super-Team

Comprehensive portfolio analysis using Alpaca MCP Server integration to fetch holdings and positions, then analyze asset allocation, risk metrics, individual stock positions, diversification, and generate rebalancing recommendations. Use when user requests portfolio review, position analysis, risk assessment, performance evaluation, or rebalancing suggestions for their brokerage account.

permission-manager

33
from aAAaqwq/AGI-Super-Team

管理Claude Code的全局工具权限配置,自动将MCP命令或其他工具添加到allowedTools中,避免每次使用时都需要手动批准。工作流程:确认用户需要添加的命令 -> 确认添加级别(默认全局~/.claude.json) -> 执行添加 -> 验证并提醒重启。

model-provider-manager

33
from aAAaqwq/AGI-Super-Team

Unified LLM provider and model configuration, health monitoring, and key management

mcp-manager

33
from aAAaqwq/AGI-Super-Team

MCP 服务器智能管理助手。自动检测 MCP 可用性、智能开关、功能问答,提供人性化的 MCP 管理体验。

email-manager

33
from aAAaqwq/AGI-Super-Team

多邮箱统一管理与智能助手。支持 Gmail、QQ邮箱等 IMAP 邮箱,定时查看邮件,AI 生成摘要和回复草稿,发送前需用户确认。

customer-success-manager

33
from aAAaqwq/AGI-Super-Team

Monitors customer health, predicts churn risk, and identifies expansion opportunities using weighted scoring models for SaaS customer success

cron-manager

33
from aAAaqwq/AGI-Super-Team

创建、监控、诊断和修复 OpenClaw cron 任务,支持自然语言时间与常见故障排查。

context-manager

33
from aAAaqwq/AGI-Super-Team

AI-powered context management for OpenClaw sessions