diff --git a/scripts/conductor-setup.sh b/scripts/conductor-setup.sh index 3bb40b40..15dbf776 100755 --- a/scripts/conductor-setup.sh +++ b/scripts/conductor-setup.sh @@ -99,9 +99,46 @@ link_agent_overlays() { ln -s "${KTX_AGENT_OVERLAYS_ROOT}/.agents" .agents } +# Expose .agents/skills/* to Claude Code by symlinking each entry under +# .claude/skills/. Codex CLI reads .agents/skills/ directly; Claude Code only +# scans .claude/skills/, so the overlay needs both sides to be visible to both +# tools. +link_agent_skills_for_claude() { + if [ ! -d .agents/skills ]; then + return 0 + fi + + mkdir -p .claude/skills + + for skill_path in .agents/skills/*; do + [ -e "$skill_path" ] || continue + + local skill_name + skill_name="$(basename "$skill_path")" + local link_path=".claude/skills/$skill_name" + local target="../../.agents/skills/$skill_name" + + if [ -L "$link_path" ]; then + if [ "$(readlink "$link_path")" = "$target" ]; then + continue + fi + echo "Skipping $link_path: existing symlink points elsewhere." >&2 + continue + fi + + if [ -e "$link_path" ]; then + echo "Skipping $link_path: already exists and is not a symlink." >&2 + continue + fi + + ln -s "$target" "$link_path" + done +} + echo "=== Conductor KTX workspace setup ===" link_agent_overlays +link_agent_skills_for_claude if [ -n "${CONDUCTOR_ROOT_PATH:-}" ] && [ -f "$CONDUCTOR_ROOT_PATH/.env" ]; then ln -sf "$CONDUCTOR_ROOT_PATH/.env" .env