← 返回 Skills 市场
charlie-morrison

git-repo-cleaner

作者 charlie-morrison · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
99
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install git-repo-cleaner
功能描述
Audit and clean up Git repositories. Find stale/merged branches, large files in history, orphaned tags, repo bloat, and generate cleanup scripts. Use when as...
使用说明 (SKILL.md)

Git Repo Cleaner

Audit Git repositories for bloat, stale branches, and maintenance issues. Generate safe cleanup scripts.

Quick Audit

python3 scripts/audit_repo.py /path/to/repo

Specific Checks

# Stale branches only
python3 scripts/audit_repo.py /path/to/repo --check branches

# Large files in history
python3 scripts/audit_repo.py /path/to/repo --check large-files

# Full audit
python3 scripts/audit_repo.py /path/to/repo --check all

Output Formats

python3 scripts/audit_repo.py /path/to/repo --format text|json|markdown

Checks Performed

1. Stale Branches

  • Branches not updated in >30 days (configurable with --stale-days)
  • Branches already merged into main/master
  • Branches with no unique commits
  • Remote tracking branches with deleted remotes

2. Large Files

  • Files >1MB in current tree (configurable with --min-size)
  • Large blobs in git history (top 20)
  • Binary files that shouldn't be tracked

3. Repo Stats

  • Total repo size (.git directory)
  • Pack file stats
  • Object count and size
  • Unreachable objects

4. Maintenance

  • Missing .gitignore patterns (node_modules, pycache, .env, etc.)
  • Unoptimized packfiles
  • Stale reflog entries

Cleanup Script Generation

Use --fix to generate (not execute) cleanup scripts:

python3 scripts/audit_repo.py /path/to/repo --fix
# Outputs cleanup.sh with safe delete commands

The generated script uses git branch -d (safe delete, refuses if not merged) by default. Use --force-delete to generate git branch -D commands instead.

Workflow

  1. Run audit on repo
  2. Review findings
  3. Generate cleanup script if needed
  4. Review script before executing
  5. Execute cleanup
安全使用建议
This skill appears to do what it says: audit a local Git repo and generate safe cleanup scripts. Before installing or running: (1) review the full scripts/audit_repo.py file (the provided listing was truncated here) to confirm there are no unexpected network calls or destructive commands; (2) run audits on a clone or non-critical copy of repositories; (3) always inspect cleanup.sh before executing, and avoid using --force-delete unless you have backups and understand the consequences; (4) ensure the machine has git and Python3 and run the tool with an account that has only the necessary filesystem access. If you want higher assurance, ask the author for the full untruncated source or run the script in a sandboxed environment first.
功能分析
Type: OpenClaw Skill Name: git-repo-cleaner Version: 1.0.0 The git-repo-cleaner skill is a legitimate utility for auditing and maintaining Git repositories. The primary logic in scripts/audit_repo.py uses the Git CLI via subprocess.run (without shell=True) to perform local analysis of branches, file sizes, and repository metadata. It does not exhibit any signs of data exfiltration, network activity, or malicious execution, and the SKILL.md instructions are consistent with the tool's stated purpose of repository maintenance.
能力评估
Purpose & Capability
Name, description, SKILL.md, STATUS.md, and the included Python script all describe repository auditing (stale/merged branches, large files, stats) and script generation. The declared requirements (none) and use of the git CLI are proportionate to the stated purpose.
Instruction Scope
SKILL.md instructs the agent to run the included script against a local repository path and to review generated scripts before executing. The instructions reference only repo paths and git operations; they do not ask the agent to read arbitrary unrelated files or transmit data externally.
Install Mechanism
No install spec — instruction-only with a bundled Python script. This is low-risk and consistent with a CLI tool that requires only the git binary and Python runtime.
Credentials
The skill requests no environment variables, no credentials, and no config paths. The operations (reading a repo directory and invoking git) align with the task and do not require elevated secrets or external service tokens.
Persistence & Privilege
always is false and the skill does not request persistent system-wide privileges. It generates cleanup scripts but explicitly documents that --fix produces scripts (does not execute by default). No evidence of the skill modifying other skills or system configs.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install git-repo-cleaner
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /git-repo-cleaner 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release
元数据
Slug git-repo-cleaner
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

git-repo-cleaner 是什么?

Audit and clean up Git repositories. Find stale/merged branches, large files in history, orphaned tags, repo bloat, and generate cleanup scripts. Use when as... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 99 次。

如何安装 git-repo-cleaner?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install git-repo-cleaner」即可一键安装,无需额外配置。

git-repo-cleaner 是免费的吗?

是的,git-repo-cleaner 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

git-repo-cleaner 支持哪些平台?

git-repo-cleaner 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 git-repo-cleaner?

由 charlie-morrison(@charlie-morrison)开发并维护,当前版本 v1.0.0。

💬 留言讨论