colgen

Generate Go collection helpers from collection.go directives using AST parsing.

6|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/vmkteam/claude-plugins --skill colgen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: colgen
Source: https://github.com/vmkteam/claude-plugins/tree/main/plugins/developer/skills/colgen
Command: npx skills add https://github.com/vmkteam/claude-plugins --skill colgen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Colgen automates the creation of Go collection helpers and type-safe lists from directives embedded in collection.go, reducing boilerplate and keeping domain models consistent across layers.

Core Features & Use Cases

  • Generates collection types like XxxList []Xxx and associated methods from directives such as //colgen:News,Tag.
  • Supports inline-snippet constructors and LLm-enabled modes to accelerate API-layer scaffolding.
  • Provides converters between layers via Map/MapP patterns and flexible field-based helpers (Index, UniqueIDs, Group, Fill).

Quick Start

Run colgen to generate the collection helpers from your collection.go directives.

Frequently Asked Questions about colgen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Go collection helpers from directives?

colgen parses directives embedded in collection.go, such as //colgen:News,Tag, to automatically generate Go collection helpers and type-safe list methods, reducing manual boilerplate for domain models.

What are Go collection helpers and when do I need them?

Go collection helpers are generated types like XxxList []Xxx with methods for Index, UniqueIDs, Group, and Fill. You need them to reduce boilerplate and keep domain models consistent across architectural layers.

Does the Go collection code generator work with AST parsing?

Yes, the Go collection code generator uses AST parsing to enforce directive correctness in your collection.go file. This ensures the generated type-safe lists and inline snippets match your struct definitions accurately.

Do I need my Go project to compile before generating collection types?

Yes, you need your Go project to compile before generating collection types. The AST parsing mechanism requires a valid, compilable project state to accurately read struct definitions and enforce directive correctness.

How do I create converters between layers in Go?

You create converters between layers in Go by using the Map and MapP patterns provided by the generated collection helpers. These patterns enable flexible field-based mapping to accelerate API-layer scaffolding.

Are there limitations when using LLM-assisted templates for Go codegen?

A key limitation is that your project must compile before generation, as AST parsing enforces directive correctness. Additionally, LLM-assisted templates and inline snippets are scoped to struct-to-layer conversions and specific collection.go directives.