agent

package
v0.42.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 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",
	"CLAUDE.local.md",
	"GEMINI.md",
	"GEMINI.local.md",
	"CODEX.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 AnyFileHasTDInstructions added in v0.39.0

func AnyFileHasTDInstructions(baseDir string) bool

AnyFileHasTDInstructions checks all known agent files in baseDir for td instructions. Returns true if any file already contains the instructions (dedup check).

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. Use the first existing known agent file 3. If none exist, prefer AGENTS.md for new installations

Types

This section is empty.

Jump to

Keyboard shortcuts

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