skillref

package
v0.60.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package skillref checks what a skill cites against a repository (skills design D14): every repository path written in backticks, and every task or make target in backticks or a fenced code block, found or missing at one commit. It informs a reviewer and never blocks. It reads only through Source, so it is Kubernetes-free and pure.

Index

Constants

View Source
const MaxCites = 64

MaxCites bounds the citations one check reads, and so its forge calls.

View Source
const (
	MaxOutside = 20
)

MaxOutside bounds the files outside a skill directory one comment lists; maxShown clips each, so the comment stays far below GitHub's 65,536 characters whatever the pull request changes.

Variables

This section is empty.

Functions

func Render

func Render(head string, results []Result, outside []string) string

Render is the pull request comment for results at head. outside lists files the pull request changes outside a skill directory, under .agents/skills/ or not: a skill request changes only its skill's directory. The first MaxOutside are named, then how many more.

Types

type Cite

type Cite struct {
	Kind  Kind
	Value string
}

Cite is one citation.

func Cites

func Cites(texts ...string) []Cite

Cites are texts' citations in order of first appearance, without duplicates, at most MaxCites. Paths come from backtick spans outside fenced blocks; targets from spans and fenced lines.

type Kind

type Kind string

Kind is what a citation names.

const (
	KindPath Kind = "path"
	KindTask Kind = "task"
	KindMake Kind = "make"
)

The citation kinds.

type Result

type Result struct {
	Cite      Cite
	Found     bool
	Unchecked bool
}

Result is one citation's outcome. Unchecked: the read failed, or nothing defines targets of its kind (no Taskfile, no Makefile).

func Check

func Check(ctx context.Context, src Source, cites []Cite, skillDirs ...string) []Result

Check resolves each citation through src, in order. When a skill-local path citation (scripts/..., references/..., assets/...) is absent at the repository root, each prefix in skillDirs (such as ".agents/skills/<name>") is checked before reporting it missing.

type Source

type Source interface {
	// Exists reports whether path is a file or a directory at the commit.
	Exists(ctx context.Context, path string) (bool, error)
	// Text is path's text at the commit; found is false when it is absent.
	Text(ctx context.Context, path string) (text string, found bool, err error)
}

Source reads the repository at the commit being checked.

Jump to

Keyboard shortcuts

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