Documentation
¶
Overview ¶
Package catalog define el registro declarativo de categorías y opciones de skills.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Categories = []SkillCategory{ { Name: "architecture", Label: "Architecture", Exclusive: true, Options: []SkillOption{ { Name: "clean", Label: "Clean (DDD, BDD, CQRS, Hexagonal)", TemplateDir: "default", TemplateMapping: map[string]string{ "ddd_entity.template": "ddd_entity", "clean_arch_layer.template": "clean_arch_layer", "bdd_scenario.template": "bdd_scenario", "cqrs_command.template": "cqrs_command", "hexagonal_port.template": "hexagonal_port", }, }, { Name: "neutral", Label: "Neutral (Code review, testing, API design, refactoring)", TemplateDir: "neutral", TemplateMapping: map[string]string{ "code_review.template": "code_review", "test_strategy.template": "test_strategy", "refactor_safely.template": "refactor_safely", "api_design.template": "api_design", }, }, }, }, { Name: "workflow", Label: "Workflow", Exclusive: false, Options: []SkillOption{ { Name: "conventional-commit", Label: "Conventional Commits", TemplateDir: "workflow", TemplateMapping: map[string]string{ "conventional_commit.template": "conventional_commit", }, }, { Name: "semantic-versioning", Label: "Semantic Versioning", TemplateDir: "workflow", TemplateMapping: map[string]string{ "semantic_versioning.template": "semantic_versioning", }, }, }, }, }
Categories es el registro global de categorías de skills.
var LegacyPresetMapping = map[string][2]string{
"default": {"architecture", "clean"},
"neutral": {"architecture", "neutral"},
"workflow": {"workflow", "all"},
}
LegacyPresetMapping mapea presets legados (--preset flag antiguo) al nuevo modelo.
Functions ¶
func CategoryNames ¶
func CategoryNames() []string
CategoryNames devuelve los nombres de todas las categorías registradas.
Types ¶
type ResolvedSelection ¶
type ResolvedSelection struct {
TemplateDir string
TemplateMapping map[string]string // nil = cargar todos los templates del directorio
}
ResolvedSelection es el resultado de resolver una selección del catálogo.
type SkillCategory ¶
type SkillCategory struct {
Name string // identificador: "architecture", "workflow"
Label string // display: "Architecture", "Workflow"
Exclusive bool // true = sub-opciones mutuamente excluyentes (sin "all")
Options []SkillOption // sub-opciones disponibles
}
SkillCategory representa una categoría de nivel 1 en el menú de skills.
func FindCategory ¶
func FindCategory(name string) (*SkillCategory, error)
FindCategory busca una categoría por nombre.
func (*SkillCategory) OptionLabels ¶
func (c *SkillCategory) OptionLabels() []string
OptionLabels devuelve los labels de las sub-opciones (para el menú interactivo).
func (*SkillCategory) OptionNames ¶
func (c *SkillCategory) OptionNames() []string
OptionNames devuelve los nombres de las sub-opciones de la categoría.
func (*SkillCategory) Resolve ¶
func (c *SkillCategory) Resolve(preset string) (*ResolvedSelection, error)
Resolve resuelve la selección de una sub-opción (o "all") dentro de la categoría.
type SkillOption ¶
type SkillOption struct {
Name string // identificador: "clean", "neutral", "conventional-commit"
Label string // display: "Clean (DDD, BDD, CQRS, Hexagonal)"
TemplateDir string // directorio en templates/{locale}/skills/
TemplateMapping map[string]string // nil = todos los templates del dir; map = solo los indicados
}
SkillOption representa una sub-opción dentro de una categoría.