Documentation
¶
Overview ¶
Package propose turns a local skill into a pull request on the registry, the only way to change a team skill.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoChanges reports a proposal identical to the registry version. ErrNoChanges = errors.New("the proposed skill does not differ from the registry") // ErrNoPullRequest reports that the branch was pushed but no pull request // could be opened; the developer has to open it manually. ErrNoPullRequest = errors.New("branch pushed but no pull request opened") )
Functions ¶
This section is empty.
Types ¶
type CLIOpener ¶
type CLIOpener struct {
LookPath func(string) (string, error)
Run func(ctx context.Context, name string, args ...string) (string, error)
}
CLIOpener opens pull requests with gh (GitHub) or glab (GitLab) when installed.
func NewCLIOpener ¶
func NewCLIOpener() CLIOpener
NewCLIOpener returns a CLIOpener using the tools found in PATH.
type Opener ¶
type Opener interface {
Open(ctx context.Context, remoteURL, base, branch, title, body string) (string, error)
}
Opener opens a pull request for a pushed branch and returns its URL.
type Request ¶
type Request struct {
Base string // registry branch the PR targets, e.g. "main"
Branch string // branch to create and push, e.g. "skillcrew/review-20261011-120000"
SkillDir string // skill directory inside the registry, slash-separated, e.g. "plugins/security/skills/review"
Name string // skill name in the registry; the proposed SKILL.md frontmatter name is reset to it
Source string // local directory holding the proposed skill files
Title string // commit message and PR title
Body string // PR body
}
Request describes a proposal.
type Result ¶
type Result struct {
Branch string
URL string // pull request URL, or empty if no PR could be opened
}
Result of a proposal.
func Propose ¶
Propose validates the skill in req.Source, commits it in place of req.SkillDir on a new branch based on origin's req.Base, pushes that branch (never forcing, never pushing anything else) and opens a pull request.
It returns ErrNoChanges when the skill matches the registry. When the push succeeds but opener fails (or is nil), it returns the Result with Branch set and an error wrapping both ErrNoPullRequest and the opener error, so the caller can tell the developer to open the pull request manually.