Skip to content

feat(skills): auto-provision bundled skills to managed dir on startup#2090

Merged
bug-ops merged 2 commits intomainfrom
feat/issue-2089/auto-provision-bundled-skills
Mar 21, 2026
Merged

feat(skills): auto-provision bundled skills to managed dir on startup#2090
bug-ops merged 2 commits intomainfrom
feat/issue-2089/auto-provision-bundled-skills

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 21, 2026

Closes #2089

Summary

  • Embeds all skills from .zeph/skills/ into the binary at compile time via include_dir! (gated behind bundled-skills feature, enabled by default and in full)
  • On startup, provision_bundled_skills() is called before SkillRegistry::load() — missing or outdated bundled skills are written to the managed dir (~/.config/zeph/skills/)
  • User-owned skills (no .bundled marker) are never overwritten
  • Provisioning is atomic: files are written to a temp dir, then renamed into place — interrupted writes leave no partial state and are re-provisioned on next startup
  • Version comparison uses != so rollback also downgrades skills to the older bundled version

Key fix found during review

include_dir 0.7 dirs() returns empty at root level; only entries() works. Without this fix the entire feature would silently install 0 skills. Caught by the end-to-end integration test added in the fix-review cycle.

Test plan

  • cargo nextest run -p zeph-skills — 6 unit tests pass (5 new for helpers + 1 integration for main flow)
  • cargo nextest run --workspace --lib --bins — 5769 tests pass
  • cargo clippy --workspace -- -D warnings — clean
  • cargo +nightly fmt --check — clean
  • Feature flag: cargo check -p zeph-skills (no bundled-skills) compiles without include_dir

bug-ops added 2 commits March 21, 2026 22:52
…#2089)

On every startup, bundled skills embedded at compile time via include_dir!
are copied to ~/.config/zeph/skills/ if missing or if the embedded version
differs from the previously provisioned version (.bundled marker file).

- User-installed skills (no .bundled marker) are never overwritten
- Atomic provisioning: writes to a temp dir, then renames into place so
  interrupted writes are treated as absent and re-provisioned on next startup
- Version comparison uses != so binary rollback downgrades bundled skills
- bundled-skills feature flag (default + full); packagers can opt out
- build.rs guard emits a clear error if .zeph/skills/ is missing at compile time
- DEBUG log when all bundled skills are already up to date
- Non-skill entries (README.md) are filtered by requiring SKILL.md presence
- 5 new unit tests: frontmatter parsing, marker state variants
- Replace Dir::dirs() with entries() filter on root Dir — dirs() returns
  empty on the embedded root in include_dir 0.7; entries() correctly
  yields all 24 skill subdirectories
- Fix get_file() calls to use root-relative paths (e.g. "api-request/SKILL.md")
  instead of relative-to-dir paths, matching include_dir 0.7 lookup semantics
- Replace draft self-contradicting comment in write_skill() with concise
  atomic-rename guarantee description (R1)
- Add provision_to_empty_dir_installs_all_skills integration test (R2):
  provisions to a temp dir and asserts every skill has SKILL.md + .bundled
@github-actions github-actions bot added documentation Improvements or additions to documentation skills zeph-skills crate rust Rust code changes core zeph-core crate dependencies Dependency updates enhancement New feature or request size/L Large PR (201-500 lines) labels Mar 21, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 21, 2026 22:19
@bug-ops bug-ops merged commit 3b45e28 into main Mar 21, 2026
25 checks passed
@bug-ops bug-ops deleted the feat/issue-2089/auto-provision-bundled-skills branch March 21, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/L Large PR (201-500 lines) skills zeph-skills crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: auto-provision new bundled skills to managed dir on upgrade

1 participant