feat(pi): implement milestone M2 - script-backed skills

This commit is contained in:
Stefano Fiorini
2026-04-23 16:04:39 -05:00
parent 7ba6f90e14
commit 51372eb420
32 changed files with 5299 additions and 1 deletions
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
SOURCE_DIR="${ROOT_DIR}/codex/scripts"
TARGETS=(
"claude-code"
"opencode"
"pi"
)
replace_dir() {
local source=$1
local target=$2
if [[ -z "$target" || "$target" == "/" || "$target" == "." || "$target" == ".." ]]; then
echo "Refusing to sync into unsafe target: $target" >&2
exit 1
fi
case "$target" in
"${ROOT_DIR}"/*) ;;
*)
echo "Refusing to remove target outside root: $target" >&2
exit 1
;;
esac
rm -rf "$target"
mkdir -p "$target"
cp -R "${source}/." "$target/"
}
if [[ ! -d "$SOURCE_DIR" ]]; then
echo "Missing canonical source directory: $SOURCE_DIR" >&2
exit 1
fi
for variant in "${TARGETS[@]}"; do
replace_dir "$SOURCE_DIR" "${ROOT_DIR}/${variant}/scripts"
done
echo "Synced web-automation scripts from codex into ${#TARGETS[@]} variant directories."