Skip to content

Waza doesn't understand skills under the .github directory #52

Description

@RickWinter

Detailed Description

Waza does not discover skills located in .github/skills/ — a standard location used by GitHub Copilot for project-level skills. Users must manually add paths.skills: .github/skills in .waza.yaml as a workaround, but this only replaces the default skills/ path instead of supplementing it. Skills in .github/skills/ should be found automatically.

Root Cause

There are two independent code paths that both exclude .github/skills/:

1. internal/workspace/workspace.goDetectContext() and scanForSkills()

DetectContext() step 3 only checks a single configured skillsDir (default "skills/"):

skillsDir := filepath.Join(absDir, o.skillsDir)
if isDir(skillsDir) {
    skills := scanForSkills(skillsDir)
    ...
}

It never checks .github/skills/ unless the user explicitly overrides paths.skills in .waza.yaml — and even then, it replaces the default rather than adding to it.

Step 4 scans immediate children for SKILL.md, but scanForSkills() explicitly skips hidden directories:

for _, entry := range entries {
    if !entry.IsDir() || strings.HasPrefix(entry.Name(), ".") {
        continue // ← skips .github
    }
    ...
}

2. internal/discovery/discovery.goDiscover()

The Discover() function (used by waza run --discover) also skips hidden directories during its filepath.Walk:

if info.IsDir() && strings.HasPrefix(info.Name(), ".") {
    return filepath.SkipDir // ← skips entire .github tree
}

Reproduction Steps

  1. Create a skill in .github/skills/my-skill/SKILL.md
  2. Run any waza command that detects the workspace (e.g., waza run my-skill, waza dev my-skill, waza tokens check)
  3. Expected: Skill is discovered
  4. Actual: no skills detected in workspace error

Current Workaround

Add to .waza.yaml:

paths:
  skills: .github/skills

This only works if all skills are in .github/skills/. If some are in skills/ and some in .github/skills/, there is no workaround since paths.skills only supports a single directory.

Proposed Solution

Phase 1: internal/workspace/workspace.go

Modify DetectContext() to also search .github/skills/ as a built-in secondary skills location:

  • After step 3 (checking configured skillsDir), also check .github/skills/ if it exists
  • Merge skills from both locations, deduplicating by name (configured skillsDir wins on conflict)
  • This approach is backward-compatible and requires zero config changes

The scanForSkills() function does not need changes since it will be called with .github/skills as the parent directory directly (not .github).

Phase 2: internal/discovery/discovery.go

Modify Discover() to exempt .github from the hidden-directory skip:

if info.IsDir() && strings.HasPrefix(info.Name(), ".") && info.Name() != ".github" {
    return filepath.SkipDir
}

This ensures waza run --discover also finds skills under .github/skills/.

Tests to Add

internal/workspace/workspace_test.go:

  • TestDetectContext_GitHubSkillsDir — skills in .github/skills/ are auto-discovered
  • TestDetectContext_BothSkillsDirs — skills in both skills/ and .github/skills/ are merged
  • TestDetectContext_GitHubSkillsDirWithCustomOverride — custom paths.skills + .github/skills/ both work
  • TestDetectContext_GitHubSkillsDirDedup — same skill name in both dirs resolves correctly

internal/discovery/discovery_test.go:

  • TestDiscoverGitHubSkillsDirDiscover() finds skills under .github/skills/
  • TestDiscoverOtherHiddenDirsStillSkipped.hidden/ directories other than .github remain skipped

Files to Modify

File Change
internal/workspace/workspace.go Add .github/skills/ as secondary search path in DetectContext()
internal/workspace/workspace_test.go Add tests for .github/skills/ discovery and merging
internal/discovery/discovery.go Exempt .github from hidden-directory skip in Discover()
internal/discovery/discovery_test.go Add tests for .github exemption

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions