templates

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClaudeTemplateFiles = []string{
	".claude/commands/spec.md",
	".claude/commands/implement.md",
	".claude/commands/refine.md",
	".claude/commands/verify.md",
	".claude/agents/verify-agent.md",
}

ClaudeTemplateFiles lists all template files belonging to the Claude agent.

View Source
var CursorTemplateFiles = []string{
	".cursor/skills/spec/SKILL.md",
	".cursor/skills/implement/SKILL.md",
	".cursor/skills/refine/SKILL.md",
	".cursor/skills/verify/SKILL.md",
	".cursor/agents/verify-agent.md",
	".cursor/specs/TEMPLATE.md",
}

CursorTemplateFiles lists all template files belonging to the Cursor agent.

View Source
var LegacyTemplateFiles = map[string]string{
	".claude/specs/TEMPLATE.md": "specs/TEMPLATE.md",
}

LegacyTemplateFiles maps old file locations to their new canonical paths.

View Source
var SharedTemplateFiles = []string{
	".principles/design-principles.md",
	".principles/review-role.md",
	"specs/TEMPLATE.md",
}

SharedTemplateFiles lists template files not specific to any agent.

Functions

func AllTemplateFiles added in v0.5.1

func AllTemplateFiles() []string

AllTemplateFiles returns the complete list of allowed template file paths.

Types

type EmbeddedLoader

type EmbeddedLoader struct {
	// contains filtered or unexported fields
}

EmbeddedLoader loads templates from an embedded filesystem

func NewEmbeddedLoader

func NewEmbeddedLoader(fs embed.FS, prefix string) *EmbeddedLoader

NewEmbeddedLoader creates an EmbeddedLoader with the given embedded filesystem. The prefix is the path within the embed.FS where templates are located (e.g., "templates")

func (*EmbeddedLoader) Load

func (e *EmbeddedLoader) Load() (fs.FS, error)

Load returns the embedded filesystem

func (*EmbeddedLoader) Source

func (e *EmbeddedLoader) Source() string

Source returns a description of the template source

type GitHubLoader

type GitHubLoader struct {
	// contains filtered or unexported fields
}

GitHubLoader loads templates from a GitHub release

func NewGitHubLoader

func NewGitHubLoader(owner, repo, version string) *GitHubLoader

NewGitHubLoader creates a GitHubLoader for the specified repository and version. If version is empty, it will fetch from the latest release.

func (*GitHubLoader) Load

func (g *GitHubLoader) Load() (fs.FS, error)

Load fetches the release tarball from GitHub and extracts the .claude directory

func (*GitHubLoader) Source

func (g *GitHubLoader) Source() string

Source returns a description of the template source

type LoadResult

type LoadResult struct {
	FS     fs.FS
	Source string
}

LoadResult contains the loaded filesystem and metadata about the source

type Loader

type Loader interface {
	// Load returns a filesystem containing the .claude directory structure
	Load() (fs.FS, error)
	// Source returns a human-readable description of where templates came from
	Source() string
}

Loader defines the interface for loading template files

type LocalLoader

type LocalLoader struct {
	// contains filtered or unexported fields
}

LocalLoader loads templates from a local filesystem path

func NewLocalLoader

func NewLocalLoader(path string) *LocalLoader

NewLocalLoader creates a LocalLoader for the given path. The path should contain .claude/ and specs/ subdirectories.

func (*LocalLoader) Load

func (l *LocalLoader) Load() (fs.FS, error)

Load validates the directory structure and returns the filesystem

func (*LocalLoader) Source

func (l *LocalLoader) Source() string

Source returns a description of the template source

Jump to

Keyboard shortcuts

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