skill

package
v0.26041.1000-preview Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SkillLocationsFile is the filename for skill locations storage
	SkillLocationsFile = "skill_locations.json"
	// SkillClientConfigFile is the filename for IDE client scanning configuration
	SkillClientConfigFile = "skill_client.json"
)

Variables

This section is empty.

Functions

func DefaultIDEAdapters

func DefaultIDEAdapters() ([]typ.IDEAdapter, error)

DefaultIDEAdapters returns the list of supported IDE adapters from embedded config

func RegisterRoutes

func RegisterRoutes(router *swagger.RouteGroup, handler *Handler)

RegisterRoutes registers all skill management routes with swagger documentation

Types

type AddSkillLocationRequest

type AddSkillLocationRequest struct {
	Name      string        `json:"name" binding:"required" description:"Display name for the location" example:"Claude Code Skills"`
	Path      string        `` /* 127-byte string literal not displayed */
	IDESource typ.IDESource `json:"ide_source" binding:"required" description:"IDE/source type" example:"claude_code"`
}

AddSkillLocationRequest represents the request to add a skill location

type AddSkillLocationResponse

type AddSkillLocationResponse struct {
	Success bool               `json:"success" example:"true"`
	Message string             `json:"message" example:"Skill location added successfully"`
	Data    *typ.SkillLocation `json:"data,omitempty"`
}

AddSkillLocationResponse represents the response for adding a skill location

type DiscoverIdesResponse

type DiscoverIdesResponse struct {
	Success bool                 `json:"success" example:"true"`
	Data    *typ.DiscoveryResult `json:"data,omitempty"`
}

DiscoverIdesResponse represents the response for discovering IDEs

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles skill-related HTTP requests

func NewHandler

func NewHandler(manager *SkillManager) *Handler

NewHandler creates a new skill handler

func (*Handler) AddSkillLocation

func (h *Handler) AddSkillLocation(c *gin.Context)

AddSkillLocation adds a new skill location

func (*Handler) DiscoverIdes

func (h *Handler) DiscoverIdes(c *gin.Context)

DiscoverIdes scans the home directory for installed IDEs with skills

func (*Handler) GetSkillContent

func (h *Handler) GetSkillContent(c *gin.Context)

GetSkillContent returns the content of a skill file

func (*Handler) GetSkillLocation

func (h *Handler) GetSkillLocation(c *gin.Context)

GetSkillLocation retrieves a specific skill location

func (*Handler) GetSkillLocations

func (h *Handler) GetSkillLocations(c *gin.Context)

GetSkillLocations returns all skill locations

func (*Handler) ImportSkillLocations

func (h *Handler) ImportSkillLocations(c *gin.Context)

ImportSkillLocations imports discovered skill locations

func (*Handler) RefreshSkillLocation

func (h *Handler) RefreshSkillLocation(c *gin.Context)

RefreshSkillLocation scans a location for updated skill list

func (*Handler) RemoveSkillLocation

func (h *Handler) RemoveSkillLocation(c *gin.Context)

RemoveSkillLocation removes a skill location

func (*Handler) ScanIdes

func (h *Handler) ScanIdes(c *gin.Context)

ScanIdes scans all IDE locations and returns discovered skills This is a comprehensive scan that checks all default IDE locations

type ImportSkillLocationsRequest

type ImportSkillLocationsRequest struct {
	Locations []typ.SkillLocation `json:"locations" binding:"required" description:"Array of skill locations to import"`
}

ImportSkillLocationsRequest represents the request to import skill locations

type ImportSkillLocationsResponse

type ImportSkillLocationsResponse struct {
	Success bool                `json:"success" example:"true"`
	Message string              `json:"message" example:"Imported 5 skill locations"`
	Data    []typ.SkillLocation `json:"data,omitempty"`
}

ImportSkillLocationsResponse represents the response for importing skill locations

type RefreshSkillLocationResponse

type RefreshSkillLocationResponse struct {
	Success bool            `json:"success" example:"true"`
	Message string          `json:"message" example:"Skill location refreshed successfully"`
	Data    *typ.ScanResult `json:"data,omitempty"`
}

RefreshSkillLocationResponse represents the response for refreshing a skill location

type RemoveSkillLocationResponse

type RemoveSkillLocationResponse struct {
	Success bool   `json:"success" example:"true"`
	Message string `json:"message" example:"Skill location removed successfully"`
}

RemoveSkillLocationResponse represents the response for removing a skill location

type ScanIdesResponse

type ScanIdesResponse struct {
	Success bool                 `json:"success" example:"true"`
	Data    *typ.DiscoveryResult `json:"data,omitempty"`
}

ScanIdesResponse represents the response for scanning all IDEs

type SkillContentResponse

type SkillContentResponse struct {
	Success bool       `json:"success" example:"true"`
	Data    *typ.Skill `json:"data,omitempty"`
}

SkillContentResponse represents the response for getting skill content

type SkillLocationResponse

type SkillLocationResponse struct {
	Success bool               `json:"success" example:"true"`
	Data    *typ.SkillLocation `json:"data,omitempty"`
}

SkillLocationResponse represents the response for getting a skill location

type SkillLocationsResponse

type SkillLocationsResponse struct {
	Success bool                `json:"success" example:"true"`
	Data    []typ.SkillLocation `json:"data"`
}

SkillLocationsResponse represents the response for listing skill locations

type SkillManager

type SkillManager struct {
	// contains filtered or unexported fields
}

SkillManager manages skill locations

func NewSkillManager

func NewSkillManager(configDir string) (*SkillManager, error)

NewSkillManager creates a new skill manager

func (*SkillManager) AddLocation

func (sm *SkillManager) AddLocation(name, path string, ideSource typ.IDESource) (*typ.SkillLocation, error)

AddLocation adds a new skill location

func (*SkillManager) DiscoverIdes

func (sm *SkillManager) DiscoverIdes() (*typ.DiscoveryResult, error)

DiscoverIdes scans the home directory for installed IDEs with skills

func (*SkillManager) GetLocation

func (sm *SkillManager) GetLocation(id string) (*typ.SkillLocation, error)

GetLocation retrieves a skill location by ID

func (*SkillManager) GetSkillContent

func (sm *SkillManager) GetSkillContent(locationID, skillID, skillPath string) (*typ.Skill, error)

GetSkillContent reads and returns the content of a skill file

func (*SkillManager) ListLocations

func (sm *SkillManager) ListLocations() []typ.SkillLocation

ListLocations returns all skill locations

func (*SkillManager) RemoveLocation

func (sm *SkillManager) RemoveLocation(id string) error

RemoveLocation removes a skill location by ID

func (*SkillManager) ScanIdes

func (sm *SkillManager) ScanIdes() (*typ.DiscoveryResult, error)

ScanIdes scans all IDE locations and returns discovered skills This is a comprehensive scan that checks all configured IDE locations

func (*SkillManager) ScanLocation

func (sm *SkillManager) ScanLocation(locationID string) (*typ.ScanResult, error)

ScanLocation scans a location directory for skill files

func (*SkillManager) UpdateLocation

func (sm *SkillManager) UpdateLocation(location typ.SkillLocation) error

UpdateLocation updates a skill location

func (*SkillManager) UpdateLocationSkillCount

func (sm *SkillManager) UpdateLocationSkillCount(id string, count int) error

UpdateLocationSkillCount updates the skill count for a location

Jump to

Keyboard shortcuts

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