claude-skill-management

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Claude Code Skill Management Expert

Claude Code 技能管理专家

Expert knowledge for managing Claude Code skills and commands using the centralized repository pattern with
$CLAUDE_METADATA
.
使用集中式仓库模式结合
$CLAUDE_METADATA
管理Claude Code技能与命令的专业知识。

When to Use This Skill

何时使用此技能

  • Creating new global skills or commands
  • Setting up skills for a new project
  • Synchronizing projects with updated global skills
  • Organizing the centralized skill repository
  • Troubleshooting skill discovery or activation issues
  • Understanding the skill lifecycle
  • 创建新的全局技能或命令
  • 为新项目配置技能
  • 同步项目与更新后的全局技能
  • 管理集中式技能仓库
  • 排查技能发现或激活问题
  • 理解技能生命周期

Environment Setup

环境配置

Required Environment Variable

必需的环境变量

$CLAUDE_METADATA
must be set to your centralized skills directory.
Check if set:
bash
echo $CLAUDE_METADATA
必须将**
$CLAUDE_METADATA
**设置为你的集中式技能目录路径。
检查是否已设置:
bash
echo $CLAUDE_METADATA

Should output your claude_data directory path

应输出你的claude_data目录路径


**If not set, add to `~/.zshrc` (or `~/.bashrc`):**
```bash
export CLAUDE_METADATA="$HOME/path/to/claude_data"  # Adjust to your actual path
Apply immediately:
bash
source ~/.zshrc  # or source ~/.bashrc

**如果未设置,添加到`~/.zshrc`(或`~/.bashrc`):**
```bash
export CLAUDE_METADATA="$HOME/path/to/claude_data"  # 根据实际路径调整
立即生效:
bash
source ~/.zshrc  # 或 source ~/.bashrc

Verify Directory Structure

验证目录结构

bash
ls -la $CLAUDE_METADATA/
bash
ls -la $CLAUDE_METADATA/

Should show:

应显示:

├── skills/ # Global skills

├── skills/ # 全局技能

├── commands/ # Global commands

├── commands/ # 全局命令

├── README.md

├── README.md

└── QUICK_REFERENCE.md

└── QUICK_REFERENCE.md

undefined
undefined

Complete Setup from Scratch

从零开始完成配置

If setting up a centralized skill repository for the first time:
  1. Create directory structure:
    bash
    mkdir -p $CLAUDE_METADATA/{skills,commands}
    cd $CLAUDE_METADATA
  2. Set environment variable (add to
    ~/.zshrc
    or
    ~/.bashrc
    ):
    bash
    echo 'export CLAUDE_METADATA="$HOME/path/to/claude_data"  # Adjust to your actual path' >> ~/.zshrc
    source ~/.zshrc
  3. Verify setup:
    bash
    echo $CLAUDE_METADATA
    # Should output your claude_data directory path
  4. Create initial documentation:
    bash
    # Create README and QUICK_REFERENCE
    # (use templates from claude-skill-management skill)
  5. Initialize git (recommended):
    bash
    cd $CLAUDE_METADATA
    git init
    git add .
    git commit -m "Initial centralized skill repository"
  6. Create your first skill:
    bash
    mkdir -p $CLAUDE_METADATA/skills/my-first-skill
    # Create SKILL.md with frontmatter
  7. Link to first project:
    bash
    cd ~/Workdir/my-project
    mkdir -p .claude/skills
    ln -s $CLAUDE_METADATA/skills/my-first-skill .claude/skills/
Environment variable best practices:
  • Use
    $HOME
    not hardcoded paths for portability
  • Source shell config after adding:
    source ~/.zshrc
  • Verify in new terminals:
    echo $CLAUDE_METADATA
  • Document for team members in README.md

如果是首次搭建集中式技能仓库:
  1. 创建目录结构
    bash
    mkdir -p $CLAUDE_METADATA/{skills,commands}
    cd $CLAUDE_METADATA
  2. 设置环境变量(添加到
    ~/.zshrc
    ~/.bashrc
    ):
    bash
    echo 'export CLAUDE_METADATA="$HOME/path/to/claude_data"  # 根据实际路径调整' >> ~/.zshrc
    source ~/.zshrc
  3. 验证配置
    bash
    echo $CLAUDE_METADATA
    # 应输出你的claude_data目录路径
  4. 创建初始文档
    bash
    # 创建README和QUICK_REFERENCE
    # (使用claude-skill-management技能中的模板)
  5. 初始化git(推荐):
    bash
    cd $CLAUDE_METADATA
    git init
    git add .
    git commit -m "Initial centralized skill repository"
  6. 创建你的第一个技能
    bash
    mkdir -p $CLAUDE_METADATA/skills/my-first-skill
    # 创建带前置元数据的SKILL.md
  7. 关联到第一个项目
    bash
    cd ~/Workdir/my-project
    mkdir -p .claude/skills
    ln -s $CLAUDE_METADATA/skills/my-first-skill .claude/skills/
环境变量最佳实践:
  • 使用
    $HOME
    而非硬编码路径以保证可移植性
  • 添加后执行shell配置生效:
    source ~/.zshrc
  • 在新终端中验证:
    echo $CLAUDE_METADATA
  • 在README.md中为团队成员记录配置方法

Creating New Skills

创建新技能

Step 1: Create Skill Directory

步骤1:创建技能目录

bash
mkdir -p $CLAUDE_METADATA/skills/your-skill-name
Naming conventions:
  • Use
    kebab-case
    (lowercase with hyphens)
  • Be descriptive but concise
  • Examples:
    galaxy-tool-wrapping
    ,
    python-testing
    ,
    docker-workflows
bash
mkdir -p $CLAUDE_METADATA/skills/your-skill-name
命名规范:
  • 使用
    kebab-case
    (小写字母加连字符)
  • 描述性强且简洁
  • 示例:
    galaxy-tool-wrapping
    ,
    python-testing
    ,
    docker-workflows

Step 2: Create SKILL.md with Frontmatter

步骤2:创建带前置元数据的SKILL.md

bash
cat > $CLAUDE_METADATA/skills/your-skill-name/SKILL.md << 'EOF'
---
name: your-skill-name
description: Brief description that helps Claude decide when to activate this skill (1-2 sentences)
---
bash
cat > $CLAUDE_METADATA/skills/your-skill-name/SKILL.md << 'EOF'
---
name: your-skill-name
description: 帮助Claude决定何时激活此技能的简短描述(1-2句话)
---

Your Skill Name

你的技能名称

Detailed instructions for Claude when this skill is activated.
当此技能被激活时,给Claude的详细说明。

When to Use This Skill

何时使用此技能

  • Specific use case 1
  • Specific use case 2
  • Specific use case 3
  • 特定使用场景1
  • 特定使用场景2
  • 特定使用场景3

Core Concepts

核心概念

Concept 1

概念1

Explanation and examples...
解释和示例...

Concept 2

概念2

Explanation and examples...
解释和示例...

Best Practices

最佳实践

  • Practice 1
  • Practice 2
  • 实践1
  • 实践2

Common Issues and Solutions

常见问题与解决方案

Issue 1

问题1

Problem: Description Solution: How to fix it
问题描述: 问题说明 解决方案: 修复方法

Examples

示例

Example 1: Task Name

示例1:任务名称

Description and code examples... EOF

**Frontmatter fields:**
- `name` (required): Must match directory name
- `description` (required): Clear, concise description for activation
- `version` (optional): Semantic versioning (e.g., `1.0.0`)
- `dependencies` (optional): Required tools/packages
描述和代码示例... EOF

**前置元数据字段:**
- `name`(必填):必须与目录名称一致
- `description`(必填):清晰简洁的激活描述
- `version`(可选):语义化版本(例如:`1.0.0`)
- `dependencies`(可选):所需工具/包

Step 3: Add Supporting Files (Optional)

步骤3:添加支持文件(可选)

bash
undefined
bash
undefined

Add detailed reference documentation

添加详细参考文档

cat > $CLAUDE_METADATA/skills/your-skill-name/reference.md << 'EOF'
cat > $CLAUDE_METADATA/skills/your-skill-name/reference.md << 'EOF'

Reference Documentation

参考文档

Detailed technical information, API references, etc. EOF
详细技术信息、API参考等。 EOF

Add examples directory

添加示例目录

mkdir -p $CLAUDE_METADATA/skills/your-skill-name/examples
mkdir -p $CLAUDE_METADATA/skills/your-skill-name/examples

Add templates directory

添加模板目录

mkdir -p $CLAUDE_METADATA/skills/your-skill-name/templates
undefined
mkdir -p $CLAUDE_METADATA/skills/your-skill-name/templates
undefined

Step 4: Test the Skill

步骤4:测试技能

bash
undefined
bash
undefined

Create a test project

创建测试项目

mkdir -p /tmp/test-skill-project/.claude/skills
mkdir -p /tmp/test-skill-project/.claude/skills

Symlink the new skill

关联新技能

ln -s $CLAUDE_METADATA/skills/your-skill-name /tmp/test-skill-project/.claude/skills/your-skill-name
ln -s $CLAUDE_METADATA/skills/your-skill-name /tmp/test-skill-project/.claude/skills/your-skill-name

Start Claude Code in test project

在测试项目中启动Claude Code

cd /tmp/test-skill-project
cd /tmp/test-skill-project

Tell Claude: "Use the your-skill-name skill to [test task]"

告诉Claude: "Use the your-skill-name skill to [test task]"


---

---

Creating New Commands

创建新命令

Step 1: Choose or Create Category Directory

步骤1:选择或创建类别目录

bash
undefined
bash
undefined

Use existing category

使用现有类别

ls $CLAUDE_METADATA/commands/
ls $CLAUDE_METADATA/commands/

Or create new category

或创建新类别

mkdir -p $CLAUDE_METADATA/commands/your-category

**Common categories:**
- `vgp-pipeline/` - VGP workflow commands
- `git-workflows/` - Git-related commands
- `testing/` - Testing-related commands
- `deployment/` - Deployment commands
mkdir -p $CLAUDE_METADATA/commands/your-category

**常见类别:**
- `vgp-pipeline/` - VGP工作流命令
- `git-workflows/` - Git相关命令
- `testing/` - 测试相关命令
- `deployment/` - 部署命令

Step 2: Create Command File

步骤2:创建命令文件

bash
cat > $CLAUDE_METADATA/commands/your-category/command-name.md << 'EOF'
---
name: command-name
description: Brief description shown in /help
---

Your command prompt here. This will be expanded when the user types /command-name.

You can include:
- Multi-line instructions
- Variable references: {{variable_name}}
- Markdown formatting
- Code blocks

Example:
Check the status of all workflows for species {{species_name}}.
Show me which workflows are complete, running, or failed.
EOF
Naming conventions:
  • Use
    kebab-case
  • Start with verb:
    check-status
    ,
    debug-failed
    ,
    update-skills
  • Be specific:
    deploy-production
    not just
    deploy
bash
cat > $CLAUDE_METADATA/commands/your-category/command-name.md << 'EOF'
---
name: command-name
description: 在/help中显示的简短描述
---

你的命令提示内容。当用户输入/command-name时,此内容会被展开。

你可以包含:
- 多行说明
- 变量引用:{{variable_name}}
- Markdown格式
- 代码块

示例:
检查物种{{species_name}}的所有工作流状态。
告诉我哪些工作流已完成、正在运行或失败。
EOF
命名规范:
  • 使用
    kebab-case
  • 以动词开头:
    check-status
    ,
    debug-failed
    ,
    update-skills
  • 具体明确:
    deploy-production
    而非仅
    deploy

Step 3: Test the Command

步骤3:测试命令

bash
undefined
bash
undefined

Symlink to test project

关联到测试项目

ln -s $CLAUDE_METADATA/commands/your-category/command-name.md /tmp/test-project/.claude/commands/
ln -s $CLAUDE_METADATA/commands/your-category/command-name.md /tmp/test-project/.claude/commands/

Start Claude Code and test

启动Claude Code并测试

Type: /command-name

输入:/command-name


---

---

Symlinking Skills and Commands to Projects

将技能和命令关联到项目

Recommended Global Skills (Always Symlink These)

推荐的全局技能(始终关联)

Every new project should include these globally useful skills:
每个新项目都应包含这些全局通用技能:

1. token-efficiency (Essential)

1. token-efficiency(必备)

Why: Automatically optimizes Claude's token usage, saving 80-90% on typical operations
bash
ln -s $CLAUDE_METADATA/skills/token-efficiency .claude/skills/token-efficiency
Benefits:
  • Uses
    --quiet
    mode for commands automatically
  • Reads log files efficiently (tail/grep instead of full read)
  • Strategic file selection for learning mode
  • Extends your Claude Pro usage 5-10x
原因: 自动优化Claude的token使用量,在典型操作中节省80-90%
bash
ln -s $CLAUDE_METADATA/skills/token-efficiency .claude/skills/token-efficiency
优势:
  • 自动为命令使用
    --quiet
    模式
  • 高效读取日志文件(使用tail/grep而非全量读取)
  • 为学习模式智能选择文件
  • 将你的Claude Pro使用时长延长5-10倍

2. claude-collaboration (Highly Recommended)

2. claude-collaboration(强烈推荐)

Why: Teaches best practices for managing skills and team collaboration
bash
ln -s $CLAUDE_METADATA/skills/claude-collaboration .claude/skills/claude-collaboration
Benefits:
  • Explains when and how to update skills
  • Documents skill lifecycle and version control
  • Helps onboard team members
  • Ensures consistency across projects
原因: 教授管理技能和团队协作的最佳实践
bash
ln -s $CLAUDE_METADATA/skills/claude-collaboration .claude/skills/claude-collaboration
优势:
  • 解释何时以及如何更新技能
  • 记录技能生命周期和版本控制
  • 帮助团队成员快速上手
  • 确保跨项目的一致性

3. galaxy-automation (For Galaxy projects)

3. galaxy-automation(适用于Galaxy项目)

Why: Universal BioBlend and Planemo knowledge for any Galaxy automation project
bash
ln -s $CLAUDE_METADATA/skills/galaxy-automation .claude/skills/galaxy-automation
Benefits:
  • Foundation for Galaxy workflow automation
  • Required dependency for vgp-pipeline
  • Useful for galaxy-tool-wrapping (Planemo testing)
  • Reduces duplication across Galaxy-related skills
原因: 适用于任何Galaxy自动化项目的通用BioBlend和Planemo知识
bash
ln -s $CLAUDE_METADATA/skills/galaxy-automation .claude/skills/galaxy-automation
优势:
  • Galaxy工作流自动化的基础
  • vgp-pipeline的必需依赖
  • 对galaxy-tool-wrapping(Planemo测试)有用
  • 减少Galaxy相关技能的重复内容

4. Recommended Global Commands (Highly Recommended)

4. 推荐的全局命令(强烈推荐)

Useful for managing skills across all projects:
bash
mkdir -p .claude/commands
对管理所有项目的技能有用:
bash
mkdir -p .claude/commands

Symlink ALL global commands (always include)

关联所有全局命令(始终包含)

ln -s $CLAUDE_METADATA/commands/global/*.md .claude/commands/

**Available commands:**
- `/update-skills` - Review session and suggest skill updates
- `/list-skills` - Show all available skills in $CLAUDE_METADATA
- `/setup-project` - Set up a new project with intelligent defaults
- `/sync-skills` - Check for new skills/commands added to $CLAUDE_METADATA
- `/cleanup-project` - End-of-project cleanup (working docs, verbose READMEs)
ln -s $CLAUDE_METADATA/commands/global/*.md .claude/commands/

**可用命令:**
- `/update-skills` - 回顾会话并建议技能更新
- `/list-skills` - 显示$CLAUDE_METADATA中所有可用技能
- `/setup-project` - 使用智能默认值设置新项目
- `/sync-skills` - 检查$CLAUDE_METADATA中新增的技能/命令
- `/cleanup-project` - 项目收尾清理(整理工作文档、精简README)

Quick Setup for Both Skills and Commands

技能和命令快速配置

bash
undefined
bash
undefined

Navigate to your new project

导航到你的新项目

cd ~/Workdir/your-new-project/
cd ~/Workdir/your-new-project/

Create .claude directories

创建.claude目录

mkdir -p .claude/skills .claude/commands
mkdir -p .claude/skills .claude/commands

Symlink essential global skills

关联必备的全局技能

ln -s $CLAUDE_METADATA/skills/token-efficiency .claude/skills/token-efficiency ln -s $CLAUDE_METADATA/skills/claude-collaboration .claude/skills/claude-collaboration ln -s $CLAUDE_METADATA/skills/python-environment-management .claude/skills/python-environment-management
ln -s $CLAUDE_METADATA/skills/token-efficiency .claude/skills/token-efficiency ln -s $CLAUDE_METADATA/skills/claude-collaboration .claude/skills/claude-collaboration ln -s $CLAUDE_METADATA/skills/python-environment-management .claude/skills/python-environment-management

Symlink ALL global commands (always include)

关联所有全局命令(始终包含)

ln -s $CLAUDE_METADATA/commands/global/*.md .claude/commands/
ln -s $CLAUDE_METADATA/commands/global/*.md .claude/commands/

Add project-specific skills as needed

验证

For Galaxy projects:

ln -s $CLAUDE_METADATA/skills/galaxy-automation .claude/skills/galaxy-automation

Verify

ls -la .claude/skills/ ls -la .claude/commands/

**Or ask Claude:**
Set up this new project with Claude Code. Symlink the essential global skills (token-efficiency, claude-collaboration, and python-environment-management) and global commands from $CLAUDE_METADATA/skills/ and ALL global commands from $CLAUDE_METADATA/commands/global/, then show me other available skills I might want to add.

**Or simply use:**
/setup-project
(if the setup-project command is already symlinked)

---
ls -la .claude/skills/ ls -la .claude/commands/

**或者询问Claude:**
为这个新项目配置Claude Code。关联$CLAUDE_METADATA/skills/中的必备全局技能(token-efficiency、claude-collaboration和python-environment-management)以及$CLAUDE_METADATA/commands/global/中的所有全局命令,然后告诉我可能需要添加的其他可用技能。

**或者直接使用:**
/setup-project
(如果setup-project命令已关联)

---

Method 1: Quick Setup (Recommended for New Projects)

方法1:快速配置(推荐用于新项目)

Tell Claude:
Set up Claude Code for this project. Show me available skills in $CLAUDE_METADATA and let me choose which ones to symlink.
Claude will:
  1. Automatically symlink token-efficiency, claude-collaboration, python-environment-management (if not already present)
  2. List all available skills and commands
  3. Ask which additional ones you want
  4. Create the symlinks
  5. Verify everything works
告诉Claude:
为这个项目配置Claude Code。显示$CLAUDE_METADATA中可用的技能,让我选择要关联的技能。
Claude会:
  1. 自动关联token-efficiency、claude-collaboration、python-environment-management(如果尚未存在)
  2. 列出所有可用技能和命令
  3. 询问你想要添加的额外技能
  4. 创建关联链接
  5. 验证所有配置正常工作

Method 2: Manual Symlink (Specific Skills)

方法2:手动关联(特定技能)

bash
undefined
bash
undefined

Navigate to your project

导航到你的项目

cd ~/Workdir/your-project/
cd ~/Workdir/your-project/

Create directories if needed

按需创建目录

mkdir -p .claude/skills .claude/commands
mkdir -p .claude/skills .claude/commands

Symlink specific skill

关联特定技能

ln -s $CLAUDE_METADATA/skills/skill-name .claude/skills/skill-name
ln -s $CLAUDE_METADATA/skills/skill-name .claude/skills/skill-name

Symlink all commands from a category

关联某个类别下的所有命令

ln -s $CLAUDE_METADATA/commands/category/*.md .claude/commands/
ln -s $CLAUDE_METADATA/commands/category/*.md .claude/commands/

Symlink specific command

关联特定命令

ln -s $CLAUDE_METADATA/commands/category/command-name.md .claude/commands/command-name.md
undefined
ln -s $CLAUDE_METADATA/commands/category/command-name.md .claude/commands/command-name.md
undefined

Method 3: Symlink All Skills

方法3:关联所有技能

bash
undefined
bash
undefined

Link every skill (use cautiously)

关联所有技能(谨慎使用)

for skill in $CLAUDE_METADATA/skills/*; do ln -s "$skill" .claude/skills/$(basename "$skill") done
for skill in $CLAUDE_METADATA/skills/*; do ln -s "$skill" .claude/skills/$(basename "$skill") done

Link all commands from all categories

关联所有类别下的所有命令

for category in $CLAUDE_METADATA/commands/; do ln -s "$category"/.md .claude/commands/ done

**Note:** Progressive disclosure means having many skills doesn't hurt performance, but keep projects focused on relevant skills for clarity.
for category in $CLAUDE_METADATA/commands/; do ln -s "$category"/.md .claude/commands/ done

**注意:** 渐进式展示意味着拥有多个技能不会影响性能,但为了清晰性,应保持项目聚焦于相关技能。

Verify Symlinks

验证关联链接

bash
undefined
bash
undefined

Check what's linked

查看已关联的内容

ls -la .claude/skills/ ls -la .claude/commands/
ls -la .claude/skills/ ls -la .claude/commands/

Verify targets exist

验证目标是否存在

ls -L .claude/skills/ # Follows symlinks

---
ls -L .claude/skills/ # 跟随关联链接

---

Updating Existing Skills

更新现有技能

When to Update Skills

何时更新技能

Update when you discover:
  • ✅ Repeated patterns or solutions
  • ✅ New best practices
  • ✅ Common errors and their fixes
  • ✅ Token optimizations
  • ✅ Workflow improvements
Don't update for:
  • ❌ One-time issues
  • ❌ Experimental approaches (wait until proven)
  • ❌ User-specific preferences
  • ❌ Obvious information
当你发现以下情况时更新:
  • ✅ 重复出现的模式或解决方案
  • ✅ 新的最佳实践
  • ✅ 常见错误及其修复方法
  • ✅ Token优化技巧
  • ✅ 工作流改进
不要为以下情况更新:
  • ❌ 一次性问题
  • ❌ 实验性方法(待验证后再更新)
  • ❌ 用户特定偏好
  • ❌ 显而易见的信息

Method 1: Direct Editing

方法1:直接编辑

bash
undefined
bash
undefined

Edit the skill file

编辑技能文件

nano $CLAUDE_METADATA/skills/skill-name/SKILL.md
nano $CLAUDE_METADATA/skills/skill-name/SKILL.md

Or use Claude

或者告诉Claude

Tell Claude: "Update the skill-name skill to add [new information]"

告诉Claude: "Update the skill-name skill to add [new information]"

undefined
undefined

Method 2: Use /update-skills Command

方法2:使用/update-skills命令

bash
undefined
bash
undefined

If you have the update-skills command linked

如果已关联update-skills命令

/update-skills
/update-skills

Claude will:

Claude会:

1. Review your session

1. 回顾你的会话

2. Suggest skill updates

2. 建议技能更新

3. Ask for approval

3. 请求你的批准

4. Apply changes

4. 应用更改

undefined
undefined

Method 3: End-of-Session Updates

方法3:会话结束时更新

Tell Claude:
Review today's session and suggest updates to relevant skills in $CLAUDE_METADATA.
告诉Claude:
回顾今天的会话,并建议更新$CLAUDE_METADATA中的相关技能。

Propagation of Updates

更新的传播

Automatic propagation:
bash
undefined
自动传播:
bash
undefined

Update skill in central location

在中心位置更新技能

vim $CLAUDE_METADATA/skills/vgp-pipeline/SKILL.md
vim $CLAUDE_METADATA/skills/vgp-pipeline/SKILL.md

ALL projects with symlinks immediately see the update! 🎉

所有关联了该技能的项目会立即看到更新! 🎉

No need to update each project individually

无需逐个更新每个项目


---

---

Synchronizing Projects with Global Skills

同步项目与全局技能

Scenario: Added New Skills to $CLAUDE_METADATA

场景:向$CLAUDE_METADATA添加了新技能

Tell Claude (in existing project):
Check what skills and commands are available in $CLAUDE_METADATA and compare with what's currently symlinked in this project. Show me what's new or missing, and let me choose which ones to add.
Claude will:
  1. List current symlinks
  2. List available skills in
    $CLAUDE_METADATA
  3. Show what's new
  4. Create symlinks for selected items
在现有项目中告诉Claude:
检查$CLAUDE_METADATA中可用的技能和命令,并与当前项目中已关联的内容进行比较。告诉我新增或缺失的内容,让我选择要添加的技能。
Claude会:
  1. 列出当前已关联的链接
  2. 列出
    $CLAUDE_METADATA
    中可用的技能
  3. 显示新增的内容
  4. 为你选择的内容创建关联链接

Manual Sync

手动同步

bash
undefined
bash
undefined

List available skills

列出可用技能

ls $CLAUDE_METADATA/skills/
ls $CLAUDE_METADATA/skills/

List what you have

列出已有的技能

ls .claude/skills/
ls .claude/skills/

Add missing ones

添加缺失的技能

ln -s $CLAUDE_METADATA/skills/new-skill .claude/skills/new-skill

---
ln -s $CLAUDE_METADATA/skills/new-skill .claude/skills/new-skill

---

Organizing the Centralized Repository

管理集中式仓库

Directory Organization Best Practices

目录组织最佳实践

By domain/technology:
$CLAUDE_METADATA/skills/
├── vgp-pipeline/              # VGP workflows
├── galaxy-tool-wrapping/      # Galaxy development
├── python-testing/            # Python test patterns
├── docker-workflows/          # Docker/containers
└── bioinformatics-common/     # General bioinformatics
By function:
$CLAUDE_METADATA/commands/
├── vgp-pipeline/              # VGP-specific commands
│   ├── check-status.md
│   └── debug-failed.md
├── git-workflows/             # Git commands
│   └── review-commits.md
└── deployment/                # Deployment commands
    └── deploy-production.md
按领域/技术分类:
$CLAUDE_METADATA/skills/
├── vgp-pipeline/              # VGP工作流
├── galaxy-tool-wrapping/      # Galaxy开发
├── python-testing/            # Python测试模式
├── docker-workflows/          # Docker/容器
└── bioinformatics-common/     # 通用生物信息学
按功能分类:
$CLAUDE_METADATA/commands/
├── vgp-pipeline/              # VGP特定命令
│   ├── check-status.md
│   └── debug-failed.md
├── git-workflows/             # Git命令
│   └── review-commits.md
└── deployment/                # 部署命令
    └── deploy-production.md

Naming Consistency

命名一致性

Skills:
  • Format:
    domain-subdomain
    or
    technology-purpose
  • Examples:
    • galaxy-tool-wrapping
      (technology-purpose)
    • vgp-pipeline
      (project-type)
    • python-testing
      (language-purpose)
Commands:
  • Format:
    verb-noun
    or
    verb-target
  • Examples:
    • check-status
      (verb-noun)
    • debug-failed
      (verb-state)
    • update-skills
      (verb-noun)
技能:
  • 格式:
    domain-subdomain
    technology-purpose
  • 示例:
    • galaxy-tool-wrapping
      (技术-用途)
    • vgp-pipeline
      (项目-类型)
    • python-testing
      (语言-用途)
命令:
  • 格式:
    verb-noun
    verb-target
  • 示例:
    • check-status
      (动词-名词)
    • debug-failed
      (动词-状态)
    • update-skills
      (动词-名词)

Documentation Requirements

文档要求

Every skill directory should have:
  • SKILL.md
    (required) - Main skill file
  • ✅ Clear frontmatter with name and description
  • ✅ "When to Use This Skill" section
  • ⚠️
    reference.md
    (optional) - Detailed documentation
  • ⚠️
    examples/
    (optional) - Example code/configs
Every command should have:
  • ✅ Frontmatter with name and description
  • ✅ Clear prompt/instructions
  • ✅ Examples if the command takes parameters

每个技能目录应包含:
  • SKILL.md
    (必填)- 主技能文件
  • ✅ 包含名称和描述的清晰前置元数据
  • ✅ "何时使用此技能"部分
  • ⚠️
    reference.md
    (可选)- 详细文档
  • ⚠️
    examples/
    (可选)- 示例代码/配置
每个命令应包含:
  • ✅ 包含名称和描述的前置元数据
  • ✅ 清晰的提示/说明
  • ✅ 如果命令接受参数,需包含示例

Version Control with Git

使用Git进行版本控制

Initialize Git Repository

初始化Git仓库

bash
cd $CLAUDE_METADATA
git init
git add .
git commit -m "Initial commit: centralized skills and commands"
bash
cd $CLAUDE_METADATA
git init
git add .
git commit -m "Initial commit: centralized skills and commands"

Track Changes

跟踪更改

bash
undefined
bash
undefined

After updating skills

更新技能后

cd $CLAUDE_METADATA git status # See what changed git diff # Review changes
cd $CLAUDE_METADATA git status # 查看更改内容 git diff # 审查更改

Commit updates

提交更新

git add skills/skill-name/SKILL.md git commit -m "Add troubleshooting section for XYZ issue"
git add skills/skill-name/SKILL.md git commit -m "Add troubleshooting section for XYZ issue"

Optional: Push to remote for team sharing

可选:推送到远程仓库供团队共享

git push origin main
undefined
git push origin main
undefined

Team Collaboration

团队协作

Setup shared repository:
bash
undefined
设置共享仓库:
bash
undefined

Create GitHub/GitLab repo

创建GitHub/GitLab仓库

git remote add origin git@github.com:your-team/claude-metadata.git git push -u origin main

**Team members clone:**
```bash
git clone git@github.com:your-team/claude-metadata.git ~/path/to/claude_data
export CLAUDE_METADATA="$HOME/path/to/claude_data"  # Adjust to your actual path
Pull updates:
bash
cd $CLAUDE_METADATA
git pull  # All projects with symlinks auto-update!
git remote add origin git@github.com:your-team/claude-metadata.git git push -u origin main

**团队成员克隆:**
```bash
git clone git@github.com:your-team/claude-metadata.git ~/path/to/claude_data
export CLAUDE_METADATA="$HOME/path/to/claude_data"  # 根据实际路径调整
拉取更新:
bash
cd $CLAUDE_METADATA
git pull  # 所有关联了技能的项目会自动更新!

Good Commit Messages

良好的提交信息

Good:
bash
git commit -m "Add token optimization for VGP log files (96% savings)"
git commit -m "Document WF8 failure pattern when Hi-C R2 missing"
git commit -m "Create galaxy-tool-wrapping skill for tool development"
Bad:
bash
git commit -m "update"
git commit -m "changes"
git commit -m "fix stuff"

优秀示例:
bash
git commit -m "Add token optimization for VGP log files (96% savings)"
git commit -m "Document WF8 failure pattern when Hi-C R2 missing"
git commit -m "Create galaxy-tool-wrapping skill for tool development"
糟糕示例:
bash
git commit -m "update"
git commit -m "changes"
git commit -m "fix stuff"

Troubleshooting

故障排除

Skill Not Activating

技能未激活

Check 1: Verify symlink exists
bash
ls -la .claude/skills/
检查1:验证关联链接是否存在
bash
ls -la .claude/skills/

Should show: skill-name -> $CLAUDE_METADATA/skills/skill-name

应显示: skill-name -> $CLAUDE_METADATA/skills/skill-name


**Check 2: Verify target exists**
```bash
ls -L .claude/skills/skill-name

**检查2:验证目标是否存在**
```bash
ls -L .claude/skills/skill-name

Should show: SKILL.md

应显示: SKILL.md


**Check 3: Check frontmatter**
```bash
head -10 .claude/skills/skill-name/SKILL.md

**检查3:检查前置元数据**
```bash
head -10 .claude/skills/skill-name/SKILL.md

Should have:

应包含:

---

---

name: skill-name

name: skill-name

description: ...

description: ...

---

---


**Check 4: Description clarity**
- Is the description clear about when to use the skill?
- Does it match your request?
- Try explicitly mentioning: "Use the skill-name skill to..."

**检查4:描述清晰度**
- 描述是否清晰说明了何时使用该技能?
- 描述是否与你的请求匹配?
- 尝试明确提及:"Use the skill-name skill to..."

Command Not Found

命令未找到

Check 1: Verify symlink
bash
ls -la .claude/commands/command-name.md
Check 2: Restart Claude Code Commands are loaded at session start, so restart if you just added it.
Check 3: Check frontmatter
bash
head -5 .claude/commands/command-name.md
检查1:验证关联链接
bash
ls -la .claude/commands/command-name.md
检查2:重启Claude Code 命令在会话启动时加载,因此如果刚添加命令,需要重启会话。
检查3:检查前置元数据
bash
head -5 .claude/commands/command-name.md

Should have:

应包含:

---

---

name: command-name

name: command-name

description: ...

description: ...

---

---

undefined
undefined

$CLAUDE_METADATA Not Set

$CLAUDE_METADATA未设置

Symptom: Symlink commands fail with "No such file or directory"
Fix:
bash
undefined
症状: 关联命令失败,提示"No such file or directory"
修复:
bash
undefined

Check current value

检查当前值

echo $CLAUDE_METADATA
echo $CLAUDE_METADATA

If empty, add to shell config

如果为空,添加到shell配置

echo 'export CLAUDE_METADATA="$HOME/path/to/claude_data" # Adjust to your actual path' >> ~/.zshrc source ~/.zshrc
echo 'export CLAUDE_METADATA="$HOME/path/to/claude_data" # 根据实际路径调整' >> ~/.zshrc source ~/.zshrc

Verify

验证

echo $CLAUDE_METADATA
undefined
echo $CLAUDE_METADATA
undefined

Symlink Points to Wrong Location

关联链接指向错误位置

Symptom:
ls -la .claude/skills/skill-name
shows wrong path
Fix:
bash
undefined
症状:
ls -la .claude/skills/skill-name
显示错误路径
修复:
bash
undefined

Remove broken symlink

删除损坏的关联链接

rm .claude/skills/skill-name
rm .claude/skills/skill-name

Recreate with correct path

使用正确路径重新创建

ln -s $CLAUDE_METADATA/skills/skill-name .claude/skills/skill-name
ln -s $CLAUDE_METADATA/skills/skill-name .claude/skills/skill-name

Verify

验证

ls -L .claude/skills/skill-name
undefined
ls -L .claude/skills/skill-name
undefined

Changes Not Appearing in Projects

更改未在项目中显示

Symptom: Updated skill in
$CLAUDE_METADATA
but projects don't see changes
Possible causes:
  1. Not using symlinks - Projects have copies instead
    bash
    # Check if it's a symlink
    ls -la .claude/skills/skill-name
    # Should show -> pointing to $CLAUDE_METADATA
  2. Claude Code hasn't restarted - Skills loaded at session start
    • Fix: Restart Claude Code session
  3. Editing wrong file - Multiple copies exist
    bash
    # Find all copies
    find ~/Workdir -name "SKILL.md" -path "*/skill-name/*"
    # Should only show one in $CLAUDE_METADATA

症状:
$CLAUDE_METADATA
中更新了技能,但项目中未看到更改
可能原因:
  1. 未使用关联链接 - 项目中使用的是副本而非链接
    bash
    # 检查是否为关联链接
    ls -la .claude/skills/skill-name
    # 应显示指向$CLAUDE_METADATA的->符号
  2. Claude Code未重启 - 技能在会话启动时加载
    • 修复:重启Claude Code会话
  3. 编辑了错误的文件 - 存在多个副本
    bash
    # 查找所有副本
    find ~/Workdir -name "SKILL.md" -path "*/skill-name/*"
    # 应只显示$CLAUDE_METADATA中的一个

Best Practices

最佳实践

1. Keep Skills Focused

1. 保持技能聚焦

Good: One skill per domain
  • galaxy-tool-wrapping/SKILL.md
    - Only Galaxy tools
  • vgp-pipeline/SKILL.md
    - Only VGP workflows
Bad: Kitchen sink skill
  • everything/SKILL.md
    - Galaxy + VGP + Docker + Python + ...
良好实践: 一个技能对应一个领域
  • galaxy-tool-wrapping/SKILL.md
    - 仅包含Galaxy工具相关内容
  • vgp-pipeline/SKILL.md
    - 仅包含VGP工作流相关内容
不良实践: 全能型技能
  • everything/SKILL.md
    - 包含Galaxy + VGP + Docker + Python + ...

2. Use Clear, Specific Descriptions

2. 使用清晰、具体的描述

Good descriptions:
yaml
description: Expert in Galaxy tool wrapper development, XML schemas, and Planemo testing
description: VGP genome assembly pipeline orchestration, debugging, and workflow management
Bad descriptions:
yaml
description: Helps with stuff
description: Development skill
优秀描述:
yaml
description: Expert in Galaxy tool wrapper development, XML schemas, and Planemo testing
description: VGP genome assembly pipeline orchestration, debugging, and workflow management
糟糕描述:
yaml
description: Helps with stuff
description: Development skill

3. Regular Maintenance

3. 定期维护

Weekly:
  • Review session learnings
  • Update skills with new patterns
  • Commit changes with clear messages
Monthly:
  • Audit all skills for conflicts
  • Remove outdated information
  • Reorganize if needed
每周:
  • 回顾会话中的经验
  • 用新模式更新技能
  • 用清晰的信息提交更改
每月:
  • 审核所有技能以排查冲突
  • 删除过时信息
  • 必要时重新组织

4. Document Rationale

4. 记录原理

Include "why" not just "what":
markdown
undefined
不仅要记录“做什么”,还要记录“为什么”:
markdown
undefined

Use --quiet Mode for Status Checks

对状态检查使用--quiet模式

Why: Status checks with verbose output produce 15K tokens, but only 2K with --quiet mode. Over a typical workflow (10 checks), this saves 130K tokens (87% reduction).
When to override: User explicitly requests detailed output, or debugging requires full logs.
undefined
原因: 详细输出的状态检查会产生15K token,而使用--quiet模式仅产生2K token。在典型工作流中(10次检查),这会节省130K token(减少87%)。
何时覆盖: 用户明确要求详细输出,或调试需要完整日志时。
undefined

5. Version Control Everything

5. 版本控制所有内容

bash
undefined
bash
undefined

Always use git

始终使用git

cd $CLAUDE_METADATA git add . git commit -m "Descriptive message"
cd $CLAUDE_METADATA git add . git commit -m "Descriptive message"

Never work without version control

永远不要在没有版本控制的情况下工作

You'll want to undo changes eventually!

你最终会需要撤销更改!

undefined
undefined

6. Share with Team

6. 与团队共享

bash
undefined
bash
undefined

Use git for team collaboration

使用git进行团队协作

git push origin main
git push origin main

Team members stay updated

团队成员保持更新

cd $CLAUDE_METADATA && git pull
undefined
cd $CLAUDE_METADATA && git pull
undefined

7. Symlink, Don't Copy

7. 使用关联链接,不要复制

Good:
bash
ln -s $CLAUDE_METADATA/skills/my-skill .claude/skills/my-skill
Bad:
bash
cp -r $CLAUDE_METADATA/skills/my-skill .claude/skills/my-skill
Why: Symlinks mean updates propagate automatically. Copies create maintenance nightmares.
良好实践:
bash
ln -s $CLAUDE_METADATA/skills/my-skill .claude/skills/my-skill
不良实践:
bash
cp -r $CLAUDE_METADATA/skills/my-skill .claude/skills/my-skill
原因: 关联链接意味着更新会自动传播。复制会导致维护噩梦。

8. Template-Based Script Generation

8. 基于模板的脚本生成

When creating reusable installers or scripts that need customization across repositories:
Use placeholders in templates:
bash
undefined
当创建需要在多个仓库中自定义的可重用安装程序或脚本时:
在模板中使用占位符:
bash
undefined

Template with placeholders

带占位符的模板

TEMPLATE=' MAIN_FILE="MAIN_FILE" BACKUP_DIR="BACKUP_BASE_DIR" DAYS="DAYS_TO_KEEP" '
TEMPLATE=' MAIN_FILE="MAIN_FILE" BACKUP_DIR="BACKUP_BASE_DIR" DAYS="DAYS_TO_KEEP" '

Substitute with actual values

替换为实际值

echo "$TEMPLATE" |
sed "s|MAIN_FILE|$ACTUAL_FILE|g" |
sed "s|BACKUP_BASE_DIR|$ACTUAL_DIR|g" |
sed "s|DAYS_TO_KEEP|$ACTUAL_DAYS|g" \
final_script.sh

**Benefits:**
- Reusable across projects
- Single source of truth for logic
- Easy to maintain and update
- Parameter validation in one place
- Reduces duplication

**Example use case:**
Creating a global installer for backup systems that can be customized for any data file and directory structure. The template contains all the logic, and sed substitution customizes it for each project.

**Alternative: Template files:**
```bash
echo "$TEMPLATE" |
sed "s|MAIN_FILE|$ACTUAL_FILE|g" |
sed "s|BACKUP_BASE_DIR|$ACTUAL_DIR|g" |
sed "s|DAYS_TO_KEEP|$ACTUAL_DAYS|g" \
final_script.sh

**优势:**
- 可在多个项目中重用
- 逻辑的单一来源
- 易于维护和更新
- 集中进行参数验证
- 减少重复内容

**示例用例:**
创建可针对任何数据文件和目录结构自定义的全局备份系统安装程序。模板包含所有逻辑,sed替换为每个项目自定义。

**替代方案:模板文件:**
```bash

Store template in file

将模板存储在文件中

cat > template.sh << 'EOF' MAIN_FILE="MAIN_FILE" BACKUP_DIR="BACKUP_BASE_DIR" EOF
cat > template.sh << 'EOF' MAIN_FILE="MAIN_FILE" BACKUP_DIR="BACKUP_BASE_DIR" EOF

Generate from template

从模板生成

sed "s|MAIN_FILE|data.csv|g" template.sh > backup.sh

---
sed "s|MAIN_FILE|data.csv|g" template.sh > backup.sh

---

Quick Reference

快速参考

Create New Skill

创建新技能

bash
mkdir -p $CLAUDE_METADATA/skills/skill-name
cat > $CLAUDE_METADATA/skills/skill-name/SKILL.md << 'EOF'
---
name: skill-name
description: Brief description
---
bash
mkdir -p $CLAUDE_METADATA/skills/skill-name
cat > $CLAUDE_METADATA/skills/skill-name/SKILL.md << 'EOF'
---
name: skill-name
description: Brief description
---

Content here

Content here

EOF
undefined
EOF
undefined

Link to Project

关联到项目

bash
ln -s $CLAUDE_METADATA/skills/skill-name .claude/skills/skill-name
bash
ln -s $CLAUDE_METADATA/skills/skill-name .claude/skills/skill-name

Update Skill

更新技能

bash
undefined
bash
undefined

Edit directly

直接编辑

vim $CLAUDE_METADATA/skills/skill-name/SKILL.md
vim $CLAUDE_METADATA/skills/skill-name/SKILL.md

Or tell Claude

或者告诉Claude

"Update the skill-name skill to add [information]"
undefined
"Update the skill-name skill to add [information]"
undefined

Sync Project

同步项目

bash
undefined
bash
undefined

Tell Claude

告诉Claude

"Check what skills are available in $CLAUDE_METADATA and show me what's new"
undefined
"Check what skills are available in $CLAUDE_METADATA and show me what's new"
undefined

List Available Skills

列出可用技能

bash
ls $CLAUDE_METADATA/skills/
bash
ls $CLAUDE_METADATA/skills/

List Available Commands

列出可用命令

bash
ls $CLAUDE_METADATA/commands/*/
bash
ls $CLAUDE_METADATA/commands/*/

Verify Setup

验证配置

bash
echo $CLAUDE_METADATA
ls -la .claude/skills/
ls -la .claude/commands/
bash
echo $CLAUDE_METADATA
ls -la .claude/skills/
ls -la .claude/commands/

Setup New Project with Essential Skills and Commands

使用必备技能和命令设置新项目

bash
undefined
bash
undefined

Quick setup for new project

新项目快速配置

cd ~/Workdir/new-project mkdir -p .claude/skills .claude/commands
cd ~/Workdir/new-project mkdir -p .claude/skills .claude/commands

Always symlink these essential skills

始终关联这些必备技能

ln -s $CLAUDE_METADATA/skills/token-efficiency .claude/skills/token-efficiency ln -s $CLAUDE_METADATA/skills/claude-collaboration .claude/skills/claude-collaboration
ln -s $CLAUDE_METADATA/skills/token-efficiency .claude/skills/token-efficiency ln -s $CLAUDE_METADATA/skills/claude-collaboration .claude/skills/claude-collaboration

Always symlink these useful commands

始终关联这些实用命令

ln -s $CLAUDE_METADATA/commands/global/*.md .claude/commands/
ln -s $CLAUDE_METADATA/commands/global/*.md .claude/commands/

Verify

验证

ls -la .claude/skills/ ls -la .claude/commands/

---
ls -la .claude/skills/ ls -la .claude/commands/

---

Common Workflows

常见工作流

Workflow 1: Creating and Using a New Skill

工作流1:创建并使用新技能

  1. Create skill:
    bash
    mkdir -p $CLAUDE_METADATA/skills/docker-workflows
    # Create SKILL.md with frontmatter
  2. Test in isolated project:
    bash
    mkdir -p /tmp/test/.claude/skills
    ln -s $CLAUDE_METADATA/skills/docker-workflows /tmp/test/.claude/skills/
    # Start Claude Code, test the skill
  3. Link to real projects:
    bash
    cd ~/Workdir/real-project
    ln -s $CLAUDE_METADATA/skills/docker-workflows .claude/skills/
  4. Share with team:
    bash
    cd $CLAUDE_METADATA
    git add skills/docker-workflows/
    git commit -m "Add docker-workflows skill"
    git push
  1. 创建技能:
    bash
    mkdir -p $CLAUDE_METADATA/skills/docker-workflows
    # 创建带前置元数据的SKILL.md
  2. 在隔离项目中测试:
    bash
    mkdir -p /tmp/test/.claude/skills
    ln -s $CLAUDE_METADATA/skills/docker-workflows /tmp/test/.claude/skills/
    # 启动Claude Code,测试技能
  3. 关联到实际项目:
    bash
    cd ~/Workdir/real-project
    ln -s $CLAUDE_METADATA/skills/docker-workflows .claude/skills/
  4. 与团队共享:
    bash
    cd $CLAUDE_METADATA
    git add skills/docker-workflows/
    git commit -m "Add docker-workflows skill"
    git push

Workflow 2: Updating Skill After Learning

工作流2:学习后更新技能

  1. Work with Claude, discover pattern
  2. Tell Claude: "Add this pattern to the vgp-pipeline skill"
  3. Claude updates:
    $CLAUDE_METADATA/skills/vgp-pipeline/SKILL.md
  4. Review changes:
    git diff
  5. Commit:
    git commit -m "Add WF8 troubleshooting pattern"
  6. Push:
    git push
    (if using team repo)
  7. All projects auto-updated via symlinks! 🎉
  1. 与Claude协作,发现新模式
  2. 告诉Claude:"Add this pattern to the vgp-pipeline skill"
  3. Claude更新
    $CLAUDE_METADATA/skills/vgp-pipeline/SKILL.md
  4. 审查更改
    git diff
  5. 提交
    git commit -m "Add WF8 troubleshooting pattern"
  6. 推送
    git push
    (如果使用团队仓库)
  7. 所有项目通过关联链接自动更新! 🎉

Workflow 3: Setting Up New Project

工作流3:设置新项目

  1. Create .claude directory:
    bash
    cd ~/Workdir/new-project
    mkdir -p .claude/skills .claude/commands
  2. Symlink essential global skills:
    bash
    # Always include these
    ln -s $CLAUDE_METADATA/skills/token-efficiency .claude/skills/token-efficiency
    ln -s $CLAUDE_METADATA/skills/claude-collaboration .claude/skills/claude-collaboration
    ln -s $CLAUDE_METADATA/skills/python-environment-management .claude/skills/python-environment-management
  3. Symlink ALL global commands:
    bash
    # Always include for all projects
    ln -s $CLAUDE_METADATA/commands/global/*.md .claude/commands/
  4. Add project-specific skills (if needed):
    bash
    # For Galaxy projects:
    ln -s $CLAUDE_METADATA/skills/galaxy-automation .claude/skills/galaxy-automation
  5. Tell Claude (or use
    /setup-project
    if already linked):
    I've set up the essential skills and commands. Show me other available skills in
    $CLAUDE_METADATA that might be relevant for [describe your project type].
    Or simply:
    /list-skills
  6. Claude shows list, you choose project-specific skills
  7. Claude creates additional symlinks
  8. Commit symlinks to project:
    bash
    git add .claude/
    git commit -m "Add Claude Code configuration
    
    Essential global skills and commands:
    - token-efficiency (token optimization)
    - claude-collaboration (team best practices)
    - galaxy-automation (BioBlend & Planemo)
    - Global commands: /update-skills, /list-skills, /setup-project
    
    [Additional project-specific skills if added]"
  9. Team members get symlinks via git pull
  10. Team members point to their $CLAUDE_METADATA
    • They need to set
      $CLAUDE_METADATA
      in their shell config
    • Symlinks work automatically once environment variable is set
Pro tip: Use
/update-skills
at the end of productive sessions to capture new learnings!

  1. 创建.claude目录:
    bash
    cd ~/Workdir/new-project
    mkdir -p .claude/skills .claude/commands
  2. 关联必备的全局技能:
    bash
    # 始终包含这些
    ln -s $CLAUDE_METADATA/skills/token-efficiency .claude/skills/token-efficiency
    ln -s $CLAUDE_METADATA/skills/claude-collaboration .claude/skills/claude-collaboration
    ln -s $CLAUDE_METADATA/skills/python-environment-management .claude/skills/python-environment-management
  3. 关联所有全局命令:
    bash
    # 始终为所有项目包含
    ln -s $CLAUDE_METADATA/commands/global/*.md .claude/commands/
  4. 添加项目特定技能(如果需要):
    bash
    # 对于Galaxy项目:
    ln -s $CLAUDE_METADATA/skills/galaxy-automation .claude/skills/galaxy-automation
  5. 告诉Claude(或如果已关联则使用
    /setup-project
    ):
    我已配置了必备技能和命令。告诉我$CLAUDE_METADATA中可能与[描述你的项目类型]相关的其他可用技能。
    或者直接:
    /list-skills
  6. Claude显示列表,你选择项目特定技能
  7. Claude创建额外的关联链接
  8. 将关联链接提交到项目:
    bash
    git add .claude/
    git commit -m "Add Claude Code configuration
    
    Essential global skills and commands:
    - token-efficiency (token optimization)
    - claude-collaboration (team best practices)
    - galaxy-automation (BioBlend & Planemo)
    - Global commands: /update-skills, /list-skills, /setup-project
    
    [Additional project-specific skills if added]"
  9. 团队成员通过git pull获取关联链接
  10. 团队成员指向他们的$CLAUDE_METADATA
    • 他们需要在shell配置中设置
      $CLAUDE_METADATA
    • 一旦设置了环境变量,关联链接会自动生效
专业提示: 在高效会话结束时使用
/update-skills
捕获新的经验!

Repository Maintenance

仓库维护

Periodic Cleanup to Remove Redundancies

定期清理以消除冗余

As your skill repository grows, redundancies can accumulate from:
  • Legacy files after reorganizations
  • Duplicate documentation in different locations
  • Outdated quick-start guides
  • Superseded command files
Cleanup workflow:
  1. Identify redundancies:
    bash
    # List all markdown files
    find $CLAUDE_METADATA -name "*.md" -type f | sort
    
    # Compare similar files
    diff file1.md file2.md
    
    # Search for overlapping content
    grep -r "specific topic" $CLAUDE_METADATA
  2. Categorize files:
    • Skills (must be unique, in
      skills/*/SKILL.md
      )
    • Supporting docs (should be in skill subdirectories)
    • Commands (one version only, in
      commands/category/
      )
    • Root docs (only README.md, QUICK_REFERENCE.md)
  3. Always backup before cleanup:
    bash
    cd $CLAUDE_METADATA
    mkdir -p .backup-$(date +%Y%m%d-%H%M%S)
    cp -r files-to-modify .backup-$(date +%Y%m%d-%H%M%S)/
  4. Consolidation patterns:
    • Standalone docs → Move to
      skills/skill-name/reference.md
    • Legacy commands → Remove if superseded by new versions
    • Duplicate guides → Consolidate into single skill
    • Quick reference prompts → Replace with standardized QUICK_REFERENCE.md
  5. Update skill to reference supporting docs:
    markdown
    ## Supporting Documentation
    
    This skill includes detailed reference documentation:
    - **reference.md** - Comprehensive guide
    - **troubleshooting.md** - Common issues and solutions
  6. Verify structure:
    bash
    tree -L 3 $CLAUDE_METADATA
    # Should show clean, logical organization
Benefits of regular cleanup:
  • Reduces confusion about which file to use
  • Improves discoverability via progressive disclosure
  • Easier maintenance (single source of truth)
  • Faster skill loading (no duplicate content)

随着技能仓库的增长,冗余内容会从以下方面积累:
  • 重组后的遗留文件
  • 不同位置的重复文档
  • 过时的快速入门指南
  • 被取代的命令文件
清理工作流:
  1. 识别冗余内容:
    bash
    # 列出所有markdown文件
    find $CLAUDE_METADATA -name "*.md" -type f | sort
    
    # 比较相似文件
    diff file1.md file2.md
    
    # 搜索重叠内容
    grep -r "specific topic" $CLAUDE_METADATA
  2. 分类文件:
    • 技能(必须唯一,位于
      skills/*/SKILL.md
    • 支持文档(应位于技能子目录中)
    • 命令(仅一个版本,位于
      commands/category/
    • 根文档(仅README.md, QUICK_REFERENCE.md)
  3. 清理前始终备份:
    bash
    cd $CLAUDE_METADATA
    mkdir -p .backup-$(date +%Y%m%d-%H%M%S)
    cp -r files-to-modify .backup-$(date +%Y%m%d-%H%M%S)/
  4. 整合模式:
    • 独立文档 → 移动到
      skills/skill-name/reference.md
    • 遗留命令 → 如果被新版本取代则删除
    • 重复指南 → 整合到单个技能中
    • 快速参考提示 → 替换为标准化的QUICK_REFERENCE.md
  5. 更新技能以引用支持文档:
    markdown
    ## 支持文档
    
    此技能包含详细的参考文档:
    - **reference.md** - 综合指南
    - **troubleshooting.md** - 常见问题与解决方案
  6. 验证结构:
    bash
    tree -L 3 $CLAUDE_METADATA
    # 应显示清晰、逻辑化的组织
定期清理的优势:
  • 减少对使用哪个文件的困惑
  • 通过渐进式展示提高可发现性
  • 更易于维护(单一真相来源)
  • 技能加载更快(无重复内容)

Summary

总结

Key Principles:
  1. Central repository - All skills in
    $CLAUDE_METADATA
  2. Symlinks, not copies - Updates propagate automatically
  3. Version control - Track changes with git
  4. Essential global skills first - Always symlink token-efficiency, claude-collaboration, and python-environment-management
  5. Selective activation - Link only relevant skills per project
  6. Team collaboration - Share via git, everyone benefits
Every new project should start with:
bash
undefined
核心原则:
  1. 集中仓库 - 所有技能位于
    $CLAUDE_METADATA
  2. 关联链接,而非复制 - 更新自动传播
  3. 版本控制 - 使用git跟踪更改
  4. 优先必备全局技能 - 始终关联token-efficiency、claude-collaboration和python-environment-management
  5. 选择性激活 - 每个项目仅关联相关技能
  6. 团队协作 - 通过git共享,人人受益
每个新项目都应从以下开始:
bash
undefined

Essential global skills (always)

必备全局技能(始终)

ln -s $CLAUDE_METADATA/skills/token-efficiency .claude/skills/token-efficiency ln -s $CLAUDE_METADATA/skills/claude-collaboration .claude/skills/claude-collaboration ln -s $CLAUDE_METADATA/skills/python-environment-management .claude/skills/python-environment-management
ln -s $CLAUDE_METADATA/skills/token-efficiency .claude/skills/token-efficiency ln -s $CLAUDE_METADATA/skills/claude-collaboration .claude/skills/claude-collaboration ln -s $CLAUDE_METADATA/skills/python-environment-management .claude/skills/python-environment-management

ALL global commands (always include for management)

所有全局命令(始终包含用于管理)

ln -s $CLAUDE_METADATA/commands/global/*.md .claude/commands/
ln -s $CLAUDE_METADATA/commands/global/*.md .claude/commands/

Project-specific skills (add as needed)

项目特定技能(按需添加)

For Galaxy projects:

对于Galaxy项目:

ln -s $CLAUDE_METADATA/skills/galaxy-automation .claude/skills/galaxy-automation

ln -s $CLAUDE_METADATA/skills/galaxy-automation .claude/skills/galaxy-automation


**Available global commands:**
- `/update-skills` - Capture learnings from current session
- `/list-skills` - Show all available skills
- `/setup-project` - Set up a new project intelligently
- `/sync-skills` - Check for new skills/commands to symlink
- `/cleanup-project` - End-of-project cleanup (removes working docs, condenses READMEs)

**Remember:** The centralized pattern makes skills:
- ✅ Maintainable (update once, apply everywhere)
- ✅ Shareable (team uses same knowledge)
- ✅ Versionable (track evolution with git)
- ✅ Scalable (works for 1 or 100 projects)
- ✅ Efficient (progressive disclosure = no token waste)

**With token-efficiency skill active:**
- 80-90% token savings on typical operations
- 5-10x more interactions from your Claude Pro subscription
- Strategic file reading for learning and debugging

**可用全局命令:**
- `/update-skills` - 捕获当前会话的经验
- `/list-skills` - 显示所有可用技能
- `/setup-project` - 智能设置新项目
- `/sync-skills` - 检查要关联的新技能/命令
- `/cleanup-project` - 项目收尾清理(移除工作文档、精简README)

**记住:** 集中式模式让技能:
- ✅ 易于维护(更新一次,应用到所有地方)
- ✅ 易于共享(团队使用相同知识)
- ✅ 可版本化(用git跟踪演变)
- ✅ 可扩展(适用于1个或100个项目)
- ✅ 高效(渐进式展示 = 无token浪费)

**当token-efficiency技能激活时:**
- 在典型操作中节省80-90%的token
- 你的Claude Pro订阅可支持5-10倍更多交互
- 为学习和调试智能读取文件