generate

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package generate provides functions for generating platform-specific plugins from canonical JSON specifications.

This package is the core library used by the assistantkit CLI and can be used directly by projects that need programmatic plugin generation.

Example usage:

result, err := generate.Plugins("plugins/spec", "plugins", []string{"claude", "kiro"})
if err != nil {
    log.Fatal(err)
}
fmt.Printf("Generated %d commands, %d skills\n", result.CommandCount, result.SkillCount)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentsResult added in v0.8.0

type AgentsResult struct {
	// AgentCount is the number of agents loaded.
	AgentCount int

	// TeamName is the name of the team being deployed.
	TeamName string

	// TargetsGenerated lists the names of generated targets.
	TargetsGenerated []string

	// GeneratedDirs maps target names to their output directories.
	GeneratedDirs map[string]string
}

AgentsResult contains the results of simplified agent generation.

func Agents added in v0.8.0

func Agents(specsDir, target, outputDir string) (*AgentsResult, error)

Agents generates platform-specific agents from a specs directory with simplified options.

The specsDir should contain:

  • agents/: Agent definitions (*.md with YAML frontmatter)
  • deployments/: Deployment definitions (*.json)

The target parameter specifies which deployment file to use (looks for {target}.json). The outputDir is the base directory for resolving relative output paths in the deployment.

type DeploymentResult

type DeploymentResult struct {
	// AgentCount is the number of agents loaded.
	AgentCount int

	// TeamName is the name of the team being deployed.
	TeamName string

	// TargetsGenerated lists the names of generated targets.
	TargetsGenerated []string

	// GeneratedDirs maps target names to their output directories.
	GeneratedDirs map[string]string
}

DeploymentResult contains the results of deployment generation.

func Deployment

func Deployment(specsDir string, deploymentFile string) (*DeploymentResult, error)

Deployment generates platform-specific output from multi-agent-spec definitions.

The specsDir should contain:

  • agents/: Agent definitions (*.md with YAML frontmatter)
  • teams/: Team definitions (*.json)
  • deployments/: Deployment definitions (*.json)

Each deployment target specifies a platform and output directory.

type DeploymentSpec

type DeploymentSpec struct {
	Team    string             `json:"team"`
	Targets []DeploymentTarget `json:"targets"`
}

DeploymentSpec represents a deployment definition.

type DeploymentTarget

type DeploymentTarget struct {
	Name     string          `json:"name"`
	Platform string          `json:"platform"`
	Mode     string          `json:"mode,omitempty"`
	Priority string          `json:"priority,omitempty"`
	Output   string          `json:"output"`
	Config   json.RawMessage `json:"config,omitempty"`
}

DeploymentTarget represents a deployment target configuration.

type KiroAgent

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

KiroAgent represents a Kiro CLI agent definition.

type MCPServer

type MCPServer struct {
	Command     string   `json:"command"`
	Args        []string `json:"args,omitempty"`
	Description string   `json:"description,omitempty"`
}

MCPServer defines an MCP server configuration.

type PluginSpec

type PluginSpec struct {
	plugins.Plugin
	DisplayName string               `json:"displayName,omitempty"`
	Keywords    []string             `json:"keywords,omitempty"`
	MCPServers  map[string]MCPServer `json:"mcpServers,omitempty"`
}

PluginSpec extends the base Plugin with power-specific fields.

type Result

type Result struct {
	// CommandCount is the number of commands loaded.
	CommandCount int

	// SkillCount is the number of skills loaded.
	SkillCount int

	// AgentCount is the number of agents loaded.
	AgentCount int

	// GeneratedDirs maps platform names to their output directories.
	GeneratedDirs map[string]string
}

Result contains the results of plugin generation.

func Plugins

func Plugins(specDir, outputDir string, platforms []string) (*Result, error)

Plugins generates platform-specific plugins from a canonical spec directory.

The specDir should contain:

  • plugin.json: Plugin metadata
  • commands/: Command definitions (*.json)
  • skills/: Skill definitions (*.json)
  • agents/: Agent definitions (*.json)

Generated plugins are written to outputDir/<platform>/.

Jump to

Keyboard shortcuts

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