Skip to content

Delete only the resource owned by the selected skill #557

Description

@spences10

Parent: #554

Problem

Root Markdown skills use the containing skills directory as baseDir. The manager's deletion operation validates containment and then recursively removes baseDir.

Deleting one root Markdown skill can therefore delete sibling skills and other contents of the shared directory.

Evidence and reproduction

Source baseline: 57f1407142e6318a5d0c935127b6461a5e87526a.

In a temporary project, create .pi/skills/one.md and .pi/skills/two.md, each with valid skill frontmatter. Discover them with create_skills_manager({ cwd }), then call delete_skill('one').

Observed: both skills were discovered, but two.md no longer existed after deleting one.

The isolated probe used the actual manager and scanner source with SDK leaf imports. It did not delete any real user skill files.

Acceptance criteria

  • Deleting a root Markdown skill removes only that file and preserves sibling files/directories.
  • A dedicated owned skill directory can still be deleted as a unit, including its associated resources.
  • Imported copies retain provenance-aware deletion and existing ownership checks.
  • Unsafe or ambiguous deletion targets are rejected before removal.
  • Existing explicit deletion confirmation remains in the user-facing flow.
  • Regression tests cover both global and project root Markdown skills with siblings, plus a dedicated-directory skill.
  • Tests exercise the real deletion operation with temporary files rather than only checking a computed path.
  • Focused package checks/tests and source diagnostics pass.

Scope boundaries

Represent deletion ownership explicitly enough to distinguish a file from a dedicated skill directory. Do not migrate discovery locations, redesign skill profiles, or consolidate importer UIs in this issue.

Related history

Preserve that boundary; this issue repairs deletion ownership.

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions