install-skills

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Install Skills Configuration Tool

安装技能配置工具

Configure skills by asking the user for their preferences and updating the skill files accordingly.
通过询问用户偏好并相应更新技能文件来配置技能。

Arguments

参数

  • $0
    (optional): Skill name to configure. If not provided, configure all available skills that need setup.
  • $0
    (可选):要配置的技能名称。如果未提供,则配置所有需要设置的可用技能。

Supported Skills

支持的技能

Build Skill

Build Skill

The
build
skill can be configured with:
  1. Build directory pattern: Where builds are stored relative to workspace
    • Always prompt with at least these options:
      • build/${buildType}
        (e.g.,
        build/Debug
        ,
        build/Release
        ) - Recommended
      • build
        (single build directory)
    • Additional optional patterns:
      • cmake-build-${buildType}
        (CLion style)
      • Custom pattern
  2. Default build type: What build type to use when not specified
    • Options:
      Release
      ,
      Debug
      ,
      RelWithDebInfo
      ,
      ASAN
      ,
      TSAN
      ,
      MSAN
      ,
      UBSAN
  3. Default target: What to build by default
    • Common targets:
      clickhouse
      ,
      clickhouse-server
      ,
      clickhouse-client
      , or build all
build
技能可配置以下内容:
  1. 构建目录模式:构建产物相对于工作区的存储位置
    • 必须至少提供以下选项供用户选择:
      • build/${buildType}
        (例如:
        build/Debug
        build/Release
        )- 推荐选项
      • build
        (单一构建目录)
    • 其他可选模式:
      • cmake-build-${buildType}
        (CLion风格)
      • 自定义模式
  2. 默认构建类型:未指定时使用的构建类型
    • 选项:
      Release
      Debug
      RelWithDebInfo
      ASAN
      TSAN
      MSAN
      UBSAN
  3. 默认构建目标:默认要构建的内容
    • 常见目标:
      clickhouse
      clickhouse-server
      clickhouse-client
      ,或构建全部内容

Test Skill

Test Skill

The
test
skill can be configured with:
  1. Build directory pattern: Where to find the clickhouse binary for testing
    • Should match the build skill configuration
    • Used to set PATH for test runner
    • Always prompt with at least:
      build/${buildType}
      and
      build
  2. Default build type for testing: Which build to use when running tests
    • Options:
      Release
      ,
      Debug
      ,
      RelWithDebInfo
      ,
      ASAN
      ,
      TSAN
      , etc.
    • Typically the same as the build skill default
test
技能可配置以下内容:
  1. 构建目录模式:测试时查找clickhouse二进制文件的位置
    • 应与Build Skill的配置匹配
    • 用于为测试运行器设置PATH
    • 必须至少提供以下选项:
      build/${buildType}
      build
  2. 测试默认构建类型:运行测试时使用的构建版本
    • 选项:
      Release
      Debug
      RelWithDebInfo
      ASAN
      TSAN
    • 通常与Build Skill的默认设置相同

Configuration Process

配置流程

  1. Identify the skill to configure:
    • If
      $ARGUMENTS
      is provided, configure that specific skill
    • Otherwise, configure all available skills that need setup (build and test together)
  2. When configuring both build and test skills together:
    • Ask all questions upfront (build directory, default build type, default target)
    • Use the same answers to configure both skills
    • The test skill will use the same build directory and default build type as the build skill
    • After configuration, update CLAUDE.md to load both skills
  3. For the build skill:
    a. Ask about build directory structure:
    • Use
      AskUserQuestion
      to ask: "What is your build directory structure?"
    • MANDATORY: Always include at least these two options:
      • build/${buildType}
        - Separate directory per build type (e.g., build/Debug, build/Release)
      • build
        - Single build directory for all build types
    • Additional optional options:
      • cmake-build-${buildType}
        - CLion/JetBrains style
      • Custom - Let user specify their own pattern
    b. Ask about default build type:
    • Use
      AskUserQuestion
      to ask: "What should be the default build type?"
    • Options (with descriptions):
      • RelWithDebInfo
        - Optimized with debug info (recommended for development)
      • Debug
        - Full debug symbols, no optimization
      • Release
        - Fully optimized, no debug info
      • ASAN
        - AddressSanitizer build
      • TSAN
        - ThreadSanitizer build
      • Other sanitizers as options
    c. Ask about default target:
    • Use
      AskUserQuestion
      to ask: "What should be the default build target?"
    • Options:
      • clickhouse
        - Main binary (recommended)
      • clickhouse-server
        - Server only
      • clickhouse-client
        - Client only
      • all
        - Build everything
      • Custom - Let user specify
    d. Update the build skill file:
    • Read
      .claude/skills/build/SKILL.md
    • Use
      Edit
      tool to update:
      • Build directory path pattern
      • Default build type in the arguments section
      • Default target in the arguments section
      • Update examples to reflect new defaults
      • Update the "Build Process" section with the actual paths
  4. For the test skill:
    a. Ask about build directory structure:
    • Use the same build directory structure selected for the build skill
    • Or ask separately if configuring test skill independently
    • MANDATORY: When asking, always include at least these two options:
      • build/${buildType}
        - Separate directory per build type
      • build
        - Single build directory
    b. Ask about default build type for testing:
    • Use
      AskUserQuestion
      to ask: "Which build should be used for running tests?"
    • Options (with descriptions):
      • RelWithDebInfo
        - Optimized with debug info (recommended, same as build default)
      • Debug
        - Full debug build
      • Release
        - Optimized build
      • ASAN
        - AddressSanitizer build (for memory testing)
      • TSAN
        - ThreadSanitizer build (for concurrency testing)
    c. Update the test skill file:
    • Read
      .claude/skills/test/SKILL.md
    • Use
      Edit
      tool to update:
      • Binary path in step 3 (verify server) to match build directory pattern
      • Binary path in step 4 (PATH export) to match build directory pattern
      • Update examples and notes with correct paths
  5. Confirm configuration:
    • Show summary of changes made
    • Confirm the skill is now configured for their workspace
    • Provide example commands they can use
  6. Update CLAUDE.md to load configured skills:
    After configuring skills, update
    .claude/CLAUDE.md
    to include them in the "Always load and apply" section:
    a. Read the current CLAUDE.md:
    • Use
      Read
      tool to read
      .claude/CLAUDE.md
    b. Update the skills list:
    • Find the section that starts with "Always load and apply the following skills:"
    • The section currently lists only
      .claude/skills/install-skills
    • Add entries for all configured skills:
      • .claude/skills/build
        - if build skill was configured
      • .claude/skills/test
        - if test skill was configured
    c. Use Edit to update CLAUDE.md:
    • Replace the skills list to include all configured skills
    • Maintain the format with one skill per line prefixed with "- "
    • Example result:
      Always load and apply the following skills:
      
      - .claude/skills/install-skills
      - .claude/skills/build
      - .claude/skills/test
    d. Confirm the update:
    • Inform user that CLAUDE.md has been updated to load the configured skills
    • Explain that the skills will be automatically available in future sessions
  1. 确定要配置的技能:
    • 如果提供了
      $ARGUMENTS
      ,则配置指定的技能
    • 否则,配置所有需要设置的可用技能(Build和Test一起配置)
  2. 同时配置Build和Test技能时:
    • 提前询问所有问题(构建目录、默认构建类型、默认构建目标)
    • 使用相同的答案配置两个技能
    • Test技能将使用与Build技能相同的构建目录和默认构建类型
    • 配置完成后,更新CLAUDE.md以加载这两个技能
  3. 针对Build技能:
    a. 询问构建目录结构:
    • 使用
      AskUserQuestion
      询问:"你的构建目录结构是什么?"
    • **必填:**必须至少包含以下两个选项:
      • build/${buildType}
        - 每个构建类型对应单独目录(例如:build/Debug、build/Release)
      • build
        - 所有构建类型共用单一目录
    • 其他可选选项:
      • cmake-build-${buildType}
        - CLion/JetBrains风格
      • 自定义 - 允许用户指定自己的模式
    b. 询问默认构建类型:
    • 使用
      AskUserQuestion
      询问:"默认构建类型应该是什么?"
    • 选项(含描述):
      • RelWithDebInfo
        - 带调试信息的优化版本(推荐用于开发)
      • Debug
        - 完整调试符号,无优化
      • Release
        - 完全优化,无调试信息
      • ASAN
        - AddressSanitizer构建版本
      • TSAN
        - ThreadSanitizer构建版本
      • 其他 sanitizer 选项
    c. 询问默认构建目标:
    • 使用
      AskUserQuestion
      询问:"默认构建目标应该是什么?"
    • 选项:
      • clickhouse
        - 主二进制文件(推荐)
      • clickhouse-server
        - 仅服务器
      • clickhouse-client
        - 仅客户端
      • all
        - 构建全部内容
      • 自定义 - 允许用户指定
    d. 更新Build技能文件:
    • 读取
      .claude/skills/build/SKILL.md
    • 使用
      Edit
      工具更新:
      • 构建目录路径模式
      • 参数部分的默认构建类型
      • 参数部分的默认构建目标
      • 更新示例以反映新的默认设置
      • 使用实际路径更新“构建流程”部分
  4. 针对Test技能:
    a. 询问构建目录结构:
    • 使用为Build技能选择的相同构建目录结构
    • 如果独立配置Test技能,则单独询问
    • **必填:**询问时必须至少包含以下两个选项:
      • build/${buildType}
        - 每个构建类型对应单独目录
      • build
        - 单一构建目录
    b. 询问测试默认构建类型:
    • 使用
      AskUserQuestion
      询问:"运行测试应使用哪个构建版本?"
    • 选项(含描述):
      • RelWithDebInfo
        - 带调试信息的优化版本(推荐,与Build默认设置相同)
      • Debug
        - 完整调试构建版本
      • Release
        - 优化构建版本
      • ASAN
        - AddressSanitizer构建版本(用于内存测试)
      • TSAN
        - ThreadSanitizer构建版本(用于并发测试)
    c. 更新Test技能文件:
    • 读取
      .claude/skills/test/SKILL.md
    • 使用
      Edit
      工具更新:
      • 步骤3(验证服务器)中的二进制路径以匹配构建目录模式
      • 步骤4(PATH导出)中的二进制路径以匹配构建目录模式
      • 使用正确路径更新示例和说明
  5. 确认配置:
    • 显示所做更改的摘要
    • 确认技能已为工作区配置完成
    • 提供可使用的示例命令
  6. 更新CLAUDE.md以加载已配置的技能:
    配置技能后,更新
    .claude/CLAUDE.md
    ,将它们添加到“始终加载并应用”部分:
    a. 读取当前CLAUDE.md:
    • 使用
      Read
      工具读取
      .claude/CLAUDE.md
    b. 更新技能列表:
    • 找到以“Always load and apply the following skills:”开头的部分
    • 该部分当前仅列出
      .claude/skills/install-skills
    • 添加所有已配置技能的条目:
      • .claude/skills/build
        - 如果配置了Build技能
      • .claude/skills/test
        - 如果配置了Test技能
    c. 使用Edit更新CLAUDE.md:
    • 替换技能列表以包含所有已配置技能
    • 保持格式为每行一个技能,前缀为“- ”
    • 示例结果:
      Always load and apply the following skills:
      
      - .claude/skills/install-skills
      - .claude/skills/build
      - .claude/skills/test
    d. 确认更新:
    • 告知用户CLAUDE.md已更新以加载已配置的技能
    • 说明这些技能将在未来会话中自动可用

Implementation Details

实现细节

  • Always use
    AskUserQuestion
    to gather preferences before making changes
  • Use
    Read
    to read the current skill files and CLAUDE.md
  • Use
    Edit
    to make precise updates to skill files and CLAUDE.md
  • Present clear options with descriptions to help users choose
  • IMPORTANT: When prompting for build directory, ALWAYS include at minimum:
    build/${buildType}
    and
    build
    as options
  • Validate user inputs before applying changes
  • Show before/after summary of what changed
  • After configuring skills, always update CLAUDE.md to include them in the load list
  • 始终使用
    AskUserQuestion
    收集偏好后再进行更改
  • 使用
    Read
    读取当前技能文件和CLAUDE.md
  • 使用
    Edit
    对技能文件和CLAUDE.md进行精确更新
  • 提供带描述的清晰选项以帮助用户选择
  • 重要提示: 询问构建目录时,必须至少包含
    build/${buildType}
    build
    作为选项
  • 应用更改前验证用户输入
  • 显示更改前后的摘要
  • 配置技能后,始终更新CLAUDE.md以将其添加到加载列表中

Example Usage

示例用法

  • /install-skills
    - Configure all skills (build and test together)
  • /install-skills build
    - Configure only the build skill
  • /install-skills test
    - Configure only the test skill
  • /install-skills
    - 配置所有技能(Build和Test一起)
  • /install-skills build
    - 仅配置Build技能
  • /install-skills test
    - 仅配置Test技能

Notes

注意事项

  • Configuration is workspace-specific and stored in
    .claude/skills/
  • Changes are made to the local skill files
  • Users can manually edit skill files later if needed
  • The tool preserves other skill content while updating only the specified sections
  • 配置是工作区特定的,存储在
    .claude/skills/
  • 更改会应用到本地技能文件
  • 用户之后可根据需要手动编辑技能文件
  • 工具会保留技能的其他内容,仅更新指定部分