Expose .agents/skills overlay to Claude Code (#10)

Conductor workspaces symlink `.agents` from KTX_AGENT_OVERLAYS_ROOT, which
Codex CLI reads directly. Claude Code only scans `.claude/skills/`, so the
shared skills were invisible to it. Add `link_agent_skills_for_claude` to
mirror each `.agents/skills/*` entry as a symlink under `.claude/skills/*`.
Idempotent and refuses to clobber existing non-matching entries.
This commit is contained in:
Andrey Avtomonov 2026-05-11 16:21:40 +02:00 committed by GitHub
parent 2e10a2d0be
commit 0ae9b6effd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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