cli-skill-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

CLI Skill Creator

CLI Skill 创建器

Overview

概述

This skill guides the creation of comprehensive skills for command-line interface (CLI) tools. It provides a systematic workflow for introspecting CLI tools through multiple sources (help text, manual pages, GitHub repositories, online research), extracting mental models and command patterns, and organizing findings into effective skill documentation using the skill-creator skill.
本技能可指导你为命令行界面(CLI)工具创建完整的Skill文档。它提供了一套系统化的工作流,可通过多种来源(帮助文本、手册页、GitHub仓库、在线研究)剖析CLI工具,提取核心模型和命令模式,并使用skill-creator技能将研究成果整理为实用的Skill文档。

When to Use This Skill

适用场景

Invoke this skill when users:
  • Ask to create a skill for a CLI tool (e.g., "Create a skill for docker", "Document kubectl")
  • Request comprehensive CLI documentation or guidance
  • Want to understand a CLI tool's mental model and structure
  • Need to organize CLI knowledge for consistent use
  • Ask about documenting command-line tools systematically
当用户有以下需求时,可调用本技能:
  • 要求为某款CLI工具创建Skill(例如:"为docker创建Skill"、"记录kubectl的使用方法")
  • 需要完整的CLI工具文档或使用指南
  • 希望理解CLI工具的核心模型和结构
  • 需要整理CLI相关知识以实现统一使用
  • 询问如何系统化地记录命令行工具

Core Workflow

核心工作流

Creating a CLI skill follows a systematic seven-step process that gathers comprehensive information before organizing it into skill documentation.
创建CLI Skill需遵循一套系统化的七步流程,先收集全面的信息,再将其整理为Skill文档。

Step 1: CLI Identification & Availability Check

步骤1:CLI工具识别与可用性检查

Objectives:
  • Verify CLI tool is installed or accessible
  • Determine tool version and variant
  • Identify documentation sources
  • Assess open-source availability
Actions:
  1. Check installation and version
    bash
    <cli-tool> --version
    which <cli-tool>
  2. Identify tool characteristics
    • Name and official name (if different)
    • Current version
    • Primary purpose/domain
    • Open source or proprietary
  3. Locate documentation sources
    • Official website/documentation
    • GitHub repository (if open source)
    • Man pages availability
    • Community resources
Output: Tool profile including version, purpose, and available documentation sources.
目标:
  • 验证CLI工具已安装或可访问
  • 确定工具版本和变体
  • 识别文档来源
  • 评估开源可用性
操作:
  1. 检查安装情况和版本
    bash
    <cli-tool> --version
    which <cli-tool>
  2. 识别工具特性
    • 工具名称及官方名称(若不同)
    • 当前版本
    • 主要用途/所属领域
    • 开源或专有软件
  3. 查找文档来源
    • 官方网站/文档
    • GitHub仓库(若为开源)
    • 手册页可用性
    • 社区资源
输出: 包含版本、用途及可用文档来源的工具概况。

Step 2: Comprehensive Help Text Introspection

步骤2:全面剖析帮助文本

Objectives:
  • Map command hierarchy and structure
  • Extract all commands, subcommands, and flags
  • Capture examples from help text
  • Identify command patterns (verb-noun, noun-verb, flat)
Reference: Load
references/help-text-patterns.md
for detailed parsing guidance.
Actions:
  1. Extract top-level help
    bash
    <cli-tool> --help
    <cli-tool> -h
    <cli-tool> help
    <cli-tool>  # (no args, if applicable)
  2. Map command hierarchy
    • Identify all subcommands
    • Determine nesting depth
    • Note command organization pattern
  3. Document each command/subcommand
    bash
    # For each discovered command
    <cli-tool> <command> --help
    <cli-tool> <command> <subcommand> --help
  4. Extract key information
    • Command purpose and description
    • Required vs optional arguments
    • Flags and their descriptions
    • Usage examples
    • Default behaviors
  5. Identify patterns
    • Flag naming conventions
    • Argument patterns
    • Output format options
    • Common options across commands
Output: Structured command reference with hierarchy, all commands documented, examples extracted, and patterns identified.
目标:
  • 梳理命令层级和结构
  • 提取所有命令、子命令和参数
  • 捕获帮助文本中的示例
  • 识别命令模式(动词-名词、名词-动词、扁平化)
参考: 加载
references/help-text-patterns.md
获取详细的解析指南。
操作:
  1. 提取顶层帮助信息
    bash
    <cli-tool> --help
    <cli-tool> -h
    <cli-tool> help
    <cli-tool>  # (无参数时,若适用)
  2. 梳理命令层级
    • 列出所有子命令
    • 确定嵌套深度
    • 记录命令组织模式
  3. 记录每个命令/子命令
    bash
    # 针对每个已发现的命令
    <cli-tool> <command> --help
    <cli-tool> <command> <subcommand> --help
  4. 提取关键信息
    • 命令用途和描述
    • 必填与可选参数
    • 参数及其说明
    • 使用示例
    • 默认行为
  5. 识别模式
    • 参数命名规范
    • 参数模式
    • 输出格式选项
    • 跨命令通用选项
输出: 包含命令层级、所有已记录命令、提取的示例及识别出的模式的结构化命令参考文档。

Step 3: GitHub Repository Analysis (if open-source)

步骤3:GitHub仓库分析(若为开源)

Objectives:
  • Understand implementation patterns
  • Find real-world usage examples
  • Identify common user pain points
  • Discover undocumented features or gotchas
Reference: Load
references/help-text-patterns.md
section "GitHub Repository Analysis" for detailed guidance.
Actions:
  1. Clone repository (if accessible and reasonable size)
    bash
    git clone --depth 1 https://github.com/<org>/<repo>
  2. Examine documentation structure
    • README.md - Quick start, core concepts
    • docs/ or doc/ - Detailed documentation
    • examples/ - Usage examples
    • CONTRIBUTING.md - Development patterns
    • man/ - Man page sources
  3. Analyze code structure
    • CLI framework used (Cobra, Click, Commander, Clap, etc.)
    • Command file organization
    • Main entry point
    • Subcommand implementations
  4. Review tests for usage patterns
    • Integration tests show common workflows
    • Unit tests reveal edge cases
    • Test fixtures show example inputs
    • Assertions reveal expected outputs
  5. Mine issues and discussions
    • Search for
      label:question
      - Common user questions
    • Search for
      label:documentation
      - Doc gaps
    • Look for "How do I..." - Workflow questions
    • Find repeated issues - Common pain points
  6. Check shell completions (reveal command structure)
    • completions/ or scripts/ directory
    • Shell completion files show all commands/flags
Output: Implementation insights, real-world usage examples, common pain points, and undocumented behaviors.
目标:
  • 理解实现模式
  • 查找实际使用示例
  • 识别常见用户痛点
  • 发现未文档化的功能或注意事项
参考: 加载
references/help-text-patterns.md
中的“GitHub Repository Analysis”部分获取详细指南。
操作:
  1. 克隆仓库(若可访问且大小合理)
    bash
    git clone --depth 1 https://github.com/<org>/<repo>
  2. 检查文档结构
    • README.md - 快速入门、核心概念
    • docs/ 或 doc/ - 详细文档
    • examples/ - 使用示例
    • CONTRIBUTING.md - 开发模式
    • man/ - 手册页源文件
  3. 分析代码结构
    • 使用的CLI框架(Cobra、Click、Commander、Clap等)
    • 命令文件组织方式
    • 主入口点
    • 子命令实现
  4. 查看测试用例以了解使用模式
    • 集成测试展示常见工作流
    • 单元测试揭示边缘情况
    • 测试夹具展示示例输入
    • 断言揭示预期输出
  5. 挖掘issues和讨论内容
    • 搜索
      label:question
      - 常见用户问题
    • 搜索
      label:documentation
      - 文档缺口
    • 查找“How do I...”类问题 - 工作流相关疑问
    • 发现重复出现的issues - 常见痛点
  6. 检查shell补全功能(可揭示命令结构)
    • completions/ 或 scripts/ 目录
    • shell补全文件包含所有命令/参数
输出: 实现见解、实际使用示例、常见痛点及未文档化的行为。

Step 4: Manual Page Parsing (if available)

步骤4:手册页解析(若可用)

Objectives:
  • Extract comprehensive command documentation
  • Capture formal syntax descriptions
  • Identify related commands
  • Note historical context or design rationale
Reference: Load
references/help-text-patterns.md
section "Manual Page Parsing" for detailed guidance.
Actions:
  1. Check man page availability
    bash
    man <cli-tool>
    man -k <cli-tool>  # Search for related pages
  2. Extract key sections
    • NAME - Command identity
    • SYNOPSIS - Formal syntax
    • DESCRIPTION - Detailed explanation
    • OPTIONS - Comprehensive flag documentation
    • EXAMPLES - Usage examples
    • SEE ALSO - Related commands
    • BUGS - Known issues
  3. Export for analysis
    bash
    # Export to plain text
    man <cli-tool> | col -b > man_<cli-tool>.txt
    
    # Extract specific sections
    man <cli-tool> | grep -A 50 "^OPTIONS"
    man <cli-tool> | grep -A 30 "^EXAMPLES"
  4. Check for subcommand man pages
    bash
    man <cli-tool>-<subcommand>
Output: Formal command documentation, comprehensive option descriptions, and usage examples from man pages.
目标:
  • 提取完整的命令文档
  • 捕获正式语法描述
  • 识别相关命令
  • 记录历史背景或设计理念
参考: 加载
references/help-text-patterns.md
中的“Manual Page Parsing”部分获取详细指南。
操作:
  1. 检查手册页可用性
    bash
    man <cli-tool>
    man -k <cli-tool>  # 搜索相关页面
  2. 提取关键章节
    • NAME - 命令标识
    • SYNOPSIS - 正式语法
    • DESCRIPTION - 详细说明
    • OPTIONS - 完整的参数文档
    • EXAMPLES - 使用示例
    • SEE ALSO - 相关命令
    • BUGS - 已知问题
  3. 导出以便分析
    bash
    # 导出为纯文本
    man <cli-tool> | col -b > man_<cli-tool>.txt
    
    # 提取特定章节
    man <cli-tool> | grep -A 50 "^OPTIONS"
    man <cli-tool> | grep -A 30 "^EXAMPLES"
  4. 检查子命令手册页
    bash
    man <cli-tool>-<subcommand>
输出: 来自手册页的正式命令文档、完整的参数说明及使用示例。

Step 5: Online Research & Best Practices

步骤5:在线研究与最佳实践

Objectives:
  • Discover community best practices
  • Find common workflows and patterns
  • Identify integration points with other tools
  • Learn from tutorials and guides
Actions:
  1. Search for official documentation
    • Official website documentation
    • API documentation (if CLI wraps an API)
    • Architecture guides
    • Best practices guides
  2. Find community resources
    • Blog posts about advanced usage
    • Tutorial sites (Medium, Dev.to, etc.)
    • Video tutorials (YouTube)
    • Conference talks
  3. Check Q&A sites
    • Stack Overflow common questions
    • Reddit discussions
    • GitHub Discussions
    • Tool-specific forums
  4. Identify integration patterns
    • How does it work with Git?
    • CI/CD integration patterns
    • Editor/IDE integrations
    • Companion tools
  5. Look for comparisons
    • "X vs Y" articles (reveals strengths/differences)
    • Migration guides (reveals mental model differences)
    • "Awesome X" lists (reveals ecosystem)
Output: Community best practices, common workflows, integration patterns, and ecosystem understanding.
目标:
  • 发现社区最佳实践
  • 查找常见工作流和模式
  • 识别与其他工具的集成点
  • 从教程和指南中学习
操作:
  1. 搜索官方文档
    • 官方网站文档
    • API文档(若CLI封装了API)
    • 架构指南
    • 最佳实践指南
  2. 查找社区资源
    • 关于高级用法的博客文章
    • 教程网站(Medium、Dev.to等)
    • 视频教程(YouTube)
    • 会议演讲
  3. 查看问答网站
    • Stack Overflow上的常见问题
    • Reddit讨论
    • GitHub Discussions
    • 工具专属论坛
  4. 识别集成模式
    • 如何与Git配合使用?
    • CI/CD集成模式
    • 编辑器/IDE集成
    • 配套工具
  5. 查找对比内容
    • "X vs Y"类文章(可揭示优势/差异)
    • 迁移指南(可揭示核心模型差异)
    • "Awesome X"列表(可揭示生态系统)
输出: 社区最佳实践、常见工作流、集成模式及生态系统认知。

Step 6: Material Organization & Structure Design

步骤6:素材整理与结构设计

Objectives:
  • Synthesize findings into coherent mental model
  • Identify command structure pattern
  • Organize content by user task/workflow
  • Determine skill structure (workflow-based, command-based, etc.)
Reference: Load
references/skill-templates.md
for guidance.
Actions:
  1. Extract core mental model
    • What are the fundamental concepts? (resources, actions, state)
    • How does the tool want users to think?
    • What abstractions does it use?
    • What's the command hierarchy philosophy?
  2. Identify command structure pattern
    • Flat (single-level commands)
    • Noun-Verb (resource-action)
    • Verb-Noun (action-resource)
    • Hybrid (mix of patterns)
  3. Map common workflows
    • What are the 5-10 most common tasks?
    • What's the getting-started workflow?
    • What are the advanced workflows?
    • What operations are risky/destructive?
  4. Organize findings by category
    • Core concepts and terminology
    • Command reference (grouped logically)
    • Workflow patterns (numbered for reference)
    • Configuration and setup
    • Integration patterns
    • Troubleshooting common issues
  5. Choose skill structure (load
    references/skill-templates.md
    )
    • Workflow-based: For sequential, process-oriented tools
    • Command-based: For tools with many discrete operations
    • Hybrid: Combine patterns (most common)
  6. Decide what goes where
    • skill.md: Overview, core concepts, common operations, when to load references
    • references/<tool>_reference.md: Complete command reference, all workflows, detailed examples
    • Additional reference files if needed (e.g., for GraphQL API, specialized features)
Output: Structured content outline organized by user task/workflow, clear mental model summary, and skill structure plan.
目标:
  • 将研究成果整合为连贯的核心模型
  • 识别命令结构模式
  • 按用户任务/工作流组织内容
  • 确定Skill结构(基于工作流、基于命令或混合模式等)
参考: 加载
references/skill-templates.md
获取指南。
操作:
  1. 提取核心模型
    • 基本概念有哪些?(资源、操作、状态)
    • 工具希望用户如何理解它?
    • 它使用了哪些抽象概念?
    • 命令层级设计理念是什么?
  2. 识别命令结构模式
    • 扁平化(单层命令)
    • 名词-动词(资源-操作)
    • 动词-名词(操作-资源)
    • 混合模式(多种模式结合)
  3. 梳理常见工作流
    • 最常见的5-10个任务是什么?
    • 入门工作流是什么?
    • 高级工作流是什么?
    • 哪些操作具有风险/破坏性?
  4. 按类别组织研究成果
    • 核心概念和术语
    • 命令参考(按逻辑分组)
    • 工作流模式(编号以便参考)
    • 配置与设置
    • 集成模式
    • 常见问题排查
  5. 选择Skill结构(加载
    references/skill-templates.md
    • 基于工作流:适用于顺序化、流程导向的工具
    • 基于命令:适用于包含大量独立操作的工具
    • 混合模式:结合多种模式(最常用)
  6. 确定内容分布
    • skill.md:概述、核心概念、常见操作、何时加载参考文档
    • references/<tool>_reference.md:完整命令参考、所有工作流、详细示例
    • 必要时添加其他参考文件(例如:GraphQL API、专用功能)
输出: 按用户任务/工作流组织的结构化内容大纲、清晰的核心模型摘要及Skill结构规划。

Step 7: Invoke skill-creator Skill

步骤7:调用skill-creator技能

Objectives:
  • Generate skill directory structure
  • Create skill.md and reference documentation
  • Package skill for distribution
  • Validate completeness
Actions:
  1. Prepare structured brief for skill-creator
    Organize all gathered material into a comprehensive brief including:
    • CLI Profile
      • Name, version, purpose
      • Command structure pattern
      • Open source status and GitHub URL
    • Core Mental Model
      • Fundamental concepts (2-5 key concepts)
      • How users should think about the tool
      • Key terminology and definitions
    • Command Reference Material
      • Organized by category/domain
      • All commands with syntax and examples
      • Common flags and options
      • Command relationships
    • Workflow Patterns
      • 5-10 common workflows
      • Step-by-step with commands
      • When to use each pattern
    • Integration Points
      • Other tools it works with
      • CI/CD integration
      • File formats, protocols
    • Configuration
      • Config file locations
      • Key settings
      • Environment variables
    • Troubleshooting
      • Common issues and solutions
      • Diagnostic commands
      • Error patterns
  2. Invoke skill-creator skill
    Use the Skill tool to invoke skill-creator:
    Skill: skill-creator
    
    Prompt: Create a skill for <cli-tool-name> with the following structure and content:
    
    [Provide the complete structured brief from step 1]
    
    Structure the skill using [workflow-based/command-based/hybrid] approach.
    
    The skill.md should include:
    - Overview and when to use this skill
    - Core concepts: [list key concepts]
    - Common operations organized by [category structure]
    - Reference to comprehensive command reference in references/
    
    Create references/<tool>_reference.md with:
    - Complete mental model explanation
    - Full command reference organized by [organization scheme]
    - Workflow patterns 1-N
    - Configuration, integration, and troubleshooting sections
    
    Follow the patterns from existing CLI skills like gh, graphite, and erk.
  3. Review generated skill
    • Check skill.md structure and clarity
    • Verify reference documentation completeness
    • Ensure examples are accurate
    • Test commands if possible
  4. Iterate if needed
    • Refine unclear sections
    • Add missing examples
    • Improve organization
    • Fill gaps in documentation
  5. Package skill (if ready for distribution)
    bash
    python scripts/package_skill.py .claude/skills/<cli-tool-name>
Output: Complete, packaged skill ready for use and distribution.
目标:
  • 生成Skill目录结构
  • 创建skill.md和参考文档
  • 打包Skill以便分发
  • 验证内容完整性
操作:
  1. 为skill-creator准备结构化 brief
    将所有收集到的素材整理为一份完整的brief,包括:
    • CLI概况
      • 名称、版本、用途
      • 命令结构模式
      • 开源状态及GitHub地址
    • 核心模型
      • 基本概念(2-5个关键概念)
      • 用户应如何理解该工具
      • 关键术语及定义
    • 命令参考素材
      • 按类别/领域组织
      • 所有命令的语法和示例
      • 常见参数和选项
      • 命令关系
    • 工作流模式
      • 5-10个常见工作流
      • 带命令的分步说明
      • 每个模式的适用场景
    • 集成点
      • 可配合使用的其他工具
      • CI/CD集成
      • 文件格式、协议
    • 配置
      • 配置文件位置
      • 关键设置
      • 环境变量
    • 故障排查
      • 常见问题及解决方案
      • 诊断命令
      • 错误模式
  2. 调用skill-creator技能
    使用Skill工具调用skill-creator:
    Skill: skill-creator
    
    Prompt: 为<cli-tool-name>创建一个Skill,结构和内容如下:
    
    [提供步骤1中完整的结构化brief]
    
    使用[基于工作流/基于命令/混合]方式构建Skill结构。
    
    skill.md应包含:
    - 概述及适用场景
    - 核心概念:[列出关键概念]
    - 按[类别结构]组织的常见操作
    - 指向references/中完整命令参考的链接
    
    创建references/<tool>_reference.md,包含:
    - 完整的核心模型说明
    - 按[组织方案]组织的完整命令参考
    - 工作流模式1-N
    - 配置、集成及故障排查章节
    
    遵循gh、graphite和erk等现有CLI Skill的模式。
  3. 审核生成的Skill
    • 检查skill.md的结构和清晰度
    • 验证参考文档的完整性
    • 确保示例准确
    • 尽可能测试命令
  4. 必要时进行迭代
    • 优化不清晰的章节
    • 添加缺失的示例
    • 改进组织方式
    • 填补文档缺口
  5. 打包Skill(若准备好分发)
    bash
    python scripts/package_skill.py .claude/skills/<cli-tool-name>
输出: 完整、已打包的Skill,可直接使用和分发。

CLI Introspection Techniques

CLI剖析技巧

Help Text Parsing Strategies

帮助文本解析策略

Progressive help discovery:
  1. Start with top-level help to understand overall structure
  2. Enumerate all subcommands
  3. Get help for each subcommand
  4. Identify nested subcommands
  5. Document all discovered commands
Information extraction:
  • Command syntax: Usage line shows required vs optional
  • Descriptions: What each command/flag does
  • Examples: Copy verbatim from help text
  • Defaults: Note default values for flags
  • Aliases: Note short forms (e.g.,
    -h
    for
    --help
    )
Pattern recognition:
  • Flag naming: Single-letter vs long-form consistency
  • Argument conventions:
    <required>
    vs
    [optional]
  • Subcommand organization: Grouped by domain/resource
  • Output options:
    --json
    ,
    --plain
    ,
    --format
Load
references/help-text-patterns.md
for comprehensive parsing guidance including regex patterns, format variations, and special cases.
渐进式帮助发现:
  1. 从顶层帮助开始,了解整体结构
  2. 列出所有子命令
  3. 获取每个子命令的帮助信息
  4. 识别嵌套子命令
  5. 记录所有已发现的命令
信息提取:
  • 命令语法:使用行显示必填与可选内容
  • 描述:每个命令/参数的作用
  • 示例:直接复制帮助文本中的内容
  • 默认值:记录参数的默认值
  • 别名:记录简写形式(例如:
    -h
    对应
    --help
模式识别:
  • 参数命名:单字母与长格式的一致性
  • 参数约定:
    <required>
    对应
    [optional]
  • 子命令组织:按领域/资源分组
  • 输出选项:
    --json
    --plain
    --format
加载
references/help-text-patterns.md
获取包含正则表达式模式、格式变体及特殊情况的完整解析指南。

GitHub Analysis Strategies

GitHub分析策略

Quick reconnaissance:
  • README.md overview
  • Documentation directory structure
  • Examples directory
  • Contributing guide
Deep analysis:
  • Command implementation files (reveals structure)
  • Test files (reveals usage patterns)
  • Issues (reveals pain points)
  • Discussions (reveals community questions)
Framework detection:
Different CLI frameworks reveal structure differently:
  • Cobra (Go):
    cmd/
    directory with file per command
  • Click (Python): Decorators on functions
  • Commander (Node.js): Fluent API chains
  • Clap (Rust): Struct definitions or builder pattern
Load
references/help-text-patterns.md
section "GitHub Repository Analysis" for detailed code reading strategies.
快速侦察:
  • README.md概述
  • 文档目录结构
  • 示例目录
  • 贡献指南
深度分析:
  • 命令实现文件(可揭示结构)
  • 测试文件(可揭示使用模式)
  • Issues(可揭示痛点)
  • Discussions(可揭示社区问题)
框架检测:
不同的CLI框架揭示的结构不同:
  • Cobra (Go)
    cmd/
    目录下每个命令对应一个文件
  • Click (Python):函数上的装饰器
  • Commander (Node.js):流畅的API链式调用
  • Clap (Rust):结构体定义或构建器模式
加载
references/help-text-patterns.md
中的“GitHub Repository Analysis”部分获取详细的代码阅读策略。

Mental Model Extraction

核心模型提取

Ask these questions while introspecting:
  1. Core abstractions: What are the primary "things" this CLI manipulates?
  2. Action patterns: What verbs/actions does it support?
  3. State management: Does it track state? Where?
  4. Hierarchy: Is there a parent-child relationship between concepts?
  5. Workflows: What are the common sequences of operations?
Look for explicit mental model explanations:
  • README "How it works" sections
  • Documentation "Concepts" pages
  • Architecture diagrams
  • Design rationale documents
Infer from command structure:
  • Noun-verb suggests resource-oriented model
  • Verb-noun suggests action-oriented model
  • Flat structure suggests simple, single-purpose tool
  • Deep nesting suggests complex domain model
剖析时可提出以下问题:
  1. 核心抽象:该CLI主要操作的“对象”是什么?
  2. 操作模式:它支持哪些动词/操作?
  3. 状态管理:它是否跟踪状态?在哪里跟踪?
  4. 层级关系:概念之间是否存在父子关系?
  5. 工作流:常见的操作序列是什么?
查找明确的核心模型说明:
  • README中的“How it works”章节
  • 文档中的“Concepts”页面
  • 架构图
  • 设计理念文档
从命令结构推断:
  • 名词-动词模式表明是面向资源的模型
  • 动词-名词模式表明是面向操作的模型
  • 扁平化结构表明是简单、单一用途的工具
  • 深度嵌套结构表明是复杂的领域模型

Skill Structure Guidance

Skill结构指南

Choosing the Right Structure

选择合适的结构

Load
references/skill-templates.md
for complete templates and examples.
Workflow-based (use when):
  • Clear sequential processes
  • Most tasks follow similar steps
  • Getting-started focus important
  • Example: Deployment tools, CI/CD tools
Command-based (use when):
  • Many discrete, independent operations
  • Users need command reference
  • Operations don't follow fixed sequence
  • Example: File manipulation tools, utilities
Hybrid (use when - most common):
  • Mix of common workflows and discrete operations
  • Need both getting-started and comprehensive reference
  • Example: gh, docker, kubectl, git
加载
references/skill-templates.md
获取完整的模板和示例。
基于工作流(适用于):
  • 清晰的顺序化流程
  • 大多数任务遵循相似步骤
  • 入门引导很重要
  • 示例:部署工具、CI/CD工具
基于命令(适用于):
  • 大量独立的操作
  • 用户需要命令参考
  • 操作不遵循固定序列
  • 示例:文件操作工具、实用工具
混合模式(适用于 - 最常见):
  • 同时包含常见工作流和独立操作
  • 既需要入门引导又需要完整参考
  • 示例:gh、docker、kubectl、git

Content Distribution: skill.md vs references/

内容分布:skill.md vs references/

skill.md should contain:
  • Clear description triggering skill use
  • Overview of tool purpose
  • Core concepts (2-5 key concepts)
  • When to load references
  • Common operations (high-level guidance)
  • Workflow decision guidance
  • Integration overview
references/<tool>_reference.md should contain:
  • Comprehensive mental model
  • Complete command reference
  • All workflow patterns (numbered)
  • Full configuration documentation
  • Detailed troubleshooting
  • Integration details
  • Advanced usage
Additional reference files (when needed):
  • Separate file for specialized APIs (e.g., GraphQL)
  • Separate file for large schema references
  • Separate file for extensive configuration options
skill.md应包含:
  • 清晰的技能触发说明
  • 工具用途概述
  • 核心概念(2-5个关键概念)
  • 何时加载参考文档
  • 常见操作(高级引导)
  • 工作流决策引导
  • 集成概述
references/<tool>_reference.md应包含:
  • 完整的核心模型
  • 完整的命令参考
  • 所有工作流模式(编号)
  • 完整的配置文档
  • 详细的故障排查
  • 集成细节
  • 高级用法
额外参考文件(必要时):
  • 专用API的单独文件(例如:GraphQL)
  • 大型架构参考的单独文件
  • 大量配置选项的单独文件

Organizing Command Reference

命令参考组织

Best practices:
  1. Group by domain/resource (not alphabetically)
    • Groups related commands together
    • Matches user mental model
    • Example: "Pull Request Commands", "Issue Commands"
  2. Order by frequency of use
    • Most common operations first
    • Advanced features later
    • Matches progressive learning
  3. Include for each command:
    • Purpose (one sentence)
    • Syntax with placeholders
    • Key flags (not exhaustive, link to help)
    • 2-3 examples (simple to complex)
    • Related commands
  4. Use consistent formatting:
    • Code blocks for commands
    • Tables for flag reference
    • Numbered workflows
    • Clear section headers
最佳实践:
  1. 按领域/资源分组(而非按字母顺序)
    • 将相关命令分组
    • 匹配用户的核心模型
    • 示例:"拉取请求命令"、"Issue命令"
  2. 按使用频率排序
    • 最常见的操作放在前面
    • 高级功能放在后面
    • 符合渐进式学习规律
  3. 每个命令应包含:
    • 用途(一句话)
    • 带占位符的语法
    • 关键参数(无需全部列出,链接到帮助文档)
    • 2-3个示例(从简单到复杂)
    • 相关命令
  4. 使用一致的格式:
    • 命令使用代码块
    • 参数参考使用表格
    • 工作流使用编号
    • 清晰的章节标题

Writing Effective Workflow Patterns

编写有效的工作流模式

Pattern structure:
markdown
undefined
模式结构:
markdown
undefined

Pattern N: <Descriptive-Name>

模式N: <描述性名称>

Use case: When to use this workflow
Steps:
  1. <Step name> <Explanation> ```bash <command>

2. <Next step>
   ...

**Complete example:**

```bash
适用场景: 何时使用本工作流
步骤:
  1. <步骤名称> <说明>
    bash
    <命令>

2. <下一步>
   ...

**完整示例:**

```bash

<Scenario>

<场景>

<full-workflow> ```
Variations: Alternative approaches

**Pattern best practices:**

- Start with most common workflows
- Show realistic examples (not foo/bar)
- Include expected output
- Note side effects or state changes
- Link to related patterns
- Mention prerequisites

Load `references/skill-templates.md` for complete workflow pattern template and examples.
<完整工作流>

**变体:** 替代方法
模式最佳实践:
  • 从最常见的工作流开始
  • 展示真实示例(而非foo/bar)
  • 包含预期输出
  • 记录副作用或状态变化
  • 链接到相关模式
  • 提及前置条件
加载
references/skill-templates.md
获取完整的工作流模式模板和示例。

Integration with skill-creator

与skill-creator的集成

This skill gathers and organizes CLI material, then delegates to skill-creator for actual skill generation.
Workflow:
  1. cli-skill-creator: Introspects CLI, extracts patterns, organizes material
  2. Handoff: Provides structured brief to skill-creator
  3. skill-creator: Generates skill files, validates, packages
Structured brief format:
Provide skill-creator with:
  • CLI profile (name, version, purpose, structure pattern)
  • Core mental model (concepts, terminology)
  • Organized command reference material
  • Workflow patterns
  • Integration points
  • Configuration and troubleshooting
Invocation:
Use the Skill tool:

Skill: skill-creator

Create a skill for <cli-tool> using the following material:
[Complete structured brief]

Use [workflow-based/command-based/hybrid] structure.
Follow patterns from gh/graphite/erk skills.
Advantages of this approach:
  • Separates introspection from generation
  • Leverages skill-creator's validation and packaging
  • Maintains consistency with other skills
  • Allows iterative refinement
本技能负责收集和整理CLI素材,然后将实际的Skill生成工作委托给skill-creator。
工作流:
  1. cli-skill-creator:剖析CLI、提取模式、整理素材
  2. 交接:向skill-creator提供结构化brief
  3. skill-creator:生成Skill文件、验证、打包
结构化brief格式:
向skill-creator提供:
  • CLI概况(名称、版本、用途、结构模式)
  • 核心模型(概念、术语)
  • 已组织的命令参考素材
  • 工作流模式
  • 集成点
  • 配置与故障排查
调用方式:
使用Skill工具:

Skill: skill-creator

使用以下素材为<cli-tool>创建Skill:
[完整的结构化brief]

使用[基于工作流/基于命令/混合]结构。
遵循gh/graphite/erk等Skill的模式。
该方式的优势:
  • 将剖析与生成分离
  • 利用skill-creator的验证和打包能力
  • 与其他Skill保持一致性
  • 支持迭代优化

Tips for Different CLI Types

不同类型CLI的技巧

Modern Subcommand CLIs (gh, docker, kubectl)

现代子命令CLI(gh、docker、kubectl)

Focus on:
  • Clear command hierarchy
  • Workflow patterns (most important)
  • Integration with ecosystems
  • Progressive examples
Structure: Hybrid (workflows + command reference)
重点:
  • 清晰的命令层级
  • 工作流模式(最重要)
  • 与生态系统的集成
  • 渐进式示例
结构: 混合模式(工作流 + 命令参考)

Simple Utility CLIs (jq, curl, grep)

简单实用CLI(jq、curl、grep)

Focus on:
  • Core functionality explanation
  • Common use cases
  • Piping and composition
  • Flag combinations
Structure: Command-based or simple workflow
重点:
  • 核心功能说明
  • 常见用例
  • 管道和组合
  • 参数组合
结构: 基于命令或简单工作流

API-Wrapper CLIs (aws, gcloud, heroku)

API封装CLI(aws、gcloud、heroku)

Focus on:
  • API mapping
  • Authentication patterns
  • JSON output handling
  • Rate limiting
Structure: Command-based with workflow patterns
重点:
  • API映射
  • 认证模式
  • JSON输出处理
  • 速率限制
结构: 基于命令,附带工作流模式

Legacy CLIs (tar, find, sed)

传统CLI(tar、find、sed)

Focus on:
  • Modern usage patterns (not all historical options)
  • Common gotchas
  • Modern alternatives context
  • Safety warnings
Structure: Workflow-based (guide away from dangerous patterns)
重点:
  • 现代使用模式(无需包含所有历史选项)
  • 常见注意事项
  • 现代替代方案背景
  • 安全警告
结构: 基于工作流(引导用户避开危险模式)

Quality Checklist

质量检查清单

Before finalizing CLI skill:
  • Captured all major commands and subcommands
  • Documented 5-10 common workflow patterns
  • Extracted core mental model clearly
  • Organized by user task (not alphabetically)
  • Included realistic examples with output
  • Noted integration points
  • Documented common gotchas
  • Verified commands actually work
  • Noted CLI version documented
  • Linked to authoritative documentation
  • Followed structure of gh/graphite/erk skills
  • skill.md is concise (<300 lines)
  • references/ contains comprehensive details
在完成CLI Skill之前:
  • 已捕获所有主要命令和子命令
  • 已记录5-10个常见工作流模式
  • 已清晰提取核心模型
  • 按用户任务组织内容(而非按字母顺序)
  • 包含带输出的真实示例
  • 已记录集成点
  • 已记录常见注意事项
  • 已验证命令确实可用
  • 已记录所文档化的CLI版本
  • 已链接到权威文档
  • 遵循gh/graphite/erk等Skill的结构
  • skill.md简洁(<300行)
  • references/包含详细内容

Common Pitfalls

常见陷阱

Avoid:
  1. Alphabetical organization - Organize by task/domain instead
  2. Exhaustive flag documentation - Link to help, show common flags only
  3. Missing mental model - Always explain how to think about the tool
  4. No workflow patterns - Users need task-oriented guidance
  5. Untested examples - Verify all commands actually work
  6. Version agnostic - Note which version was documented
  7. Missing integration points - Document how it works with other tools
  8. Poor skill.md description - Be specific about when to use skill
避免:
  1. 按字母顺序组织 - 改为按任务/领域组织
  2. 详尽的参数文档 - 链接到帮助文档,仅展示常见参数
  3. 缺失核心模型 - 务必说明如何理解该工具
  4. 无工作流模式 - 用户需要面向任务的引导
  5. 未测试的示例 - 验证所有命令确实可用
  6. 不指定版本 - 记录所文档化的CLI版本
  7. 缺失集成点 - 记录如何与其他工具配合使用
  8. skill.md描述模糊 - 明确说明何时使用该技能

Resources

资源

references/

references/

This skill includes two comprehensive reference documents:
  • help-text-patterns.md - Practical guidance for parsing help text, man pages, and GitHub repositories. Load when introspecting CLI tools for comprehensive information extraction.
  • skill-templates.md - Reusable templates for skill structure, command reference, workflows, and sections. Load when organizing material and structuring skill documentation.
Loading strategy:
  • Load
    help-text-patterns.md
    during introspection steps (Steps 2-4)
  • Load
    skill-templates.md
    during organization and structure design (Step 6)
These references ensure consistent, comprehensive CLI skill creation following modern best practices.
undefined
本技能包含两份完整的参考文档:
  • help-text-patterns.md - 解析帮助文本、手册页和GitHub仓库的实用指南。剖析CLI工具时加载,以获取全面的信息提取方法。
  • skill-templates.md - Skill结构、命令参考、工作流和章节的可重用模板。整理素材和设计Skill文档结构时加载。
加载策略:
  • 剖析步骤(步骤2-4)中加载
    help-text-patterns.md
  • 组织和结构设计步骤(步骤6)中加载
    skill-templates.md
这些参考文档可确保遵循现代最佳实践,一致、全面地创建CLI Skill。