Token导航 LogoToken导航TokenDH.com
开发需要联网clawhub未标认证来源可访问clear审计通过

code-url-cleaner代码 url 清理器

Agent Skill

code-url-cleaner 用于补充开发相关能力,适合在 OpenClaw 中需要让 Agent 承接开发相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

8,514

周安装

362

GitHub Stars

公开资料未说明

下载量

2,983
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-url-cleaner(代码 url 清理器)
来源仓库:https://github.com/ra1nzzz/code-url-cleaner
安装命令:
openclaw skills install code-url-cleaner
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install code-url-cleaner

简介

自动清理代码片段、URL 和文件路径中的多余空格。

  • 适用于格式化输出内容以提升代码整洁度。
  • 可避免因格式问题导致的解析错误。适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。
  • 安装前请确认权限范围、维护状态及是否触发文件读写或命令执行。
  • code-url-cleaner 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Code URL Cleaner Skill | 代码 URL 清理器技能

Description | 描述

English: Automatically clean extra spaces in code and URLs, preserving necessary spaces (text, indentation). Hook auto-registers on skill load - no manual activation needed!

中文: 自动清理代码和 URL 中的多余空格,保留必要的空格(文本、缩进)。Hook 在技能加载时自动注册 - 无需手动激活!


✅ Auto-Activation | 自动激活

English: The hook automatically registers when the skill is loaded by OpenClaw. No manual commands needed!

中文: Hook 在技能被 OpenClaw 加载时自动注册。无需手动命令!

How It Works | 工作原理

English: When you install this skill, the hook automatically activates in your OpenClaw session. All agent output is cleaned immediately.

中文: 安装此技能后,Hook 在 OpenClaw 会话中自动激活。所有 agent 输出立即被清理。

Optional: Manual Activation | 可选:手动激活

English: If auto-activation fails, you can manually activate:

中文: 如果自动激活失败,可以手动激活:

python3 -c "from cleaner import register_auto_hook; register_auto_hook()"

Problem | 问题

English: When generating code and URLs, extra spaces are often inserted in wrong positions, causing execution failures.

中文: 在生成代码和 URL 时,经常会在错误的位置插入多余空格,导致执行失败。

Examples | 示例:

❌ https://github.com/Johnserf-Seed /TikTokDownload.git
✅ https://github.com/Johnserf-Seed/TikTokDownload.git

❌ cd /tmp && git clone https://github.com/Johnserf-Seed /TikTokDownload.git
✅ cd /tmp && git clone https://github.com/Johnserf-Seed/TikTokDownload.git

❌ pip3 install -r requirements.txt  --break-system-packages
✅ pip3 install -r requirements.txt --break-system-packages

Installation | 安装

npx clawhub@latest install code-url-cleaner

That's It! | 就这样!

English: No further setup needed. The hook activates automatically.

中文: 无需进一步配置。Hook 自动激活。


Usage | 使用方法

Auto Mode (Default) | 自动模式(默认)

English: Once installed, all agent output is automatically cleaned. No manual calls needed.

中文: 安装后,所有 agent 输出自动清理,无需手动调用。

# Agent output is automatically cleaned | Agent 输出自动清理
print("https://github.com/Johnserf-Seed /TikTokDownload.git")
# Output: https://github.com/Johnserf-Seed/TikTokDownload.git

Manual Mode | 手动模式

from cleaner import clean_text

text = "https://github.com/Johnserf-Seed /TikTokDownload.git"
cleaned = clean_text(text)
print(cleaned)
# Output: https://github.com/Johnserf-Seed/TikTokDownload.git

Hook Implementation | Hook 实现

How It Works | 工作原理

English: The skill registers an OpenClaw lifecycle hook that intercepts agent output and cleans it before display. This happens automatically on skill load.

中文: 技能注册一个 OpenClaw 生命周期钩子,拦截 agent 输出并在显示前清理。这在技能加载时自动发生。

Code | 代码

# cleaner.py - Auto-executed on import | 导入时自动执行
def _auto_register_hook():
    from openclaw import get_current_agent
    agent = get_current_agent()
    
    def clean_output(event, ctx):
        output = event.get('output', '')
        return {'output': clean_text(output)}
    
    agent.on('before_output', clean_output)
    return True

# Auto-register on module load | 模块加载时自动注册
_auto_register_hook()

Rules | 规则

Cleaned | 清理的

  1. URL Internal Spaces | URL 内部的空格
  2. Multiple Consecutive Spaces in Commands | 命令中的多个连续空格
  3. Path Spaces | 路径中的空格

Preserved | 保留的

  1. Natural Language Text | 自然语言文本
  2. Single Space Between Arguments | 命令参数之间的单个空格
  3. Code Indentation | 代码缩进

Testing | 测试

cd /path/to/code-url-cleaner
python3 cleaner.py --test

Expected Output | 期望输出:

============================================================
Code/URL Space Cleaner 测试
============================================================

✅ URL 中间有空格
✅ 命令多个空格
✅ 路径空格

============================================================
测试结果:4 通过,0 失败
============================================================

============================================================
Hook 功能测试
============================================================
Hook 状态:✅ 已激活(自动)
============================================================

Files | 文件

File文件Description描述
cleaner.pycleaner.pyCore cleaning logic + Auto-Hook核心清理逻辑 + 自动 Hook
SKILL.mdSKILL.mdThis documentation本文档
README.mdREADME.mdUser guide用户指南
_meta.json_meta.jsonPackage metadata包元数据

Version History | 版本历史

v1.2.0 (2026-03-08)

  • Auto-hook activation | 自动 Hook 激活
  • ✅ No manual commands needed | 无需手动命令
  • ✅ Hook registers on module load | Hook 在模块加载时注册
  • ✅ Backward compatible | 向后兼容

v1.1.1 (2026-03-08)

  • ✅ Fix hook activation logic | 修复 Hook 激活逻辑
  • ✅ Auto-detect OpenClaw environment | 自动检测 OpenClaw 环境

v1.1.0 (2026-03-08)

  • ✅ Auto-hook feature | 自动 Hook 功能
  • ✅ Hook activation command | Hook 激活命令
  • ✅ Hook status check | Hook 状态检查
  • ✅ Bilingual documentation | 双语文档

v1.0.0 (2026-03-08)

  • ✅ Initial release | 初始发布
  • ✅ URL space cleaning | URL 空格清理
  • ✅ Command space cleaning | 命令空格清理
  • ✅ Path space cleaning | 路径空格清理
  • ✅ 100% test coverage | 100% 测试覆盖

Requirements | 依赖

  • Python 3.6+
  • OpenClaw 0.1.6+
  • No external dependencies | 无外部依赖

License | 许可证

MIT License | MIT 许可证


Author | 作者

OpenClaw Community | OpenClaw 社区


Links | 链接

  • GitHub: https://github.com/ra1nzzz/code-url-cleaner
  • ClawHub: https://clawhub.ai/skills/code-url-cleaner
  • Issues: https://github.com/ra1nzzz/code-url-cleaner/issues

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

88.32%
按下载量换算2,635

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills