agent

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package agent provides utilities for detecting and configuring AI agent instruction files.

Index

Constants

View Source
const InstructionText = `` /* 362-byte string literal not displayed */

InstructionText is the mandatory td usage instructions to add to agent files.

Variables

View Source
var KnownAgentFiles = []string{
	"AGENTS.md",
	"CLAUDE.md",
	"COPILOT.md",
	"CURSOR.md",
	".github/copilot-instructions.md",
}

KnownAgentFiles lists agent instruction files in priority order. AGENTS.md is preferred since td supports multiple agent types.

Functions

func DetectAgentFile

func DetectAgentFile(baseDir string) string

DetectAgentFile finds the first existing agent file in baseDir. Returns the full path if found, empty string if none exist.

func HasTDInstructions

func HasTDInstructions(path string) bool

HasTDInstructions checks if the file already contains td instructions.

func InstallInstructions

func InstallInstructions(path string) error

InstallInstructions adds td instructions to an agent file. Creates the file if it doesn't exist.

func PreferredAgentFile

func PreferredAgentFile(baseDir string) string

PreferredAgentFile returns the best agent file to use for installation. Priority: 1. If AGENTS.md exists, use it (td supports many agents) 2. If only CLAUDE.md exists, use it 3. If both or neither exist, prefer AGENTS.md

Types

This section is empty.

Jump to

Keyboard shortcuts

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