catalog

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 4 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 HookCategories = []SkillCategory{
	{
		Name:      "hooks",
		Label:     "Claude Code Hooks",
		Exclusive: false,
		Options: []SkillOption{
			{
				Name:            "linting",
				Label:           "Linting (auto-format on Edit/Write)",
				TemplateDir:     "hooks/linting",
				TemplateMapping: nil,
			},
			{
				Name:            "security-guardrails",
				Label:           "Security Guardrails (block dangerous commands and sensitive files)",
				TemplateDir:     "hooks/security-guardrails",
				TemplateMapping: nil,
			},
			{
				Name:            "convention-enforcement",
				Label:           "Convention Enforcement (Conventional Commits, protected branches)",
				TemplateDir:     "hooks/convention-enforcement",
				TemplateMapping: nil,
			},
		},
	},
}

HookCategories es el registro global de categorias de hooks.

A diferencia de skills/workflows, los hooks NO usan TemplateMapping para resolver archivos individualmente: cada preset apunta a un directorio completo (templates/{locale}/hooks/{preset}/) cuyo contenido se copia tal cual al output. El mapping es nil intencionalmente; la logica de delivery lee el directorio entero.

View Source
var HookMetadata = map[string]HookMeta{
	"linting":                {Description: "Auto-format and lint files on every Edit/Write (PostToolUse)"},
	"security-guardrails":    {Description: "Block dangerous Bash commands and protect sensitive files (PreToolUse)"},
	"convention-enforcement": {Description: "Validate Conventional Commits and protect main branches (PreToolUse with `if`)"},
}

HookMetadata mapea nombres de preset a su metadata.

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:        "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",
				},
			},
			{
				Name:        "spec-driven-change",
				Label:       "Spec-driven Change (propose → apply → archive)",
				TemplateDir: "workflows",
				TemplateMapping: map[string]string{
					"spec_propose.template": "spec_propose",
					"spec_apply.template":   "spec_apply",
					"spec_archive.template": "spec_archive",
				},
			},
		},
	},
}

WorkflowCategories is the global registry of workflow categories.

View Source
var WorkflowMetadata = map[string]WorkflowMeta{
	"bug_fix":       {Description: "Structured bug fix: reproduce, diagnose, fix, test, and PR"},
	"release_cycle": {Description: "Release process: version bump, changelog, tag, and deploy"},
	"spec_propose":  {Description: "Propose a feature change with spec deltas, design, tasks, and feature branch"},
	"spec_apply":    {Description: "Apply a spec-driven change: implement tasks, test, and create PR"},
	"spec_archive":  {Description: "Archive a completed change: merge spec deltas, finalize, and clean up"},
}

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 HookCategoryNames added in v1.19.0

func HookCategoryNames() []string

HookCategoryNames retorna los nombres de las categorias registradas.

func HookPresetNames added in v1.19.0

func HookPresetNames() []string

HookPresetNames retorna los nombres de los presets disponibles dentro de la categoria "hooks". Util para validacion en CLI/MCP sin necesidad de buscar la categoria primero.

func StripAnnotationLines added in v1.17.0

func StripAnnotationLines(content string) string

StripAnnotationLines removes Antigravity execution annotation lines from workflow content. Non-annotation lines are preserved as-is.

func WorkflowCategoryNames added in v1.13.0

func WorkflowCategoryNames() []string

WorkflowCategoryNames returns the names of all registered workflow categories.

Types

type HookMeta added in v1.19.0

type HookMeta struct {
	Description string // max 250 chars
}

HookMeta contiene metadata de un preset de hooks.

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 FindHookCategory added in v1.19.0

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

FindHookCategory busca una categoria de hooks 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