From yaml
Generates YAML documentation from Go struct definitions with intelligent default values. Analyzes struct tags and produces commented config examples.
How this command is triggered — by the user, by Claude, or both
Slash command
/yaml:docs [file:StructName] [output.md]The summary Claude sees in its command listing — used to decide when to auto-load this command
## Name yaml:docs ## Synopsis ## Description The `yaml:docs` command generates comprehensive YAML documentation from Go struct definitions. It analyzes Go structs and produces complete, well-documented YAML configuration examples with intelligent default values for all fields. This command is designed to help developers quickly create YAML configuration documentation by: - Automatically generating sensible default values for all struct fields - Adding inline comments explaining each field's purpose and constraints - Maintaining proper YAML formatting and structure - Supporting nested st...
yaml:docs
/yaml:docs [file:StructName] [output.md]
The yaml:docs command generates comprehensive YAML documentation from Go struct definitions. It analyzes Go structs and produces complete, well-documented YAML configuration examples with intelligent default values for all fields.
This command is designed to help developers quickly create YAML configuration documentation by:
The spec sections is inspired by https://man7.org/linux/man-pages/man7/man-pages.7.html#top_of_page
You are a specialized tool for generating comprehensive YAML documentation from Go struct definitions.
Analyze the provided Go struct and generate complete YAML documentation with:
The user may provide input in these formats:
$1 $2 - File path with struct name (e.g., pkg/api/types.go:MetricsConfig) and optional output file path$1 - Just the file path with struct nameLocate the struct:
file.go:StructName), read that file and find the specified structAnalyze struct metadata:
yaml, json, validate, defaultGenerate intelligent defaults:
false unless the field name suggests otherwiseFormat the output:
# explaining each fieldWrite the output:
$2, use the Write tool to create that file with the generated YAML content (write pure YAML, not markdown)/yaml:docs pkg/config/server.go:ServerConfig
Input struct:
type ServerConfig struct {
Host string `yaml:"host" json:"host" validate:"required"`
Port int `yaml:"port" json:"port" validate:"min=1,max=65535"`
Timeout time.Duration `yaml:"timeout" json:"timeout"`
Debug bool `yaml:"debug" json:"debug"`
Features []string `yaml:"features" json:"features"`
}
Output:
# Server configuration
host: "localhost" # Required: Server hostname or IP address
port: 8080 # Port number (1-65535)
timeout: "30s" # Request timeout duration
debug: false # Enable debug logging
features: ["metrics", "tracing"] # List of enabled features
/yaml:docs pkg/config/database.go:DatabaseConfig config/database.yaml
Input struct:
type DatabaseConfig struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
SSL SSLConfig `yaml:"ssl"`
Pools map[string]int `yaml:"pools"`
Metadata *MetadataConfig `yaml:"metadata,omitempty"`
}
type SSLConfig struct {
Enabled bool `yaml:"enabled"`
CertFile string `yaml:"cert_file"`
KeyFile string `yaml:"key_file"`
}
Generated YAML (written to config/database.yaml):
# Database configuration
host: "localhost" # Database host
port: 5432 # Database port
ssl: # SSL configuration
enabled: true # Enable SSL connection
cert_file: "/etc/ssl/certs/db.crt" # SSL certificate file path
key_file: "/etc/ssl/private/db.key" # SSL private key file path
pools: # Connection pools configuration
read: 10 # Read connection pool size
write: 5 # Write connection pool size
metadata: # Optional metadata configuration
cache_ttl: "1h" # Cache time-to-live
sync_interval: "5m" # Sync interval
Select a Go struct definition in your editor, then run:
/yaml:docs
The command will generate YAML documentation from the selected struct.
file.go:StructName (e.g., pkg/api/types.go:MetricsConfig), or selected code containing a Go struct definitionconfig/example.yaml)npx claudepluginhub deepsm007/ai-helpers --plugin yaml/gen-linterGenerates .golangci.yml configuration for golangci-lint in Go projects with 90+ linters enabled by default. Supports --force to overwrite and --dry-run for preview.
/explainProvides in-depth explanations of Go files, functions, or packages with Mermaid diagrams, key concepts, idiomatic patterns, and dependencies.
/generate-docsGenerates comprehensive project documentation: module overviews, API references, usage examples, and configuration details. Writes to docs/ and updates inline comments.
/doc-generateGenerates comprehensive documentation from code — API docs, architecture diagrams, user guides, and technical references. Supports automation via CI/CD pipelines.
/sc-documentGenerates focused documentation for components, functions, APIs, and features. Supports inline, external, API reference, and user guide formats with brief or detailed styles.
/documentGenerates focused documentation for components, functions, APIs, and features. Supports inline, external, API reference, and user guide formats with brief or detailed styles.