feat(skills): populate every detected runtime's skills dir#65
Merged
Conversation
Runtime auto-detection was single-pick, first-match-wins. On a machine with both claude and opencode installed, `./setup.sh --skills-only` silently populated only one runtime's skills dir (.claude/skills/ won via cascade). Users had to re-run with explicit `--runtime opencode` to get skills into the other dir. Track all detected runtimes in DETECTED_RUNTIMES[] alongside the primary RUNTIME. In install_skills and print_skills_summary, iterate every detected runtime, resolve its skills dir via _resolve_skills_dir_for_runtime() (sources the runtime file in a subshell so the primary runtime's functions stay intact), and install into each unique dir. claude-code + studio-code both resolve to $SITE_PATH/.claude/skills, so paths are de-duped. Explicit `--runtime <name>` still narrows to a single runtime (single-runtime-mode preserved for users who want that). The primary RUNTIME keeps driving runtime_install, runtime_generate_config, runtime_install_hooks, and the chat-bridge default — nothing else changes in the single-runtime path. Closes #63.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #63.
Runtime auto-detection in
setup.sh(andupgrade.sh) was single-pick, first-match-wins:On a machine with both
claudeandopencodeinstalled, cascade pickedclaude-codesilently.SKILLS_DIR="$(runtime_skills_dir)"resolved to a single runtime's dir (.claude/skills/vs.opencode/skills/), so./setup.sh --skills-onlyonly ever populated one runtime. To get skills into the other runtime users had to re-run with explicit--runtime opencode.Fix
Track all detected runtimes in a new
DETECTED_RUNTIMES[]array alongside the existing primaryRUNTIME. Ininstall_skillsandprint_skills_summary, iterate every detected runtime, resolve its skills dir, and install into each unique dir.setup.sh/upgrade.shDETECTED_RUNTIMES=()array populated during auto-detect (studio-code → claude-code → opencode, keeps existing cascade order).RUNTIME="\${DETECTED_RUNTIMES[0]}"— primary stays first-match.--runtime <name>narrows both lists to the single runtime (preserves single-runtime-mode for users who want it).lib/skills.sh_resolve_skills_dir_for_runtime()helper sources a runtime file in a subshell and echoes itsruntime_skills_dir. Avoids polluting the primary runtime's functions.install_skillsbuilds a unique list of skills dirs acrossDETECTED_RUNTIMES(de-duped — claude-code and studio-code both resolve to\$SITE_PATH/.claude/skills) and installs into each.SKILLS_DIRis restored at the end so the kimaki mirror source, persistent-source mirror, and summary output keep working against the primary runtime's dir.print_skills_summarynow lists every populated dir.The primary
RUNTIMEstill drivesruntime_install,runtime_generate_config,runtime_install_hooks, and the chat-bridge default — nothing else changes in the single-runtime path.Testing
bash -n setup.sh upgrade.sh lib/skills.sh— passes.tests/bridge-render.sh— all 8 snapshots byte-identical.claudeandopencodeon PATH:.claude/skills/and.opencode/skills/populated with all 5 skills. Kimaki mirror (\$(npm root -g)/kimaki/skills/) and persistent source (~/.kimaki/kimaki-config/skills/) still single-sourced from the primary runtime's dir as before.--runtime claude-codereduces back to just.claude/skills/with no multi-runtime banner.AI assistance
.claude/skills/and.opencode/skills/populated in a single run).