skills

package
v0.0.0-...-2211d34 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: AGPL-3.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

View Source
const MaxFeedbackNoteRunes = 4000

MaxFeedbackNoteRunes caps a feedback note everywhere it is handled: the wire contract, ingest validation, and the suggestion prompt all admit the full note so recorded evidence is never silently truncated downstream.

Variables

View Source
var ErrCaptureHashConflict = errors.New("captured skill raw hash conflicts with an existing alias")
View Source
var ErrInvalidCapture = errors.New("invalid captured skill manifest")
View Source
var ErrSkillSuggestionNoOp = errors.New("skill suggestion is unchanged from base")

ErrSkillSuggestionNoOp marks a valid proposal that is canonically identical to its base. Suggestion generation treats this as a terminal decline rather than asking the model to reformat the same content.

Functions

func Attach

func Attach(mux goahttp.Muxer, service *Service)

func ReplayOpenSuggestionOntoBase

func ReplayOpenSuggestionOntoBase(ctx context.Context, queries *repo.Queries, projectID, skillID uuid.UUID) error

ReplayOpenSuggestionOntoBase repoints an open suggestion at the skill's current base version. Because each proposed change stores its own diff, a change survives edits it does not overlap and is dropped on its own when it no longer applies; the suggestion is superseded only once nothing is left.

func ValidSpecName

func ValidSpecName(name string) bool

ValidSpecName reports whether name is already in canonical skill-spec form.

func ValidateSkillManifest

func ValidateSkillManifest(content, expectedName string) error

ValidateSkillManifest applies the canonical SKILL.md parser and spec validation, and verifies that the frontmatter name matches expectedName.

Types

type CaptureResult

type CaptureResult struct {
	SkillID        uuid.UUID
	SkillVersionID uuid.UUID
	CreatedSkill   bool
	CreatedVersion bool
}

func CaptureSkillContent

func CaptureSkillContent(ctx context.Context, db *pgxpool.Pool, projectID uuid.UUID, content string) (*CaptureResult, error)

CaptureSkillContent materializes an observed manifest without changing an existing skill's presentation or emitting a user-authored audit event.

type EditSuggestionStatus

type EditSuggestionStatus string
const (
	EditSuggestionStatusOpen       EditSuggestionStatus = "open"
	EditSuggestionStatusApproved   EditSuggestionStatus = "approved"
	EditSuggestionStatusDismissed  EditSuggestionStatus = "dismissed"
	EditSuggestionStatusSuperseded EditSuggestionStatus = "superseded"
)

type FeedbackOutcome

type FeedbackOutcome string
const (
	FeedbackOutcomeHelped          FeedbackOutcome = "helped"
	FeedbackOutcomePartiallyHelped FeedbackOutcome = "partially_helped"
	FeedbackOutcomeDidNotHelp      FeedbackOutcome = "did_not_help"
	FeedbackOutcomeMisleading      FeedbackOutcome = "misleading"
	FeedbackOutcomeHarmful         FeedbackOutcome = "harmful"
)

func (FeedbackOutcome) Valid

func (o FeedbackOutcome) Valid() bool

type FeedbackSource

type FeedbackSource string
const (
	FeedbackSourceDev       FeedbackSource = "dev"
	FeedbackSourceAssistant FeedbackSource = "assistant"
)

func (FeedbackSource) Valid

func (s FeedbackSource) Valid() bool

type ManualSuggestionSignaler

type ManualSuggestionSignaler interface {
	SignalManual(ctx context.Context, projectID, skillID uuid.UUID) error
}

ManualSuggestionSignaler starts or wakes analysis while bypassing automatic thresholds.

type ReconcileSkillObservationsResult

type ReconcileSkillObservationsResult struct {
	Processed int
	HasMore   bool
}

func ReconcileSkillObservations

func ReconcileSkillObservations(ctx context.Context, db *pgxpool.Pool, projectID uuid.UUID, batchSize int32) (*ReconcileSkillObservationsResult, error)

ReconcileSkillObservations folds one project-scoped batch into the skill registry. Observation completion and sighting updates commit atomically, so retries cannot count the same activation twice.

type Service

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

func NewService

func NewService(
	logger *slog.Logger,
	tracerProvider trace.TracerProvider,
	db *pgxpool.Pool,
	sessions *sessions.Manager,
	authzEngine *authz.Engine,
	features *productfeatures.Client,
	auditLogger *audit.Logger,
	signaler ManualSuggestionSignaler,
	siteURL *url.URL,
) *Service

func (*Service) APIKeyAuth

func (s *Service) APIKeyAuth(ctx context.Context, key string, schema *security.APIKeyScheme) (context.Context, error)

func (*Service) AddVersion

func (s *Service) AddVersion(ctx context.Context, payload *gen.AddVersionPayload) (*gen.RecordSkillResult, error)

func (*Service) ApproveAllSuggestions

func (*Service) ApproveSuggestion

func (s *Service) ApproveSuggestion(ctx context.Context, payload *gen.ApproveSuggestionPayload) (*gen.ApproveSkillSuggestionResult, error)

func (*Service) Archive

func (s *Service) Archive(ctx context.Context, payload *gen.ArchivePayload) error

func (*Service) Create

func (s *Service) Create(ctx context.Context, payload *gen.CreatePayload) (*gen.RecordSkillResult, error)

func (*Service) DismissSuggestion

func (s *Service) DismissSuggestion(ctx context.Context, payload *gen.DismissSuggestionPayload) (*types.SkillEditSuggestion, error)

func (*Service) Distribute

func (s *Service) Distribute(ctx context.Context, payload *gen.DistributePayload) (*types.SkillDistribution, error)

func (*Service) Get

func (s *Service) Get(ctx context.Context, payload *gen.GetPayload) (*gen.GetSkillResult, error)

func (*Service) GetShared

func (s *Service) GetShared(ctx context.Context, payload *gen.GetSharedPayload) (*gen.SharedSkill, error)

func (*Service) List

func (s *Service) List(ctx context.Context, payload *gen.ListPayload) (*gen.ListSkillsResult, error)

func (*Service) ListDistributions

func (s *Service) ListDistributions(ctx context.Context, payload *gen.ListDistributionsPayload) (*gen.ListSkillDistributionsResult, error)

func (*Service) ListFeedback

func (s *Service) ListFeedback(ctx context.Context, payload *gen.ListFeedbackPayload) (*gen.ListSkillFeedbackResult, error)

func (*Service) ListSuggestionFeedback

func (*Service) ListSuggestions

func (s *Service) ListSuggestions(ctx context.Context, payload *gen.ListSuggestionsPayload) (*gen.ListSkillSuggestionsResult, error)

func (*Service) ListTags

func (*Service) ListUnknownActivations

func (*Service) ListVersions

func (s *Service) ListVersions(ctx context.Context, payload *gen.ListVersionsPayload) (*gen.ListSkillVersionsResult, error)

func (*Service) RestoreVersion

func (s *Service) RestoreVersion(ctx context.Context, payload *gen.RestoreVersionPayload) (*gen.RecordSkillResult, error)

func (*Service) ServeSharedSkillMarkdown

func (s *Service) ServeSharedSkillMarkdown(w http.ResponseWriter, r *http.Request) error

ServeSharedSkillMarkdown serves the raw SKILL.md of a shared skill at GET /shared/skills/{token}/SKILL.md with the same tenancy rules as ServeSharedSkillPage.

func (*Service) ServeSharedSkillPage

func (s *Service) ServeSharedSkillPage(w http.ResponseWriter, r *http.Request) error

ServeSharedSkillPage renders the public share page for a skill at GET /shared/skills/{token}. On a custom domain the lookup is pinned to the domain's organization so one tenant's skill can never be served under another tenant's domain. On the platform host the canonical page is the dashboard SPA route, so the request is redirected there instead.

func (*Service) Share

func (s *Service) Share(ctx context.Context, payload *gen.SharePayload) (*types.SkillShareLink, error)

func (*Service) TriggerSuggestion

func (s *Service) TriggerSuggestion(ctx context.Context, payload *gen.TriggerSuggestionPayload) error

func (*Service) Undistribute

func (s *Service) Undistribute(ctx context.Context, payload *gen.UndistributePayload) error

func (*Service) Unshare

func (s *Service) Unshare(ctx context.Context, payload *gen.UnsharePayload) error

func (*Service) Update

func (s *Service) Update(ctx context.Context, payload *gen.UpdatePayload) (*types.Skill, error)

type ValidatedSkillSuggestion

type ValidatedSkillSuggestion struct {
	Content         string
	CanonicalSHA256 string
}

ValidatedSkillSuggestion is a proposed SKILL.md that differs canonically from its base version.

func ValidateSkillSuggestion

func ValidateSkillSuggestion(content, expectedName, baseCanonicalSHA256 string) (ValidatedSkillSuggestion, error)

ValidateSkillSuggestion applies the SKILL.md parser and spec validation used by skill versions, verifies the target skill, and rejects canonical no-ops.

Directories

Path Synopsis
Package efficacy scores how well a skill served an agent session: it renders the session transcript, asks an LLM judge for a structured verdict, and normalizes that verdict for the skill_efficacy_scores ClickHouse sink.
Package efficacy scores how well a skill served an agent session: it renders the session transcript, asks an LLM judge for a structured verdict, and normalizes that verdict for the skill_efficacy_scores ClickHouse sink.
Package skilldiff represents a proposed SKILL.md edit as a unified diff so a suggestion outlives the exact version it was generated against.
Package skilldiff represents a proposed SKILL.md edit as a unified diff so a suggestion outlives the exact version it was generated against.
Package suggest generates evidence-backed edits to recently active skills.
Package suggest generates evidence-backed edits to recently active skills.

Jump to

Keyboard shortcuts

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