Initial commit: add all skills
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
67
command-help-zh-skill/SKILL.md
Normal file
67
command-help-zh-skill/SKILL.md
Normal file
@@ -0,0 +1,67 @@
|
||||
---
|
||||
name: command-help-zh-skill
|
||||
description: |
|
||||
为任意 CLI 命令生成一个独立的 **Bash 可执行脚本**(`<command>-help`),
|
||||
运行该脚本时会调用原始命令的 --help,将说明文字翻译成中文并用 ANSI 黄色高亮,
|
||||
命令名/选项/参数保持原色,脚本可直接放入 PATH 供日常终端使用。
|
||||
|
||||
**触发条件(满足任一即可)**:
|
||||
- 用户明确提到"bash 脚本"、"help 脚本"、"中文 help"、"中文高亮帮助"
|
||||
- 用户想要一个可放入 PATH、在终端直接运行的脚本
|
||||
- 用户说"帮我翻译 X 的 --help"但没有要求保存为 .md 文档
|
||||
- 用户说"帮我写一个 X 的中文 help 脚本 / 帮助脚本"
|
||||
|
||||
典型触发示例:
|
||||
- "帮我写一个 git 的中文 help 脚本"
|
||||
- "给 docker 做一个终端里用的中文帮助脚本"
|
||||
- "翻译 kubectl --help 输出,高亮说明部分"
|
||||
- "生成一个 tea-help bash 脚本,说明用中文显示"
|
||||
|
||||
**不触发本 skill 的情况**(交给 cli-docs 处理):
|
||||
- 用户明确说要生成 .md 文档 / markdown 文件
|
||||
- 用户想要存档或分享的完整命令参考文档
|
||||
---
|
||||
|
||||
# 命令帮助中文高亮
|
||||
|
||||
## 适用场景
|
||||
|
||||
用户要把任意命令的 `--help` / `-h` 帮助页做成中文版本,并且要求:
|
||||
|
||||
- 只高亮“介绍 / 描述”文字
|
||||
- 命令名、参数名、选项名保持普通颜色
|
||||
- 脚本必须是单文件 `bash`
|
||||
- 不能依赖复杂工具链,优先只用 `printf`、`case`、`cat`
|
||||
|
||||
## 处理流程
|
||||
|
||||
1. 先确认目标命令名,例如 `codex`、`git`、`tea`、`gh`,或由用户提供 `--help` 输出。
|
||||
2. 如果没有原始帮助内容,就先运行 `<command> --help` 获取输出。
|
||||
3. 翻译成自然、简洁的中文。
|
||||
4. 保留原始结构:
|
||||
- 标题
|
||||
- 简介
|
||||
- 用法
|
||||
- 命令
|
||||
- 参数
|
||||
- 选项
|
||||
5. 输出时只让说明文字使用 ANSI 黄色。
|
||||
- 例如 `\033[1;33m`
|
||||
- 结束后恢复默认颜色
|
||||
6. 命令名、参数、选项、括号内容保持普通颜色,不要整行染色。
|
||||
7. 生成可直接放到全局 PATH 的脚本,默认命名为 `<command>-help`;如果用户要求或命名冲突,再用 `<command>-help-zh`。
|
||||
|
||||
## 实现要求
|
||||
|
||||
- 必须是独立脚本,不能依赖仓库内外的其他文件。
|
||||
- 脚本开头应固定目标命令名,执行时再调用原始命令的 `--help`。
|
||||
- 推荐使用 `printf` 逐行输出,避免把整段文本一起染色。
|
||||
- 如果需要分隔“左侧标签”和“右侧说明”,先打印标签,再单独打印黄色说明。
|
||||
- 保持输出整洁,避免多余前导空格。
|
||||
|
||||
## 输出标准
|
||||
|
||||
- 中文表达自然,优先清晰准确。
|
||||
- 说明部分高亮黄色。
|
||||
- 可以直接复制到 `/usr/local/bin/` 之类的位置使用。
|
||||
- 如果用户指定了固定命令名,按用户要求命名。
|
||||
4
command-help-zh-skill/agents/openai.yaml
Normal file
4
command-help-zh-skill/agents/openai.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
interface:
|
||||
display_name: "Command Help Chinese Highlight"
|
||||
short_description: "Translate any CLI help text into Chinese with yellow-highlighted descriptions only"
|
||||
default_prompt: "Create a standalone no-dependency Bash help wrapper for the specified command. Translate its help text into Chinese, keep command names and arguments uncolored, and highlight only descriptions in yellow."
|
||||
Reference in New Issue
Block a user