Skip to content

[Plugin Arch] Phase 7 — Plugin Code Generator (catalog-gen) #2533

@Al-Pragliola

Description

@Al-Pragliola

Summary

Build a code generation tool (catalog-gen) that scaffolds new catalog plugins from a single configuration file, producing all the boilerplate needed for models, services, API handlers, providers, loader, and plugin registration.

Motivation

After Phases 5 and 6, the pattern for creating a catalog plugin is well-established but involves significant boilerplate: Go types, service interfaces, API handlers, OpenAPI specs, provider implementations, plugin registration, and tests. A code generator dramatically reduces the effort to add new catalog types and ensures consistency across all plugins.

Scope

  • Define the plugin configuration schema (YAML/JSON) that describes a new catalog type's entities, fields, and source types
  • Implement catalog-gen as a Go CLI tool
  • Generate: Go model types, service interfaces and stubs, API handler scaffolding, OpenAPI spec files (openapi.yaml + components.yaml), provider skeleton, plugin registration (init() + interface implementation), basic unit test files
  • Add make gen/catalog-plugin target to the Makefile
  • Document usage in the project README or a dedicated guide

Acceptance Criteria

  • catalog-gen reads a config file and produces a complete, compilable plugin scaffold
  • Generated code follows all project conventions (naming, error handling, imports)
  • Generated plugin passes make build && make lint out of the box
  • Generated OpenAPI specs reference common.yaml shared types correctly
  • Generated plugin self-registers and runs in the unified server without manual wiring
  • catalog-gen itself has unit tests
  • Usage documentation exists

Dependencies

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions