generate

package
v0.13.0 Latest Latest
Warning

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

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

Documentation

Overview

Package generate produces static discovery files from structcli command trees.

All generators consume structcli.JSONSchema with jsonschema.WithFullTree and produce []byte output. The caller decides where to write the files.

The generators produce mechanically correct scaffolds — every flag name, type, default, env var, and required marker comes from the same struct definition that powers --jsonschema. Humans should add on top:

  • Trigger phrases for skill discovery ("use when user asks to deploy")
  • Workflow guidance and step-by-step instructions
  • Realistic examples with domain-specific values
  • Error handling advice and troubleshooting sections
  • Negative triggers ("do NOT use for general file management")

Supported formats:

  • Skill: SKILL.md for Claude.ai, Claude Code, Claude API
  • LLMsTxt: llms.txt for any LLM (emerging web standard)
  • Agents: AGENTS.md for coding agents (Linux Foundation standard)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Agents

func Agents(rootCmd *cobra.Command, opts AgentsOptions) ([]byte, error)

Agents generates an AGENTS.md file from a cobra command tree. Returns the file content as bytes.

func LLMsTxt

func LLMsTxt(rootCmd *cobra.Command, opts LLMsTxtOptions) ([]byte, error)

LLMsTxt generates an llms.txt file from a cobra command tree. Returns the file content as bytes.

func Skill

func Skill(rootCmd *cobra.Command, opts SkillOptions) ([]byte, error)

Skill generates a SKILL.md file from a cobra command tree. Returns the file content as bytes.

Types

type AgentsOptions

type AgentsOptions struct {
	ModulePath string // Go module path for install instructions (eg. "github.com/myorg/mycli")
	IncludeMCP bool   // Mention --mcp in Machine Interface section
}

AgentsOptions configures the AGENTS.md generator.

type LLMsTxtOptions

type LLMsTxtOptions struct {
	ModulePath string // Go module path (eg. "github.com/myorg/mycli") — used to derive project URL
	IncludeMCP bool   // Mention --mcp in the output
}

LLMsTxtOptions configures the llms.txt generator.

type SkillOptions

type SkillOptions struct {
	Name      string // Override skill name (default: root command name, kebab-case)
	Author    string // metadata.author (optional)
	Version   string // metadata.version (optional)
	MCPServer string // metadata.mcp-server (optional)
}

SkillOptions configures the SKILL.md generator.

Jump to

Keyboard shortcuts

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