feat: deploy skills pipeline with provider adapter pattern

This commit is contained in:
2026-05-15 08:46:25 +00:00
parent c0ede4b22e
commit 15a4387eb2
39 changed files with 175 additions and 104 deletions

View File

@@ -19,7 +19,7 @@ DEPLOY_DIRS=(
"core:.claude/core"
)
# Empty directories to create if absent
DEPLOY_EMPTY_DIRS=(
".agents/skills"
)
# Skills — merged per-skill into canonical location (parent not wiped, user skills preserved)
DEPLOY_SKILLS_SRC=".agents/skills"
# Provider skill adapters are declared in providers/*/provider-manifest.sh, not here.

View File

@@ -5,6 +5,13 @@ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck source=deploy-manifest.sh
source "$REPO_ROOT/scripts/deploy-manifest.sh"
# Collect provider skill adapters from all provider-manifest.sh files
SKILL_ADAPTERS=()
for provider_manifest in "$REPO_ROOT"/providers/*/provider-manifest.sh; do
# shellcheck source=/dev/null
source "$provider_manifest"
done
echo "Installing from $REPO_ROOT..."
for entry in "${DEPLOY_FILES[@]}"; do
@@ -27,8 +34,25 @@ for entry in "${DEPLOY_DIRS[@]}"; do
cp -r "$REPO_ROOT/${entry%%:*}/." "$dest/"
done
for dir in "${DEPLOY_EMPTY_DIRS[@]}"; do
mkdir -p "$HOME/$dir"
# Deploy skills to canonical location — merge per-skill, never wipe the parent
skills_dest="$HOME/$DEPLOY_SKILLS_SRC"
mkdir -p "$skills_dest"
for skill_dir in "$REPO_ROOT/$DEPLOY_SKILLS_SRC"/*/; do
skill_name="$(basename "$skill_dir")"
rm -rf "$skills_dest/$skill_name"
cp -r "$skill_dir" "$skills_dest/$skill_name"
done
# Create provider skill adapters as symlinks to the canonical skills location
for adapter in "${SKILL_ADAPTERS[@]}"; do
target="$HOME/$adapter"
if [ -L "$target" ]; then
ln -sfn "$skills_dest" "$target"
elif [ -d "$target" ]; then
echo "Warning: $target exists as a real directory — remove it and re-run install to create the skill adapter symlink."
else
ln -s "$skills_dest" "$target"
fi
done
echo ""
@@ -39,6 +63,7 @@ done
for entry in "${DEPLOY_DIRS[@]}"; do
echo " ~/${entry##*:}/"
done
for dir in "${DEPLOY_EMPTY_DIRS[@]}"; do
echo " ~/$dir/ (directory created)"
echo " ~/$DEPLOY_SKILLS_SRC/ (skills)"
for adapter in "${SKILL_ADAPTERS[@]}"; do
echo " ~/$adapter -> ~/$DEPLOY_SKILLS_SRC (symlink)"
done