Skip to content

mission control for agent skills

fix: report missing command tools

Alvin Unreal6b01993e06da
diff --git a/internal/doctor/doctor.go b/internal/doctor/doctor.go
index 5e89dbe..57233ad 100644
--- a/internal/doctor/doctor.go
+++ b/internal/doctor/doctor.go
@@ -40,6 +40,13 @@ func Build(result model.ScanResult) Report {
Cwd: compat.SanitizeMetadata(result.Cwd),
Findings: make([]Finding, 0, len(result.HealthIssues)),
}
+ if result.Preflight != nil && !result.Preflight.CanRunSkills {
+ report.add("Workspace", "", "", model.HealthIssue{
+ Type: "missing_skill_tools",
+ Severity: "error",
+ Message: "LazySkills cannot run skill commands because neither the skills CLI nor Node.js with npm and npx is available.",
+ })
+ }
for _, issue := range result.HealthIssues {
report.add("Workspace", "", "", issue)
}
@@ -140,6 +147,8 @@ func title(issueType string) string {
return "Corrupt global lock file"
case "shared_scope_root":
return "Shared skills root"
+ case "missing_skill_tools":
+ return "Missing skill command tools"
default:
return strings.ReplaceAll(compat.SanitizeMetadata(issueType), "_", " ")
}
@@ -175,6 +184,8 @@ func advice(issueType, scope, skillName string) string {
return "This location is shared through a symlinked skills root. Repair it at the canonical source."
case "ghost_agent_skill":
return "Move or reinstall it through the canonical skills directory if it should be shared."
+ case "missing_skill_tools":
+ return "Install the skills CLI, or install Node.js and npm so LazySkills can use npx."
default:
return "Review this configuration and run lazyskills doctor again."
}
diff --git a/internal/doctor/doctor_test.go b/internal/doctor/doctor_test.go
index 55b908a..63f8f69 100644
--- a/internal/doctor/doctor_test.go
+++ b/internal/doctor/doctor_test.go
@@ -39,6 +39,16 @@ func TestBuildPrioritizesAndSanitizesFindings(t *testing.T) {
}
}
+func TestBuildIncludesMissingCommandTools(t *testing.T) {
+ report := Build(model.ScanResult{Preflight: &model.Preflight{CanRunSkills: false}})
+ if len(report.Findings) != 1 || report.Findings[0].Type != "missing_skill_tools" || report.Findings[0].Severity != "error" {
+ t.Fatalf("expected missing tools error, got %#v", report)
+ }
+ if !strings.Contains(report.Findings[0].Advice, "Node.js and npm") {
+ t.Fatalf("unexpected missing tools advice: %q", report.Findings[0].Advice)
+ }
+}
+
func TestRestoreAdviceQuotesShellMetacharacters(t *testing.T) {
report := Build(model.ScanResult{Skills: []*model.Skill{{
Name: "$(bad)'name",