Documentation
¶
Overview ¶
Package bundle provides a unified type for AI assistant plugin bundles. A bundle combines all components (plugin, skills, commands, hooks, agents, MCP servers, and context) into a single structure that can be generated for any supported tool.
Example usage:
package main
import (
"log"
"github.com/agentplexus/assistantkit/bundle"
)
func main() {
b := bundle.New("agentcall", "0.1.0", "Voice calling for AI assistants")
b.Plugin.Author = "agentplexus"
b.Plugin.Repository = "https://github.com/agentplexus/agentcall"
// Add MCP server
b.AddMCPServer("agentcall", bundle.MCPServer{
Command: "./agentcall",
Env: map[string]string{"NGROK_AUTHTOKEN": "${NGROK_AUTHTOKEN}"},
})
// Add skill
skill := bundle.NewSkill("phone-input", "Voice calling via phone")
skill.Instructions = "Use initiate_call to start a call..."
b.AddSkill(skill)
// Generate for Claude Code
if err := b.Generate("claude", "."); err != nil {
log.Fatal(err)
}
// Or generate for all supported tools
if err := b.GenerateAll("./plugins"); err != nil {
log.Fatal(err)
}
}
Index ¶
- Constants
- Variables
- func NewAgent(name, description string) *agentscore.Agent
- func NewCommand(name, description string) *commandscore.Command
- func NewContext(name string) *contextcore.Context
- func NewHooksConfig() *hookscore.Config
- func NewSkill(name, description string) *skillscore.Skill
- type Agent
- type Argument
- type Bundle
- func (b *Bundle) AddAgent(agent *agentscore.Agent)
- func (b *Bundle) AddCommand(cmd *commandscore.Command)
- func (b *Bundle) AddMCPServer(name string, server MCPServer)
- func (b *Bundle) AddSkill(skill *skillscore.Skill)
- func (b *Bundle) Generate(tool, outputDir string) error
- func (b *Bundle) GenerateAll(outputDir string) error
- func (b *Bundle) SetContext(ctx *contextcore.Context)
- func (b *Bundle) SetHooks(cfg *hookscore.Config)
- type Command
- type Config
- type Context
- type Event
- type GenerateError
- type Hook
- type HookEntry
- type MCPServer
- type Skill
- type ToolConfig
Constants ¶
const ( EventOnStop = hookscore.OnStop EventOnNotification = hookscore.OnNotification EventOnSubagentStop = hookscore.OnSubagentStop EventBeforeCommand = hookscore.BeforeCommand EventAfterCommand = hookscore.AfterCommand EventBeforeFileRead = hookscore.BeforeFileRead EventAfterFileRead = hookscore.AfterFileRead )
Re-export common hook events.
Variables ¶
var DefaultToolConfigs = map[string]ToolConfig{
"claude": {
PluginDir: ".claude-plugin",
PluginFile: "plugin.json",
SkillsDir: "skills",
CommandsDir: "commands",
AgentsDir: "agents",
ContextDir: ".",
ContextFile: "CLAUDE.md",
},
"kiro": {
AgentsDir: ".kiro/agents",
MCPDir: ".kiro/settings",
MCPFile: "mcp.json",
},
"gemini": {
PluginDir: ".",
PluginFile: "gemini-extension.json",
CommandsDir: "commands",
AgentsDir: "agents",
},
"cursor": {
HooksDir: ".",
HooksFile: ".cursorrules",
MCPDir: ".cursor",
MCPFile: "mcp.json",
ContextDir: ".",
ContextFile: ".cursorrules",
},
"codex": {
SkillsDir: "skills",
CommandsDir: "prompts",
AgentsDir: "agents",
MCPDir: ".codex",
MCPFile: "mcp.json",
ContextDir: ".",
ContextFile: "AGENTS.md",
},
"vscode": {
MCPDir: ".vscode",
MCPFile: "mcp.json",
},
}
DefaultToolConfigs maps tool names to their configurations.
var SupportedTools = []string{
"claude",
"kiro",
"gemini",
"cursor",
"codex",
}
SupportedTools lists all tools that have bundle generation support.
Functions ¶
func NewAgent ¶
func NewAgent(name, description string) *agentscore.Agent
NewAgent creates a new agent.
func NewCommand ¶
func NewCommand(name, description string) *commandscore.Command
NewCommand creates a new command.
func NewContext ¶
func NewContext(name string) *contextcore.Context
NewContext creates a new context.
func NewHooksConfig ¶
NewHooksConfig creates a new hooks configuration.
func NewSkill ¶
func NewSkill(name, description string) *skillscore.Skill
NewSkill creates a new skill.
Types ¶
type Bundle ¶
type Bundle struct {
// Plugin is the core plugin/extension metadata.
Plugin *pluginscore.Plugin
// Skills are the skill definitions.
Skills []*skillscore.Skill
// Commands are the command/prompt definitions.
Commands []*commandscore.Command
// Hooks is the lifecycle hooks configuration.
Hooks *hookscore.Config
// Agents are the agent/subagent definitions.
Agents []*agentscore.Agent
// Context is the project context (CLAUDE.md, .cursorrules, etc.).
Context *contextcore.Context
// MCP is the MCP server configuration.
MCP *mcpcore.Config
}
Bundle represents a complete plugin bundle with all components.
func (*Bundle) AddAgent ¶
func (b *Bundle) AddAgent(agent *agentscore.Agent)
AddAgent adds an agent to the bundle.
func (*Bundle) AddCommand ¶
func (b *Bundle) AddCommand(cmd *commandscore.Command)
AddCommand adds a command to the bundle.
func (*Bundle) AddMCPServer ¶
AddMCPServer adds an MCP server configuration. This is a convenience method that adds the server to both the MCP config and the Plugin's MCPServers field.
func (*Bundle) AddSkill ¶
func (b *Bundle) AddSkill(skill *skillscore.Skill)
AddSkill adds a skill to the bundle.
func (*Bundle) GenerateAll ¶
GenerateAll outputs the bundle for all supported tools.
func (*Bundle) SetContext ¶
func (b *Bundle) SetContext(ctx *contextcore.Context)
SetContext sets the project context.
type GenerateError ¶
GenerateError represents an error during bundle generation.
func (*GenerateError) Error ¶
func (e *GenerateError) Error() string
func (*GenerateError) Unwrap ¶
func (e *GenerateError) Unwrap() error
type ToolConfig ¶
type ToolConfig struct {
// PluginDir is the directory for the plugin manifest.
PluginDir string
// PluginFile is the plugin manifest filename.
PluginFile string
// SkillsDir is the directory for skills.
SkillsDir string
// CommandsDir is the directory for commands.
CommandsDir string
// HooksDir is the directory for hooks config.
HooksDir string
// HooksFile is the hooks config filename.
HooksFile string
// AgentsDir is the directory for agents.
AgentsDir string
// MCPDir is the directory for MCP config.
MCPDir string
// MCPFile is the MCP config filename.
MCPFile string
// ContextDir is the directory for context files.
ContextDir string
// ContextFile is the context filename.
ContextFile string
}
ToolConfig defines the output paths and supported components for a tool.