Documentation
¶
Overview ¶
Package template is a copy-paste boilerplate for creating new tool adapters. Replace every "TODO" comment with your tool-specific logic.
Steps to use this template:
- Copy this entire directory to adapters/{tool}/
- Replace "template" with your tool ID in all files
- Follow the TODO comments in order
- Register in cmd/sequoia/main.go with a blank import
See CONTRIBUTING.md for the full step-by-step guide.
Index ¶
- func GenerateRulesMD(path, content string) error
- func RemoveRulesMD(path string) error
- type Adapter
- func (a *Adapter) CommandsPath() string
- func (a *Adapter) Detect() bool
- func (a *Adapter) ID() string
- func (a *Adapter) Install(opts adapters.InstallOpts) error
- func (a *Adapter) IsInstalled() bool
- func (a *Adapter) Name() string
- func (a *Adapter) PromptStrategy() adapters.PromptStrategy
- func (a *Adapter) SkillsPath() string
- func (a *Adapter) Status() adapters.AdapterStatus
- func (a *Adapter) SystemPromptPath() string
- func (a *Adapter) Uninstall(opts adapters.InstallOpts) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRulesMD ¶
GenerateRulesMD writes Sequoia content to the system prompt file at path. If the file does not exist it is created. If it already contains Sequoia markers the file is replaced in place. If it contains other content the original file is backed up to path+".sequoia-backup" before replacement.
TODO: This function is for StrategyFileReplace. If your tool uses a different strategy, replace this with the appropriate injection logic:
- StrategyMarkdownSections: InjectSection() / RemoveSection() (see adapters/claude/installer.go)
- StrategyConfigMerge: similar to MarkdownSections (see adapters/gemini/installer.go)
- StrategyTOMLMerge: TOML table merge (see adapters/codex/installer.go)
func RemoveRulesMD ¶
RemoveRulesMD removes Sequoia from the system prompt file at path. If a backup exists the original content is restored. If no backup exists and the file is Sequoia-managed it is deleted. If the file is missing or contains no markers and no backup exists the function returns nil.
TODO: Match the approach used in GenerateRulesMD above.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements adapters.ToolAdapter. homeDir overrides os.UserHomeDir() for testing. Leave empty for production use.
func NewAdapter ¶
NewAdapter creates an Adapter with an overridden home directory. Pass an empty string to use the real home directory (production use). Pass a temp directory in tests to avoid touching the real config directory.
func (*Adapter) CommandsPath ¶
CommandsPath returns the absolute path to the commands directory.
func (*Adapter) Detect ¶
Detect reports whether the tool appears to be installed on this machine.
TODO: Replace with tool-specific detection logic:
- Check if the config directory exists (os.Stat)
- Check if the binary is in PATH (exec.LookPath)
- Return true if either check succeeds
func (*Adapter) ID ¶
ID returns the unique machine-readable identifier.
TODO: Replace "template" with your adapter ID (e.g. "my-tool"). Must be lowercase, kebab-case, and unique across all adapters.
func (*Adapter) Install ¶
func (a *Adapter) Install(opts adapters.InstallOpts) error
Install installs Sequoia files for this tool.
func (*Adapter) IsInstalled ¶
IsInstalled reports whether Sequoia has already been installed for this tool.
TODO: Choose the right check for your tool:
- If the system prompt is a dedicated file, check os.Stat(systemPromptPath(base))
- If it's a section in a config file, check for marker presence
func (*Adapter) Name ¶
Name returns the human-readable display name.
TODO: Replace "Template Tool" with the tool's brand name (e.g. "My Tool").
func (*Adapter) PromptStrategy ¶
func (a *Adapter) PromptStrategy() adapters.PromptStrategy
PromptStrategy returns the injection strategy used by this adapter.
TODO: Choose the right strategy for your tool:
- StrategyMarkdownSections: inject markers into a Markdown file
- StrategyFileReplace: dedicated file, full replace with backup
- StrategyConfigMerge: config file with markers (non-Markdown format)
- StrategyTOMLMerge: TOML config merge
See CONTRIBUTING.md for guidance on each strategy.
func (*Adapter) SkillsPath ¶
SkillsPath returns the absolute path to the skills directory.
func (*Adapter) Status ¶
func (a *Adapter) Status() adapters.AdapterStatus
Status returns the current installation status. It populates Version from the .sequoia-version file when present.
func (*Adapter) SystemPromptPath ¶
SystemPromptPath returns the absolute path to the system prompt file.