mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-07 07:55:13 +02:00
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:
parent
2e10a2d0be
commit
0ae9b6effd
1 changed files with 37 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue