hooks

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 4 Imported by: 0

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

func DefaultPaths() map[string]string

DefaultPaths returns the default output paths for each supported format.

func EventSupport

func EventSupport() map[string][]core.Event

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

func (c *Config) Generate() *hooks.Config

Generate creates an assistantkit hooks.Config from the api-style-spec configuration.

func (*Config) MarshalFormat

func (c *Config) MarshalFormat(format string) ([]byte, error)

MarshalFormat converts the configuration to a specific format.

func (*Config) WriteToFile

func (c *Config) WriteToFile(path, format string) error

WriteToFile writes the hooks configuration to a file in the specified format.

Jump to

Keyboard shortcuts

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