Skip to content

mission control for agent skills

Add agent compatibility diagnostics

Alvin Unreal21e4a8a58187
diff --git a/internal/agents/agents.go b/internal/agents/agents.go
index 693157d..154852b 100644
--- a/internal/agents/agents.go
+++ b/internal/agents/agents.go
@@ -3,49 +3,298 @@ package agents
import (
"os"
"path/filepath"
+ "sort"
"lazyskills/internal/model"
)
type Agent struct {
- Name string
- Display string
- ProjectDir string
- GlobalDir string
- Universal bool
+ Name string
+ Display string
+ ProjectDir string
+ GlobalDir string
+ SupportsGlobal bool
+ Universal bool
+ ShowInUniversalList bool
+ ShowInUniversalPrompt bool
+ Detected bool
+}
+type Env struct {
+ Home string
+ Vars map[string]string
+ ExistsFunc func(string) bool
}
-func configHome() string {
- if v := os.Getenv("XDG_CONFIG_HOME"); v != "" {
+func DefaultEnv() Env {
+ home, _ := os.UserHomeDir()
+ return Env{Home: home, Vars: map[string]string{}, ExistsFunc: pathExists}
+}
+func pathExists(path string) bool {
+ if path == "" {
+ return false
+ }
+ _, err := os.Stat(path)
+ return err == nil
+}
+func (e Env) EnvValue(key string) string {
+ if e.Vars != nil {
+ if v, ok := e.Vars[key]; ok {
+ return v
+ }
+ }
+ return os.Getenv(key)
+}
+func (e Env) Env(key string) string { return e.EnvValue(key) }
+func (e Env) Exists(path string) bool {
+ if e.ExistsFunc != nil {
+ return e.ExistsFunc(path)
+ }
+ return pathExists(path)
+}
+func (e Env) ConfigHome() string {
+ if v := e.EnvValue("XDG_CONFIG_HOME"); v != "" {
return v
}
- home, _ := os.UserHomeDir()
- return filepath.Join(home, ".config")
+ return filepath.Join(e.Home, ".config")
}
-
-func homeJoin(parts ...string) string {
- home, _ := os.UserHomeDir()
- all := append([]string{home}, parts...)
- return filepath.Join(all...)
+func (e Env) CodexHome() string {
+ if v := e.EnvValue("CODEX_HOME"); v != "" {
+ return v
+ }
+ return filepath.Join(e.Home, ".codex")
}
-
-func InitialAgents() []Agent {
- codexHome := os.Getenv("CODEX_HOME")
- if codexHome == "" {
- codexHome = homeJoin(".codex")
+func (e Env) ClaudeHome() string {
+ if v := e.EnvValue("CLAUDE_CONFIG_DIR"); v != "" {
+ return v
+ }
+ return filepath.Join(e.Home, ".claude")
+}
+func (e Env) VibeHome() string {
+ if v := e.EnvValue("VIBE_HOME"); v != "" {
+ return v
+ }
+ return filepath.Join(e.Home, ".vibe")
+}
+func (e Env) HermesHome() string {
+ if v := e.EnvValue("HERMES_HOME"); v != "" {
+ return v
+ }
+ return filepath.Join(e.Home, ".hermes")
+}
+func (e Env) AutohandHome() string {
+ if v := e.EnvValue("AUTOHAND_HOME"); v != "" {
+ return v
+ }
+ return filepath.Join(e.Home, ".autohand")
+}
+func anyExists(e Env, paths ...string) bool {
+ for _, p := range paths {
+ if e.Exists(p) {
+ return true
+ }
+ }
+ return false
+}
+func openClawGlobalSkillsDir(e Env) string {
+ if e.Exists(filepath.Join(e.Home, ".openclaw")) {
+ return filepath.Join(e.Home, ".openclaw", "skills")
}
- claudeHome := os.Getenv("CLAUDE_CONFIG_DIR")
- if claudeHome == "" {
- claudeHome = homeJoin(".claude")
+ if e.Exists(filepath.Join(e.Home, ".clawdbot")) {
+ return filepath.Join(e.Home, ".clawdbot", "skills")
}
+ if e.Exists(filepath.Join(e.Home, ".moltbot")) {
+ return filepath.Join(e.Home, ".moltbot", "skills")
+ }
+ return filepath.Join(e.Home, ".openclaw", "skills")
+}
+func agentDetectRoot(globalDir string) string {
+ dir := filepath.Clean(globalDir)
+ for _, suffix := range []string{filepath.Join("agent", "skills"), filepath.Join("data", "skills"), "skills"} {
+ if filepath.Base(dir) == filepath.Base(suffix) {
+ dir = filepath.Dir(dir)
+ if filepath.Base(suffix) == "skills" && filepath.Base(dir) == "agent" {
+ dir = filepath.Dir(dir)
+ }
+ return dir
+ }
+ }
+ return filepath.Dir(dir)
+}
+func Registry() []Agent { return RegistryWithEnv(DefaultEnv(), "") }
+func RegistryWithEnv(e Env, cwd string) []Agent {
+ agents := []Agent{
+ {Name: `aider-desk`, Display: `AiderDesk`, ProjectDir: `.aider-desk/skills`, GlobalDir: filepath.Join(e.Home, `.aider-desk/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.aider-desk/skills`)))},
+ {Name: `amp`, Display: `Amp`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.ConfigHome(), `agents/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.ConfigHome(), `agents/skills`)))},
+ {Name: `antigravity`, Display: `Antigravity`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.gemini/antigravity/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.gemini/antigravity/skills`)))},
+ {Name: `antigravity-cli`, Display: `Antigravity CLI`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.gemini/antigravity-cli/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.gemini/antigravity-cli/skills`)))},
+ {Name: `astrbot`, Display: `AstrBot`, ProjectDir: `data/skills`, GlobalDir: filepath.Join(e.Home, `.astrbot/data/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: anyExists(e, filepath.Join(cwd, "data", "skills"), filepath.Join(e.Home, ".astrbot"))},
+ {Name: `autohand-code`, Display: `Autohand Code CLI`, ProjectDir: `.autohand/skills`, GlobalDir: filepath.Join(e.AutohandHome(), `skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(e.AutohandHome())},
+ {Name: `augment`, Display: `Augment`, ProjectDir: `.augment/skills`, GlobalDir: filepath.Join(e.Home, `.augment/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.augment/skills`)))},
+ {Name: `bob`, Display: `IBM Bob`, ProjectDir: `.bob/skills`, GlobalDir: filepath.Join(e.Home, `.bob/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.bob/skills`)))},
+ {Name: `claude-code`, Display: `Claude Code`, ProjectDir: `.claude/skills`, GlobalDir: filepath.Join(e.ClaudeHome(), `skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(e.ClaudeHome())},
+ {Name: `openclaw`, Display: `OpenClaw`, ProjectDir: `skills`, GlobalDir: openClawGlobalSkillsDir(e), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: anyExists(e, filepath.Join(e.Home, ".openclaw"), filepath.Join(e.Home, ".clawdbot"), filepath.Join(e.Home, ".moltbot"))},
+ {Name: `cline`, Display: `Cline`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.agents`, `skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.agents`, `skills`)))},
+ {Name: `codearts-agent`, Display: `CodeArts Agent`, ProjectDir: `.codeartsdoer/skills`, GlobalDir: filepath.Join(e.Home, `.codeartsdoer/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.codeartsdoer/skills`)))},
+ {Name: `codebuddy`, Display: `CodeBuddy`, ProjectDir: `.codebuddy/skills`, GlobalDir: filepath.Join(e.Home, `.codebuddy/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: anyExists(e, filepath.Join(cwd, ".codebuddy"), filepath.Join(e.Home, ".codebuddy"))},
+ {Name: `codemaker`, Display: `Codemaker`, ProjectDir: `.codemaker/skills`, GlobalDir: filepath.Join(e.Home, `.codemaker/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.codemaker/skills`)))},
+ {Name: `codestudio`, Display: `Code Studio`, ProjectDir: `.codestudio/skills`, GlobalDir: filepath.Join(e.Home, `.codestudio/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.codestudio/skills`)))},
+ {Name: `codex`, Display: `Codex`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.CodexHome(), `skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: anyExists(e, e.CodexHome(), "/etc/codex")},
+ {Name: `command-code`, Display: `Command Code`, ProjectDir: `.commandcode/skills`, GlobalDir: filepath.Join(e.Home, `.commandcode/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.commandcode/skills`)))},
+ {Name: `continue`, Display: `Continue`, ProjectDir: `.continue/skills`, GlobalDir: filepath.Join(e.Home, `.continue/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: anyExists(e, filepath.Join(cwd, ".continue"), filepath.Join(e.Home, ".continue"))},
+ {Name: `cortex`, Display: `Cortex Code`, ProjectDir: `.cortex/skills`, GlobalDir: filepath.Join(e.Home, `.snowflake/cortex/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.snowflake/cortex/skills`)))},
+ {Name: `crush`, Display: `Crush`, ProjectDir: `.crush/skills`, GlobalDir: filepath.Join(e.Home, `.config/crush/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.config/crush/skills`)))},
+ {Name: `cursor`, Display: `Cursor`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.cursor/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.cursor/skills`)))},
+ {Name: `deepagents`, Display: `Deep Agents`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.deepagents/agent/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.deepagents/agent/skills`)))},
+ {Name: `devin`, Display: `Devin for Terminal`, ProjectDir: `.devin/skills`, GlobalDir: filepath.Join(e.ConfigHome(), `devin/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.ConfigHome(), `devin/skills`)))},
+ {Name: `dexto`, Display: `Dexto`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.agents/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: false, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.agents/skills`)))},
+ {Name: `droid`, Display: `Droid`, ProjectDir: `.factory/skills`, GlobalDir: filepath.Join(e.Home, `.factory/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.factory/skills`)))},
+ {Name: `firebender`, Display: `Firebender`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.firebender/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: false, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.firebender/skills`)))},
+ {Name: `forgecode`, Display: `ForgeCode`, ProjectDir: `.forge/skills`, GlobalDir: filepath.Join(e.Home, `.forge/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.forge/skills`)))},
+ {Name: `gemini-cli`, Display: `Gemini CLI`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.gemini/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.gemini/skills`)))},
+ {Name: `github-copilot`, Display: `GitHub Copilot`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.copilot/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.copilot/skills`)))},
+ {Name: `goose`, Display: `Goose`, ProjectDir: `.goose/skills`, GlobalDir: filepath.Join(e.ConfigHome(), `goose/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.ConfigHome(), `goose/skills`)))},
+ {Name: `hermes-agent`, Display: `Hermes Agent`, ProjectDir: `.hermes/skills`, GlobalDir: filepath.Join(e.HermesHome(), `skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(e.HermesHome())},
+ {Name: `inference-sh`, Display: `inference.sh`, ProjectDir: `.inferencesh/skills`, GlobalDir: filepath.Join(e.Home, `.inferencesh/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.inferencesh/skills`)))},
+ {Name: `jazz`, Display: `Jazz`, ProjectDir: `.jazz/skills`, GlobalDir: filepath.Join(e.Home, `.jazz/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: anyExists(e, filepath.Join(e.Home, ".jazz"), filepath.Join(cwd, ".jazz"))},
+ {Name: `junie`, Display: `Junie`, ProjectDir: `.junie/skills`, GlobalDir: filepath.Join(e.Home, `.junie/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.junie/skills`)))},
+ {Name: `iflow-cli`, Display: `iFlow CLI`, ProjectDir: `.iflow/skills`, GlobalDir: filepath.Join(e.Home, `.iflow/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.iflow/skills`)))},
+ {Name: `kilo`, Display: `Kilo Code`, ProjectDir: `.kilocode/skills`, GlobalDir: filepath.Join(e.Home, `.kilocode/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.kilocode/skills`)))},
+ {Name: `kimi-code-cli`, Display: `Kimi Code CLI`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.agents/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.agents/skills`)))},
+ {Name: `kiro-cli`, Display: `Kiro CLI`, ProjectDir: `.kiro/skills`, GlobalDir: filepath.Join(e.Home, `.kiro/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.kiro/skills`)))},
+ {Name: `kode`, Display: `Kode`, ProjectDir: `.kode/skills`, GlobalDir: filepath.Join(e.Home, `.kode/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.kode/skills`)))},
+ {Name: `lingma`, Display: `Lingma`, ProjectDir: `.lingma/skills`, GlobalDir: filepath.Join(e.Home, `.lingma/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.lingma/skills`)))},
+ {Name: `loaf`, Display: `Loaf`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.agents/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: false, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.agents/skills`)))},
+ {Name: `mcpjam`, Display: `MCPJam`, ProjectDir: `.mcpjam/skills`, GlobalDir: filepath.Join(e.Home, `.mcpjam/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.mcpjam/skills`)))},
+ {Name: `mistral-vibe`, Display: `Mistral Vibe`, ProjectDir: `.vibe/skills`, GlobalDir: filepath.Join(e.VibeHome(), `skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(e.VibeHome())},
+ {Name: `moxby`, Display: `Moxby`, ProjectDir: `.moxby/skills`, GlobalDir: filepath.Join(e.Home, `.moxby/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.moxby/skills`)))},
+ {Name: `mux`, Display: `Mux`, ProjectDir: `.mux/skills`, GlobalDir: filepath.Join(e.Home, `.mux/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.mux/skills`)))},
+ {Name: `opencode`, Display: `OpenCode`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.ConfigHome(), `opencode/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.ConfigHome(), `opencode/skills`)))},
+ {Name: `openhands`, Display: `OpenHands`, ProjectDir: `.openhands/skills`, GlobalDir: filepath.Join(e.Home, `.openhands/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.openhands/skills`)))},
+ {Name: `ona`, Display: `Ona`, ProjectDir: `.ona/skills`, GlobalDir: filepath.Join(e.Home, `.ona/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.ona/skills`)))},
+ {Name: `pi`, Display: `Pi`, ProjectDir: `.pi/skills`, GlobalDir: filepath.Join(e.Home, `.pi/agent/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.pi/agent/skills`)))},
+ {Name: `qoder`, Display: `Qoder`, ProjectDir: `.qoder/skills`, GlobalDir: filepath.Join(e.Home, `.qoder/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.qoder/skills`)))},
+ {Name: `qoder-cn`, Display: `Qoder CN`, ProjectDir: `.qoder/skills`, GlobalDir: filepath.Join(e.Home, `.qoder-cn/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.qoder-cn/skills`)))},
+ {Name: `qwen-code`, Display: `Qwen Code`, ProjectDir: `.qwen/skills`, GlobalDir: filepath.Join(e.Home, `.qwen/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.qwen/skills`)))},
+ {Name: `replit`, Display: `Replit`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.ConfigHome(), `agents/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: false, ShowInUniversalPrompt: true, Detected: e.Exists(filepath.Join(cwd, ".replit"))},
+ {Name: `reasonix`, Display: `Reasonix`, ProjectDir: `.reasonix/skills`, GlobalDir: filepath.Join(e.Home, `.reasonix/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.reasonix/skills`)))},
+ {Name: `rovodev`, Display: `Rovo Dev`, ProjectDir: `.rovodev/skills`, GlobalDir: filepath.Join(e.Home, `.rovodev/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.rovodev/skills`)))},
+ {Name: `roo`, Display: `Roo Code`, ProjectDir: `.roo/skills`, GlobalDir: filepath.Join(e.Home, `.roo/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.roo/skills`)))},
+ {Name: `tabnine-cli`, Display: `Tabnine CLI`, ProjectDir: `.tabnine/agent/skills`, GlobalDir: filepath.Join(e.Home, `.tabnine/agent/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.tabnine/agent/skills`)))},
+ {Name: `terramind`, Display: `Terramind`, ProjectDir: `.terramind/skills`, GlobalDir: filepath.Join(e.Home, `.terramind/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.terramind/skills`)))},
+ {Name: `tinycloud`, Display: `Tinycloud`, ProjectDir: `.tinycloud/skills`, GlobalDir: filepath.Join(e.Home, `.tinycloud/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.tinycloud/skills`)))},
+ {Name: `trae`, Display: `Trae`, ProjectDir: `.trae/skills`, GlobalDir: filepath.Join(e.Home, `.trae/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.trae/skills`)))},
+ {Name: `trae-cn`, Display: `Trae CN`, ProjectDir: `.trae/skills`, GlobalDir: filepath.Join(e.Home, `.trae-cn/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.trae-cn/skills`)))},
+ {Name: `warp`, Display: `Warp`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.agents/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.agents/skills`)))},
+ {Name: `windsurf`, Display: `Windsurf`, ProjectDir: `.windsurf/skills`, GlobalDir: filepath.Join(e.Home, `.codeium/windsurf/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.codeium/windsurf/skills`)))},
+ {Name: `zed`, Display: `Zed`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.Home, `.agents/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: false},
+ {Name: `zencoder`, Display: `Zencoder`, ProjectDir: `.zencoder/skills`, GlobalDir: filepath.Join(e.Home, `.zencoder/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.zencoder/skills`)))},
+ {Name: `zenflow`, Display: `Zenflow`, ProjectDir: `.zencoder/skills`, GlobalDir: filepath.Join(e.Home, `.zencoder/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.zencoder/skills`)))},
+ {Name: `neovate`, Display: `Neovate`, ProjectDir: `.neovate/skills`, GlobalDir: filepath.Join(e.Home, `.neovate/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.neovate/skills`)))},
+ {Name: `pochi`, Display: `Pochi`, ProjectDir: `.pochi/skills`, GlobalDir: filepath.Join(e.Home, `.pochi/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.pochi/skills`)))},
+ {Name: `promptscript`, Display: `PromptScript`, ProjectDir: `.agents/skills`, GlobalDir: "", SupportsGlobal: false, Universal: true, ShowInUniversalList: true, ShowInUniversalPrompt: false, Detected: anyExists(e, filepath.Join(cwd, ".promptscript"), filepath.Join(cwd, "promptscript.yaml"))},
+ {Name: `adal`, Display: `AdaL`, ProjectDir: `.adal/skills`, GlobalDir: filepath.Join(e.Home, `.adal/skills`), SupportsGlobal: true, Universal: false, ShowInUniversalList: true, ShowInUniversalPrompt: true, Detected: e.Exists(agentDetectRoot(filepath.Join(e.Home, `.adal/skills`)))},
+ {Name: `universal`, Display: `Universal`, ProjectDir: `.agents/skills`, GlobalDir: filepath.Join(e.ConfigHome(), `agents/skills`), SupportsGlobal: true, Universal: true, ShowInUniversalList: false, ShowInUniversalPrompt: true, Detected: false},
+ }
+ for i := range agents {
+ agents[i].Detected = detectAgentInstalled(agents[i], e, cwd)
+ }
+ return agents
+}
- return []Agent{
- {Name: "universal", Display: "Universal", ProjectDir: ".agents/skills", GlobalDir: homeJoin(".agents", "skills"), Universal: true},
- {Name: "opencode", Display: "OpenCode", ProjectDir: ".agents/skills", GlobalDir: filepath.Join(configHome(), "opencode", "skills"), Universal: true},
- {Name: "claude-code", Display: "Claude Code", ProjectDir: ".claude/skills", GlobalDir: filepath.Join(claudeHome, "skills")},
- {Name: "cursor", Display: "Cursor", ProjectDir: ".agents/skills", GlobalDir: homeJoin(".cursor", "skills"), Universal: true},
- {Name: "codex", Display: "Codex", ProjectDir: ".agents/skills", GlobalDir: filepath.Join(codexHome, "skills"), Universal: true},
+func detectAgentInstalled(agent Agent, e Env, cwd string) bool {
+ switch agent.Name {
+ case "amp":
+ return e.Exists(filepath.Join(e.ConfigHome(), "amp"))
+ case "cline":
+ return e.Exists(filepath.Join(e.Home, ".cline"))
+ case "dexto":
+ return e.Exists(filepath.Join(e.Home, ".dexto"))
+ case "kimi-code-cli":
+ return anyExists(e, filepath.Join(e.Home, ".kimi-code"), filepath.Join(e.Home, ".kimi"))
+ case "loaf":
+ return e.Exists(filepath.Join(e.Home, ".loaf"))
+ case "warp":
+ return e.Exists(filepath.Join(e.Home, ".warp"))
+ case "pi":
+ return e.Exists(filepath.Join(e.Home, ".pi", "agent"))
+ case "zed":
+ paths := []string{filepath.Join(e.ConfigHome(), "zed")}
+ if appData := e.Env("APPDATA"); appData != "" {
+ paths = append(paths, filepath.Join(appData, "Zed"))
+ }
+ if flatpakConfig := e.Env("FLATPAK_XDG_CONFIG_HOME"); flatpakConfig != "" {
+ paths = append(paths, filepath.Join(flatpakConfig, "zed"))
+ }
+ return anyExists(e, paths...)
+ case "claude-code":
+ return e.Exists(e.ClaudeHome())
+ case "codex":
+ return anyExists(e, e.CodexHome(), "/etc/codex")
+ case "promptscript":
+ return anyExists(e, filepath.Join(cwd, ".promptscript"), filepath.Join(cwd, "promptscript.yaml"))
+ case "openclaw":
+ return anyExists(e, filepath.Join(e.Home, ".openclaw"), filepath.Join(e.Home, ".clawdbot"), filepath.Join(e.Home, ".moltbot"))
+ case "astrbot":
+ return anyExists(e, filepath.Join(cwd, "data", "skills"), filepath.Join(e.Home, ".astrbot"))
+ case "codebuddy":
+ return anyExists(e, filepath.Join(cwd, ".codebuddy"), filepath.Join(e.Home, ".codebuddy"))
+ case "continue":
+ return anyExists(e, filepath.Join(cwd, ".continue"), filepath.Join(e.Home, ".continue"))
+ case "jazz":
+ return anyExists(e, filepath.Join(e.Home, ".jazz"), filepath.Join(cwd, ".jazz"))
+ case "replit":
+ return e.Exists(filepath.Join(cwd, ".replit"))
+ case "universal":
+ return false
+ default:
+ return e.Exists(agentDetectRoot(agent.GlobalDir))
+ }
+}
+func InitialAgents() []Agent { return Registry() }
+func Get(name string) (Agent, bool) {
+ for _, a := range Registry() {
+ if a.Name == name {
+ return a, true
+ }
}
+ return Agent{}, false
+}
+func UniversalAgents() []Agent {
+ out := []Agent{}
+ for _, a := range Registry() {
+ if a.Universal && a.ShowInUniversalList {
+ out = append(out, a)
+ }
+ }
+ return out
+}
+func VisibleUniversalAgents() []Agent {
+ out := []Agent{}
+ for _, a := range Registry() {
+ if a.Universal && a.ShowInUniversalList && a.ShowInUniversalPrompt {
+ out = append(out, a)
+ }
+ }
+ return out
+}
+func NonUniversalAgents() []Agent {
+ out := []Agent{}
+ for _, a := range Registry() {
+ if !a.Universal {
+ out = append(out, a)
+ }
+ }
+ return out
+}
+func DetectInstalled(cwd string) []Agent {
+ out := []Agent{}
+ for _, a := range RegistryWithEnv(DefaultEnv(), cwd) {
+ if a.Detected {
+ out = append(out, a)
+ }
+ }
+ sort.Slice(out, func(i, j int) bool { return out[i].Name < out[j].Name })
+ return out
}
type Location struct {
@@ -55,21 +304,26 @@ type Location struct {
Canonical bool
}
-func Locations(cwd string) []Location {
+func Locations(cwd string) []Location { return LocationsWithEnv(cwd, DefaultEnv()) }
+func LocationsWithEnv(cwd string, e Env) []Location {
var out []Location
- globalCanonical := homeJoin(".agents", "skills")
- for _, a := range InitialAgents() {
- out = append(out, Location{
- Root: filepath.Join(cwd, filepath.FromSlash(a.ProjectDir)),
- Scope: model.ScopeProject,
- AgentName: a.Name,
- Canonical: a.ProjectDir == ".agents/skills",
- })
- if a.Universal {
- out = append(out, Location{Root: globalCanonical, Scope: model.ScopeGlobal, AgentName: a.Name, Canonical: true})
+ seen := map[string]bool{}
+ add := func(loc Location) {
+ key := string(loc.Scope) + "\x00" + loc.AgentName + "\x00" + loc.Root
+ if seen[key] {
+ return
+ }
+ seen[key] = true
+ out = append(out, loc)
+ }
+ globalCanonical := filepath.Join(e.Home, ".agents", "skills")
+ for _, a := range RegistryWithEnv(e, cwd) {
+ add(Location{Root: filepath.Join(cwd, filepath.FromSlash(a.ProjectDir)), Scope: model.ScopeProject, AgentName: a.Name, Canonical: a.Universal})
+ if a.Universal && a.SupportsGlobal {
+ add(Location{Root: globalCanonical, Scope: model.ScopeGlobal, AgentName: a.Name, Canonical: true})
}
- if a.GlobalDir != "" && a.GlobalDir != globalCanonical {
- out = append(out, Location{Root: a.GlobalDir, Scope: model.ScopeGlobal, AgentName: a.Name, Canonical: false})
+ if a.SupportsGlobal && a.GlobalDir != "" && a.GlobalDir != globalCanonical {
+ add(Location{Root: a.GlobalDir, Scope: model.ScopeGlobal, AgentName: a.Name, Canonical: false})
}
}
return out
diff --git a/internal/agents/agents_test.go b/internal/agents/agents_test.go
new file mode 100644
index 0000000..2fac646
--- /dev/null
+++ b/internal/agents/agents_test.go
@@ -0,0 +1,159 @@
+package agents
+
+import (
+ "path/filepath"
+ "testing"
+)
+
+func testEnv(home string, existing ...string) Env {
+ seen := map[string]bool{}
+ for _, path := range existing {
+ seen[path] = true
+ }
+ return Env{
+ Home: home,
+ Vars: map[string]string{},
+ ExistsFunc: func(path string) bool {
+ return seen[path]
+ },
+ }
+}
+
+func agentByName(t *testing.T, list []Agent, name string) Agent {
+ t.Helper()
+ for _, agent := range list {
+ if agent.Name == name {
+ return agent
+ }
+ }
+ t.Fatalf("agent %q not found", name)
+ return Agent{}
+}
+
+func TestRegistryIncludesRepresentativeUpstreamAgents(t *testing.T) {
+ registry := RegistryWithEnv(testEnv("/home/test"), "/repo")
+ for _, name := range []string{"opencode", "claude-code", "codex", "promptscript", "zed"} {
+ agentByName(t, registry, name)
+ }
+ if len(registry) < 70 {
+ t.Fatalf("expected full upstream registry, got %d agents", len(registry))
+ }
+}
+
+func TestPromptScriptDoesNotSupportGlobal(t *testing.T) {
+ agent := agentByName(t, RegistryWithEnv(testEnv("/home/test"), "/repo"), "promptscript")
+ if agent.SupportsGlobal {
+ t.Fatalf("promptscript should not support global skills")
+ }
+ if agent.GlobalDir != "" {
+ t.Fatalf("promptscript global dir should be empty, got %q", agent.GlobalDir)
+ }
+}
+
+func TestUniversalClassificationAndVisibility(t *testing.T) {
+ registry := RegistryWithEnv(testEnv("/home/test"), "/repo")
+ if !agentByName(t, registry, "opencode").Universal {
+ t.Fatalf("opencode should be universal")
+ }
+ if agentByName(t, registry, "claude-code").Universal {
+ t.Fatalf("claude-code should not be universal")
+ }
+ if agentByName(t, registry, "replit").ShowInUniversalList {
+ t.Fatalf("replit should be hidden from universal list")
+ }
+ if agentByName(t, registry, "firebender").ShowInUniversalPrompt {
+ t.Fatalf("firebender should be hidden from universal prompt")
+ }
+
+ visible := VisibleUniversalAgents()
+ for _, hidden := range []string{"dexto", "firebender", "loaf", "promptscript", "replit", "universal"} {
+ for _, agent := range visible {
+ if agent.Name == hidden {
+ t.Fatalf("%s should not be in visible universal agents", hidden)
+ }
+ }
+ }
+}
+
+func TestEnvOverridesForAgentHomes(t *testing.T) {
+ env := testEnv("/home/test")
+ env.Vars["CODEX_HOME"] = "/custom/codex"
+ env.Vars["CLAUDE_CONFIG_DIR"] = "/custom/claude"
+ registry := RegistryWithEnv(env, "/repo")
+ if got := agentByName(t, registry, "codex").GlobalDir; got != filepath.Join("/custom/codex", "skills") {
+ t.Fatalf("unexpected codex global dir: %q", got)
+ }
+ if got := agentByName(t, registry, "claude-code").GlobalDir; got != filepath.Join("/custom/claude", "skills") {
+ t.Fatalf("unexpected claude global dir: %q", got)
+ }
+}
+
+func TestOpenClawLegacyGlobalDirFallback(t *testing.T) {
+ home := "/home/test"
+ if got := agentByName(t, RegistryWithEnv(testEnv(home), "/repo"), "openclaw").GlobalDir; got != filepath.Join(home, ".openclaw", "skills") {
+ t.Fatalf("expected openclaw fallback, got %q", got)
+ }
+ if got := agentByName(t, RegistryWithEnv(testEnv(home, filepath.Join(home, ".clawdbot")), "/repo"), "openclaw").GlobalDir; got != filepath.Join(home, ".clawdbot", "skills") {
+ t.Fatalf("expected clawdbot legacy path, got %q", got)
+ }
+}
+
+func TestDetectInstalledCwdBasedAgents(t *testing.T) {
+ cwd := "/repo"
+ env := testEnv("/home/test", filepath.Join(cwd, ".promptscript"), filepath.Join(cwd, ".replit"))
+ registry := RegistryWithEnv(env, cwd)
+ if !agentByName(t, registry, "promptscript").Detected {
+ t.Fatalf("promptscript should be detected from cwd")
+ }
+ if !agentByName(t, registry, "replit").Detected {
+ t.Fatalf("replit should be detected from cwd")
+ }
+}
+
+func TestDetectorPathsMatchTrickyUpstreamAgents(t *testing.T) {
+ home := "/home/test"
+ cwd := "/repo"
+ cases := []struct {
+ name string
+ path string
+ }{
+ {"amp", filepath.Join(home, ".config", "amp")},
+ {"cline", filepath.Join(home, ".cline")},
+ {"dexto", filepath.Join(home, ".dexto")},
+ {"kimi-code-cli", filepath.Join(home, ".kimi-code")},
+ {"loaf", filepath.Join(home, ".loaf")},
+ {"warp", filepath.Join(home, ".warp")},
+ {"pi", filepath.Join(home, ".pi", "agent")},
+ {"claude-code", filepath.Join(home, ".claude")},
+ {"codex", filepath.Join(home, ".codex")},
+ {"promptscript", filepath.Join(cwd, "promptscript.yaml")},
+ }
+ for _, tc := range cases {
+ t.Run(tc.name, func(t *testing.T) {
+ env := testEnv(home, tc.path)
+ if !agentByName(t, RegistryWithEnv(env, cwd), tc.name).Detected {
+ t.Fatalf("expected %s detected by %s", tc.name, tc.path)
+ }
+ })
+ }
+}
+
+func TestZedDetectorUsesConfigAppDataAndFlatpak(t *testing.T) {
+ home := "/home/test"
+ cwd := "/repo"
+ if agentByName(t, RegistryWithEnv(testEnv(home, "zed", "Zed"), cwd), "zed").Detected {
+ t.Fatalf("zed should not be detected from relative zed/Zed paths when env vars are unset")
+ }
+
+ env := testEnv(home, filepath.Join("/appdata", "Zed"))
+ env.Vars["APPDATA"] = "/appdata"
+ if !agentByName(t, RegistryWithEnv(env, cwd), "zed").Detected {
+ t.Fatalf("expected zed detected from APPDATA")
+ }
+
+ env = testEnv(home, filepath.Join("/flatpak", "zed"))
+ env.Vars["FLATPAK_XDG_CONFIG_HOME"] = "/flatpak"
+ if !agentByName(t, RegistryWithEnv(env, cwd), "zed").Detected {
+ t.Fatalf("expected zed detected from Flatpak config")
+ }
+}
diff --git a/internal/display/display.go b/internal/display/display.go
index 84db1bb..47539d1 100644
--- a/internal/display/display.go
+++ b/internal/display/display.go
@@ -15,6 +15,7 @@ type SkillView struct {
CanonicalPath string
SkillPath string
Observed []ObservedPathView
+ Visibility []VisibilityView
LocalLock *compat.LocalLockDisplay
GlobalLock *compat.GlobalLockDisplay
HealthIssues []HealthIssueView
@@ -36,6 +37,15 @@ type HealthIssueView struct {
Path string
}
+type VisibilityView struct {
+ Agent string
+ Display string
+ Visible bool
+ Reason string
+ Path string
+ Status string
+}
+
func Skill(sk *model.Skill) SkillView {
if sk == nil {
return SkillView{}
@@ -56,6 +66,16 @@ func Skill(sk *model.Skill) SkillView {
TargetPath: compat.SanitizeMetadata(p.TargetPath),
})
}
+ for _, visibility := range sk.Visibility {
+ view.Visibility = append(view.Visibility, VisibilityView{
+ Agent: compat.SanitizeMetadata(visibility.Agent),
+ Display: compat.SanitizeMetadata(visibility.Display),
+ Visible: visibility.Visible,
+ Reason: compat.SanitizeMetadata(visibility.Reason),
+ Path: compat.SanitizeMetadata(visibility.Path),
+ Status: compat.SanitizeMetadata(string(visibility.Status)),
+ })
+ }
if sk.LocalLock != nil {
lock := compat.SanitizeLocalLockDisplay(*sk.LocalLock)
view.LocalLock = &lock
diff --git a/internal/display/display_test.go b/internal/display/display_test.go
index 1f0cc9e..5e815d5 100644
--- a/internal/display/display_test.go
+++ b/internal/display/display_test.go
@@ -22,6 +22,14 @@ func TestSkillViewSanitizesRenderedFields(t *testing.T) {
Agent: "opencode\x07",
Status: model.StatusCanonical,
}},
+ Visibility: []model.SkillVisibility{{
+ Agent: "opencode\x1b[31m",
+ Display: "Open\x1b[31mCode",
+ Visible: true,
+ Reason: "visible\x1b[31m_via_universal_canonical",
+ Path: "/tmp/\x1b[31mskill",
+ Status: model.StatusCanonical,
+ }},
LocalLock: &model.LocalLockEntry{Source: "owner/\x1b[31mrepo", SkillPath: "skills/demo\r/SKILL.md"},
HealthIssues: []model.HealthIssue{{
Type: "broken_symlink",
@@ -30,7 +38,7 @@ func TestSkillViewSanitizesRenderedFields(t *testing.T) {
}},
}
view := Skill(sk)
- if strings.Contains(view.Name, "\x1b") || strings.Contains(view.Observed[0].Path, "\x1b") || strings.Contains(view.HealthIssues[0].Message, "\x1b") {
+ if strings.Contains(view.Name, "\x1b") || strings.Contains(view.Observed[0].Path, "\x1b") || strings.Contains(view.HealthIssues[0].Message, "\x1b") || strings.Contains(view.Visibility[0].Reason, "\x1b") {
t.Fatalf("expected sanitized view: %#v", view)
}
if view.Name != "Bad Name" || view.Description != "Line one Line two" || view.LocalLock.Source != "owner/repo" {
diff --git a/internal/model/model.go b/internal/model/model.go
index 33a73ba..e3f4229 100644
--- a/internal/model/model.go
+++ b/internal/model/model.go
@@ -35,6 +35,30 @@ type HealthIssue struct {
Path string `json:"path,omitempty"`
}
+// AgentState describes LazySkills' compatibility view of a supported agent.
+type AgentState struct {
+ Name string `json:"name"`
+ Display string `json:"display"`
+ Supported bool `json:"supported"`
+ Detected bool `json:"detected"`
+ Universal bool `json:"universal"`
+ SupportsGlobal bool `json:"supports_global"`
+ ProjectDir string `json:"project_dir"`
+ GlobalDir string `json:"global_dir,omitempty"`
+ ProjectDirExists bool `json:"project_dir_exists"`
+ GlobalDirExists bool `json:"global_dir_exists,omitempty"`
+}
+
+// SkillVisibility explains whether one supported agent can see a skill.
+type SkillVisibility struct {
+ Agent string `json:"agent"`
+ Display string `json:"display"`
+ Visible bool `json:"visible"`
+ Reason string `json:"reason"`
+ Path string `json:"path,omitempty"`
+ Status Status `json:"status,omitempty"`
+}
+
// AddHealthIssue appends a health issue unless an identical issue already exists.
func (sk *Skill) AddHealthIssue(issue HealthIssue) {
for _, existing := range sk.HealthIssues {
@@ -81,16 +105,17 @@ type GlobalLockFile struct {
// Skill represents the consolidated view of a skill.
type Skill struct {
- Name string `json:"name"`
- Description string `json:"description"`
- Scope Scope `json:"scope"`
- CanonicalPath string `json:"canonical_path,omitempty"`
- SkillPath string `json:"skill_path,omitempty"`
- Preview string `json:"-"`
- ObservedPaths []ObservedPath `json:"observed_paths"`
- LocalLock *LocalLockEntry `json:"local_lock,omitempty"`
- GlobalLock *GlobalLockEntry `json:"global_lock,omitempty"`
- HealthIssues []HealthIssue `json:"health_issues"`
+ Name string `json:"name"`
+ Description string `json:"description"`
+ Scope Scope `json:"scope"`
+ CanonicalPath string `json:"canonical_path,omitempty"`
+ SkillPath string `json:"skill_path,omitempty"`
+ Preview string `json:"-"`
+ ObservedPaths []ObservedPath `json:"observed_paths"`
+ Visibility []SkillVisibility `json:"visibility,omitempty"`
+ LocalLock *LocalLockEntry `json:"local_lock,omitempty"`
+ GlobalLock *GlobalLockEntry `json:"global_lock,omitempty"`
+ HealthIssues []HealthIssue `json:"health_issues"`
}
// ScanResult is the root schema produced by lazyskills scan --json.
@@ -98,6 +123,7 @@ type ScanResult struct {
Cwd string `json:"cwd"`
GlobalLock string `json:"global_lock_path,omitempty"`
ProjectLock string `json:"project_lock_path,omitempty"`
+ Agents []AgentState `json:"agents,omitempty"`
Skills []*Skill `json:"skills"`
HealthIssues []HealthIssue `json:"health_issues,omitempty"`
}
diff --git a/internal/scan/scan.go b/internal/scan/scan.go
index 620309e..b2f3979 100644
--- a/internal/scan/scan.go
+++ b/internal/scan/scan.go
@@ -27,6 +27,7 @@ func Run(cwd string) (model.ScanResult, error) {
}
res := model.ScanResult{Cwd: absCwd, ProjectLock: locks.ProjectLockPath(absCwd), GlobalLock: locks.GlobalLockPath()}
+ res.Agents = agentStates(absCwd)
skills := map[string]*model.Skill{}
localLock, err := locks.ReadLocal(res.ProjectLock)
@@ -69,7 +70,11 @@ func Run(cwd string) (model.ScanResult, error) {
if sk.Scope == model.ScopeGlobal && sk.GlobalLock == nil {
sk.AddHealthIssue(model.HealthIssue{Type: "missing_global_lock", Severity: "warning", Message: "global skill is present on disk but not found in global lock"})
}
+ if sk.CanonicalPath == "" && hasNonCanonicalObservation(sk) {
+ sk.AddHealthIssue(model.HealthIssue{Type: "ghost_agent_skill", Severity: "warning", Message: "skill exists in an agent-specific directory without a canonical .agents/skills copy"})
+ }
}
+ sk.Visibility = skillVisibility(sk, res.Agents)
res.Skills = append(res.Skills, sk)
}
sort.Slice(res.Skills, func(i, j int) bool {
@@ -82,6 +87,98 @@ func Run(cwd string) (model.ScanResult, error) {
return res, nil
}
+func hasNonCanonicalObservation(sk *model.Skill) bool {
+ for _, observed := range sk.ObservedPaths {
+ if observed.Status != model.StatusCanonical {
+ return true
+ }
+ }
+ return false
+}
+
+func agentStates(cwd string) []model.AgentState {
+ registry := agents.RegistryWithEnv(agents.DefaultEnv(), cwd)
+ states := make([]model.AgentState, 0, len(registry))
+ for _, agent := range registry {
+ projectDir := filepath.Join(cwd, filepath.FromSlash(agent.ProjectDir))
+ state := model.AgentState{
+ Name: agent.Name,
+ Display: compat.SanitizeMetadata(agent.Display),
+ Supported: true,
+ Detected: agent.Detected,
+ Universal: agent.Universal,
+ SupportsGlobal: agent.SupportsGlobal,
+ ProjectDir: projectDir,
+ GlobalDir: agent.GlobalDir,
+ ProjectDirExists: pathExists(projectDir),
+ GlobalDirExists: agent.SupportsGlobal && pathExists(agent.GlobalDir),
+ }
+ states = append(states, state)
+ }
+ return states
+}
+
+func pathExists(path string) bool {
+ if path == "" {
+ return false
+ }
+ _, err := os.Stat(path)
+ return err == nil
+}
+
+func skillVisibility(sk *model.Skill, states []model.AgentState) []model.SkillVisibility {
+ visibility := make([]model.SkillVisibility, 0, len(states))
+ for _, state := range states {
+ item := model.SkillVisibility{Agent: state.Name, Display: state.Display}
+ if observed, ok := observedForAgent(sk, state.Name); ok {
+ item.Visible = observed.Status != model.StatusBrokenSymlink
+ item.Path = observed.Path
+ item.Status = observed.Status
+ switch observed.Status {
+ case model.StatusCanonical:
+ if state.Universal {
+ item.Reason = "visible_via_universal_canonical"
+ } else {
+ item.Reason = "visible_via_canonical"
+ }
+ case model.StatusSymlink:
+ item.Reason = "visible_via_symlink"
+ case model.StatusCopy:
+ item.Reason = "visible_via_copy"
+ case model.StatusBrokenSymlink:
+ item.Reason = "broken_symlink"
+ default:
+ item.Reason = "visible"
+ }
+ visibility = append(visibility, item)
+ continue
+ }
+
+ item.Visible = false
+ switch {
+ case sk.Scope == model.ScopeGlobal && !state.SupportsGlobal:
+ item.Reason = "unsupported_global"
+ case !state.Detected:
+ item.Reason = "agent_not_detected"
+ case state.Universal:
+ item.Reason = "not_in_universal_canonical_dir"
+ default:
+ item.Reason = "missing_agent_link"
+ }
+ visibility = append(visibility, item)
+ }
+ return visibility
+}
+
+func observedForAgent(sk *model.Skill, agent string) (model.ObservedPath, bool) {
+ for _, observed := range sk.ObservedPaths {
+ if observed.Agent == agent {
+ return observed, true
+ }
+ }
+ return model.ObservedPath{}, false
+}
+
func scanLocation(loc agents.Location, skills map[string]*model.Skill) {
entries, err := os.ReadDir(loc.Root)
if err != nil {
diff --git a/internal/scan/scan_test.go b/internal/scan/scan_test.go
index 87a0ea6..2e6747f 100644
--- a/internal/scan/scan_test.go
+++ b/internal/scan/scan_test.go
@@ -5,6 +5,8 @@ import (
"os"
"path/filepath"
"testing"
+
+ "lazyskills/internal/model"
)
func writeSkill(t *testing.T, dir, name, desc string) {
@@ -297,8 +299,14 @@ func TestSharedUniversalHealthIssuesAreDeduplicated(t *testing.T) {
if missingCount != 1 {
t.Fatalf("expected exactly one missing_skill_md issue, got %d issues=%#v", missingCount, res.Skills[0].HealthIssues)
}
- if len(res.Skills[0].ObservedPaths) != 4 {
- t.Fatalf("expected observed paths for universal/opencode/cursor/codex, got %#v", res.Skills[0].ObservedPaths)
+ seen := map[string]bool{}
+ for _, observed := range res.Skills[0].ObservedPaths {
+ seen[observed.Agent] = true
+ }
+ for _, agent := range []string{"universal", "opencode", "cursor", "codex"} {
+ if !seen[agent] {
+ t.Fatalf("expected observed path for %s, got %#v", agent, res.Skills[0].ObservedPaths)
+ }
}
}
@@ -325,6 +333,102 @@ func TestSnapshotBoundary(t *testing.T) {
}
}
+func TestScanIncludesAgentStatesAndVisibilityReasons(t *testing.T) {
+ home := withHome(t)
+ cwd := t.TempDir()
+ writeSkill(t, filepath.Join(cwd, ".agents", "skills", "build"), "Build", "Build desc")
+ if err := os.MkdirAll(filepath.Join(home, ".claude"), 0o755); err != nil {
+ t.Fatal(err)
+ }
+
+ res, err := Run(cwd)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(res.Agents) < 70 {
+ t.Fatalf("expected upstream-compatible agent states, got %d", len(res.Agents))
+ }
+ if !agentState(res.Agents, "claude-code").Detected {
+ t.Fatalf("expected claude-code detected from cwd .claude")
+ }
+ if agentState(res.Agents, "promptscript").SupportsGlobal {
+ t.Fatalf("expected promptscript global unsupported")
+ }
+
+ sk := res.Skills[0]
+ if got := visibilityReason(sk.Visibility, "opencode"); got != "visible_via_universal_canonical" {
+ t.Fatalf("expected opencode universal visibility, got %q", got)
+ }
+ if got := visibilityReason(sk.Visibility, "claude-code"); got != "missing_agent_link" {
+ t.Fatalf("expected claude-code missing link visibility, got %q", got)
+ }
+ if got := visibilityReason(sk.Visibility, "augment"); got != "agent_not_detected" {
+ t.Fatalf("expected augment not detected visibility, got %q", got)
+ }
+}
+
+func TestUnsupportedGlobalAgentDoesNotGetGlobalCanonicalVisibility(t *testing.T) {
+ home := withHome(t)
+ cwd := t.TempDir()
+ writeSkill(t, filepath.Join(home, ".agents", "skills", "global-build"), "Global Build", "desc")
+
+ res, err := Run(cwd)
+ if err != nil {
+ t.Fatal(err)
+ }
+ sk := res.Skills[0]
+ if got := visibilityReason(sk.Visibility, "promptscript"); got != "unsupported_global" {
+ t.Fatalf("expected promptscript unsupported global, got %q visibility=%#v", got, sk.Visibility)
+ }
+ for _, observed := range sk.ObservedPaths {
+ if observed.Agent == "promptscript" && observed.Scope == model.ScopeGlobal {
+ t.Fatalf("promptscript should not observe global canonical skills: %#v", sk.ObservedPaths)
+ }
+ }
+}
+
+func TestGhostAgentDirectoryWithoutCanonicalDiagnostic(t *testing.T) {
+ withHome(t)
+ cwd := t.TempDir()
+ writeSkill(t, filepath.Join(cwd, ".claude", "skills", "ghost"), "Ghost", "desc")
+
+ res, err := Run(cwd)
+ if err != nil {
+ t.Fatal(err)
+ }
+ sk := res.Skills[0]
+ if !hasIssue(sk.HealthIssues, "ghost_agent_skill") {
+ t.Fatalf("expected ghost_agent_skill issue, got %#v", sk.HealthIssues)
+ }
+}
+
+func agentState(states []model.AgentState, name string) model.AgentState {
+ for _, state := range states {
+ if state.Name == name {
+ return state
+ }
+ }
+ return model.AgentState{}
+}
+
+func visibilityReason(items []model.SkillVisibility, agent string) string {
+ for _, item := range items {
+ if item.Agent == agent {
+ return item.Reason
+ }
+ }
+ return ""
+}
+
+func hasIssue(issues []model.HealthIssue, issueType string) bool {
+ for _, issue := range issues {
+ if issue.Type == issueType {
+ return true
+ }
+ }
+ return false
+}
+
func TestSnapshotLoadsPreviewOnce(t *testing.T) {
withHome(t)
cwd := t.TempDir()
diff --git a/internal/tui/tui.go b/internal/tui/tui.go
index be674b1..ba8dc50 100644
--- a/internal/tui/tui.go
+++ b/internal/tui/tui.go
@@ -302,6 +302,9 @@ func (m appModel) listPane(height, width int) string {
for i := start; i < end; i++ {
view := display.Skill(items[i])
label := fmt.Sprintf("%s [%s]", view.Name, view.Scope)
+ if m.agent != "" {
+ label += " " + agentVisibilityBadge(items[i], m.agent)
+ }
if len(view.HealthIssues) > 0 {
label += fmt.Sprintf(" !%d", len(view.HealthIssues))
}
@@ -341,6 +344,7 @@ func (m appModel) detailLines(width int) []string {
if m.agent != "" {
lines = append(lines, "Agent filter: "+m.agentLabel())
}
+ lines = append(lines, m.visibilitySummary(view)...)
lines = append(lines, "", "Observed")
for _, p := range view.Observed {
line := fmt.Sprintf("- %s %s %s", p.Agent, p.Scope, p.Status)
@@ -376,6 +380,36 @@ func (m appModel) detailLines(width int) []string {
return lines
}
+func (m appModel) visibilitySummary(view display.SkillView) []string {
+ if len(view.Visibility) == 0 {
+ return nil
+ }
+ if m.agent != "" {
+ for _, visibility := range view.Visibility {
+ if visibility.Agent != m.agent {
+ continue
+ }
+ prefix := "cannot see"
+ if visibility.Visible {
+ prefix = "can see"
+ }
+ line := fmt.Sprintf("Visibility: %s %s (%s)", visibility.Display, prefix, visibility.Reason)
+ if visibility.Path != "" {
+ line += " at " + visibility.Path
+ }
+ return []string{wrapText(line, max(1, m.viewport.Width))}
+ }
+ return []string{"Visibility: no compatibility data for " + m.agentLabel()}
+ }
+ visible := 0
+ for _, visibility := range view.Visibility {
+ if visibility.Visible {
+ visible++
+ }
+ }
+ return []string{fmt.Sprintf("Visibility: %d/%d supported agents", visible, len(view.Visibility))}
+}
+
func (m appModel) commandPreview(sk *model.Skill, width int) []string {
lines := []string{titleStyle.Render("Command previews")}
lines = append(lines, dimStyle.Render("Preview only. LazySkills will not run these commands yet."))
@@ -418,7 +452,7 @@ func (m appModel) filteredSkills() []*model.Skill {
if m.filter == scopeGlobal && sk.Scope != model.ScopeGlobal {
continue
}
- if m.agent != "" && !skillObservedByAgent(sk, m.agent) {
+ if m.agent != "" && !skillRelevantToAgent(sk, m.agent) {
continue
}
if query != "" {
@@ -434,15 +468,37 @@ func (m appModel) filteredSkills() []*model.Skill {
}
func (m appModel) agentFilters() []string {
- ids := []string{}
- for _, agent := range agents.InitialAgents() {
+ if len(m.result.Agents) == 0 {
+ ids := []string{}
+ for _, agent := range agents.InitialAgents() {
+ if agent.Name == "universal" {
+ continue
+ }
+ ids = append(ids, agent.Name)
+ }
+ sort.Strings(ids)
+ return ids
+ }
+ observed := map[string]bool{}
+ for _, skill := range m.result.Skills {
+ for _, path := range skill.ObservedPaths {
+ observed[path.Agent] = true
+ }
+ }
+ detected, rest := []string{}, []string{}
+ for _, agent := range m.result.Agents {
if agent.Name == "universal" {
continue
}
- ids = append(ids, agent.Name)
+ if agent.Detected || observed[agent.Name] {
+ detected = append(detected, agent.Name)
+ } else {
+ rest = append(rest, agent.Name)
+ }
}
- sort.Strings(ids)
- return ids
+ sort.Strings(detected)
+ sort.Strings(rest)
+ return append(detected, rest...)
}
func (m appModel) nextAgentFilter() string {
@@ -473,6 +529,34 @@ func skillObservedByAgent(sk *model.Skill, agent string) bool {
return false
}
+func skillRelevantToAgent(sk *model.Skill, agent string) bool {
+ if skillObservedByAgent(sk, agent) {
+ return true
+ }
+ for _, visibility := range sk.Visibility {
+ if visibility.Agent == agent {
+ return true
+ }
+ }
+ return false
+}
+
+func agentVisibilityBadge(sk *model.Skill, agent string) string {
+ for _, visibility := range sk.Visibility {
+ if visibility.Agent != agent {
+ continue
+ }
+ if visibility.Visible {
+ return "✓ visible"
+ }
+ return "× " + compat.SanitizeMetadata(visibility.Reason)
+ }
+ if skillObservedByAgent(sk, agent) {
+ return "✓ observed"
+ }
+ return "× no data"
+}
+
func (m appModel) agentLabel() string {
if m.agent == "" {
return "all"
diff --git a/internal/tui/tui_test.go b/internal/tui/tui_test.go
index 494a498..5828498 100644
--- a/internal/tui/tui_test.go
+++ b/internal/tui/tui_test.go
@@ -62,15 +62,15 @@ func TestNextAgentFilterCyclesThroughObservedAgents(t *testing.T) {
{Name: "A", ObservedPaths: []model.ObservedPath{{Agent: "opencode"}, {Agent: "cursor"}}},
}}}
first := m.nextAgentFilter()
- if first != "claude-code" {
- t.Fatalf("expected first supported agent claude-code, got %q", first)
+ if first != "adal" {
+ t.Fatalf("expected first supported agent adal, got %q", first)
}
m.agent = first
second := m.nextAgentFilter()
- if second != "codex" {
- t.Fatalf("expected second supported agent codex, got %q", second)
+ if second != "aider-desk" {
+ t.Fatalf("expected second supported agent aider-desk, got %q", second)
}
- m.agent = "opencode"
+ m.agent = "zenflow"
if got := m.nextAgentFilter(); got != "" {
t.Fatalf("expected cycle back to all, got %q", got)
}
@@ -113,6 +113,38 @@ 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"}},
+ }}}}
+ out := m.View()
+ if !strings.Contains(out, "Build") || !strings.Contains(out, "Claude Code cannot see") || !strings.Contains(out, "missing_agent_link") {
+ t.Fatalf("expected active agent visibility reason, got %q", out)
+ }
+}
+
+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: "Missing",
+ Scope: model.ScopeProject,
+ Visibility: []model.SkillVisibility{{Agent: "claude-code", Display: "Claude Code", Visible: false, Reason: "missing_agent_link"}},
+ },
+ }}}
+ out := m.View()
+ if !strings.Contains(out, "Visible [project] ✓ visible") || !strings.Contains(out, "Missing [project] × missing_agent_l") {
+ t.Fatalf("expected list-level visibility badges, got %q", out)
+ }
+}
+
func TestCommandPreviewToggle(t *testing.T) {
m := appModel{}
updated, _ := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'c'}})