catalog

package
v1.14.0 Latest Latest
Warning

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

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

Documentation

Overview

Package catalog define el registro declarativo de categorías y opciones de skills.

Index

Constants

This section is empty.

Variables

View Source
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:      "testing",
		Label:     "Testing",
		Exclusive: true,
		Options: []SkillOption{
			{
				Name:        "foundational",
				Label:       "Foundational (Test Desiderata — properties of good tests)",
				TemplateDir: "testing",
				TemplateMapping: map[string]string{
					"foundational.template": "test_foundational",
				},
			},
			{
				Name:        "tdd",
				Label:       "TDD (Test-Driven Development — includes foundational)",
				TemplateDir: "testing",
				TemplateMapping: map[string]string{
					"tdd.template": "test_tdd",
				},
			},
			{
				Name:        "bdd",
				Label:       "BDD (Behavior-Driven Development — includes foundational)",
				TemplateDir: "testing",
				TemplateMapping: map[string]string{
					"bdd.template": "test_bdd",
				},
			},
		},
	},
	{
		Name:      "conventions",
		Label:     "Conventions",
		Exclusive: false,
		Options: []SkillOption{
			{
				Name:        "conventional-commit",
				Label:       "Conventional Commits",
				TemplateDir: "conventions",
				TemplateMapping: map[string]string{
					"conventional_commit.template": "conventional_commit",
				},
			},
			{
				Name:        "semantic-versioning",
				Label:       "Semantic Versioning",
				TemplateDir: "conventions",
				TemplateMapping: map[string]string{
					"semantic_versioning.template": "semantic_versioning",
				},
			},
		},
	},
}

Categories es el registro global de categorías de skills.

View Source
var LegacyPresetMapping = map[string][2]string{
	"default":     {"architecture", "clean"},
	"neutral":     {"architecture", "neutral"},
	"workflow":    {"conventions", "all"},
	"conventions": {"conventions", "all"},
}

LegacyPresetMapping mapea presets legados (--preset flag antiguo) al nuevo modelo.

View Source
var SkillMetadata = map[string]SkillMeta{

	"ddd_entity":       {Description: "Create domain entities following DDD principles", Triggers: []string{"entity", "aggregate", "value object", "domain model"}},
	"clean_arch_layer": {Description: "Implement features respecting Clean Architecture layers", Triggers: []string{"layer", "architecture", "dependency rule"}},
	"bdd_scenario":     {Description: "Write BDD scenarios in Gherkin with proper step definitions", Triggers: []string{"test", "scenario", "gherkin", "bdd"}},
	"cqrs_command":     {Description: "Implement CQRS commands and queries with proper separation", Triggers: []string{"command", "query", "cqrs", "handler"}},
	"hexagonal_port":   {Description: "Design ports and adapters following Hexagonal Architecture", Triggers: []string{"port", "adapter", "hexagonal", "dependency inversion"}},

	"code_review":     {Description: "Perform structured, actionable code reviews", Triggers: []string{"review", "pull request", "code quality"}},
	"test_strategy":   {Description: "Design test strategies with proper test pyramid coverage", Triggers: []string{"test", "testing", "coverage", "test plan"}},
	"refactor_safely": {Description: "Refactor code safely with incremental transformations", Triggers: []string{"refactor", "cleanup", "tech debt"}},
	"api_design":      {Description: "Design REST APIs with consistent contracts and versioning", Triggers: []string{"api", "endpoint", "rest", "contract"}},

	"conventional_commit": {Description: "Write commit messages following Conventional Commits 1.0.0", Triggers: []string{"commit", "git commit", "conventional"}},
	"semantic_versioning": {Description: "Determine version bumps following Semantic Versioning 2.0.0", Triggers: []string{"version", "release", "tag", "semver"}},

	"test_foundational": {Description: "Evaluate and write tests using Kent Beck's Test Desiderata (12 properties)", Triggers: []string{"test", "testing", "test quality", "desiderata"}},
	"test_tdd":          {Description: "Practice Test-Driven Development with Red-Green-Refactor discipline", Triggers: []string{"tdd", "test driven", "red green refactor", "test first"}},
	"test_bdd":          {Description: "Specify behavior with BDD using Given/When/Then and Gherkin", Triggers: []string{"bdd", "gherkin", "cucumber", "given when then", "acceptance test"}},
}

SkillMetadata mapea guide names a su metadata para frontmatter.

View Source
var WorkflowCategories = []SkillCategory{
	{
		Name:      "workflows",
		Label:     "Workflows",
		Exclusive: false,
		Options: []SkillOption{
			{
				Name:        "feature-development",
				Label:       "Feature Development (branch → implement → test → PR → review)",
				TemplateDir: "workflows",
				TemplateMapping: map[string]string{
					"feature_development.template": "feature_development",
				},
			},
			{
				Name:        "bug-fix",
				Label:       "Bug Fix (reproduce → diagnose → fix → test → PR)",
				TemplateDir: "workflows",
				TemplateMapping: map[string]string{
					"bug_fix.template": "bug_fix",
				},
			},
			{
				Name:        "release-cycle",
				Label:       "Release Cycle (version → changelog → tag → deploy)",
				TemplateDir: "workflows",
				TemplateMapping: map[string]string{
					"release_cycle.template": "release_cycle",
				},
			},
		},
	},
}

WorkflowCategories is the global registry of workflow categories.

View Source
var WorkflowMetadata = map[string]WorkflowMeta{
	"feature_development": {Description: "Full feature lifecycle: branch, implement, test, PR, and review"},
	"bug_fix":             {Description: "Structured bug fix: reproduce, diagnose, fix, test, and PR"},
	"release_cycle":       {Description: "Release process: version bump, changelog, tag, and deploy"},
}

WorkflowMetadata maps guide names to their metadata for frontmatter.

Functions

func CategoryNames

func CategoryNames() []string

CategoryNames devuelve los nombres de todas las categorías registradas.

func GenerateFrontmatter added in v1.10.0

func GenerateFrontmatter(guideName, target string) string

GenerateFrontmatter genera YAML frontmatter para un skill según el ecosistema target.

func GenerateWorkflowFrontmatter added in v1.13.0

func GenerateWorkflowFrontmatter(guideName, target string) string

GenerateWorkflowFrontmatter generates YAML frontmatter for a workflow based on the target ecosystem.

func WorkflowCategoryNames added in v1.13.0

func WorkflowCategoryNames() []string

WorkflowCategoryNames returns the names of all registered workflow categories.

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.

func ResolveAllWorkflows added in v1.13.0

func ResolveAllWorkflows() *ResolvedSelection

ResolveAllWorkflows combines all workflow options into a single selection.

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 FindWorkflowCategory added in v1.13.0

func FindWorkflowCategory(name string) (*SkillCategory, error)

FindWorkflowCategory looks up a workflow category by name.

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 SkillMeta added in v1.10.0

type SkillMeta struct {
	Description string
	Triggers    []string // usado por ecosistemas que lo soportan (e.g. antigravity)
}

SkillMeta contiene metadata de un skill para generación de frontmatter estático.

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.

type WorkflowMeta added in v1.13.0

type WorkflowMeta struct {
	Description string // max 250 chars (Antigravity constraint)
}

WorkflowMeta contains metadata for a workflow for static frontmatter generation.

Jump to

Keyboard shortcuts

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