agentfs

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package agentfs discovers and reads agent metadata from the filesystem.

Agents are represented as flat .md files under a team path (e.g., yuki.md) with YAML frontmatter fields (name, role, voice, emoji, etc.). Provides functions to discover all agents, look up a single agent by name or path, filter by role, and update individual frontmatter fields in place.

Plane: shared

Index

Constants

This section is empty.

Variables

View Source
var SkipFiles = map[string]bool{
	"CLAUDE":      true,
	"CLAUDE.user": true,
	"README":      true,
}

SkipFiles contains known non-agent files to exclude from discovery.

Functions

func Count

func Count(teamPath string) (int, error)

Count returns the number of agent directories in teamPath.

func DiscoverAgents

func DiscoverAgents(teamPath string) ([]string, error)

DiscoverAgents returns sorted agent names from flat .md files in team root.

func HasAgent added in v1.2.0

func HasAgent(teamPath, agentName string) bool

HasAgent returns true if an agent with the given name exists in teamPath.

func SetField

func SetField(teamPath, name, field, value string) error

SetField updates a single frontmatter field in an agent's .md file. If no frontmatter exists, it adds one. Preserves existing content.

Types

type AgentInfo

type AgentInfo struct {
	Name        string // directory name (lowercase)
	Path        string // absolute path to agent directory
	Voice       string // Kokoro TTS voice ID
	Emoji       string // display emoji
	Description string // short role summary
	Role        string // e.g. designer, researcher — matches [prompts] key
}

AgentInfo holds agent metadata parsed from .md file frontmatter.

func Discover

func Discover(teamPath string) ([]AgentInfo, error)

Discover scans teamPath for agents via flat .md files (e.g., yuki.md). Returns sorted list of agents with metadata parsed from frontmatter.

func FindByRole

func FindByRole(teamPath, role string) ([]AgentInfo, error)

FindByRole returns all agents with a matching role field.

func Get

func Get(teamPath, name string) (*AgentInfo, error)

Get returns metadata for a single agent by name. Looks for name.md in team root.

func GetFromPath

func GetFromPath(agentPath string) (*AgentInfo, error)

GetFromPath returns agent metadata from an absolute agent directory path.

Jump to

Keyboard shortcuts

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