go-mapper

Generate pure Go mapper functions for structs, slices, and error-returning transformations.

Updated Jan 4, 2026
One-click install
npx skills add https://github.com/cristiano-pacheco/ai-tools --skill go-mapper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-mapper
Source: https://github.com/cristiano-pacheco/ai-tools/tree/main/skills/go-mapper
Command: npx skills add https://github.com/cristiano-pacheco/ai-tools --skill go-mapper

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation of pure mapper functions in Go, streamlining the process of transforming data structures between different layers of an application (e.g., DTOs to use case inputs, models to response DTOs).

Core Features & Use Cases

  • Automated Mapping: Generates functions to map structs between various layers like HTTP DTOs, use case inputs/outputs, and persistence models.
  • Consistent Naming: Enforces a ToXxx naming convention for public functions and toXxx for private helpers.
  • Use Case: When receiving a CreateUserRequest from an API, use this Skill to generate a mapper function that converts it into a CreateUserInput struct for your business logic.

Quick Start

Use the go-mapper skill to generate a mapper function for converting a UserModel to a UserResponse.

Frequently Asked Questions about go-mapper

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

FAQPage Schema
How do I generate Go mapper functions for transforming structs between layers?

Generate Go mapper functions to automate data transformation between application layers. This produces pure functions mapping HTTP DTOs to use case inputs or persistence models, adhering to consistent naming conventions.

What is the best way to map slices of structs in Go without writing boilerplate?

Mapping slices of structs in Go is handled by generating pure mapper functions that iterate over collections. This automates data transformation for slices, ensuring functional purity and consistent naming across application layers.

Can I generate Go mappers for transformations that may return errors?

Yes, generating Go mappers supports transformations that may return errors. The generated functions handle data mapping between structs while accommodating error returns, ensuring safe data transformation across application boundaries.

Does go-mapper enforce naming conventions for data transformation functions?

Yes, go-mapper enforces strict naming conventions for data transformation functions. It uses a ToXxx naming convention for public mapper functions and toXxx for private helpers, ensuring consistent struct mapping across layers.

When do I need to generate mapper functions for DTOs and persistence models?

Generate mapper functions for DTOs and persistence models when transforming data structures between application layers. This is needed to convert HTTP requests into use case inputs or map persistence models to response DTOs.

What are the limitations of using generated pure Go mapper functions?

Generated pure Go mapper functions focus strictly on mapping single structs, slices, and error-returning transformations. They do not handle complex runtime reflections or external dependencies, relying on functional purity for predictable data mapping.