Skip to content

fix: discover skills under .github/skills/ directory#69

Merged
github-actions[bot] merged 5 commits into
mainfrom
squad/52-github-skills-discovery
Mar 5, 2026
Merged

fix: discover skills under .github/skills/ directory#69
github-actions[bot] merged 5 commits into
mainfrom
squad/52-github-skills-discovery

Conversation

@spboyer

@spboyer spboyer commented Mar 4, 2026

Copy link
Copy Markdown
Member

Fixes #52

Changes

This PR enables waza to automatically discover skills in (GitHub Copilot's standard location) without requiring manual configuration.

Phase 1: Workspace Detection ()

Modified to check both configured skills directory and :

  • After checking the configured (default ), also checks
  • Merges skills from both locations, deduplicating by name (configured dir wins on conflict)
  • Backward-compatible: no config changes needed

Phase 2: Discovery ()

Modified to exempt from hidden directory skipping:

  • Changed condition to: if info.IsDir() && strings.HasPrefix(info.Name(), ".") && info.Name() != ".github"
  • Other hidden directories (, , etc.) still skipped

Tests

Added comprehensive test coverage:

Workspace tests:

  • TestDetectContext_GitHubSkillsDir - Skills in .github/skills/ auto-discovered
  • TestDetectContext_BothSkillsDirs - Skills from both locations merged
  • TestDetectContext_GitHubSkillsDirDedup - Deduplication works correctly
  • TestDetectContext_GitHubSkillsDirWithCustomOverride - Custom paths.skills + .github/skills both work

Discovery tests:

  • TestDiscoverGitHubSkillsDir - Discover() finds skills under .github/skills/
  • TestDiscoverOtherHiddenDirsStillSkipped - Other hidden dirs remain skipped

Verification

✅ All tests pass: go test ./internal/workspace/ ./internal/discovery/ -v -count=1
✅ Build succeeds: go build ./...
✅ Clean diff: Only touches workspace.go, workspace_test.go, discovery.go, discovery_test.go

@spboyer spboyer requested a review from chlowell as a code owner March 4, 2026 23:07
Copilot AI review requested due to automatic review settings March 4, 2026 23:07
@github-actions github-actions Bot enabled auto-merge (squash) March 4, 2026 23:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Enables automatic discovery of skills placed under GitHub Copilot’s conventional .github/skills/ location, without requiring users to override paths.skills.

Changes:

  • Update workspace detection to merge skills from the configured skills directory (default skills/) and .github/skills/, deduplicating by skill name (configured directory wins).
  • Update discovery traversal to avoid skipping the .github directory while still skipping other hidden directories.
  • Add tests covering .github/skills/ detection, merging, and hidden-directory skip behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
internal/workspace/workspace.go Merges skills from configured skills dir and .github/skills/ in DetectContext().
internal/workspace/workspace_test.go Adds workspace tests for .github/skills/ auto-discovery and merge/dedup behavior.
internal/discovery/discovery.go Exempts .github from hidden-directory skipping during Discover() traversal.
internal/discovery/discovery_test.go Adds discovery tests ensuring .github/skills/ is discovered while other hidden dirs remain skipped.

Comment thread internal/discovery/discovery.go Outdated
Comment thread internal/workspace/workspace.go Outdated

@spboyer spboyer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Both review comments have been addressed in commit e35daae:

  1. ✅ .github exemption restricted to root-level only (filepath.Dir(path) == resolvedRoot)
  2. ✅ Dedup map updated on append (existingNames[s.Name] = true added)

@spboyer spboyer force-pushed the squad/52-github-skills-discovery branch from e35daae to 666221a Compare March 4, 2026 23:32
Copilot AI review requested due to automatic review settings March 4, 2026 23:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread internal/workspace/workspace.go
Comment thread internal/execution/copilot_test.go Outdated
Comment thread internal/execution/copilot_test.go Outdated
@spboyer spboyer force-pushed the squad/52-github-skills-discovery branch from 666221a to 07e0790 Compare March 4, 2026 23:58

@spboyer spboyer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

✅ Reviewed by Rusty — LGTM. .github/skills/ discovery support with squad state updates per team decisions. Ready to merge (can't self-approve since you authored this).

Copilot AI review requested due to automatic review settings March 5, 2026 16:00
@spboyer spboyer force-pushed the squad/52-github-skills-discovery branch from 07e0790 to 3032f7f Compare March 5, 2026 16:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread internal/discovery/discovery.go Outdated
spboyer added a commit that referenced this pull request Mar 5, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
spboyer and others added 2 commits March 5, 2026 12:46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 5, 2026 17:46
@spboyer spboyer force-pushed the squad/52-github-skills-discovery branch from 8468aef to edf7a5a Compare March 5, 2026 17:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread internal/workspace/workspace.go
Comment thread internal/discovery/discovery.go Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
chlowell pushed a commit to chlowell/waza that referenced this pull request Mar 5, 2026
Change models to match the YAML, for less confusion.
wbreza
wbreza previously approved these changes Mar 5, 2026

@wbreza wbreza left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code Review: PR #69 — fix: discover skills under .github/skills/ directory

✅ What Looks Good

  • All 8 prior review comments addressed — thorough follow-through across three commits
  • Comprehensive test coverage — 8 new tests covering discovery, merging, deduplication, custom override, and double-scan prevention
  • Correct .github scoping — discovery only enters .github/skills/, properly skips workflows/ and other subdirs
  • Cross-platform path handlingsamePath() handles symlinks and Windows case-insensitivity
  • Backward compatible — no config changes needed; existing behavior preserved

🟡 Suggestions (non-blocking)

  1. samePath() has no direct unit test — It implements non-trivial logic (Abs, EvalSymlinks, Windows case-insensitive). Consider adding a TestSamePath with edge cases.
  2. Consider extracting skill deduplication into a helper — The merge-with-dedup logic is inline. A mergeSkills() helper would improve reuse if a third skill source is ever added.
  3. Edge case tests — No explicit test for .github without skills/ subdirectory or empty .github/skills/ directory. Both work correctly based on the code, but explicit tests would document the behavior.

Summary

Priority Count
Critical 0
High 0
Medium 2
Low 2

Overall Assessment: ✅ Approve — well-implemented feature with solid test coverage. All prior feedback addressed. Suggestions are quality improvements, not blockers.

Comment thread internal/workspace/workspace.go
Comment thread internal/workspace/workspace.go Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 5, 2026 22:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread internal/discovery/discovery.go Outdated
Comment thread internal/discovery/discovery.go
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@richardpark-msft richardpark-msft left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems fine. We might want to revisit some of it, but I think the overall feature makes sense.

@github-actions github-actions Bot merged commit 3ba02fa into main Mar 5, 2026
6 checks passed
spboyer added a commit that referenced this pull request Mar 9, 2026
* fix: discover skills under .github/skills/ directory #52

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

* fix: address review feedback on PR #69

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

* fix: address PR #69 discovery review comments

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

* fix: add samePath tests + extract dedup helper (#69 feedback)

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

* refactor: optimize and dedupe skill merge logic for PR69

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@spboyer spboyer mentioned this pull request Mar 12, 2026
4 tasks
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.

Waza doesn't understand skills under the .github directory

4 participants