rules

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClaudeCodeRulesManager

type ClaudeCodeRulesManager struct {
	StampPrefix string
	// contains filtered or unexported fields
}

ClaudeCodeRulesManager implements RulesManager for Claude Code. Rules are installed to .claude/rules/ in the project root as .md files. Files are stamped with a content hash and version for safe updates.

func NewClaudeCodeRulesManager

func NewClaudeCodeRulesManager() *ClaudeCodeRulesManager

NewClaudeCodeRulesManager creates a new Claude Code rules manager.

func NewClaudeCodeRulesManagerWithEnv

func NewClaudeCodeRulesManagerWithEnv(env agentx.Environment) *ClaudeCodeRulesManager

NewClaudeCodeRulesManagerWithEnv creates a rules manager with a custom environment.

func (*ClaudeCodeRulesManager) Install

func (m *ClaudeCodeRulesManager) Install(_ context.Context, projectRoot string, rules []agentx.RuleFile, overwrite bool) ([]string, error)

Install writes rule files to .claude/rules/. Each file is stamped with a content hash and version on the first line. If the rule has Globs set, YAML frontmatter is prepended.

func (*ClaudeCodeRulesManager) RulesDir

func (m *ClaudeCodeRulesManager) RulesDir(projectRoot string) string

RulesDir returns the path to the Claude Code rules directory.

func (*ClaudeCodeRulesManager) Uninstall

func (m *ClaudeCodeRulesManager) Uninstall(_ context.Context, projectRoot string, prefix string) ([]string, error)

Uninstall removes rule files matching the prefix from .claude/rules/.

func (*ClaudeCodeRulesManager) Validate

func (m *ClaudeCodeRulesManager) Validate(_ context.Context, projectRoot string, rules []agentx.RuleFile) (missing []string, stale []string, err error)

Validate checks which expected rule files are missing or stale.

Jump to

Keyboard shortcuts

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