Skip to content

Refactor install_skill into reusable filesystem helpers #967

Description

@jana-selva

Follow-up to PR #966 review comment: #966 (comment)

Background

install_skill() currently combines skill-resource discovery, path-safety checks, directory handling, and file copying. As more skill validation or installation behavior is added, this makes the function harder to test and maintain.

Proposed work

  • Split install_skill() into smaller focused helpers.
  • Extract reusable filesystem/path-safety checks where appropriate.
  • Keep protection against path traversal, symlinked paths, symlink replacement, and non-directory targets.
  • Preserve the current public behavior and error messages unless a deliberate API change is documented.
  • Add targeted unit tests for the extracted helpers and keep an integration test for end-to-end skill installation.

Scope

This is intentionally separate from PR #966 to avoid expanding that PR beyond packaged-skill support.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions