Files
ai-proj-helper/skills/skill-manager-plugin/init-registry.sh
John Qiu 99881e268a refactor: 合并 claude-marketplace,重构目录结构为单一仓库
- 重命名 plugins/ → skills/,个人插件迁移到 skills-personal/(gitignore)
- 更新 generate-marketplace.py 支持 config 读取和 skills-personal 扫描
- 新增 claude-config.yaml(技能启用/禁用 + MCP 配置)
- 新增 init.sh(交互式 MCP 初始化,支持 stdio/SSE 模式)
- 新增 CLAUDE.md 项目说明
- 重写 README.md 反映新结构
- 删除过时脚本:PUSH.sh、generate-marketplace.sh、convert-skills.sh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 11:11:59 +10:30

59 lines
1.4 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# init-registry.sh - 初始化技能注册表
# 用法: ./init-registry.sh
set -e
SKILLS_DIR="$HOME/.claude/skills"
REGISTRY_FILE="$SKILLS_DIR/registry.yaml"
REPOS_DIR="$SKILLS_DIR/repos"
# 颜色定义
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
echo "初始化 Skills Registry..."
echo "----------------------------------------"
# 创建 repos 目录
if [ ! -d "$REPOS_DIR" ]; then
mkdir -p "$REPOS_DIR"
echo -e "${GREEN}✓ 创建 repos 目录${NC}"
else
echo -e "${YELLOW}⚠ repos 目录已存在${NC}"
fi
# 创建 registry.yaml
if [ ! -f "$REGISTRY_FILE" ]; then
cat > "$REGISTRY_FILE" << 'EOF'
# Skills Registry - 技能注册表
# 由 skill-manager 自动管理,请勿手动编辑
version: 1
updated_at: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
# 全局配置
config:
auto_update_check: true # 启动时检查更新
update_check_interval: 86400 # 检查间隔默认24小时
default_branch: main # 默认分支
# 已安装技能
skills: {}
EOF
# 替换日期
sed -i '' "s/\$(date -u +\"%Y-%m-%dT%H:%M:%SZ\")/$(date -u +"%Y-%m-%dT%H:%M:%SZ")/" "$REGISTRY_FILE"
echo -e "${GREEN}✓ 创建 registry.yaml${NC}"
else
echo -e "${YELLOW}⚠ registry.yaml 已存在${NC}"
fi
echo "----------------------------------------"
echo -e "${GREEN}✓ 初始化完成${NC}"
echo ""
echo "目录结构:"
echo " $SKILLS_DIR/"
echo " ├── registry.yaml"
echo " └── repos/"