Documentation
¶
Overview ¶
Package agent defines the pluggable per-agent behavior gskill installs into, plus a registry of adapters. Concrete adapters (Claude Code, Codex, Cursor, Gemini CLI) live in sibling files and register themselves with a Registry.
Index ¶
Constants ¶
const DefaultID = "claude"
DefaultID is the agent used when none is specified on the command line and none is detected in the project. Installs default to Claude.
Variables ¶
var ErrInvalidAgent = errors.New("invalid agent")
ErrInvalidAgent is returned when registering an agent with an empty ID.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent interface {
// ID is the stable, lowercase identifier (e.g. "claude").
ID() string
// DisplayName is the human-facing name.
DisplayName() string
// Detect reports whether this agent is configured for the given project.
Detect(ctx context.Context, projectRoot string) (bool, error)
// ProjectSkillDir is the per-project directory skills install into.
ProjectSkillDir(projectRoot string) string
// GlobalSkillDir is the user-global directory skills install into.
GlobalSkillDir(home string) string
// SupportsSymlinks reports whether the agent tolerates symlinked skills.
SupportsSymlinks() bool
// ValidateInstallation checks that a skill installed at skillDir is usable
// by the agent.
ValidateInstallation(ctx context.Context, skillDir string) error
}
Agent is the behavior gskill needs from a target AI agent to detect it and place skills into its skill directory (FR-027, FR-031, SC-009).
func NewClaudeCode ¶
func NewClaudeCode() Agent
NewClaudeCode returns the Claude adapter, which stores skills under .claude/skills/<name> (FR-027).
func NewCodex ¶
func NewCodex() Agent
NewCodex returns the Codex adapter, which stores skills under .codex/skills/<name> (FR-027).
func NewCursor ¶
func NewCursor() Agent
NewCursor returns the Cursor adapter, which stores skills under .cursor/skills/<name> (FR-031, SC-009).
func NewGeminiCLI ¶
func NewGeminiCLI() Agent
NewGeminiCLI returns the Gemini CLI adapter, which stores skills under .gemini/skills/<name> (FR-031, SC-009).
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds the known agent adapters in registration order.
func NewDefaultRegistry ¶
func NewDefaultRegistry() *Registry
NewDefaultRegistry returns a registry populated with the v1 built-in agent adapters in priority order.
func (*Registry) Detect ¶
Detect returns the registered agents that report being configured for projectRoot, preserving registration order.