skills

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Claude scanner. Ports ClaudeSkillsScanner.swift.

Roots (precedence: custom > plugin root skill > plugin sub-skill > builtin-command):

  • $HOME/.claude/skills/<name>/SKILL.md (custom)
  • $HOME/.claude/plugins/cache/<plugin>/SKILL.md (builtin, plugin root)
  • $HOME/.claude/plugins/cache/<plugin>/skills/<name>/SKILL.md (builtin, plugin sub-skill)

Built-in slash commands use a static fallback list (no outbound HTTPS — remote hosts may block docs fetches; Mac fetches from code.claude.com with 24h cache. Static list updated via PR when Claude adds new commands).

Codex scanner. Ports CodexSkillsScanner.swift.

Roots (precedence: AgentKit/custom > Codex user > bundled system > plugins):

  • $HOME/.agents/skills/<name>/SKILL.md (custom)
  • $HOME/.codex/skills/<name>/SKILL.md (custom)
  • $HOME/.codex/skills/.system/<name>/SKILL.md (builtin)
  • $HOME/.codex/plugins/cache/{openai-bundled,openai-primary-runtime}/... (builtin)

No outbound HTTPS. Static built-in slash command list matches Codex CLI.

Grok scanner. Ports GrokSkillsScanner.swift.

Roots:

  • $HOME/.grok/skills/<name>/SKILL.md (custom)
  • $HOME/.grok/bundled/skills/<name>/SKILL.md (builtin)

Skills surface as slash commands (`/<name>`). No outbound HTTPS.

Shared filesystem scanning helpers used by all three agent scanners. Each scanner (Claude/Codex/Grok) configures its own roots + built-in command list, but the SKILL.md YAML-frontmatter parse + dedup-by-name + sort are identical across all three.

Package skills scans agent CLI installs for skill catalogs.

Providers normalize SKILL.md metadata into a shared response with stable category values ("custom", "builtin", and "builtin-command").

Index

Constants

View Source
const (
	// CategoryCustom = user-authored skills under ~/.{agent}/skills/.
	CategoryCustom = "custom"
	// CategoryBuiltin = agent-bundled skills (Claude plugins, Codex .system, Grok bundled).
	CategoryBuiltin = "builtin"
	// CategoryBuiltinCommand = hardcoded slash commands baked into the
	// scanner (no SKILL.md). Mac fetches these from docs.claude.com; the
	// daemon ships a static fallback list because remote hosts may not have
	// outbound HTTPS to Anthropy's docs (proxy / air-gap).
	CategoryBuiltinCommand = "builtin-command"
)

Category constants. Same vocabulary across all three scanners so iOS's grouped rendering works regardless of agent.

Variables

This section is empty.

Functions

func CodexInstalled

func CodexInstalled() bool

CodexInstalled reports whether a Codex CLI install is present. Heuristic: ~/.codex exists. Session scanning is intentionally best-effort.

func FindClaudeSkillContent

func FindClaudeSkillContent(name string) (string, error)

FindClaudeSkillContent returns the SKILL.md content for the named Claude skill, or "" with a nil error if no skill by that name exists (caller returns 404). Walks custom roots first, then plugin roots — same order as ScanClaude so name resolution is consistent with the catalog.

func GrokInstalled

func GrokInstalled() bool

GrokInstalled reports whether a Grok CLI install is present. Heuristic: ~/.grok exists. Session scanning is intentionally best-effort.

func InvalidateAgent

func InvalidateAgent(id string) bool

func InvalidateClaudeCache

func InvalidateClaudeCache()

InvalidateClaudeCache forces the next Scan() to walk the filesystem.

func InvalidateCodexCache

func InvalidateCodexCache()

InvalidateCodexCache forces the next ScanCodex() to walk the filesystem.

func InvalidateGrokCache

func InvalidateGrokCache()

InvalidateGrokCache forces the next ScanGrok() to walk the filesystem.

func InvalidatePiCache

func InvalidatePiCache()

InvalidatePiCache forces the next ScanPi() to walk the filesystem.

func PiInstalled

func PiInstalled() bool

PiInstalled reports whether a pi CLI install is present. Heuristic: the ~/.pi/agent state dir exists. Authoritative binary detection lives in the agents catalog (BinaryNames=["pi"]); this only gates skills-surface badges.

Types

type Provider

type Provider struct {
	Scan       func() ([]Skill, error)
	Invalidate func()
}

func ProviderFor

func ProviderFor(id string) (Provider, bool)

type Skill

type Skill struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Category    string `json:"category"`
}

Skill is a single catalog entry returned to clients. Categories are scanner-assigned (never plugin-provided) so iOS can group chips deterministically.

func ScanAgent

func ScanAgent(id string) ([]Skill, error)

func ScanClaude

func ScanClaude() ([]Skill, error)

ScanClaude returns the Claude skill catalog (custom + builtin + commands). 5-minute in-memory cache; caller should not cache further.

func ScanCodex

func ScanCodex() ([]Skill, error)

ScanCodex returns the Codex skill catalog (AgentKit + user + bundled + commands).

func ScanGrok

func ScanGrok() ([]Skill, error)

ScanGrok returns the Grok skill catalog (custom + bundled + commands).

func ScanPi

func ScanPi() ([]Skill, error)

ScanPi returns the pi skill catalog (global roots only, v1).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL