Files
Profiles-for-Coder/templates/cobol/install-skills.sh
T
octoturge 22429aa4e3
Provision Coder Templates / provision (push) Successful in 2m10s
Make each Coder template self-contained (fix coder templates push failure)
coder templates push -d templates/<env> only uploads that directory to the
Coder server, so main.tf's file() references reaching outside it via
../../profile-templates and ../../scripts failed at push/apply time
("Invalid function argument ... this function works only with files that
are distributed as part of the configuration source code"). Confirmed via
an actual failed run of coder-templates.yml once the runner network fix let
it get that far.

Fix: duplicate profile.code-profile, cli-setup-wizard.sh, and
install-skills.sh into each templates/<env>/ directory and drop the old
shared scripts/ and profile-templates/ directories.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-23 16:52:12 +02:00

69 lines
2.5 KiB
Bash

#!/usr/bin/env bash
# Installs this repo's Agent Skills (extensions/{awesome-skills-plugin,
# custom-specialty-plugin}/skills/*, each a SKILL.md-based skill directory)
# into every AI CLI's personal skills directory:
#
# Claude Code CLI -> ~/.claude/skills/<name>/
# GitHub Copilot CLI -> ~/.copilot/skills/<name>/
# Antigravity CLI -> ~/.gemini/config/skills/<name>/ (per antigravity.google/docs/skills;
# worth a spot-check if agy doesn't pick these up, some third-party
# docs disagree on the exact path)
#
# Run once at workspace startup via coder_script. Pulls this repo fresh from
# Gitea rather than embedding ~2.5MB of skill files into Terraform state.
#
# Env vars:
# SPECIALTY_SKILLS - optional space-separated skill names from
# extensions/custom-specialty-plugin/skills/ to install in addition to
# the common awesome-skills-plugin bundle (every env gets that one).
set -e
REPO_ZIP_URL="https://git.octoturge.com/octoturge/Profiles-for-Coder/archive/main.zip"
ZIP_PATH="/tmp/coder-skills-src.zip"
WORK_DIR="/tmp/coder-skills-src"
rm -rf "$WORK_DIR" "$ZIP_PATH"
curl -fsSL "$REPO_ZIP_URL" -o "$ZIP_PATH"
mkdir -p "$WORK_DIR"
unzip -q -o "$ZIP_PATH" -d "$WORK_DIR"
INNER_DIR=$(find "$WORK_DIR" -mindepth 1 -maxdepth 1 -type d | head -n1)
if [ -z "$INNER_DIR" ]; then
echo "install-skills: couldn't find extracted repo contents, skipping." >&2
rm -rf "$WORK_DIR" "$ZIP_PATH"
exit 0
fi
TARGET_DIRS=("$HOME/.claude/skills" "$HOME/.copilot/skills" "$HOME/.gemini/config/skills")
for dir in "${TARGET_DIRS[@]}"; do
mkdir -p "$dir"
done
# Common skill bundle, installed for every environment.
COMMON_SKILLS_SRC="$INNER_DIR/extensions/awesome-skills-plugin/skills"
if [ -d "$COMMON_SKILLS_SRC" ]; then
for dir in "${TARGET_DIRS[@]}"; do
cp -r "$COMMON_SKILLS_SRC/." "$dir/"
done
echo "install-skills: installed common skill bundle into ${TARGET_DIRS[*]}"
else
echo "install-skills: common skill bundle not found at $COMMON_SKILLS_SRC, skipping." >&2
fi
# Environment-specific specialty skills, if any were requested.
for skill in ${SPECIALTY_SKILLS:-}; do
SRC="$INNER_DIR/extensions/custom-specialty-plugin/skills/$skill"
if [ -d "$SRC" ]; then
for dir in "${TARGET_DIRS[@]}"; do
cp -r "$SRC" "$dir/$skill"
done
echo "install-skills: installed specialty skill '$skill'"
else
echo "install-skills: specialty skill '$skill' not found at $SRC, skipping." >&2
fi
done
rm -rf "$WORK_DIR" "$ZIP_PATH"
echo "install-skills: done."