agents

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDir

func DefaultDir() string

DefaultDir returns the user's agent directory (~/.hawk/agents/).

Types

type Agent

type Agent struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Model       string `json:"model,omitempty"`
	Prompt      string `json:"prompt"`
	FilePath    string `json:"file_path"`
}

Agent is a user-defined persona with a custom system prompt. Stored as markdown files with YAML frontmatter in ~/.hawk/agents/.

func Get

func Get(name string) (*Agent, error)

Get finds an agent by name from all known directories.

func ListAll

func ListAll() ([]*Agent, error)

ListAll discovers all agent definitions from the standard directories. Search order: ~/.hawk/agents/, .hawk/agents/ (project-local).

func Load

func Load(path string) (*Agent, error)

Load reads an agent definition from a markdown file. Format:

---
name: reviewer
description: Code review specialist
model: inherit
---
You are a code reviewer...

func Parse

func Parse(content, filePath string) (*Agent, error)

Parse extracts agent metadata and prompt from markdown content.

Jump to

Keyboard shortcuts

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