Help us shape the future of Go! Take the 2026 Go Developer Survey

agentskill

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package agentskill carries the Agent Skill that teaches coding agents how to use mcp-tester, and installs it where each harness looks for skills.

The skill is embedded in the binary, so the installed instructions always match the installed tester. Skills belong to the user's harness, not to a project, so they go into the user-level skill directories.

Index

Constants

View Source
const Name = "mcp-tester"

Name is the skill's directory name and frontmatter name.

Variables

View Source
var Harnesses = []Harness{
	{
		Name: "claude", Label: "Claude Code",
		Marker:    func(e Env) string { return filepath.Join(e.Home, ".claude") },
		Primary:   claudeSkills,
		AlsoReads: noOthers,
	},
	{

		Name: "codex", Label: "OpenAI Codex",
		Marker:    func(e Env) string { return e.CodexHome },
		Primary:   agentsSkills,
		AlsoReads: noOthers,
	},
	{
		Name: "gemini", Label: "Gemini CLI",
		Marker:    func(e Env) string { return filepath.Join(e.Home, ".gemini") },
		Primary:   func(e Env) string { return filepath.Join(e.Home, ".gemini", "skills") },
		AlsoReads: func(e Env) []string { return []string{agentsSkills(e)} },
	},
	{
		Name: "opencode", Label: "OpenCode",
		Marker:    func(e Env) string { return filepath.Join(e.ConfigHome, "opencode") },
		Primary:   func(e Env) string { return filepath.Join(e.ConfigHome, "opencode", "skills") },
		AlsoReads: func(e Env) []string { return []string{claudeSkills(e), agentsSkills(e)} },
	},
}

Harnesses in planning order: those that read one directory only come first, so the others can share their targets.

Functions

func Content

func Content(version string) []byte

Content returns the skill (skills/mcp-tester/SKILL.md) with the running tester's version in metadata.mcp-tester-version, so a development build installs a skill that names it.

func Detect

func Detect(e Env) []string

Detect returns the harnesses whose marker directory exists.

func HarnessNames

func HarnessNames() []string

HarnessNames lists the valid --harness values.

func InstalledVersion

func InstalledVersion(data []byte) string

InstalledVersion reads the tester version from an installed skill file, or "" if it has none.

Types

type Env

type Env struct {
	Home string
	// ConfigHome is $XDG_CONFIG_HOME, default ~/.config.
	ConfigHome string
	// CodexHome is $CODEX_HOME, default ~/.codex.
	CodexHome string
}

Env holds the directories the harness locations derive from.

func EnvFromOS

func EnvFromOS() (Env, error)

EnvFromOS reads Env from the environment.

type Harness

type Harness struct {
	Name  string
	Label string
	// Marker is the directory whose existence shows the harness is installed.
	Marker func(Env) string
	// Primary is where the skill goes if no other target covers the harness.
	Primary func(Env) string
	// AlsoReads lists further skill directories the harness loads; a skill
	// written there for another harness reaches this one too.
	AlsoReads func(Env) []string
}

Harness is a coding agent that loads skills from user-level directories.

type Result

type Result struct {
	Path string
	// Previous is the tester version of the replaced skill; "" for a new
	// install or a file without version.
	Previous string
	Existed  bool
}

Result reports one written skill file.

func Install

func Install(skillsDir, version string) (Result, error)

Install writes the skill into skillsDir/Name/SKILL.md.

type Target

type Target struct {
	// Dir is the skills root; the skill goes to Dir/Name/SKILL.md.
	Dir       string
	Harnesses []string
}

Target is one skill directory and the harnesses it serves.

func Plan

func Plan(e Env, names []string) ([]Target, error)

Plan picks as few skill directories as reach all given harnesses, so no harness loads the same skill twice.

Jump to

Keyboard shortcuts

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