Documentation
¶
Overview ¶
Package hooks provides integration with AI coding assistants via assistantkit.
This package defines api-style-spec hooks that can be exported to multiple AI assistant formats (Claude Code, Kiro, Cursor, Windsurf, etc.).
Example hooks:
- AfterFileWrite: Auto-lint OpenAPI specs when saved
- BeforePrompt: Inject API style context when working on APIs
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPaths ¶
DefaultPaths returns the default output paths for each supported format.
func EventSupport ¶
EventSupport returns which events are supported by which tools.
func SupportedFormats ¶
func SupportedFormats() []string
SupportedFormats returns the list of supported output formats.
Types ¶
type Config ¶
type Config struct {
// Profile is the style profile to use for linting.
Profile string
// AutoLint enables automatic linting on file save.
AutoLint bool
// AutoLintPatterns are glob patterns for files to auto-lint.
// Defaults to common OpenAPI patterns if empty.
AutoLintPatterns []string
// InjectContext enables injecting style context before prompts.
InjectContext bool
}
Config represents the api-style-spec hooks configuration.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default hooks configuration.
func (*Config) Generate ¶
Generate creates an assistantkit hooks.Config from the api-style-spec configuration.
func (*Config) MarshalFormat ¶
MarshalFormat converts the configuration to a specific format.
func (*Config) WriteToFile ¶
WriteToFile writes the hooks configuration to a file in the specified format.