agentskill

package
v0.0.0-...-12ad0e3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package agentskill 提供从 Go module 中安装 .agents/skills 的能力。

它读取 go.mod 中的 skill 引用(通过注释或 // +skill:{skill-name} 指令),计算安装计划,并将 skill 目录从 module cache 软链到目标项目的 .agents/skills/ 目录。

常见入口:

  • 用 ParseGoModSkillsFile 从 go.mod 解析 skill 引用列表。
  • 用 PlanSkillInstall 根据 module cache 计算安装计划。
  • 用 ApplyInstallPlan 执行安装。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyInstallPlan

func ApplyInstallPlan(plan *InstallPlan) error

Types

type InstallPlan

type InstallPlan struct {
	SkillsDir      string
	GitIgnorePath  string
	GitIgnoreNames []string
	Skills         []SkillInstall
}

func PlanSkillInstall

func PlanSkillInstall(projectRoot string, goModCache string, skills []SkillRef) (*InstallPlan, error)

type Installer

type Installer struct {
	ProjectRoot string
	GoModPath   string
	GoModCache  string
}

func (*Installer) Install

func (i *Installer) Install(ctx context.Context) error

func (*Installer) Plan

func (i *Installer) Plan(ctx context.Context) (*InstallPlan, error)

type SkillInstall

type SkillInstall struct {
	Ref         SkillRef
	ModuleRoot  string
	Source      string
	Destination string
}

type SkillRef

type SkillRef struct {
	Name      string
	Module    string
	Version   string
	LocalPath string // 非空时表示本地 replace 指向的文件系统路径
}

func ParseGoModSkills

func ParseGoModSkills(data []byte) ([]SkillRef, error)

func ParseGoModSkillsFile

func ParseGoModSkillsFile(path string) ([]SkillRef, error)

Jump to

Keyboard shortcuts

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