Skip to content

mission control for agent skills

Hide dot-prefixed skill directories and polish agent-specific TUI details

alvinreal3282659d0e25
diff --git a/internal/scan/scan.go b/internal/scan/scan.go
index b2f3979..d55f3e8 100644
--- a/internal/scan/scan.go
+++ b/internal/scan/scan.go
@@ -185,6 +185,9 @@ func scanLocation(loc agents.Location, skills map[string]*model.Skill) {
return
}
for _, entry := range entries {
+ if strings.HasPrefix(entry.Name(), ".") {
+ continue
+ }
path := filepath.Join(loc.Root, entry.Name())
info, err := os.Lstat(path)
if err != nil {
diff --git a/internal/scan/scan_test.go b/internal/scan/scan_test.go
index 2e6747f..d270acd 100644
--- a/internal/scan/scan_test.go
+++ b/internal/scan/scan_test.go
@@ -86,6 +86,27 @@ func TestClaudeProjectDir(t *testing.T) {
}
}
+func TestHiddenSkillDirectoriesAreIgnored(t *testing.T) {
+ home := withHome(t)
+ cwd := t.TempDir()
+ if err := os.MkdirAll(filepath.Join(home, ".codex", "skills", ".system"), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ writeSkill(t, filepath.Join(home, ".codex", "skills", "review"), "Review", "Review code")
+ res, err := Run(cwd)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, skill := range res.Skills {
+ if skill.Name == ".system" {
+ t.Fatalf("expected hidden .system directory to be ignored, got %#v", skill)
+ }
+ }
+ if len(res.Skills) != 1 || res.Skills[0].Name != "Review" {
+ t.Fatalf("expected only normal skill, got %#v", res.Skills)
+ }
+}
+
func TestLocksCorrelateBySkillName(t *testing.T) {
home := withHome(t)
cwd := t.TempDir()
diff --git a/internal/tui/tui.go b/internal/tui/tui.go
index 86414d6..edc6953 100644
--- a/internal/tui/tui.go
+++ b/internal/tui/tui.go
@@ -729,7 +729,7 @@ func listGroupLabel(skill *model.Skill) string {
if label := sourceGroupLabel(skill); label != "" {
return label
}
- return "No source metadata"
+ return "Custom / untracked"
}
type skillSourceInfo struct {
@@ -909,7 +909,11 @@ func scopeBadge(scope string) string {
func (m appModel) listPane(height, width int) string {
items := m.filteredSkills()
- lines := []string{titleStyle.Render("Skills")}
+ title := "All Skills"
+ if m.agent != "" {
+ title = m.agentLabel() + " Skills"
+ }
+ lines := []string{titleStyle.Render(title)}
if len(items) == 0 {
detail := "No skills match."
if m.agent != "" {
@@ -935,25 +939,35 @@ func (m appModel) listPane(height, width int) string {
if m.isSelected(skill) {
mark = "● "
}
- label := fmt.Sprintf("%s%s [%s]", mark, view.Name, scopeBadge(view.Scope))
+ coreLabel := fmt.Sprintf("%s%s [%s]", mark, view.Name, scopeBadge(view.Scope))
if m.agent != "" {
- label += " " + agentVisibilityBadge(items[i], m.agent)
+ coreLabel += " " + agentVisibilityBadge(items[i], m.agent)
}
issueErrors, issueWarnings := healthIssueCounts(view.HealthIssues)
+ badgeLen := 0
if issueErrors > 0 {
- label += fmt.Sprintf(" !%d", issueErrors)
+ badgeLen = len(fmt.Sprintf(" !%d", issueErrors))
} else if issueWarnings > 0 {
- label += fmt.Sprintf(" ⚠ %d", issueWarnings)
+ badgeLen = len(fmt.Sprintf(" ⚠ %d", issueWarnings))
}
+ truncatedCore := truncate(coreLabel, width-badgeLen)
var line string
if i == m.selected {
- line = selectedStyle.Render(truncate(label, width))
+ badge := ""
+ if issueErrors > 0 {
+ badge = fmt.Sprintf(" !%d", issueErrors)
+ } else if issueWarnings > 0 {
+ badge = fmt.Sprintf(" ⚠ %d", issueWarnings)
+ }
+ line = selectedStyle.Render(truncatedCore + badge)
} else if issueErrors > 0 {
- line = errorStyle.Render(truncate(label, width))
+ badge := errorStyle.Render(fmt.Sprintf(" !%d", issueErrors))
+ line = errorStyle.Render(truncatedCore) + badge
} else if issueWarnings > 0 {
- line = warningStyle.Render(truncate(label, width))
+ badge := warningStyle.Render(fmt.Sprintf(" ⚠ %d", issueWarnings))
+ line = truncatedCore + badge
} else {
- line = truncate(label, width)
+ line = truncatedCore
}
if i == m.selected {
selectedRow = len(rows)
@@ -987,6 +1001,44 @@ func healthIssueCounts(issues []display.HealthIssueView) (errors int, warnings i
return errors, warnings
}
+func humanHealthIssueType(issueType string) string {
+ switch issueType {
+ case "missing_skill_md":
+ return "Missing SKILL.md"
+ case "invalid_frontmatter":
+ return "Invalid Frontmatter"
+ case "broken_symlink":
+ return "Broken Symlink"
+ case "missing_project_lock":
+ return "Not Tracked in Project"
+ case "missing_global_lock":
+ return "Not Tracked in Global"
+ case "ghost_agent_skill":
+ return "Agent-specific skill"
+ case "duplicate_name":
+ return "Duplicate Name"
+ case "project_global_shadowing":
+ return "Name Conflict"
+ case "lock_without_files":
+ return "Lock Entry Missing Files"
+ default:
+ return strings.ReplaceAll(issueType, "_", " ")
+ }
+}
+
+func humanHealthIssueMessage(issueType, message string) string {
+ switch issueType {
+ case "ghost_agent_skill":
+ return "This skill is custom/untracked and only installed for specific agents."
+ case "missing_project_lock":
+ return "This skill is not tracked by the project lock."
+ case "missing_global_lock":
+ return "This skill is not tracked by the global lock."
+ default:
+ return message
+ }
+}
+
func (m appModel) detailPane() string {
return m.viewport.View()
}
@@ -1060,7 +1112,7 @@ func (m appModel) detailLines(width int) []string {
}
lines = append(lines, "", headerStyle.Render(header))
for _, issue := range view.HealthIssues {
- line := fmt.Sprintf("- %s: %s", issue.Type, issue.Message)
+ line := fmt.Sprintf("- %s: %s", humanHealthIssueType(issue.Type), humanHealthIssueMessage(issue.Type, issue.Message))
if issue.Path != "" {
line += " (" + issue.Path + ")"
}
@@ -1124,6 +1176,25 @@ func (m appModel) visibilitySummary(view display.SkillView, width int) []string
}
return []string{formatMetaLine("Visibility:", "no compatibility data for "+m.agentLabel(), width)}
}
+ if view.CanonicalPath == "" {
+ observedAgents := []string{}
+ for _, p := range view.Observed {
+ if p.Agent != "" {
+ displayName := p.Agent
+ for _, state := range m.result.Agents {
+ if state.Name == p.Agent {
+ displayName = state.Display
+ break
+ }
+ }
+ observedAgents = append(observedAgents, displayName)
+ }
+ }
+ if len(observedAgents) > 0 {
+ val := "Agent-specific: " + strings.Join(observedAgents, ", ")
+ return []string{formatMetaLine("Visibility:", val, width)}
+ }
+ }
detected := m.detectedAgentSet()
visible := 0
total := 0
@@ -1442,6 +1513,9 @@ func skillRelevantToAgent(sk *model.Skill, agent string) bool {
if skillObservedByAgent(sk, agent) {
return true
}
+ if sk.CanonicalPath == "" {
+ return false
+ }
for _, visibility := range sk.Visibility {
if visibility.Agent == agent {
return true
@@ -1456,12 +1530,12 @@ func agentVisibilityBadge(sk *model.Skill, agent string) string {
continue
}
if visibility.Visible {
- return "✓"
+ return successStyle.Render("✓")
}
return "×"
}
if skillObservedByAgent(sk, agent) {
- return "✓"
+ return successStyle.Render("✓")
}
return "×"
}
diff --git a/internal/tui/tui_test.go b/internal/tui/tui_test.go
index 94d280f..c8e4c82 100644
--- a/internal/tui/tui_test.go
+++ b/internal/tui/tui_test.go
@@ -9,6 +9,7 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
+ "lazyskills/internal/compat"
"lazyskills/internal/display"
"lazyskills/internal/model"
"lazyskills/internal/runner"
@@ -59,6 +60,17 @@ func TestAgentFilterLimitsVisibleSkills(t *testing.T) {
}
}
+func TestListTitleReflectsAgentFilter(t *testing.T) {
+ m := appModel{result: model.ScanResult{Skills: []*model.Skill{{Name: "Build", Scope: model.ScopeProject}}}}
+ if out := m.listPane(20, 80); !strings.Contains(out, "All Skills") {
+ t.Fatalf("expected all-skills title, got %q", out)
+ }
+ m.agent = "opencode"
+ if out := m.listPane(20, 80); !strings.Contains(out, "OpenCode Skills") {
+ t.Fatalf("expected agent-specific title, got %q", out)
+ }
+}
+
func TestNextAgentFilterCyclesThroughDetectedAgents(t *testing.T) {
m := appModel{result: model.ScanResult{Agents: []model.AgentState{
{Name: "opencode", Detected: true},
@@ -209,10 +221,11 @@ func TestCommandPreviewModeRendersWithoutExecuting(t *testing.T) {
func TestActiveAgentVisibilityReasonIsRendered(t *testing.T) {
m := appModel{width: 120, height: 32, agent: "claude-code", result: model.ScanResult{Skills: []*model.Skill{{
- Name: "Build",
- Description: "desc",
- Scope: model.ScopeProject,
- Visibility: []model.SkillVisibility{{Agent: "claude-code", Display: "Claude Code", Visible: false, Reason: "missing_agent_link"}},
+ Name: "Build",
+ Description: "desc",
+ Scope: model.ScopeProject,
+ CanonicalPath: "/tmp/build",
+ Visibility: []model.SkillVisibility{{Agent: "claude-code", Display: "Claude Code", Visible: false, Reason: "missing_agent_link"}},
}}}}
out := m.View()
if !strings.Contains(out, "Build") || !strings.Contains(out, "Claude Code: not linked") {
@@ -223,17 +236,19 @@ func TestActiveAgentVisibilityReasonIsRendered(t *testing.T) {
func TestAgentFilterListMarksNonVisibleSkills(t *testing.T) {
m := appModel{width: 120, height: 32, agent: "claude-code", result: model.ScanResult{Skills: []*model.Skill{
{
- Name: "Visible",
- Scope: model.ScopeProject,
- Visibility: []model.SkillVisibility{{Agent: "claude-code", Display: "Claude Code", Visible: true, Reason: "visible_via_symlink"}},
+ Name: "Visible",
+ Scope: model.ScopeProject,
+ CanonicalPath: "/tmp/visible",
+ Visibility: []model.SkillVisibility{{Agent: "claude-code", Display: "Claude Code", Visible: true, Reason: "visible_via_symlink"}},
},
{
- Name: "Missing",
- Scope: model.ScopeProject,
- Visibility: []model.SkillVisibility{{Agent: "claude-code", Display: "Claude Code", Visible: false, Reason: "missing_agent_link"}},
+ Name: "Missing",
+ Scope: model.ScopeProject,
+ CanonicalPath: "/tmp/missing",
+ Visibility: []model.SkillVisibility{{Agent: "claude-code", Display: "Claude Code", Visible: false, Reason: "missing_agent_link"}},
},
}}}
- out := m.listPane(20, 80)
+ out := compat.StripTerminalEscapes(m.listPane(20, 80))
if !strings.Contains(out, "Visible [P] ✓") || !strings.Contains(out, "Missing [P] ×") {
t.Fatalf("expected list-level visibility badges, got %q", out)
}
@@ -638,7 +653,7 @@ func TestSkillListSeparatesNoSourceMetadata(t *testing.T) {
{Name: "Manual", Scope: model.ScopeProject},
}}}
out := m.View()
- if !strings.Contains(out, "─ owner/repo") || !strings.Contains(out, "─ No source metadata") {
+ if !strings.Contains(out, "─ owner/repo") || !strings.Contains(out, "─ Custom / untracked") {
t.Fatalf("expected explicit source and no-source groups, got %q", out)
}
}
@@ -915,7 +930,7 @@ func TestVisibilityReasonTranslation(t *testing.T) {
}
// List badges stay compact; detail pane carries the explanation.
- if badge := agentVisibilityBadge(sk, "claude-code"); badge != "✓" {
+ if badge := compat.StripTerminalEscapes(agentVisibilityBadge(sk, "claude-code")); badge != "✓" {
t.Errorf("expected compact available badge, got %q", badge)
}
if badge := agentVisibilityBadge(sk, "opencode"); badge != "×" {