waza check eval discovery is inconsistent with coverage and run in multi-skill workspaces
Summary
In a multi-skill workspace, waza coverage . and waza run evals/.../eval.yaml both recognize the eval structure, but waza check does not discover the related eval suite consistently.
This creates a confusing user experience because the workspace appears valid for coverage and execution, but readiness checks report that no eval exists or fail to find the skill.
Environment
Waza version: 0.31.0
OS: Windows
Shell: PowerShell
Workspace shape
This was reproduced in a repository with this structure:
Coverage recognizes the pilot evals and shows the skill as partially covered.
Example outcome:
Assistant
Let me analyze the issue. The problem is that waza check doesn't discover eval suites consistently with waza coverage and waza run in multi-skill workspaces. I need to:
First explore the repository structure to understand the codebase
Find the relevant code for waza check, waza coverage, and waza run commands
Understand how they discover evals/skills differently
Fix the discovery logic in waza check to be consistent with the others
Let me start by exploring the repository structure.
Assistant
This looks like a Go project (given the cmd/ and internal/ directory structure). Let me explore further.
Assistant
Let me explore the command structure to find the check, coverage, and run commands.
Assistant
The user wants me to explore the repository and fix an issue where waza check doesn't discover eval suites consistently with waza coverage and waza run in multi-skill workspaces.
I need to continue exploring the codebase to understand:
How the check command discovers evals
How coverage and run commands discover evals
What makes them different
Let me continue exploring the command structure.
Assistant
Let me examine the key files to understand how check, coverage, and run discover evals.
Assistant
Let me search for the key function that handles eval discovery in the check command.
Assistant
Let me read the checkReadiness function more carefully to understand the eval discovery logic:
Assistant
Now let me examine the workspace.FindEval function which is the key discovery function:
Assistant
Let me look at the workspace package to understand how FindEval works:
Assistant
Now let me look at the resolveWorkspace function that's used in the check command:
Assistant
Assistant
Let me continue exploring the codebase to understand how waza coverage discovers evals.
Assistant
Assistant
Let me continue by looking at the test file to understand the expected behavior and ensure my fix aligns with the test cases.
Assistant
Now I have a clear understanding of the issue. Let me summarize my findings:
Root Cause Analysis
The waza check command has inconsistent eval discovery compared to waza coverage and waza run because:
workspace.scanForSkills only scans immediate children - When the workspace has skills in nested directories like skills/development/skill-creator/SKILL.md, the current scanForSkills function only looks at skills/ for direct children (like development). Since development doesn't have SKILL.md directly, no skills are found.
waza coverage uses filepath.WalkDir which recurses - This is why coverage works with nested structures while check doesn't.
The fallback detection in checkReadiness doesn't use config options - When a path is given to waza check, the workspace context is nil, and the fallback uses DetectContext(wd) without the project config options.
Let me fix the root cause by modifying scanForSkills to recurse into subdirectories:
Assistant
Assistant
Let me look at the project config to understand how paths are loaded.
Assistant
Now I have a clear understanding of the issue. Let me implement the fix.
Root Cause
The workspace.scanForSkills function only scans immediate children of the skills directory. When skills are in nested directories like skills/development/skill-creator/SKILL.md, it fails to detect them because:
scanForSkills("skills") finds "development" (a directory without SKILL.md directly)
Since "development" doesn't have SKILL.md, it's not added as a skill
The function doesn't recurse into "development" to find the actual skill
Additionally, when waza check receives a path argument, it calls checkReadiness(skillDir, nil) with a nil workspace context, and the fallback detection doesn't use config options.
Let me fix both issues:
Assistant
Let me use a different approach to make the edit:
Assistant
Now let me try the edit command again with the proper syntax.
Assistant
Good, the first fix is applied. Let me verify it and then address the second part of the fix - using config options in the checkReadiness fallback detection.
Assistant
Good, the first fix is in place. Now let me also fix the second issue - the fallback detection in checkReadiness should use config options. Let me look at the current code:
Assistant
Now let me fix the second issue - the fallback detection in checkReadiness should use config options:
Assistant
Now let me fix the second issue - the fallback detection should use config options:
Assistant
Let me verify both fixes are in place:
Assistant
Both fixes are in place. Let me verify the code compiles and run the existing tests:
Assistant
Let me check the Go installation and set up the environment:
Assistant
The user wants me to continue fixing the issue. Let me try to build and test the code. I need to set up the Go environment first.
Assistant
The user wants me to continue fixing the issue. I need to set up the Go environment properly and then build and test the code.
Assistant
The build succeeded. Now let me run the existing tests to make sure the changes don't break anything:
Assistant
I see there's a failing test. Let me examine it to understand the expected behavior:
Assistant
I see the test TestDetectContext_WithCustomSkillsDir is failing. The test expects that non-standard directories (like my-skills/) should NOT be scanned by default. My recursive change was too broad - it affected step 4 which scans immediate CWD children.
The fix needs to be more targeted:
Step 3 (configured skills directory like skills/) should recurse to find nested skills
Step 4 (immediate CWD children) should NOT recurse to avoid accidentally picking up skills from non-standard directories
Let me implement a targeted fix:
Assistant
Let me verify the changes and run the tests again:
Assistant
Let me verify the changes are correct and run the tests:
Assistant
All workspace tests pass now. Let me also run the check command tests to make sure those still pass:
Assistant
All tests pass. Now let me create a test script to reproduce the exact issue from the bug report and verify the fix works:
Assistant
Let me create a test script within the repository to properly test the fix:
Assistant
All three new tests pass. Let me also run all the workspace tests to make sure nothing is broken:
Assistant
All tests pass. Now let me remove the test file I added (since I shouldn't add new tests to the repository) and verify the fix works end-to-end with the actual waza binary:
Assistant
Now let me build the waza binary and test it end-to-end with a workspace structure matching the issue:
Assistant
Let me create a test workspace matching the issue structure and verify the fix works end-to-end:
Assistant
The fix is working perfectly. Let me verify the key improvements:
Before the fix:
waza check skills/development/skill-creator → "Evaluation Suite: Not Found" ❌
waza check skill-creator → "no SKILL.md found in " ❌
The eval schema errors in the output are expected - they're about the test eval.yaml files not matching the actual schema (using 'kind' instead of 'type'), but that's unrelated to the fix. The important thing is that the evals are now being discovered correctly.
Let me run all existing tests to confirm nothing is broken:
Assistant
All tests pass. Let me verify the changes I made are complete and correct:
Assistant
The changes are complete and verified. Let me provide a summary:
Summary of Changes
Problem
waza check didn't discover eval suites consistently with waza coverage and waza run in multi-skill workspaces where skills were nested in subdirectories (e.g., skills/development/skill-creator/SKILL.md).
Root Cause
workspace.scanForSkills only scanned immediate children - Skills nested deeper in the directory structure (like skills/development/skill-creator/) were not found because the function only looked one level deep.
Fallback detection in checkReadiness didn't use config options - When a path was given directly, the fallback workspace detection didn't respect .waza.yaml configuration.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
other pilot skills also appear in the coverage grid
waza run evals/skill-creator/eval.yaml ...
Run executes successfully enough to:
load the skill directories
run the selected task
apply graders
save a result JSON file under results/...
waza check skills/development/skill-creator
Output includes:
text
Evaluation Suite: Not Found
waza check skill-creator
Output includes:
text
no SKILL.md found in <workspace root>
Expected behavior
waza check should discover the corresponding eval suite consistently when:
the workspace has a valid root .waza.yaml
the skill exists under skills/.../<skill-name>/SKILL.md
the eval exists under evals/<skill-name>/eval.yaml
coverage and run already succeed against the same workspace
At minimum, check should either:
locate the matching eval and report it, or
explain the discovery rule clearly enough that the user can resolve the mismatch
Why this matters
For new users, check looks like the natural readiness command. When it disagrees with coverage and run, it is hard to tell whether:
the workspace is invalid
the eval naming/path convention is wrong
or check is using different discovery rules
This makes initial adoption harder, especially in multi-skill repositories.
Additional note
This may be either:
a discovery bug in check, or
a documentation/UX gap where check expects a different invocation pattern than users would infer from coverage and run
Either way, the current behavior is surprising.
Possible improvements
Any of these would help:
Make check reuse the same discovery logic as coverage
Document the exact resolution rule from skill path/name to eval path
Add debug output showing where check looked for the eval
Improve the error message when the skill name/path is interpreted differently than expected
Interface
No new interfaces are introduced.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work.
For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state.
You can also reset all changes in the repository using git reset --hard command.
Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later.
Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands.
However you don't need to use git add or git commit before submitting your changes. In fact,
submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.
CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
If an error was reported in the issue description, I have successfully reproduced it.
If an error was reported in the issue description, I have confirmed that my fix resolves the error.
I have thought about edge cases and made sure my fix handles them as well.
I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass.
I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /waza, current file: none) bash-$
Now I understand the issue. Let me trace through the code flow:
In runCheck (cmd_check.go), when a skill name or path is passed:
If it looks like a path (e.g., skills/development/skill-creator), it calls checkReadiness(skillDir, nil) directly with nil workspace context
If it doesn't look like a path (e.g., skill-creator), it tries resolveWorkspace(args) which:
Detects workspace
Finds the skill by name
Returns a context with just that skill
In checkReadiness:
It first checks if wsCtx != nil and tries workspace.FindEval(wsCtx, sk.Frontmatter.Name)
If that fails (wsCtx is nil), it tries to detect workspace from CWD and find eval
Finally falls back to co-located eval.yaml
The problem is in step 2: When wsCtx is nil (because the path was passed and went through the workspace.LooksLikePath branch), the fallback workspace detection uses os.Getwd() and workspace.DetectContext(wd) without the config options!
Let me verify:
When waza check skills/development/skill-creator is called:
So if the skill is found, ctx.Skills is set to just that one skill.
Then in runCheckForSkills:
go
for i, si := range wsCtx.Skills {
report, err := checkReadiness(si.Dir, wsCtx)
It passes wsCtx which contains just that skill. But workspace.FindEval(wsCtx, sk.Frontmatter.Name) expects the skill name to match. If the skill was loaded from .waza.yaml paths but the frontmatter name doesn't match the skill directory name, that could be the issue.
Wait, but the issue says both coverage and run work correctly. Let me look at how they discover evals.
Let me check the coverage command to see how it discovers evals:
Actually, let me focus on the most obvious issue first. In checkReadiness:
go
if wsCtx != nil {
if evalPath, findErr := workspace.FindEval(wsCtx, sk.Frontmatter.Name); findErr == nil && evalPath != "" {
The problem is: workspace.FindEval(wsCtx, skillName) calls FindSkill(wsCtx, skillName) which requires an exact name match. But when the skill was detected with a different name (maybe from frontmatter vs directory name), it won't find it.
But the more critical issue I see is in this path:
When waza check skills/development/skill-creator is called:
It passes workspace.LooksLikePath("skills/development/skill-creator") → true
Goes directly to checkReadiness(skillDir, nil) with wsCtx = nil
In checkReadiness:
wsCtx is nil, so first eval check is skipped
Fallback: workspace.DetectContext(wd) WITHOUT config options!
The fallback detection uses default options (skillsDir="skills", evalsDir="evals") but the workspace config has custom paths. So if the evals are under a different path, it won't find them.
Actually wait, looking at the issue description again, the workspace has:
yaml
paths:
skills: skills/
evals: evals/
These look like standard paths. So the default detection should work...
Let me re-read the issue more carefully:
code
### `waza check skills/development/skill-creator`
Output includes:
Evaluation Suite: Not Found
So the skill is found (it got past the SKILL.md check), but eval is not found.
And for skill-creator:
code
### `waza check skill-creator`
Output includes:
no SKILL.md found in <workspace root>
Hmm, "no SKILL.md found" - that's the error from checkReadiness line 362. This means when passing just skill-creator, the skill name lookup works (resolveWorkspace finds it), but when calling checkReadiness(si.Dir, wsCtx), the si.Dir might be wrong or the skill name resolution is off.
Wait, I think I need to trace through more carefully. Let me look at what resolveWorkspace returns when called with ["skill-creator"].
Actually, I think I need to look at the actual test cases to understand the expected behavior better. Let me check the test files.
Actually, let me re-focus. The key issue is:
waza check skills/development/skill-creator → "Evaluation Suite: Not Found"
waza check skill-creator → "no SKILL.md found in "
Goes to checkReadiness(skillDir, nil) with wsCtx = nil
In checkReadiness, wsCtx is nil, so it tries the fallback
The fallback does workspace.DetectContext(wd) WITHOUT config options
If the workspace config has different paths, this won't find the evals
Actually, looking more closely at the .waza.yaml in the issue:
yaml
paths:
skills: skills/
evals: evals/
These are standard paths. But there might be a subtlety - the actual structure is:
code
skills/
├── development/skill-creator/SKILL.md
So the skills are nested under skills/development/. The workspace detection would find skills at skills/ level, but the individual skill is at skills/development/skill-creator/.
It joins root + evalsDir + skillName + "eval.yaml". If skillName is "skill-creator" and evalsDir is "evals", this would be:
<root>/evals/skill-creator/eval.yaml
Which should match the expected eval path from the issue:
code
evals/
├── skill-creator/eval.yaml
So that should work... unless the skillName isn't being extracted correctly.
Wait, let me re-check. The skill name comes from sk.Frontmatter.Name after parsing SKILL.md. The frontmatter might have a different name than the directory name.
Actually, let me look at a specific issue. When calling waza check skills/development/skill-creator:
skillDir := args[0]
if !filepath.IsAbs(skillDir) {
wd, err := os.Getwd()
skillDir = filepath.Join(wd, skillDir)
}
// If the path points directly to a SKILL.md file, use its parent directory.
if filepath.Base(skillDir) == "SKILL.md" {
...
}
report, err := checkReadiness(skillDir, nil)
So it calls checkReadiness("skills/development/skill-creator", nil) (after making absolute).
In checkReadiness:
go
// 1. Check for SKILL.md
skillPath := filepath.Join(skillDir, "SKILL.md")
if _, err := os.Stat(skillPath); errors.Is(err, os.ErrNotExist) {
return nil, fmt.Errorf("no SKILL.md found in %s", skillDir)
Wait, the issue says waza check skills/development/skill-creator shows "Evaluation Suite: Not Found", which means it DID find SKILL.md (otherwise it would say "no SKILL.md found"). So this part works.
Then for eval discovery:
go
if wsCtx != nil {
... // skipped because wsCtx is nil
}
if !report.hasEval {
// Try workspace detection from the working directory
if wd, wdErr := os.Getwd(); wdErr == nil {
if autoCtx, ctxErr := workspace.DetectContext(wd); ctxErr == nil {
if evalPath, findErr := workspace.FindEval(autoCtx, sk.Frontmatter.Name); findErr == nil && evalPath != "" {
report.hasEval = true
report.evalPath = evalPath
}
}
}
}
So it calls workspace.DetectContext(wd) without config options. The config options come from configDetectOptions() which reads from .waza.yaml. Without those options:
skillsDir defaults to "skills"
evalsDir defaults to "evals"
With the issue's .waza.yaml:
yaml
paths:
skills: skills/
evals: evals/
These are the same as defaults. So the fallback detection should find the same workspace... unless there's something else going on.
Hmm, let me think about this differently. Let me check what configDetectOptions() does vs. what the fallback uses.
So it loads paths from .waza.yaml and if cfg.Dir is set, it prepends it. The paths in the issue are skills/ and evals/ - these might be relative to cfg.Dir or absolute.
Actually, I think the issue might be more subtle. Let me look at what happens when resolveWorkspace is called vs. when the fallback detection is called.
When waza check skill-creator:
resolveWorkspace(["skill-creator"]):
Calls configDetectOptions() which loads .waza.yaml and gets skillsDir=skills/, evalsDir=evals/
Hmm wait, let me re-trace. When waza check skill-creator:
workspace.LooksLikePath("skill-creator") returns false (no / or \)
So it goes to resolveWorkspace(["skill-creator"])
In resolveWorkspace:
Detects workspace
Since there's an arg that doesn't look like a path, it tries to find the skill
workspace.FindSkill(ctx, "skill-creator") - this looks for a skill whose name is "skill-creator"
But wait, the skill name comes from the frontmatter of SKILL.md. Is the frontmatter name "skill-creator"? If the frontmatter has a different name (like "Skill Creator" or something), then FindSkill would fail.
Actually, looking at the error message "no SKILL.md found in ", this is specifically the error from:
go
return nil, fmt.Errorf("no SKILL.md found in %s", skillDir)
And this only happens in the fallback case at the end of runCheck. So resolveWorkspace must be failing somehow.
If FindSkill(ctx, "skill-creator") fails because the skill name doesn't match, it would return an error like "skill "skill-creator" not found in workspace".
But the error reported is "no SKILL.md found in ", which is from the final fallback in runCheck:
So resolveWorkspace must be returning an error, causing the code to fall through to the final fallback.
Hmm, but FindSkill would return an error if the skill name doesn't match. Let me check what the actual skill name is from the SKILL.md...
Actually, I don't have access to the actual SKILL.md content. But based on the issue, the directory is named "skill-creator". The frontmatter might have the same name.
Wait, let me re-read the issue's "Actual behavior" section:
code
### `waza check skill-creator`
Output includes:
no SKILL.md found in <workspace root>
The error says "no SKILL.md found in " where <workspace root> is probably the current working directory. This means checkReadiness(".") was called and the SKILL.md wasn't found directly in CWD.
This would happen if resolveWorkspace returned an error. And resolveWorkspace would return an error if FindSkill(ctx, "skill-creator") fails.
So the question is: why does FindSkill(ctx, "skill-creator") fail?
The only reason would be if the skill's frontmatter name is different from "skill-creator". But in a normal setup, the directory name and frontmatter name should match.
Actually, wait - let me re-read the workspace detection. When detecting a multi-skill workspace, scanForSkills scans the skills directory and calls tryParseSkill for each child:
go
func scanForSkills(parentDir string) []SkillInfo {
entries, err := os.ReadDir(parentDir)
if err != nil {
return nil
}
var skills []SkillInfo
for _, entry := range entries {
if !entry.IsDir() || strings.HasPrefix(entry.Name(), ".") {
continue
}
childDir := filepath.Join(parentDir, entry.Name())
if info, ok := tryParseSkill(childDir); ok {
skills = append(skills, info)
}
}
return skills
}
And tryParseSkill gets the skill name from the frontmatter:
Then scanForSkills("skills") would look at "development" (a directory), call tryParseSkill("skills/development"), and find no SKILL.md there. So it wouldn't detect any skills!
But wait, the issue says waza coverage . works correctly. Looking at discoverSkillFiles, it uses filepath.WalkDir which walks recursively, finding nested SKILL.md files.
So the workspace detection in workspace.DetectContext only scans immediate children, not recursively. This is a limitation that affects waza check but not waza coverage.
But there's also the configDetectOptions that reads from .waza.yaml. If the config specifies paths.skills: skills/, then configDetectOptions() returns WithSkillsDir("skills/") which should work the same as the default.
So skills are nested one level deeper. The default DetectContext with skillsDir="skills" would only scan immediate children of skills/, which are directories like "development", "copilot-exclusive", etc. These directories don't have SKILL.md directly (the SKILL.md is nested one more level).
This means DetectContext would not detect any skills in a nested structure! But discoverSkillFiles (used by coverage) uses WalkDir which does find them.
Wait, but the issue says waza coverage . works. Let me re-check... yes, discoverSkillFiles walks recursively.
But for waza check, it relies on DetectContext which only scans immediate children.
Now I also see that there's a step 4 in DetectContext:
go
// 4. Scan immediate children of dir for SKILL.md
skills = scanForSkills(absDir)
This scans immediate children of the current directory. If the CWD is the workspace root, it would look for SKILL.md files directly in the workspace root, not in subdirectories.
Walk up parents looking for SKILL.md → won't find it
Check skills/ directory → scan immediate children: "development", "copilot-exclusive", etc. → none have SKILL.md directly → no skills found
Scan immediate children of /workspace → none have SKILL.md → no skills found
Return ContextNone
But if the workspace config has paths.skills: skills/development, then step 3 would check skills/development which contains skill-creator/ with SKILL.md.
Wait no, let me re-read. The issue's .waza.yaml has:
yaml
paths:
skills: skills/
evals: evals/
So skillsDir = "skills/". When DetectContext is called:
It looks at skills/ as a directory
Calls scanForSkills("skills") which scans immediate children
Immediate children are "development", "copilot-exclusive", "testing" - none have SKILL.md
So no skills are found
Unless there's additional logic in configDetectOptions that resolves the path differently...
Actually wait, let me re-read configDetectOptions:
If cfg.Dir is set to the workspace root and cfg.Paths.Skills is "skills/", then skillsDir becomes workspace_root/skills/. But that's still the same as the default skills/ path relative to CWD.
Hmm, I wonder if the .waza.yaml in the actual test environment is different from what's in the issue description. Let me check what's actually in the repo.
Actually, I just realized - I should check what the actual .waza.yaml looks like in the repo and whether the workspace detection is working correctly for this specific structure. Let me also check the workspace_resolve.go more carefully.
Actually, let me focus on the actual issue. The problem is that waza check doesn't discover evals consistently. Looking at the code flow:
For waza check skills/development/skill-creator:
LooksLikePath returns true → direct path branch
checkReadiness(skillDir, nil) with wsCtx = nil
In checkReadiness, since wsCtx == nil, it skips the workspace-aware eval detection
Falls back to workspace.DetectContext(wd) without config options
With default options (skills="skills", evals="evals"), if the structure is flat (skills/skill-creator/SKILL.md), this works
But if the structure is nested, it doesn't work
For waza check skill-creator:
LooksLikePath returns false → goes to resolveWorkspace
resolveWorkspace calls DetectContext with config options
If the config options properly resolve the paths, it should detect the workspace
But if the workspace detection doesn't find skills (due to nested structure), it fails
Falls back to checkReadiness(".") which looks for SKILL.md in CWD
So the fundamental issue is that workspace.DetectContext only scans immediate children of the skills directory, not recursively. This means it can't detect skills in nested structures.
But wait, waza coverage uses discoverSkillFiles which walks recursively and works. And waza run must also work according to the issue. So there must be something else going on.
Let me look at waza run to understand how it handles this.
Actually, let me re-read the issue:
code
### `waza run evals/skill-creator/eval.yaml ...`
Run executes successfully enough to:
- load the skill directories
- run the selected task
- apply graders
- save a result JSON file under results/
So waza run works when given an explicit eval.yaml path. It doesn't rely on workspace detection.
And:
code
### `waza coverage .`
Coverage recognizes the pilot evals and shows the skill as partially covered.
So waza coverage works with its own discovery logic.
The issue is specifically with waza check. Let me think about what the fix should be.
The fix should be to make waza check use the same discovery logic as waza coverage and waza run, or at least use consistent workspace detection.
Looking at the check command, there are two issues:
Path argument branch: When given a path like skills/development/skill-creator, it calls checkReadiness(skillDir, nil) with wsCtx = nil. The fallback detection then uses DetectContext without config options.
Workspace detection: Even with config options, DetectContext only scans immediate children, not recursively.
The fix should:
Always use config options when detecting workspace context
Ensure that when a path is given, the workspace context is still properly resolved
Let me look more carefully at how the check command calls the workspace detection and how it could be improved.
Actually, I think I've been overthinking this. Let me look at the resolveWorkspace function again:
It calls DetectContext with configDetectOptions() which loads the .waza.yaml config. So it should use the configured paths.
But the issue is in runCheck:
go
// If arg looks like a file path, use it directly
if len(args) > 0 && workspace.LooksLikePath(args[0]) {
skillDir := args[0]
...
report, err := checkReadiness(skillDir, nil) // <-- wsCtx is nil!
When a path is given, it bypasses resolveWorkspace and calls checkReadiness with wsCtx = nil. This means it falls back to detecting the workspace without config options.
The fix should be to use configDetectOptions() in the fallback detection, or better yet, always call resolveWorkspace (which already handles both path and name arguments).
Wait, actually looking at resolveWorkspace more carefully:
go
if workspace.LooksLikePath(arg) {
return ctx, nil // Returns the full workspace context, not narrowed to the specific skill
}
So when a path is given, resolveWorkspace returns the context with ALL skills, not just the one at the given path. Then runCheckForSkills iterates over all skills.
But the issue is that the user wants to check a specific skill, not all skills. So the check command needs to handle the path case differently.
So skills: skills/ means the skills are expected to be in skills/ directory. But the actual structure has skills nested one level deeper.
If the paths.skills was skills/development, then DetectContext with that config would find the skills. But it's skills/.
Wait, but the issue says waza coverage . works. Let me check how coverage handles this...
discoverSkillFiles uses filepath.WalkDir which walks recursively. So it finds skills at any depth within skills/.
For check to work the same way, the workspace detection would need to either:
Walk recursively like coverage does, OR
Accept that skills can be in nested directories
I think the right approach is to fix the checkReadiness function to properly use config options for workspace detection, and also ensure that the workspace detection can find skills in nested directories.
Actually, wait. Let me re-read the workspace detection code. There's step 4:
go
// 4. Scan immediate children of dir for SKILL.md
skills = scanForSkills(absDir)
This scans immediate children of the CWD for SKILL.md. If the structure is:
Goes to path branch, calls checkReadiness("skills/development/skill-creator", nil)
In checkReadiness:
Finds SKILL.md at skills/development/skill-creator/SKILL.md ✓
Parses frontmatter to get skill name
Tries to find eval:
wsCtx is nil, skips workspace-aware detection
Falls back to workspace.DetectContext(wd) without config options
This should find the workspace (CWD is the repo root)
But with default options, it uses skillsDir="skills" and evalsDir="evals"
It scans skills/ for immediate children → "development", "copilot-exclusive", "testing"
These directories don't have SKILL.md directly → no skills found
Returns ContextNone
No eval found
Falls back to co-located eval.yaml at skills/development/skill-creator/eval.yaml → not found
Reports "Evaluation Suite: Not Found"
So the issue is that DetectContext with default options doesn't find skills in a nested structure, so it can't find the eval either.
But wait, if cfg.Paths.Skills is "skills/" (relative), then configDetectOptions() would return WithSkillsDir("skills/"). This is the same as the default. So even with config options, DetectContext would fail to find skills in nested directories.
Unless... the paths.skills in the actual .waza.yaml is different. Let me check the actual repo's .waza.yaml.
Actually, I think the real issue might be different. Let me look at configDetectOptions again:
If cfg.Paths.Skills is already an absolute path (like /repo/skills), then it wouldn't be prepended with cfg.Dir. And the workspace detection would use that absolute path.
OK I think I need to look at this from a different angle. Let me focus on what would make waza check discover evals consistently.
The key insight is:
waza coverage uses its own discovery (WalkDir) that works with nested structures
waza check relies on workspace.DetectContext which only scans immediate children
When a path is given to waza check, it bypasses resolveWorkspace entirely
I think the fix should be:
In runCheck, when a path is given, also resolve the workspace context using config options
In checkReadiness, when falling back to workspace detection, use config options
Let me also check if there are any issues with how the workspace detection handles nested skills...
Actually, I just realized something. Looking at the scanForSkills function:
go
func scanForSkills(parentDir string) []SkillInfo {
entries, err := os.ReadDir(parentDir)
...
for _, entry := range entries {
if !entry.IsDir() || strings.HasPrefix(entry.Name(), ".") {
continue
}
childDir := filepath.Join(parentDir, entry.Name())
if info, ok := tryParseSkill(childDir); ok {
skills = append(skills, info)
}
}
return skills
}
It only scans immediate children. But tryParseSkill checks if SKILL.md is directly in the child directory:
So for the structure skills/development/skill-creator/SKILL.md:
scanForSkills("skills") looks at "development"
tryParseSkill("skills/development") checks for skills/development/SKILL.md → not found
No skill is detected
This is a fundamental limitation of the workspace detection. It can only detect skills that are directly inside the skills directory, not nested deeper.
But wait, the issue says waza coverage . works. And coverage uses discoverSkillFiles which walks recursively. So the coverage command can find skills at any depth.
For check to work the same way, the workspace detection would need to also walk recursively.
Hmm, but actually, looking at the issue again:
code
This was reproduced in a repository with this structure:
repo/
├── .waza.yaml
├── skills/
│ ├── development/skill-creator/SKILL.md
...
So the skills are under skills/development/ etc. But the .waza.yaml has:
yaml
paths:
skills: skills/
If the paths.skills was skills/development, then DetectContext with that config would scan skills/development/ and find skill-creator/ directly.
But it's skills/, so DetectContext scans skills/ and finds directories like development, none of which have SKILL.md.
So the issue might be that the workspace config is not properly configured to handle nested skills. But the coverage command doesn't rely on workspace detection, so it works.
Actually, I think I need to re-read the issue more carefully. The issue says:
code
### `waza check skills/development/skill-creator`
Output includes:
Evaluation Suite: Not Found
This means the skill IS found (it got past the SKILL.md check), but the eval is not found. The skill path was passed directly, so checkReadiness found the SKILL.md. But the eval discovery failed.
The eval discovery tries:
Workspace-aware detection (wsCtx is nil, skipped)
Fallback detection (DetectContext without config options)
Co-located eval.yaml (not found)
For the fallback detection:
DetectContext(wd) with default options
Scans skills/ for immediate children → "development" (no SKILL.md), "copilot-exclusive" (no SKILL.md), "testing" (no SKILL.md)
Returns ContextNone (no skills found)
FindEval fails
So the eval is not found because the workspace detection can't find any skills.
So the evals are flat (evals/skill-creator/eval.yaml), while skills are nested (skills/development/skill-creator/SKILL.md).
For FindEval to work:
Find the skill by name (e.g., "skill-creator")
Try root/evals/skill-creator/eval.yaml
If FindSkill can't find "skill-creator" in the workspace context (because no skills were detected), then FindEval fails.
So the root cause is that DetectContext doesn't detect nested skills.
OK, I think I now understand the issue clearly. Let me plan the fix:
Root cause: workspace.DetectContext only scans immediate children of the skills directory, not recursively. This means it can't find skills in nested structures like skills/development/skill-creator/.
Fix options:
a. Make DetectContext scan recursively (like discoverSkillFiles does)
b. Or, have checkReadiness use a different discovery method that works with nested structures
I think option (a) is the better fix because it would make workspace detection consistent with coverage detection.
This calls workspace.FindEval(wsCtx, sk.Frontmatter.Name). The wsCtx is expected to contain the skill with the matching name. If the skill was detected with a different name (e.g., from frontmatter vs directory name), this would fail.
But I think the more immediate issue is that DetectContext doesn't detect skills at all in a nested structure.
Let me look at the test files to understand the expected behavior better.
Actually, let me take a step back. The issue says the workspace is multi-skill, and the skills are in nested directories. The DetectContext function is designed for a different pattern where skills are directly in the skills directory.
But wait, looking at DetectContext again:
go
// 4. Scan immediate children of dir for SKILL.md
skills = scanForSkills(absDir)
if len(skills) > 0 {
return &WorkspaceContext{
Type: ContextMultiSkill,
...
}
}
This scans immediate children of the CWD for SKILL.md. But it doesn't recurse into subdirectories.
I think the fix should modify scanForSkills to also recurse into subdirectories. Or add a new function that walks recursively.
Actually, let me look at how this is tested in the existing tests.
Actually, let me also check if there's an EvalsDir issue. The FindEval function uses:
If evalsDir is "evals/", this would be:
/root/evals/skill-creator/eval.yaml
Which matches the expected eval path from the issue. So the eval path resolution should work IF the skill is found.
OK, let me focus on the fix. I'll modify scanForSkills to recurse into subdirectories.
Actually, looking at the code again, I see that scanForSkills is used in multiple places:
In DetectContext step 3: scanForSkills(skillsDir)
In DetectContext step 4: scanForSkills(absDir)
In discoverEvalFiles: checks for eval.yaml in skill directories
If I modify scanForSkills to recurse, it would affect all these places. But I think that's the right behavior - we want to find skills at any depth.
Actually, let me think about this differently. The issue is specifically about the check command not finding evals. Maybe instead of modifying the core workspace detection, I should fix the check command to use a different discovery method.
The issue is that when a path is given, it passes nil as the workspace context. The fallback in checkReadiness tries to detect the workspace but:
Uses default options (no config)
Can only find non-nested skills
I think the fix should be to:
Pass the workspace context to checkReadiness even when a path is given
Use config options when detecting the workspace context
Let me look at what would happen if we called resolveWorkspace instead of the path branch...
Actually, looking at resolveWorkspace:
go
if workspace.LooksLikePath(arg) {
return ctx, nil // Returns full context
}
It returns the full workspace context even for path args. Then runCheckForSkills would iterate over ALL skills. But the user only wants to check one skill.
So the fix should be different. For path args, we should:
Detect the workspace context (with config options)
Find the skill whose directory matches the given path
Pass the context to checkReadiness
Or, in checkReadiness, we should:
Try workspace detection with config options
Pass the context to FindEval
Let me think about the cleanest fix...
Actually, I think the simplest fix is to modify checkReadiness to use config options when detecting the workspace context. We can create a helper function that loads config options and uses them for detection.
Or, we could modify the path branch in runCheck to also detect the workspace context.
Let me also consider: the issue might be that configDetectOptions isn't being called in the fallback detection. Let me check...
In checkReadiness:
go
if !report.hasEval {
// Try workspace detection from the working directory
if wd, wdErr := os.Getwd(); wdErr == nil {
if autoCtx, ctxErr := workspace.DetectContext(wd); ctxErr == nil {
if evalPath, findErr := workspace.FindEval(autoCtx, sk.Frontmatter.Name); findErr == nil && evalPath != "" {
This calls workspace.DetectContext(wd) without any options. It should use config options.
The fix would be to add config options here:
go
if autoCtx, ctxErr := workspace.DetectContext(wd, configDetectOptions()...); ctxErr == nil {
But wait, configDetectOptions is defined in the main package (cmd_check.go), and it uses os.Getwd() internally. So it should work.
But there's still the issue that even with config options, DetectContext won't find nested skills. So the real fix needs to address both:
Use config options in fallback detection
Make DetectContext find nested skills
Let me look at how to fix #2. The scanForSkills function only scans immediate children. We could modify it to recurse.
Actually, let me re-read the DetectContext function. I wonder if there's already a mechanism to handle this...
Looking at step 2:
go
// 2. Walk up parent directories looking for SKILL.md
current := absDir
for i := 0; i < maxParentWalk; i++ {
parent := filepath.Dir(current)
...
if info, ok := tryParseSkill(current); ok {
return &WorkspaceContext{
Type: ContextSingleSkill,
...
}
}
}
This walks up parent directories looking for SKILL.md. But it's for finding a single skill (like when CWD is inside a skill directory), not for finding all skills in a workspace.
OK, I think I need to implement a recursive scan for skills. Let me look at how discoverSkillFiles does it and adapt that to scanForSkills.
Actually, I think the cleanest fix is:
Modify scanForSkills to recurse into subdirectories
Make sure the workspace detection uses config options in the fallback
Let me also check if there are any edge cases or issues with making scanForSkills recursive...
Looking at scanForSkills:
go
func scanForSkills(parentDir string) []SkillInfo {
entries, err := os.ReadDir(parentDir)
...
var skills []SkillInfo
for _, entry := range entries {
if !entry.IsDir() || strings.HasPrefix(entry.Name(), ".") {
continue
}
childDir := filepath.Join(parentDir, entry.Name())
if info, ok := tryParseSkill(childDir); ok {
skills = append(skills, info)
}
}
return skills
}
To make it recursive, I could:
go
func scanForSkills(parentDir string) []SkillInfo {
entries, err := os.ReadDir(parentDir)
...
var skills []SkillInfo
for _, entry := range entries {
if !entry.IsDir() || strings.HasPrefix(entry.Name(), ".") {
continue
}
childDir := filepath.Join(parentDir, entry.Name())
if info, ok := tryParseSkill(childDir); ok {
skills = append(skills, info)
} else if entry.IsDir() {
// Recurse into subdirectories
nestedSkills := scanForSkills(childDir)
skills = append(skills, nestedSkills...)
}
}
return skills
}
But this could cause issues:
If a subdirectory doesn't have SKILL.md, it recursively searches deeper
This might pick up unintended SKILL.md files from third-party packages
Actually, looking at the original code:
go
if !entry.IsDir() || strings.HasPrefix(entry.Name(), ".") {
continue
}
It already skips files and hidden directories. The recursive fix would just extend this to also search within non-hidden directories.
But we'd want to stop recursion when we find a SKILL.md, because the skill directory might have subdirectories that are not skills:
go
if info, ok := tryParseSkill(childDir); ok {
skills = append(skills, info)
} else {
// Only recurse if no SKILL.md found
nestedSkills := scanForSkills(childDir)
skills = append(skills, nestedSkills...)
}
This way, if skills/development/skill-creator/ has SKILL.md, it's detected and we don't recurse into its subdirectories.
I think this is the right approach. Let me also think about the second fix: using config options in the fallback detection.
Actually, wait. If scanForSkills is fixed to recurse, then DetectContext would find nested skills. And the workspace detection with config options would work.
But there's still the issue that when waza check skills/development/skill-creator is called, the path branch calls checkReadiness(skillDir, nil) with wsCtx = nil. Then in checkReadiness:
wsCtx is nil, so first eval check is skipped
Fallback: DetectContext(wd) without config options
If scanForSkills is recursive, this would find nested skills
FindEval would find the eval
So fixing scanForSkills to recurse should fix the issue! But using config options in the fallback would also help ensure that the correct paths are used.
Actually, let me think about this more carefully. If the workspace is at CWD, and the skills are in skills/ (relative to CWD), then:
DetectContext(wd) with default skillsDir="skills" → scans skills/ → finds skills if recursive
DetectContext(wd, WithSkillsDir("skills/")) → scans skills/ → finds skills if recursive
Both should work the same if scanForSkills is recursive. The config options would matter if the paths.skills in .waza.yaml is a different path than the default.
OK, I think the fix is:
Modify scanForSkills to recurse into subdirectories (this is the core fix)
Optionally, also use config options in checkReadiness's fallback (for consistency)
Let me implement this.
Wait, but actually, I'm second-guessing myself. Let me re-read the issue:
code
### `waza check skill-creator`
Output includes:
no SKILL.md found in <workspace root>
This is the error from checkReadiness("."). It means resolveWorkspace failed (returned an error), and the code fell through to the fallback case.
Why would resolveWorkspace fail?
go
func resolveWorkspace(args []string) (*workspace.WorkspaceContext, error) {
wd, err := os.Getwd()
ctx, err := workspace.DetectContext(wd, configDetectOptions()...)
if err != nil {
return nil, fmt.Errorf("detecting workspace: %w", err)
}
...
if len(args) > 0 {
arg := args[0]
if workspace.LooksLikePath(arg) {
return ctx, nil
}
if ctx.Type == workspace.ContextNone {
return nil, fmt.Errorf("no workspace detected and %q is not a file path", arg)
}
si, err := workspace.FindSkill(ctx, arg)
if err != nil {
return nil, err // This would be "skill \"skill-creator\" not found in workspace"
}
...
}
...
}
If DetectContext returns ContextNone, then resolveWorkspace(["skill-creator"]) would return "no workspace detected and \"skill-creator\" is not a file path".
But the error is "no SKILL.md found in ", which is from the fallback in runCheck:
So if resolveWorkspace returns an error OR wsCtx.Skills is empty, it falls back. If DetectContext returns ContextNone, then wsCtx.Skills would be empty, so it falls back to checkReadiness(".").
OK so the flow is:
resolveWorkspace(["skill-creator"]) is called
DetectContext(wd, configDetectOptions()...) is called
If workspace has nested skills, DetectContext returns ContextNone
resolveWorkspace returns wsCtx with Skills = nil
resolveWorkspace doesn't return an error (DetectContext didn't fail, it just didn't find anything)
len(wsCtx.Skills) > 0 is false, so it falls through to the fallback
checkReadiness(".") is called
SKILL.md not found in . → "no SKILL.md found in "
So the root cause is that DetectContext returns ContextNone for a workspace with nested skills.
Now I'm confident about the fix. I need to make scanForSkills recurse into subdirectories so that DetectContext can find skills in nested structures.
But wait, let me also check what happens with waza check skills/development/skill-creator:
Goes to path branch, calls checkReadiness("skills/development/skill-creator", nil)
Finds SKILL.md → skill name parsed from frontmatter
wsCtx is nil, so first eval check is skipped
Fallback: DetectContext(wd) without config options
If scanForSkills is recursive, finds skills → workspace detected
FindEval(wsCtx, skillName) → finds eval
Reports eval found
But if scanForSkills is NOT recursive:
6. DetectContext(wd) scans skills/ for immediate children → "development" (no SKILL.md) → no skills found
7. Returns ContextNone
8. FindEval returns error
9. Falls back to co-located eval.yaml → not found
10. Reports "Evaluation Suite: Not Found"
So making scanForSkills recursive should fix both cases!
Now let me also consider: what if the workspace config has paths.skills: skills/development? In that case:
DetectContext(wd, WithSkillsDir("skills/development")) would scan skills/development
Immediate children are "skill-creator", etc.
These have SKILL.md → skills found
FindEval → finds eval
So with the right config, it would work even without recursive scanning. But the issue's config has paths.skills: skills/, so recursive scanning is needed.
Actually, I just realized something. Let me re-check. The issue says the workspace .waza.yaml has:
yaml
paths:
skills: skills/
evals: evals/
But maybe the actual repo has a different .waza.yaml. Let me check.
Actually, I should just look at what the test cases expect. Let me check the test file for checkReadiness:
Actually, let me just proceed with the fix. The issue is clear:
scanForSkills only scans immediate children
This means skills in nested directories are not found
FindEval can't find evals because the skills aren't in the workspace context
The fix is to make scanForSkills recurse into subdirectories.
But wait, I need to be careful. The issue also mentions that when calling waza check skill-creator (by name, not path), it says "no SKILL.md found in ". This means resolveWorkspace didn't find any skills, so it fell through to the fallback.
If I fix scanForSkills to recurse, then DetectContext would find the skills, and resolveWorkspace(["skill-creator"]) would find the skill by name and return the context. Then runCheckForSkills would call checkReadiness(si.Dir, wsCtx) with the proper context, and FindEval would work.
So one fix (making scanForSkills recursive) should address both cases.
Let me also think about edge cases:
What if there's a directory like skills/development/vendor/ that contains SKILL.md files? → We'd pick those up too, which might be unintended
What if there's a deeply nested structure? → We'd recurse until we find SKILL.md or exhaust the directory
For edge case 1, we could add logic to skip certain directories (like vendor, node_modules, etc.):
But this might be overkill. The original scanForSkills didn't have any such filtering. Let me keep it simple and just add recursion.
Actually, looking at the original code, it already skips hidden directories (strings.HasPrefix(entry.Name(), ".")). I'll keep that behavior.
Here's my plan:
Modify scanForSkills to recurse into subdirectories (but stop when a SKILL.md is found)
This should fix both the waza check skill-creator and waza check skills/development/skill-creator cases
Let me implement this.
Actually, let me also consider whether I should also fix the config options issue in the fallback detection. Even with recursive scanning, using config options would be more robust.
But I think the recursive scanning fix is the primary fix. The config options are secondary - they'd help if the workspace config has unusual paths.
Let me also think about whether there are any issues with making scanForSkills recursive in other parts of the codebase...
scanForSkills is used in:
DetectContext step 3: scanning the configured skills directory
DetectContext step 4: scanning immediate children of CWD
For step 3, recursion is what we want (find nested skills).
For step 4, recursion might pick up unintended SKILL.md files from subdirectories. But actually, this is also fine - if there's a SKILL.md in a subdirectory, it should be detected.
Actually, wait. Step 4 is for finding skills when no configured skills directory is found. It scans the CWD directly for SKILL.md files. If I make it recursive, it would find SKILL.md in any subdirectory of CWD. This might be too broad, but it's consistent with how discoverSkillFiles works in the coverage command.
OK, let me implement the fix. I'll modify scanForSkills to recurse.
Wait, actually, I realize there might be a simpler fix. Let me look at the check command again:
go
// If arg looks like a file path, use it directly
if len(args) > 0 && workspace.LooksLikePath(args[0]) {
skillDir := args[0]
...
report, err := checkReadiness(skillDir, nil)
The issue is that checkReadiness is called with wsCtx = nil. Instead of fixing scanForSkills, I could fix this by also detecting the workspace context when a path is given.
But this would require modifying runCheck to detect the workspace context. And then checkReadiness would need to use it.
Actually, I think both fixes are needed:
Make scanForSkills recursive (so DetectContext can find nested skills)
Use config options in checkReadiness's fallback (so the correct paths are used)
But actually, if scanForSkills is recursive, then DetectContext(wd) with default options would find nested skills. And FindEval would use evalsDir = "evals" (default), which matches the issue's config (paths.evals: evals/). So the config options might not be needed.
Let me just implement the recursive scanning fix and test it.
Hmm, actually wait. There's a subtlety. The issue says:
code
### `waza check skills/development/skill-creator`
Output includes:
Evaluation Suite: Not Found
But there's a timing issue. When DetectContext(wd) is called, the wd is the current working directory. If the CWD is not the workspace root, then the paths would be wrong.
Actually, looking at the issue's commands:
code
waza check skills/development/skill-creator
This is run from the workspace root (repo/). So wd would be the workspace root, and skills/ would be relative to it. This should work.
OK, let me also think about the waza check skill-creator case:
resolveWorkspace(["skill-creator"]) is called
DetectContext(wd, configDetectOptions()...) is called with config options
If config has paths.skills: skills/, then skillsDir = "skills/"
DetectContext scans skills/ for skills
If scanForSkills is recursive, finds "skill-creator" (and other skills)
It calls FindSkill which looks for an exact name match:
go
func FindSkill(ctx *WorkspaceContext, name string) (*SkillInfo, error) {
for i := range ctx.Skills {
if ctx.Skills[i].Name == name {
return &ctx.Skills[i], nil
}
}
return nil, fmt.Errorf("skill %q not found in workspace", name)
}
So if the skill's frontmatter name is "Skill Creator" (with a space), then FindSkill(ctx, "skill-creator") would fail because the names don't match.
But the issue says waza check skill-creator reports "no SKILL.md found", not "skill not found". This means DetectContext returned ContextNone (no skills found), not that FindSkill failed.
So the name matching issue is not the root cause. The root cause is that no skills are detected at all.
OK, I'm confident now. Let me implement the fix.
Actually, let me also check if there are any existing tests for scanForSkills or DetectContext:
Now I need to modify scanForSkills to recurse into subdirectories. The key insight is:
When we find a directory with SKILL.md, add it as a skill and DON'T recurse further into it
When we find a directory without SKILL.md, recurse into it to find nested skills
Let me also check the checkReadiness fallback to ensure config options are used there. Actually, looking at the code again:
go
if !report.hasEval {
// Try workspace detection from the working directory
if wd, wdErr := os.Getwd(); wdErr == nil {
if autoCtx, ctxErr := workspace.DetectContext(wd); ctxErr == nil {
This calls DetectContext(wd) without config options. We should use config options here too.
Let me implement both fixes:
Make scanForSkills recurse into subdirectories
Use config options in checkReadiness's fallback detection
For fix #2, I need to check if configDetectOptions() is available in the cmd_check.go file. Looking at workspace_resolve.go, it's defined there as a package-level function. Let me verify.
Actually, configDetectOptions is defined in workspace_resolve.go which is in the same package main. So it should be accessible from cmd_check.go.
But wait, there's a circular dependency issue. workspace_resolve.go uses projectconfig.Load and workspace.DetectContext. If I use configDetectOptions in cmd_check.go, it would work because they're in the same package.
However, configDetectOptions uses os.Getwd() internally. Let me check if this is the same wd that's passed to DetectContext in the fallback.
In checkReadiness:
go
if wd, wdErr := os.Getwd(); wdErr == nil {
if autoCtx, ctxErr := workspace.DetectContext(wd); ctxErr == nil {
Both use os.Getwd(), so they should be consistent.
But there's a subtle issue: configDetectOptions returns options like WithSkillsDir(skillsDir) where skillsDir might already be a relative or absolute path. If it's relative and we pass it to DetectContext, the path would be resolved relative to the wd passed to DetectContext.
If cfg.Paths.Skills is "skills/" and cfg.Dir is the workspace root, then skillsDir would be /workspace/skills/ (absolute). This is fine.
If cfg.Paths.Skills is "skills/" and cfg.Dir is empty, then skillsDir is "skills/" (relative). When passed to DetectContext, it would be joined with absDir.