Documentation
¶
Index ¶
- type ClaudeCodeCommandManager
- func (m *ClaudeCodeCommandManager) CommandDir(projectRoot string) string
- func (m *ClaudeCodeCommandManager) Install(_ context.Context, projectRoot string, commands []agentx.CommandFile, ...) ([]string, error)
- func (m *ClaudeCodeCommandManager) Uninstall(_ context.Context, projectRoot string, prefix string) ([]string, error)
- func (m *ClaudeCodeCommandManager) Validate(_ context.Context, projectRoot string, commands []agentx.CommandFile) (missing []string, stale []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaudeCodeCommandManager ¶
type ClaudeCodeCommandManager struct{}
ClaudeCodeCommandManager implements CommandManager for Claude Code. Commands are installed to .claude/commands/ in the project root.
func NewClaudeCodeCommandManager ¶
func NewClaudeCodeCommandManager() *ClaudeCodeCommandManager
NewClaudeCodeCommandManager creates a new Claude Code command manager.
func (*ClaudeCodeCommandManager) CommandDir ¶
func (m *ClaudeCodeCommandManager) CommandDir(projectRoot string) string
CommandDir returns the path to the Claude Code command directory.
func (*ClaudeCodeCommandManager) Install ¶
func (m *ClaudeCodeCommandManager) Install(_ context.Context, projectRoot string, commands []agentx.CommandFile, overwrite bool) ([]string, error)
Install writes command files to .claude/commands/. When overwrite is false, existing files are skipped entirely (safe for first-time init). When overwrite is true, existing files are replaced only if content differs AND the installed version is not newer than ours (prevents older binaries from downgrading). Each file is stamped with a content hash and version on the first line.
func (*ClaudeCodeCommandManager) Uninstall ¶
func (m *ClaudeCodeCommandManager) Uninstall(_ context.Context, projectRoot string, prefix string) ([]string, error)
Uninstall removes command files matching the prefix from .claude/commands/.
func (*ClaudeCodeCommandManager) Validate ¶
func (m *ClaudeCodeCommandManager) Validate(_ context.Context, projectRoot string, commands []agentx.CommandFile) (missing []string, stale []string, err error)
Validate checks which expected command files are missing or stale. A file is stale if its content hash differs from expected AND the installed version is not newer than ours (same downgrade guard as Install). Files without a hash stamp are not considered stale (user-managed).