Skip to content

Discover the default skills destination from ancestor Git or solution markers - #34

Open
kartheekp-ms wants to merge 7 commits into
mainfrom
kartheekp-ms-repository-aware-skill-installation
Open

kartheekp-ms wants to merge 7 commits into
mainfrom
kartheekp-ms-repository-aware-skill-installation

Conversation

@kartheekp-ms

@kartheekp-ms kartheekp-ms commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Running dotnet-package-skills from a project subdirectory currently uses that subdirectory's .agents/skills folder. This change resolves the default destination from an ancestor Git or solution directory instead.

  • Select the nearest ancestor containing a .git directory/file or a .sln/.slnx file (case-insensitive solution extensions), then use its .agents/skills folder. Fall back to the invocation directory when no marker exists.
  • Share this resolution across install, list, and uninstall, including manifest lookup, interactive flows, and dry runs.
  • Preserve explicit --destination paths: relative paths remain invocation-relative, even when explicitly set to .agents/skills.
  • Keep source discovery, package-reference scope, and relative source/cache path resolution unchanged.
  • Update destination help and README documentation. Existing subdirectory installations are not migrated automatically.

SDK directory-selection behavior

The resolver matches the directory-selection behavior of the .NET SDK's GetDirectoryToCreateToolManifest:

  1. Start at the invocation directory and walk upward, stopping before the filesystem root.
  2. At each directory, check for a .git directory first, then enumerate .sln/.slnx files, then check for a .git file. Return the first matching directory.
  3. If no directory matches, use the invocation directory.

PR build succeeded

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Stale cleanup can delete skills still required by sibling projects because implicit ancestor-destination discovery compares a shared manifest against only the invoking project's references.

2 open issues
What changed in this PR

This PR makes dotnet-package-skills use a shared default skills folder under the nearest Git or solution ancestor when invoked from a project subdirectory.

Changes:

  • Add nearest-marker discovery, with invocation-directory fallback and explicit destination overrides.
  • Apply consistent destination and manifest resolution across install, list, and uninstall without changing source/cache path resolution.
  • Add resolver and CLI coverage, and document the new default behavior.
File Description
dotnet-package-skills/​tests/​DestinationLocatorTests.cs Tests markers, precedence, fallback, and explicit paths.
dotnet-package-skills/​tests/​DestinationCommandLineTests.cs Tests shared destinations, manifests, and command behavior.
dotnet-package-skills/​src/​Program.cs Wires destination discovery into commands and updates help.
dotnet-package-skills/​src/​Infrastructure/​DestinationLocator.cs Implements ancestor-marker destination resolution.
dotnet-package-skills/​README.md Documents discovery, overrides, and existing-installation handling.

Review effort: Max

Comment thread dotnet-package-skills/src/Program.cs Resolved
Require explicit source or destination scope for full-target installs and stale cleanup from a subdirectory. Report unreadable discovery ancestors with an actionable destination override.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kartheekp-ms
kartheekp-ms requested a max review from Copilot November 2, 2026 19:25
@kartheekp-ms
kartheekp-ms marked this pull request as ready for review November 2, 2026 19:25
@kartheekp-ms
kartheekp-ms requested a review from a team as a code owner November 2, 2026 19:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Successful install and uninstall --stale runs with both --source and --destination omitted are untested, leaving invocation-local destination handling unprotected against regressions.

1 open issue
2 resolved since last review

Review effort: Max

Comment thread dotnet-package-skills/src/Program.cs Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kartheekp-ms
kartheekp-ms marked this pull request as draft November 2, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The guard’s allowed path lacks CLI test coverage, so a regression could reject the primary repository-root install and stale-uninstall workflows without failing tests.

No open issues 🎉

1 resolved since last review

Review effort: Max

Allow project-local operations against discovered shared destinations without requiring explicit scope. Preserve absent package IDs while comparing stale versions only for referenced packages.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This comment was marked as low quality.

kartheekp-ms and others added 2 commits November 2, 2026 15:44
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Bound CLI fallback discovery to owned fixtures and clarify automatic versus explicit stale-cleanup scope.

Keep requested versions for replacement safety while deferring dropped-skill cleanup for incompletely inspected packages. Add normal and dry-run regressions for the missing-extra-version case while preserving current-version and interactive add-only behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kartheekp-ms
kartheekp-ms requested a max review from Copilot November 3, 2026 01:31
@kartheekp-ms
kartheekp-ms marked this pull request as ready for review November 3, 2026 01:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed to weigh unpublished documentation findings about destination-wide uninstall behavior and misleading guidance for inspecting tracked installations.

No open issues 🎉

Review effort: Max

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.

2 participants