Skip to content

fix: add missing ensure_skills_clone helper function#67

Merged
royosherove merged 1 commit into
mainfrom
fix/ensure-skills-clone
May 18, 2026
Merged

fix: add missing ensure_skills_clone helper function#67
royosherove merged 1 commit into
mainfrom
fix/ensure-skills-clone

Conversation

@royosherove
Copy link
Copy Markdown
Member

P1 Fix: Codex detected that PR #66 calls ensure_skills_clone() in all pack installers but the function was never defined in packs/common.sh, causing 'command not found' errors silently wrapped in || true.

Changes

  • Adds ensure_skills_clone() helper to packs/common.sh
  • Git availability check (gracefully skips if missing)
  • Update path: fetch + checkout existing repos (same origin)
  • Partial recovery: move aside incomplete dirs, re-clone fresh
  • Shallow clone: --depth 1 to minimize bandwidth
  • Non-fatal by default (warn mode); optional fail mode per caller

Impact

Codex P1: PR #66 calls ensure_skills_clone() in all pack installers but
the function was never defined in packs/common.sh, causing 'command not found'
silently wrapped in || true.

This adds the helper with:
- Git availability check (skips gracefully if missing)
- Update existing repo (same origin fetch + checkout)
- Partial dir recovery (move aside + fresh clone)
- Shallow clone (--depth 1 to minimize bandwidth)
- Non-fatal error handling (warn mode default, fail mode optional)

All pack installers can now properly clone loki-skills on bootstrap.
@royosherove royosherove merged commit 2b4e52e into main May 18, 2026
3 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5c19ea798

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packs/common.sh
local origin_url="$(cd "$target_dir" && git config --get remote.origin.url 2>/dev/null)"
if [[ "$origin_url" == "$repo_url" ]]; then
# Same origin, safe to update
if (cd "$target_dir" && git fetch origin "$branch" && git checkout "$branch") &>/dev/null; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Advance branch to fetched tip before reporting update

git fetch origin "$branch" && git checkout "$branch" does not move an existing local branch to the newly fetched origin/$branch, so this path can return success while leaving an outdated skills checkout. In practice, if the local branch is behind, the function logs "updated" and exits 0 even though no new commits were applied; use a fast-forward/pull/reset step after fetch to ensure the working tree matches the remote tip.

Useful? React with 👍 / 👎.

Comment thread packs/common.sh
fi

# Fresh clone (shallow)
if ! git clone --depth 1 --branch "$branch" "$repo_url" "$target_dir" &>/dev/null; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Create clone parent directory before invoking git clone

The fresh-clone path calls git clone directly into target_dir but never creates $(dirname "$target_dir"). On first-run installs where that parent path does not exist (for example ~/.local/share/lowkey/skills), clone fails immediately and skills are not installed, even though the installers continue via || true.

Useful? React with 👍 / 👎.

royosherove added a commit that referenced this pull request May 18, 2026
PR #66+#67 shipped with incorrect skills directory paths for several packs.
This correction PR aligns all pack install scripts with official documentation
verified via Tavily web search (2026-05-18).

**Changes:**

packs/pi/install.sh:
  - pi/agent/skills/ → pi/agent/extensions/
  - Pi loads TypeScript extensions from extensions/, not direct skills

packs/hermes/install.sh:
  - ~/.local/share/lowkey/skills → ~/.hermes/skills/
  - Hermes auto-discovers from ~/.hermes/skills/ with slash-command triggers

packs/codex-cli/install.sh:
  - ~/.local/share/lowkey/skills → ~/.codex/skills/
  - Codex auto-discovers SKILL.md files from ~/.codex/skills/ on startup
  - Invoke with $<skill-name>

packs/claude-code/install.sh:
  - ~/.local/share/lowkey/skills → ~/.claude/skills/
  - Claude Code auto-discovers SKILL.md from ~/.claude/skills/
  - Invoke with / prefix + always-on context via CLAUDE.md

packs/ironclaw/install.sh:
  - Remove skills pre-install (MCP-native only)
  - IronClaw extends via MCP servers, not local skills
  - Reference docs: BOOTSTRAP-MCPORTER.md

**Verified paths (per official docs):**
- openclaw: ~/.openclaw/workspace/skills/ ✅ (unchanged)
- pi: ~/.pi/agent/extensions/ (was skills/)
- hermes: ~/.hermes/skills/ (was shared cache)
- codex-cli: ~/.codex/skills/ (was shared cache)
- claude-code: ~/.claude/skills/ (was shared cache)
- ironclaw: MCP only (removed pre-install)
- kiro-cli: MCP servers (deferred for Phase 3)
- nemoclaw: inherits openclaw pattern

**Testing:**
- All 6 affected pack install.sh scripts validated
- ensure_skills_clone() helper still works with new paths
- Non-fatal error handling preserved

Fixes: PR #66+#67 path mismatch
royosherove added a commit that referenced this pull request May 18, 2026
* fix: add missing ensure_skills_clone helper function

Codex P1: PR #66 calls ensure_skills_clone() in all pack installers but
the function was never defined in packs/common.sh, causing 'command not found'
silently wrapped in || true.

This adds the helper with:
- Git availability check (skips gracefully if missing)
- Update existing repo (same origin fetch + checkout)
- Partial dir recovery (move aside + fresh clone)
- Shallow clone (--depth 1 to minimize bandwidth)
- Non-fatal error handling (warn mode default, fail mode optional)

All pack installers can now properly clone loki-skills on bootstrap.

* fix: correct skills paths for all packs per official documentation

PR #66+#67 shipped with incorrect skills directory paths for several packs.
This correction PR aligns all pack install scripts with official documentation
verified via Tavily web search (2026-05-18).

**Changes:**

packs/pi/install.sh:
  - pi/agent/skills/ → pi/agent/extensions/
  - Pi loads TypeScript extensions from extensions/, not direct skills

packs/hermes/install.sh:
  - ~/.local/share/lowkey/skills → ~/.hermes/skills/
  - Hermes auto-discovers from ~/.hermes/skills/ with slash-command triggers

packs/codex-cli/install.sh:
  - ~/.local/share/lowkey/skills → ~/.codex/skills/
  - Codex auto-discovers SKILL.md files from ~/.codex/skills/ on startup
  - Invoke with $<skill-name>

packs/claude-code/install.sh:
  - ~/.local/share/lowkey/skills → ~/.claude/skills/
  - Claude Code auto-discovers SKILL.md from ~/.claude/skills/
  - Invoke with / prefix + always-on context via CLAUDE.md

packs/ironclaw/install.sh:
  - Remove skills pre-install (MCP-native only)
  - IronClaw extends via MCP servers, not local skills
  - Reference docs: BOOTSTRAP-MCPORTER.md

**Verified paths (per official docs):**
- openclaw: ~/.openclaw/workspace/skills/ ✅ (unchanged)
- pi: ~/.pi/agent/extensions/ (was skills/)
- hermes: ~/.hermes/skills/ (was shared cache)
- codex-cli: ~/.codex/skills/ (was shared cache)
- claude-code: ~/.claude/skills/ (was shared cache)
- ironclaw: MCP only (removed pre-install)
- kiro-cli: MCP servers (deferred for Phase 3)
- nemoclaw: inherits openclaw pattern

**Testing:**
- All 6 affected pack install.sh scripts validated
- ensure_skills_clone() helper still works with new paths
- Non-fatal error handling preserved

Fixes: PR #66+#67 path mismatch

---------

Co-authored-by: Roy Osherove <575051+royosherove@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant