Skip to content

Add Rust include_dir bundle support for embedded skill trees #18

Description

@samzong

Problem

Kitup already treats a skill bundle as a directory tree: SKILL.md, references/, scripts/, assets/, and other regular files should be validated, hashed, and copied together.

The Go SDK has a good embedded-tree path through FSBundle(embed.FS, root), so embedding CLIs can ship a whole skill directory without manually listing every file.

The Rust SDK currently has directory_bundle(path) and files_bundle(files). For a released CLI binary, directory_bundle depends on a runtime filesystem path, while files_bundle pushes Rust CLI authors toward hand-maintaining a SkillFile list with include_bytes!. That becomes brittle as soon as a skill adds references/*.md, scripts, or assets.

Proposal

Add an optional Rust SDK integration for include_dir, exposed as a thin constructor over the existing bundle model.

Possible API shape:

static SKILL: include_dir::Dir<'_> =
    include_dir::include_dir!("$CARGO_MANIFEST_DIR/../skills/mycli");

let bundle = kitup::include_dir_bundle(&SKILL);

Implementation should stay boring:

  • add an optional Cargo feature such as include-dir = ["dep:include_dir"];
  • traverse include_dir::Dir into Vec<SkillFile>;
  • reuse existing files_bundle / normalization / hashing / copy behavior;
  • do not introduce a new installer path or new bundle semantics.

Why not build this from scratch?

Rust does not have a standard-library equivalent of Go embed.FS, but the ecosystem already has include_dir, whose explicit purpose is embedding a directory tree into a binary. Kitup should adapt that type instead of becoming a resource-embedding framework.

Acceptance criteria

  • Rust SDK can construct a skill bundle from an embedded include_dir::Dir.
  • Embedded bundles include nested files such as references/*.md, scripts/*, and assets/* without manually listing every file.
  • Existing deterministic hash, skip-file, validation, copy, and ownership behavior is reused.
  • Add a focused Rust test or golden coverage proving an embedded directory bundle installs the same tree shape as the current file-list fixture.
  • Update Rust README/API docs with the embedded skill bundle example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions