Documentation
¶
Overview ¶
Package prompts provides compile-time parsing of .claude directory contents from an embed.FS, returning ready-to-use registration structures for the SDK.
Usage:
//go:embed .claude
var claudeFS embed.FS
builtins := prompts.Parse(claudeFS)
runtime, _ := api.New(ctx, api.Options{
Skills: builtins.Skills,
Commands: builtins.Commands,
Subagents: builtins.Subagents,
TypedHooks: builtins.Hooks,
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builtins ¶
type Builtins struct {
Skills []SkillRegistration
Commands []CommandRegistration
Subagents []SubagentRegistration
Hooks []corehooks.ShellHook
Errors []error
}
Builtins contains all registration structures parsed from an embed.FS.
func Parse ¶
Parse parses the .claude directory from an embed.FS and returns all registration structures ready for use with api.Options.
func ParseWithOptions ¶
func ParseWithOptions(fsys fs.FS, opts ParseOptions) Builtins
ParseWithOptions parses with custom directory paths and options.
type CommandRegistration ¶
type CommandRegistration struct {
Definition commands.Definition
Handler commands.Handler
}
CommandRegistration wires a command definition to its handler.
type ParseOptions ¶
type ParseOptions struct {
// SkillsDir is the path to skills directory (default: ".claude/skills")
SkillsDir string
// CommandsDir is the path to commands directory (default: ".claude/commands")
CommandsDir string
// SubagentsDir is the path to subagents directory (default: ".claude/agents")
SubagentsDir string
// HooksDir is the path to hooks directory (default: ".claude/hooks")
HooksDir string
// Validate enables strict validation of parsed content
Validate bool
}
ParseOptions configures the parsing behavior.
type SkillRegistration ¶
type SkillRegistration struct {
Definition skills.Definition
Handler skills.Handler
}
SkillRegistration wires a skill definition to its handler.
type SubagentRegistration ¶
type SubagentRegistration struct {
Definition subagents.Definition
Handler subagents.Handler
}
SubagentRegistration wires a subagent definition to its handler.