我的 Skill
manage-skills-catalog
审查并维护个人与开源 Skills 目录,固定来源版本并阻止敏感信息进入公开站点。
- 收录个人 Skill
- 审查开源 Skill 来源
- 更新固定版本和公开元数据
把它带到你的 Codex。
执行前需在本机配置 gitlab-personal SSH 身份,并拥有私有仓库访问权限。
显示安装命令
set -euo pipefail
skill_name='manage-skills-catalog'
source_url='git@gitlab-personal:seven-grove/tools/personal-codex-skills.git'
source_ref='e279b316f8dfd3de07a84dc394c533dc2d08a80c'
source_subdirectory='skills/manage-skills-catalog'
temp_root=$(mktemp -d)
backup_root="${CODEX_HOME:-$HOME/.codex}/skills-backups"
target_root="${CODEX_HOME:-$HOME/.codex}/skills"
backup_path=""
install_complete="0"
restore_previous() {
if [ "$install_complete" != "1" ]; then
rm -rf "$target_root/$skill_name"
if [ -n "$backup_path" ] && [ -d "$backup_path" ]; then
mv "$backup_path" "$target_root/$skill_name"
fi
fi
}
cleanup() { rm -rf "$temp_root"; }
trap 'restore_previous; cleanup' EXIT
git clone --filter=blob:none --no-checkout "$source_url" "$temp_root/repo"
git -C "$temp_root/repo" checkout "$source_ref" -- "$source_subdirectory"
test -f "$temp_root/repo/$source_subdirectory/SKILL.md"
mkdir -p "$target_root" "$backup_root"
if [ -e "$target_root/$skill_name" ]; then
backup_path="$backup_root/$skill_name-$(date +%Y%m%d-%H%M%S)"
mv "$target_root/$skill_name" "$backup_path"
fi
cp -R "$temp_root/repo/$source_subdirectory" "$target_root/$skill_name"
test -f "$target_root/$skill_name/SKILL.md"
install_complete="1"
printf 'Installed %s\n' "$target_root/$skill_name"
if [ -n "$backup_path" ]; then printf 'Backup %s\n' "$backup_path"; fi